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

Florian Westphal fw at strlen.de
Tue Jul 22 18:20:24 PDT 2008


craigdo at ee.washington.edu <craigdo at ee.washington.edu> wrote:
> > > 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 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?

Yes, but I'd like fix this up properly. I'm too tired right now to read
docs, i'll check this tomorrow (i'm fairly certain the ethernet header
doesn't belong there; think about it -- if you're not using LLC, there
is no length field in the first place, and if you use LLC adding the
ethernet header length reduces the maximum data you can carry by 14 bytes,
since the length field isn't allowed to exceed 1500).

I'll check literature & some OS implementations tomorrow to make sure
that we have something that at least tries to stay in touch with
reality...

Thanks, Florian


More information about the Ns-developers mailing list