12

I'm studying for some networking concepts and have learned that a receiving host looks at an Ethernet frame's header to determine what protocol being used by the packet. It makes me wonder though, since a packet header includes this same info, why doesn't Ethernet protocol try to save space in the frame by just determining what network protocol is being used by looking at the packet header?

Thank you for the help!

  • 1
    Because the network stack can do a simple lookup for which process to send the payload, rather than a complicated parse of the payload to determine if the payload is ARP, IPv4, IPX, AppleTalk, IPv6, etc. – Ron Maupin Apr 16 at 12:17
  • 4
    To determine the format of the packet header – slebetman Apr 16 at 17:18
  • 6
    How do you know that the packet header includes that same info? – chrylis -cautiouslyoptimistic- Apr 17 at 1:32
31

The receiver has to look at the Ethernet frame to decide its contents, which might be DECnet, Appletalk or many other things -- Internet Protocol is only one of many protocols running on top of Ethernet.

When Ethernet was being designed, it wasn't obvious at all what protocols might exist in the future, and the winner-take-all effect wasn't obviously so large. A key goal of Ethernet was ubiquity -- in order to be cheap it had to be everywhere, and so it was designed to be completely neutral about its contents.

It's also a fundamental idea in the separation of the layers: code for each layer does not look inside the contents, it has a label on the outside which says what it contains along with whatever is required for addressing. For example the Ethernet frame might say "contains IP". Inside its payload, the IP header has a label which says "contains UDP". The UDP header says "contains DNS". And the DNS program is responsible for deciding what to do with that. If you don't do it like this then you duplicate at least a little of the code of the upper layer in the lower. (Or, required some kind of mechanism for the lower layer to ask an upper layer "is this packet one of yours?".) And, worse than that, this then limits the lower layer to working with upper layers which the lower-layer implementer knew and cared about. I guarantee you the Ethernet designers didn't know about IPv6, and it's the separation of layers which permits the easy development of new protocols.

Those who were obsessed about a few bytes generally wrote their protocols raw on top of Ethernet, essentially using it in the way we might use UDP. Most of those surely regretted it and converted to TCP or UDP later when they needed a facility such as ports or reliable ordered two-way byte streams.

| improve this answer | |
  • 1
    Thank you for your answer! Very good explanation and the idea of EtherType clicked once reading your explanation. – nvrMoar Apr 17 at 7:43
6

This is a fun question with a lot of history. Originally, the EtherType field indicated the length of the frame; not the type of payload. The relevant Wikipedia article contains a good explanation with references.

MPLS is an example of a protocol which lacks a field indicating the payload type. This has important consequences! Although the devices at each end of an MPLS LSP should know the type of payload -- because of how MPLS LSPs are signaled, transit devices or P-nodes do not know.

MPLS P-nodes have to guess about the payload type for some operations, such as equal-cost multi-path routing. This can have consequences when that guess is wrong. For example, MPLS routers generally misinterpret Ethernet pseudo-wire traffic destined for a MAC address beginning with a 6 as an IPv6 packet, not an Ethernet frame. This can cause unexpected packet re-ordering within flows, which can manifest as real problems for applications that don't tolerate re-ordering well!

This problem is so important that router manufacturers have designed several different approaches MPLS networks can use to allow MPLS ECMP hashing without explicitly signaling the payload type, such as Flow-Aware Transport and Entropy Labels.

| improve this answer | |
  • 1
    Just a quick note: since the frame length field is totally redundant in how an Ethernet frame is built and transmitted, that field was repurposed as EtherType = next layer protocol (for values of 0x0600 and higher) which made a lot more sense. This step might have been one of the keystone decisions for Ethernet's success because it became compatible with anything riding on top! – Zac67 Apr 17 at 13:54
  • 2
    If you're going to mention MPLS, then maybe you could mention that the goal of MPLS is not to deliver packets to arbitrary addresses, but to establish virtual circuits in which all of the traffic in any given "circuit" follows the same route between the same two end points. Virtual-circuit networking equipment, in principle, doesn't need to know anything about an individual packet other than the identity of the circuit to which it belongs. The two endpoints are presumed to know why the circuit was established, and how to interpret the packets. – Solomon Slow Apr 17 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.