[Ns-developers] add ns-3 network/data-link layers

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Thu Sep 25 10:25:24 PDT 2008


hi,

On Wed, 2008-09-24 at 21:00 -0500, Mark Kuhr wrote:
> Hello all,
> 
> I'm looking to use ns-3 to test some ideas for new communication
> protocols in a MANET.  If I wanted to build a new network layer and
> data link layer in ns-3 (possibly even physical), what classes should
> I extend from?  Just looking for some opinions on where to start in
> the ns-3 code.

To implement a new layer 1/2, you need to subclass the NetDevice and
Channel base classes. For layer 3, you would need to use the
Node::RegisterProtocolHandler/UnregisterProtocolHandler methods to get
packets and you would need to send packets using NetDevice::Send. (The
src/internet-stack/arp-l3-protocol.cc class does this)

regards,
Mathieu

PS: although it's not a big deal, I think that this is probably  a
question better suited for ns-3-users:
http://groups.google.com/group/ns-3-users



More information about the Ns-developers mailing list