Skip to content

netmap with ns 3

Mishal Shah edited this page Mar 8, 2019 · 1 revision

We have tried to explore the netmap capabilities with ns-3. It is a SOCIS2017 project. Following are the steps we followed to setup netmap with ns-3. These steps are referenced from here.

  1. Clone the netmap repository git clone https://github.com/luigirizzo/netmap

  2. Netmap provides different modes according to the network drivers used. The generic mode doesn't modify the network drivers. You can check other modes available here.

cd netmap
./configure --no-drivers
  1. Then we generate the netmap kernel mode i.e. netmap.ko with
make
  1. Finally, install the netmap headers with
make install
  1. Now we need to clone the ns-3 repository with the netmap support.
git clone https://github.com/pasquimp/ns-3-dev-git -b socis
  1. Enter promiscuous mode, and unbind the kernel drivers from NIC and connect with netmap driver
sudo ifconfig $device_name promisc
sudo insmod netmap.ko
  1. Change the variables(deviceName, clientAddress, serverAddress) in the example you are trying to run eg. /src/fd-net-device/examples/fd-netmap-emu-onoff.cc. Also set the transportProt to either Tcp/Udp. Modify the simulation timing as per requirement.

  2. On the server machine, start an iperf server using,

iperf -s -p 8000 -i 2
  1. Switching an interface in netmap mode requires that the raw-socket-creator program in ns-3 has sudo privileges. Then, the user must configure ns-3 with the --enable-sudo option such as in the following configuration. Build profile in ns-3 is to set as optimized to get the best throughput.
./waf configure --build-profile=optimized --enable-examples --enable-sudo
Clone this wiki locally