Using Linux namespace with ns3

94 views
Skip to first unread message

Alice

unread,
Sep 9, 2011, 12:12:02 AM9/9/11
to ns-3-users
Hello,
i am trying to use a linux namespace with ns3 so i can run the ospf
quagga example to test the convergence level with ns3, i have
installed rpyc and netns3 and the built sucessfully i also installed
ns3 with python bindings, but when i try to run the example i get this
error, pls can anyone help


root@alice-laptop:~/netns3/examples# ./csma-line-quagga.py -n 4
/home/alice/netns3/examples/netns3.py:3: DeprecationWarning: the ns3
module is a compatibility layer and should not be used in newly
written code
import ns3
Traceback (most recent call last):
File "./csma-line-quagga.py", line 92, in <module>
x.main()
File "/home/alice/netns3/examples/netns3.py", line 149, in main
self.run()
File "/home/alice/netns3/examples/netns3.py", line 118, in run
self.setup()
File "./csma-line-quagga.py", line 85, in setup
CsmaExperiment.setup(self)
File "/home/alice/netns3/examples/netns3.py", line 175, in setup
self.createnodes(self.options.numnodes, devhelper)
File "./csma-line-quagga.py", line 27, in createnodes
n = NetnsNode(name, logfile = "/tmp/%s.log" % name)
File "/home/alice/netns3/examples/netns3.py", line 45, in __init__
Netns3.__init__(self, *args, **kwds)
File "/usr/local/lib/python2.6/dist-packages/netns.py", line 245, in
__init__
self.start()
File "/usr/local/lib/python2.6/dist-packages/netns.py", line 251, in
start
self.pid, self.port = self.spawnserver(self.name, self.logfile)
File "/usr/local/lib/python2.6/dist-packages/netns.py", line 219, in
spawnserver
(cls.__name__, erroutput.strip()))
ValueError: NetnsNode.spawnserver() failed:
creating netns failed: [Errno 22] Invalid argument
root@alice-laptop:~/netns3/examples#


thankyou

Tom Henderson

unread,
Sep 9, 2011, 9:23:40 AM9/9/11
to ns-3-...@googlegroups.com, Alice
On 09/08/2011 09:12 PM, Alice wrote:
> Hello,
> i am trying to use a linux namespace with ns3 so i can run the ospf
> quagga example to test the convergence level with ns3, i have
> installed rpyc and netns3 and the built sucessfully i also installed
> ns3 with python bindings, but when i try to run the example i get this
> error, pls can anyone help
>
>
> root@alice-laptop:~/netns3/examples# ./csma-line-quagga.py -n 4

Does ./csma-xterm.py -n 2 work or fail the same way?

The error suggests that the subprocess call is failing. What is the
Python version you are using (output of 'python -V') and underlying
Linux distribution?

Alice

unread,
Sep 9, 2011, 7:48:23 PM9/9/11
to ns-3-users
yes ./csma-xterm.py -n 2 fails the same way, all the examples fail

i am Using Ubuntu 10.04.2
and Python 2.6.5
thankyou

Alice

unread,
Sep 11, 2011, 10:48:24 PM9/11/11
to ns-3-users
Please do you have any advice on what i can do to solve this?

Tom Henderson

unread,
Sep 13, 2011, 12:42:18 AM9/13/11
to ns-3-...@googlegroups.com, Alice
I was able to reproduce this locally on a similar machine, and will try
to debug it tomorrow.

- Tom

Alice

unread,
Sep 13, 2011, 2:11:41 AM9/13/11
to ns-3-users
ok thanks so much

Alice

unread,
Sep 14, 2011, 11:09:48 AM9/14/11
to ns-3-users
I changed my Linux distribution to Fedora 12 and started all
installations from the beginning and it worked,
but right now when i run the csma-line-quagga.py exapmple
i get an error if i try to run commands on vtysh

Exiting: Failed to connect to any daemon
pls do you know what may be wrong?
thanks

Tom Henderson

unread,
Sep 14, 2011, 12:15:43 PM9/14/11
to ns-3-...@googlegroups.com
Yes, I was able to reproduce your problem on Ubuntu 10.04 LTS system
(but not on others). The problem appears to be that the kernel with
that distribution does not fully support network namespaces. See this
wiki, for instance, about known kernel issues.
http://code.google.com/p/coreemu/wiki/Linux

Now, as for your other issue, this error means that quagga's daemons
(zebra, ospf) did not start properly. It may be that the path to the
daemons is not the same as what the script assumes.

- Tom

Alice

unread,
Sep 14, 2011, 12:33:23 PM9/14/11
to ns-3-users
Pls where do i modify the path
this is the exact error that is shown

configuring and running zebra and ospfd
/usr/lib/python2.6/site-packages/rpyc/core/vinegar.py:98:
DeprecationWarning: BaseException.message has been deprecated as of
Python 2.6
setattr(exc, name, attrval)
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 525, in
__bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 477, in run
self.__target(*self.__args, **self.__kwargs)
File "./csma-line-quagga.py", line 73, in config
n.cmd([os.path.join(QUAGGA_BIN, "zebra"), "-d"])
File "/usr/lib/python2.6/site-packages/netns.py", line 302, in cmd
tmp = self.client.root.call(args)
File "/usr/lib/python2.6/site-packages/rpyc/core/netref.py", line
125, in __call__
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "/usr/lib/python2.6/site-packages/rpyc/core/netref.py", line
42, in syncreq
return conn().sync_request(handler, oid, *args)
File "/usr/lib/python2.6/site-packages/rpyc/core/protocol.py", line
347, in sync_request
raise obj
OSError: [Errno 2] No such file or directory: None

thanks

Tom Henderson

unread,
Sep 14, 2011, 12:50:53 PM9/14/11
to ns-3-...@googlegroups.com


This suggests that the program 'zebra' is not in the path specified by
QUAGGA_BIN, which is '/usr/lib/quagga'. If you haven't installed quagga
binaries there (those are the default places if installing from rpm or
deb packages), then you will need to either install it there or repoint
the QUAGGA_BIN variable to where it is installed.

Alice

unread,
Sep 14, 2011, 4:48:40 PM9/14/11
to ns-3-users
thankyou for your help, i got it to work, i had to change the
QUAGGA_BIN to usr/sbin,
thats where zebra and ospfd were located
i can access vtysh now
Reply all
Reply to author
Forward
0 new messages