[Ns-developers] Csma, ethernet length field, NSC and the link mtu...
craigdo@ee.washington.edu
craigdo at ee.washington.edu
Tue Jul 22 17:47:39 PDT 2008
> > In CsmaNetDevice::AddHeader we have this:
> > case LLC: {
> > lengthType = p->GetSize () + header.GetSerializedSize () +
> > trailer.GetSerializedSize ();
> > LlcSnapHeader llc;
> > llc.SetType (protocolNumber);
> > p->AddHeader (llc);
> > } break;
> >
> > This looks bogus -- Why is the LLC header size ignored?
> > And is the ethernet header really expected to be accounted
> for in the length field?
>
> no idea.
This seems wrong to me. 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.
The EthernetHeader (header in the code above) represents the dst/src/length
of the packet. The LLC + SNAP header represents the LLC part
(DSAP/SSAP/HDLC Mode) and the SNAP part (ORG/EtherType). So my take is that
the above code should really be,
LlcSnapHeader llc;
llc.SetType (protocolNumber);
p->AddHeader (llc);
lengthType = header.GetSerializedSize () + llc.GetSerializedSize +
p->GetSize () + trailer.GetSerializedSize ();
Now, there's the question of MTU. The Ethernet MTU is 1500 bytes. The MTU
is 1500 bytes independent of what kind of headers and trailers are added by
the device, right?
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?
I can take care of getting the counts right, putting in a rational MTU and
updating the regression traces tomorrow AM.
I'm thinking that we should add a GetSdu to net-device.h that works with the
current MTU and mode and returns a max payload value that can be used by
clients. This probably also applies to the point-to-point device since I
remember adding a ppp header but not finding any place to reduce a payload
(it also has a 0xffff MTU where this all probably descended from). Wifi
too?
-- Craig
More information about the Ns-developers
mailing list