EthernetTypeOrLengthField

EthernetTypeOrLengthField

class

C++ definition

This class represents the EtherType field of an IEEE 802.3 Ethernet MAC header as defined in the section 3.2.6 Length/Type field of the IEEE Std 802.3-2018, IEEE Standard for Ethernet.

0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-------------------------------+ | EtherType/Length | +-------------------------------+

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
FieldsChunk class (no description)

Fields

Name Type Description
chunkLength b
typeOrLength uint16_t

This two-octet field takes one of two meanings, depending on its numeric value. For numerical evaluation, the first octet is the most significant octet of this field. a) If the value of this field is less than or equal to 1500 decimal (05DC hexadecimal), then the Length/ Type field indicates the number of MAC client data octets contained in the subsequent MAC Client Data field of the basic frame (Length interpretation). b) If the value of this field is greater than or equal to 1536 decimal (0600 hexadecimal), then the Length/Type field indicates the Ethertype of the MAC client protocol (Type interpretation).

id int
mutable bool
complete bool
correct bool
properlyRepresented bool
rawBin string[]
rawHex string[]
regionTags SharingRegionTagSet::TagBaseRegionTag[]

Source code

//
// This class represents the EtherType field of an IEEE 802.3 Ethernet MAC header
// as defined in the section 3.2.6 Length/Type field of the IEEE Std 802.3-2018,
// IEEE Standard for Ethernet.
//
//  0                   1
//  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
// +-------------------------------+
// |        EtherType/Length       |
// +-------------------------------+
//
class EthernetTypeOrLengthField extends FieldsChunk
{
    chunkLength = B(2);
    uint16_t typeOrLength; // This two-octet field takes one of two meanings, depending on its numeric value. For numerical evaluation,
                           // the first octet is the most significant octet of this field.
                           // a) If the value of this field is less than or equal to 1500 decimal (05DC hexadecimal), then the Length/
                           //    Type field indicates the number of MAC client data octets contained in the subsequent MAC Client
                           //    Data field of the basic frame (Length interpretation).
                           // b) If the value of this field is greater than or equal to 1536 decimal (0600 hexadecimal), then the
                           //    Length/Type field indicates the Ethertype of the MAC client protocol (Type interpretation).
}

File: src/inet/linklayer/ethernet/common/EthernetMacHeader.msg