EthernetTypeOrLengthField

Namespace inet

EthernetTypeOrLengthField

class

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 | +-------------------------------+

Extends

Name Type Description
FieldsChunk (unknown -- not in documented files)

Fields

Name Type Description
chunkLength
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).

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