0

How will you identify the next layer protocol after Ethernet ? IS there any provision for same in Ethernet frame ?

Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199

3 Answers3

1

The ethernet frame contains an Ethertype, a 2 byte field designating the upper layer protocol. For example IP has 0x800. When a network engine receives a frame from the network interface it checks this field and forwards it to the appropriate handler.

cnicutar
  • 178,505
  • 25
  • 365
  • 392
1

The ethertype (2 bytes, the 13th and 14th bytes) is generally right behind destination mac and source mac. The case is true for Ethernet II.

For 802.3, there is a case where the ethertype is encapsulated as part of the LLC SNAP. So in general, you can check if the 13th and 14th bytes are indeed ethertype, then use it.

If not ethertype (ethertype must be greater than 0x05DC), then you know it's payload length. Then parse the LLC SNAP to obtain the ethertype within.

user1500049
  • 993
  • 7
  • 15
0

This is Ethernet header

DstMacAddr // 6 bytes

SrcMacAddr // 6 bytes

EthType // 2 bytes -> ARP(0x0806), IPv4(0x0800), IPv6(0x86dd), VLAN(0x8100), etc

Payload // ARP, IPv4, IPv6, etc

FSC // CRC32

Community
  • 1
  • 1