Ethernet Frame Headers and Trailer
An Ethernet frame header is 22 bits long with a 4 bit trailer. An Ethernet frame header has the following fields
- Preamble: 7 bits long and is used for syncronisation
- SFD: Start Frame Delimiter. 1 bit and signifies the next byte is the Destination MAC Address.
- Destination MAC: 6 bits long and contains the destination MAC address
- Source MAC: 6 bits long and contains the source MAC address.
- Type: 2 Bits long and identifies the type of protocol (IPv4 or IPv6 commonly, 8000 for IPv4 and 86DD for IPv6)
The Ethernet Trailer contains a 2 bit FCS filed. This is used for error checking.
802.1Q Headers
An 802.1Q Header gets added to the Ethernet Headers of a frame when it traverses a Trunk port on the non Native VLAN. The following fields are added to the frame
- TPID (Tag Protocol ID): 16 bit field and is set to 0x8100 to signify that the packet is an 802.1Q packet
- PCP (Priority Code Point): 3 bit field to indicate the CoS value.
- DEI (Drop Eligible Indicator): 1 bit field that indicates if the frame can be dropped during bandwidth contention
- VLAN ID: 12 bit field that indicates the VLAN the frame belongs to
TCP Headers
UDP Headers
HTTP Headers
SMTP Headers