Ethernet – Detecting different Ethernet frames

ethernetprotocol-theory

How can someone distinguish between different packets in the Ethernet protocol? It has no "length" field/area as higher-level protocols use to do so.

Because this protocol has handling in both the physical and the logical scopes, I assume that the distinction is also separated.

Is the logical separation performed using the "EtherType" protocol field? (i.e. obtaining the packet length using the type of the higher-level protocol, that has a length field in it's headers).

Is the physical distinction is simply non-transmission of electrical signals? (To my knowledge, high/low electrical signals are representing 0/1 bits).

Best Answer

Although ytti answered, there are some relevant details you may be interested in...

How can someone distinguish between different packets in the Ethernet protocol? It has no "length" field/area as higher-level protocols use to do so.

Actually ethernet has multiple encapsulations:

  • Ethernet II (Typically used for IP, as specified in [RFC 894], is the most common encapsulation): Does not have a length field, instead a type field is used...
       +----+----+------+------+-----+
       | DA | SA | Type | Data | FCS |
       +----+----+------+------+-----+
                 ^^^^^^^^

       DA      Destination MAC Address (6 bytes)
       SA      Source MAC Address      (6 bytes)
       Type    Protocol Type           (2 bytes: >= 0x0600 or 1536 decimal)  <---
       Data    Protocol Data           (46 - 1500 bytes)
       FCS     Frame Checksum          (4 bytes)
  • 802.2 LLC Ethernet: has a length field
       +----+----+------+------+------+------+-----+
       | DA | SA | Len  | LLC  | SNAP | Data | FCS |
       +----+----+------+------+------+------+-----+
                 ^^^^^^^^

       DA      Destination MAC Address (6 bytes)
       SA      Source MAC Address      (6 bytes)
       Len     Length of Data field    (2 bytes: <= 0x05DC or 1500 decimal)  <---
       LLC     802.2 LLC Header        (3 bytes)
       SNAP                            (5 bytes)
       Data    Protocol Data           (46 - 1492 bytes)
       FCS     Frame Checksum          (4 bytes)

Regardless of the existence of 802.2's length field, you can always detect the end of an ethernet frame on the wire by looking for the 96-bit Interframe Gap.

Is the logical separation performed using the "EtherType" protocol field? (i.e. obtaining the packet length using the type of the higher-level protocol, that has a length field in it's headers).

By logical separation, I assume you mean separation between different protocols carried inside ethernet, such is distinguishing between IPv4, IPv6 or perhaps Spanning-Tree Frames.

  • Ethernet II normally uses the Type field
  • 802.2 LLC Ethernet normally uses the five-byte 802.2 Ethernet SNAP extension. Protocols are only decoded with the SNAP extension when the 802.2 DSAP / SSAP bytes are 0xAAAA.

Is the physical distinction is simply non-transmission of electrical signals? (To my knowledge, high/low electrical signals are representing 0/1 bits)

Simplistically, yes there is a 96-bit gap between Ethernet frames; however, note that ethernet uses an 8b/10b encoding (FastEthernet) and 64b/66b encoding (GigabitEthernet), so it's not technically correct to say the "non-transmission of electrical signals", since 8b/10b doesn't have a "silent" state.


For the curious, I'm also linking to the original Ethernet Version 2 spec.

Related Topic