LteMacPdu

Namespace: simu5g

class LteMacPdu

MAC PDU. MAC PDUs in LTE and NR are similar, with differences that mostly affect the layout of the packet. This class is an abstract representation that is suitable for both LTE and NR.

LCIDs size depends between LTE (5 bits) and NR (6 bits), as well the layout of the PDU (in LTE, subheaders that contain the LCIDs are at the beginning of the SDU, while in NR, a subPDU header precedes each SDU.) However, the logical content is the same.

This class stores LCIDs and SDUs in separate arrays, but an NR serializer or a more faithful chunked representation can store it like NR does.

For control elements, there is no need for the class to store the LCIDs, as they correspond one-to-one to C++ subclasses of MacControlElement.

Usage diagram

Inheritance diagram

Extends

Name

Type

Description

FieldsChunk ↗

class

(no description)

Fields

Name

Type

Description

id

int

mutable

bool

complete

bool

correct

bool

properlyRepresented

bool

chunkLength

b

rawBin

string[]

rawHex

string[]

regionTags

SharingRegionTagSet::TagBaseRegionTag[]

macPduId_

int64_t

ID of the MAC PDU

macPduLength_

int64_t

Length of the PDU

lcid

LogicalCid[]

LCID for each SDU (same array size as sdu[])

sdu

inet::Packet*[]

List Of MAC SDUs

ce

MacControlElement*[]

List of MAC CEs

headerLength

unsigned int

macPduId

long

need separate macPduId (e.g. for feedback packets) since OMNET PDU id is automatically updated whenever a new packet is created, e.g. when this PDU is duplicated

Properties

Name

Value

Description

beforeChange

handleChange()

descriptor

readonly

existingClass

packetData

Source code

//
// MAC PDU. MAC PDUs in LTE and NR are similar, with differences that mostly
// affect the layout of the packet. This class is an abstract representation
// that is suitable for both LTE and NR.
//
// LCIDs size depends between LTE (5 bits) and NR (6 bits), as well the layout
// of the PDU (in LTE, subheaders that contain the LCIDs are at the beginning
// of the SDU, while in NR, a subPDU header precedes each SDU.) However, the logical
// content is the same.
//
// This class stores LCIDs and SDUs in separate arrays, but an NR serializer
// or a more faithful chunked representation can store it like NR does.
//
// For control elements, there is no need for the class to store the LCIDs,
// as they correspond one-to-one to C++ subclasses of MacControlElement.
//
class LteMacPdu extends inet::FieldsChunk
{
    // ID of the MAC PDU
    int64_t macPduId_ = getChunkId();

    // Length of the PDU
    int64_t macPduLength_ = 0;

    // LCID for each SDU (same array size as sdu[])
    LogicalCid lcid[];

    // List Of MAC SDUs
    inet::Packet* sdu[] @owned @getter(getSduPtr);

    // List of MAC CEs
    MacControlElement* ce[] @owned;

    unsigned int headerLength = 0;

    // need separate macPduId (e.g. for feedback packets) since OMNET PDU id is automatically updated
    // whenever a new packet is created, e.g. when this PDU is duplicated
    long macPduId = 0;
}

File: src/simu5g/stack/mac/packet/LteMacPdu.msg