[Ns-developers] Csma, ethernet length field, NSC and the link mtu...

craigdo@ee.washington.edu craigdo at ee.washington.edu
Wed Jul 23 11:43:07 PDT 2008


> > See RFC 1042, page two.  First comes 802.3 MAC, then 802.2 
> LLC then 802.2
> > SNAP.
> 
> Yes, but when you look at page 6 (For IEEE 802.3), it says:
> 
> "This allows 1518 - 18 (MAC header+trailer) - 8 (LLC+SNAP header) =
> 1492 for the IP datagram (including the IP header).  Note that
> 1492 is not equal to 1500 which is the MTU for Ethernet networks."

Isn't this a paraphrase of what I wrote earlier:

"The LlcSnapHeader header comes after the dst/src/length and consumes eight
bytes.  This means the maximum payload should be reduced to 1492 bytes when
LLC/SNAP encapsulation is used."

and

"Aren't we really talking about having an MTU of 1500 bytes and a maximum
SDU
(service data unit) of 1492 bytes in this case?  Is that being too
pedantic?"

> Also,
> http://standards.ieee.org/getieee802/download/802.3-2005_section1.pdf
> Section 3.2.6
> a) says:
> [..] indicates the number of MAC client data octets contained
> in the _subsequent_ data field of the frame [..] (emphasis mine)
> 
> In fact, 'data field' sounds to me as if the trailer doesn't 
> belong there
> either.
> Just using llc header length and the payload size results in
> 1500 (maximum length allowed) - 8 (llc header length) = 1492 (for the
> actual payload without Llc header)  which conveniently matches the
> RFC 1042 quote above.
> I propose something like this:
> 
> csma: Fix LLC header length calculation
> 
> Must only count the actual data payload (including LLC header).
> The ethernet header/trailer must not be counted.

Oh, okay.  I see.  You are not really talking about how the packet should be
formed -- we agree on that; you are saying that not only does the code not
count the LLC header, it wrongly adds the lengths of the mac header and FCS
to the length.

That does seem to be the case ...
 
> Also, add NS_ASSERT to make sure the LLC length does not 
> exceed the 1500
> byte limit.
> 
> diff -r 6cd7d91ba8c8 -r 8101ec181e2b 
> src/devices/csma/csma-net-device.cc
> --- a/src/devices/csma/csma-net-device.cc	Tue Jul 22 
> 20:09:07 2008 +0200
> +++ b/src/devices/csma/csma-net-device.cc	Wed Jul 24 
> 14:04:32 2008 +0200
> @@ -201,11 +201,16 @@
>        lengthType = protocolNumber;
>        break;
>      case LLC: {
> -      lengthType = p->GetSize () + header.GetSerializedSize () + 
> -        trailer.GetSerializedSize ();
>        LlcSnapHeader llc;
>        llc.SetType (protocolNumber);
>        p->AddHeader (llc);
> +      /*
> +       * the ethernet header and trailer are not counted, 
> see RFC 1042 and
> +       * 
> http://standards.ieee.org/getieee802/download/802.3-2005_section1.pdf,
> +       * Section 3.2.6 a)
> +       */
> +      lengthType = p->GetSize ();
> +      NS_ASSERT_MSG (lengthType <= 1500, "802.3/LLC length 
> must not exceed 1500; reduce MTU");
>      } break;
>      case RAW:
>        NS_ASSERT (false);
> 




More information about the Ns-developers mailing list