Adding NDN testbed
diff --git a/mininet/node.py b/mininet/node.py
index f8ec8c9..7f3c4c7 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -553,7 +553,7 @@
pass
-
+
class CPULimitedHost( Host ):
"CPU limited host"
@@ -592,7 +592,7 @@
"Return value of cgroup parameter"
cmd = 'cgget -r %s.%s /%s' % (
resource, param, self.name )
-
+
return int(quietRun( cmd ).split()[ -1 ] )
def cgroupDel( self ):
@@ -721,29 +721,31 @@
def __init__( self, name, **kwargs ):
-
+
Host.__init__( self, name, **kwargs )
if not CCNHost.inited:
CCNHost.init()
-
+
+ # self.cmd("export CCND_DEBUG=6")
+ # self.cmd("export CCND_LOG=./log.{0}".format(self.name))
self.cmd("export CCN_LOCAL_SOCKNAME=/tmp/.sock.ccnx.{0}".format(self.name))
self.cmd("ccndstart")
self.peerList = {}
def config( self, fib=None, app=None, **params ):
-
+
r = Node.config( self, **params )
-
+
self.setParam( r, 'app', fib=fib )
self.setParam( r, 'fib', app=app)
-
+
return r
-
+
def configCCN(self):
-
+
self.buildPeerIP()
self.setFIB()
-
+
def buildPeerIP(self):
for iface in self.intfList():
link = iface.link
@@ -753,8 +755,8 @@
self.peerList[node2.name] = link.intf2.node.IP(link.intf2)
else:
self.peerList[node1.name] = link.intf1.node.IP(link.intf1)
-
-
+
+
def setFIB(self):
for name in self.params['fib']:
@@ -762,53 +764,57 @@
pass
else:
self.insert_fib(name[0],self.peerList[name[1]])
-
-
+
+
def insert_fib(self, uri, host):
self.cmd('ccndc add {0} tcp {1}'.format(uri,host))
-
+ # self.cmd('ccndc add {0} udp {1}'.format(uri,host))
+
def terminate( self ):
"Stop node."
self.cmd('ccndstop')
+ self.cmd('killall -r zebra ospf')
Host.terminate(self)
-
+
inited = False
-
+
@classmethod
def init( cls ):
"Initialization for CCNHost class"
cls.inited = True
-
+
class CPULimitedCCNHost( CPULimitedHost ):
'''CPULimitedCCNHost is a Host that always runs the ccnd daemon and extends CPULimitedHost.
It should be used when one wants to limit the resources of CCN routers and hosts '''
-
+
def __init__( self, name, sched='cfs', **kwargs ):
-
+
CPULimitedHost.__init__( self, name, sched, **kwargs )
if not CCNHost.inited:
CCNHost.init()
-
- self.cmd("export CCN_LOCAL_SOCKNAME=/tmp/.sock.ccnx.{0}".format(self.name))
+
+ # self.cmd("export CCND_DEBUG=6")
+ # self.cmd("export CCND_LOG=./log.{0}".format(self.name))
+ self.cmd("export CCN_LOCAL_SOCKNAME=/tmp/.sock.ccnx.{0}".format(self.name))
self.cmd("ccndstart")
self.peerList = {}
- def config( self, fib=None, app=None, cpu=None, cores=None, **params):
+ def config( self, fib=None, app=None, cpu=None, cores=None, **params):
r = CPULimitedHost.config(self,cpu,cores, **params)
-
+
self.setParam( r, 'app', fib=fib )
self.setParam( r, 'fib', app=app)
-
+
return r
-
+
def configCCN(self):
-
+
self.buildPeerIP()
self.setFIB()
-
+
def buildPeerIP(self):
for iface in self.intfList():
link = iface.link
@@ -818,8 +824,8 @@
self.peerList[node2.name] = link.intf2.node.IP(link.intf2)
else:
self.peerList[node1.name] = link.intf1.node.IP(link.intf1)
-
-
+
+
def setFIB(self):
for name in self.params['fib']:
@@ -827,19 +833,21 @@
pass
else:
self.insert_fib(name[0],self.peerList[name[1]])
-
-
+
+
def insert_fib(self, uri, host):
self.cmd('ccndc add {0} tcp {1}'.format(uri,host))
-
+# self.cmd('ccndc add {0} udp {1}'.format(uri,host))
+
def terminate( self ):
"Stop node."
self.cmd('ccndstop')
+ self.cmd('killall -r zebra ospf')
Host.terminate(self)
-
+
inited = False
-
+
@classmethod
def init( cls ):
"Initialization for CCNHost class"