0

I was reading about the Ethernet frame and its various fields, I noticed that the data (payload) field can be variable and is followed by a FCS field for detecting bit errors.

If the payload is variable in length and there is no field to specify the length of payload (unlike IP header), how does the layer 2 logic figure out where the data field ends and from where the FCS field starts?

  • 1
    The line must go idle for 96 bits at the end of a frame. When the line goes idle, the frame is done, and what the host has received is the entire frame. Today, this is all done in hardware. – Ron Maupin Jul 28 at 14:35
4

Switches and NICs don't actually detect the FCS and compare it with their own calculation. They receive a frame until the carrier stops or an idle symbol is detected, depending on the physical-layer variant.

On reception, the FCS is calculated in real time across the whole frame, including the FCS field itself. Some clever math is used, so when the carrier end the frame ends the current FCS calculation must be equal to the "magic residue" of 0x2144DF1C (or 0x38FB2284, depending on the exact method used). Any other value means that the FCS check has failed and that the frame integrity is compromised.

| improve this answer | |
4

The end of a frame is signaled by loss of carrier or by a special symbol or sequence in the line coding scheme for a particular Ethernet physical layer, so the length of the frame does not always need to be encoded as a value in the Ethernet frame. However, as the minimum payload of an Ethernet frame is 46 bytes, a protocol which uses EtherType must include its own length field if that is necessary for the recipient of the frame to determine the length of short packets (if allowed) for that protocol.

https://en.wikipedia.org/wiki/EtherType

| improve this answer | |
  • So if the type field is EtherType used in Ethernet II , then the FCS can be extracted by taking the last 4 bytes of the frame ? – cstronix Jul 28 at 14:55

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.