Monday, May 9, 2016

Ethernet frame encapsulations

Ethernet packets are referred to as frames.  There are 4 types of Ethernet encapsulations:
  • Ethernet II: This is the version that came out of the original Ethernet specification from Digital-Intel-Xerox, commonly referred to as DIX.  This is the one that uses an Ethertype and is the most common format in use today.  [MAC DA | MAC SA | Etype | Payload | FCS] 
  • IEEE 802.3 Raw: This was defined by IEEE 802.3.  It was most widely used by Novell IPX with the first two bytes of the payload being 0xFFFF. [MAC DA | MAC SA | Length | Payload | FCS]
  • IEEE 802.3 LLC: This version used the service access points (DSAP/SSAP) to indicate the protocol in the frame. [MAC DA | MAC SA | Length | DSAP | SSAP | Control | Payload | FCS]
  • IEEE 802.3 SNAP: This version was use by SNA and some IP implementations. [MAC DA | MAC SA | Length | DSAP=0xAA SSAP=0xAA Control=0x03 | OUI=00 00 00 | Type=Ethertype | Payload | FCS]
Frame size

The minimum frame size in Ethernet is 64 bytes (from the start of the MAC DA to the end of the FCS).

For length-encapsulated frames, the length field indicates the actual amount of data following the length field excluding any pad.  Valid values of the length field are 0 to 1500 bytes.  If the length is less than 46 bytes, then one or more bytes of pad are added to the frame to bring it up to 64 bytes.  A received frame that is smaller than 64 bytes is termed a runt.  Runts are usually discarded by the receiver.  Runts were more common in the days when Ethernet deployments used CSMA/CD, collisions being the main cause.

If the 2-byte following the MAC SA is 1536 or larger, then it is interpreted as an Ethertype.  Frames for which these 2 bytes are greater than 1500 but less than 1536 are non-standard frames and may be discarded by some switches.

The maximum payload size in IEEE 802.3 is 1500 bytes.  This is what follows the type/length field (and includes the DSAP, SSAP, etc. if used).  This makes the max frame size in Ethernet 1518 bytes (from start of MAC DA to end of FCS).  IEEE 802.3ac increase the max frame size to 1522 bytes when a VLAN tag is present; without the VLAN tag the max frame size is still 1518 bytes.  IEEE 802.3as increased the max frame size to 2000 bytes but specifies that the payload size is still 1500 bytes.  The additional bytes (500 of them in all) are used to accommodate headers define by 802 (e.g. MACsec, Provider Backbone Bridge aka MAC-in-MAC, etc.).

A frame that is larger than 1518 (or 1522 with a VLAN tag) is term a jumbo frame.  These are non-standard frames, but they are supported by almost all vendors of commercial networking equipment.  Jumbo frames are sometimes also referred to as giants.  Frames that are slightly over 1518/1522 bytes are sometimes called as baby giants.  Commonly supported jumbo frame sizes are 9 KB (9216 bytes) and 12 KB.  There are slight differences in the jumbo frame sizes supported by different vendors.

There was an attempt to create a project to standardize jumbo frames in IEEE 802.3, but the effort failed.  This is documented in draft-ietf-isis-ext-eth-01 (see the appendices at the end of the document).

On the wire frames also include an 8-byte-preamble, and 12-bytes of inter-frame gap.

Useful references

No comments:

Post a Comment