Ethernet encapsulation
Realizations which bypass upper layers in general are architectures which implement special protocols which will be encapsulated in Ethernet once reaching the physical layer. A problem exists in networking when detection of protocols is needed at the very low levels of protocol stacks, thus now we are going to describe how this process is possible in Ethernet.
Ethernet encapsulation
In order to avoid altering the hardware of devices, the use of Ethernet with a different stacked protocol on top of it is possible by means of the EtherType field in the Ethernet frame.
Important Remember that in case of non-real-time traffic the Ethernet layer will encapsulate a TCP/IP or UDP/IP packet. In case of real-time traffic though, the encapsulated packet will belong to a different protocol.
The EtherType field helps us in making sure two different higher protocols can be used for transmissions.
Field definition
This 2-byte field is defined in Ethernet II frames (the most commonly used today) and is utilized to specify which upper-layer protocol is used and will, therefore, be encapsulated into the Ethernet frame.
The standard value for EtherType is 0x0800
which identifies the IP protocol. Since realizations with this architecture might have their own stack in upper layers, the value in this field is very important. Every CP defines a specific value for field EtherType.
Enthernet II vs IEEE 802.3
It is important to note a difference in 2 protocols:
- IEEE 802.3 is the Ethernet protocol standardized by IEEE.
- Ethernet II is an evolution of Ethernet and is defined in RFC 894 and makes changes in the Ethernet protocol in order to optimize the encapsulation of IP packets.
This question provides a good description of this difference.
Ambiguity in field semantics
The EtherType field is present both in IEEE 802.3 and Ethernet II frames, however its meaning is totally different in those 2 frame types.
- In IEEE 802.3, the field indicates the length of the payload in bytes.
- In Ethernet II, the field indicates which protocol in upper layers is encapsulated in the frame.
In order to have both IEEE 802.3 and Ethernet II devices cohexist and communicate in the same network, it is necessary to solve the ambiguity being generated by this field. A solution was found by considring that IEEE 802.3 frames can have a max data length of 1500 bytes (0x05DC
); RFC 894 forces the EtherType field to have values higher than 0x0600
(1536), thus the following applies when a frame is received:
- If the data length is higher than 1500 bytes, then the frame must be an Ethernet II frame and the field being read is actually the upper protocol identifier.
- Otherwise, if the data length is lower or equal to 1500 bytes, then the frame is an IEEE 802.3 frame and the field being read indicates the payload length.