[Ns-developers] Emulated and Tap Net Devices (ns-3.3 new features)
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Tue Oct 28 00:16:03 PDT 2008
On Mon, 2008-10-27 at 23:24 -0700, craigdo at ee.washington.edu wrote:
> Since these are self-contained devices with helpers that require no API
> changes, there is really no "official" need for a design review; however, I
There are two new helper classes: these probably need to be at least
minimally reviewed. I am also not very sure I understand why we should
merge these two slightly different but almost identical pieces of code
and I am bit surprised that you picked up the tap code since I never
submitted it for inclusion and I don't plan to maintain it myself as-is.
I was hoping that, instead, the tap code or features you find useful
would be picked and merged in the emulated code and that I could modify
my code to use the emulated device instead when that happens.
> am providing a repository with these two devices' implementations in case
> anyone has any comments. You can find them in
>
> http://code.nsnam.org/craigdo/ns-3-emutap/
>
> in the src/devices/emulated and src/devices/tap directories.
>
> There is a clear and pressing need for better documentation which I am
> addressing now. I may push the devices before the documentation process is
> done, but I will certainly address this for ns-3.3. I will also finish up
> an emu-manager and emu-manager-client to deal with the suid root
> requirements in a method similar to the tap device (see man cmsg for
> details). However, the basic devices are there for your perusal.
It would be nice to get rid of the tap device code proper and see the
EmulatedNetDevice class gain the 'tap' capabilities, which means:
1) as you allude to above, delegate file descriptor creation to an
external root suid binary with command-line options to create either a
raw socket or a tap device and an attribute to control which of the two
options to use (you might also consider picking up the 'sudo' waf
capability from the ns-3-simu/ tree which allows waf to ask for a sudo
password unless you --disable-sudo when it needs to perform chown+chmod
on the generated suid binary).
2) provide a 'host'-side device to allow the simulation to be aware of
the link-level connectivity with the host system and its ip
configuration, hence allowing full ip connectivity through global
routing.
3) implement EmulatedNetDevice::MakeMulticastAddress with
Mac48Address::GetMulticast (group) (it has been reported to me that this
is enough together with making IsMulticast return true to support
multicast)
4) a common helper class
5) Also, if you merge this code, the example code in
mathieu/ns-3-simu/examples/tap.cc might be brought in.
1), 3), and 5), are pretty trivial. I don't know how easy it would be to
make 2) optional for the emulated code. 4) might be tricky and might not
be worth the pain.
regards,
Mathieu
More information about the Ns-developers
mailing list