Add static routes to NFDs in parallel
This allows setting up static routing in large topologies in a reasonable time. Some timer values are also reduced, seems to work fine to me Change-Id: I112cfd216615a100db6dc18182db40ba614d83e6
This commit is contained in:
1 parent
d8e6b8e508
commit
63a330d317
4 files changed
+20
-7
No files matched your search
+1
-1
@@ -72,4 +72,4 @@ class Nfd(Application):
|
||||
|
||||
def start(self):
|
||||
Application.start(self, 'nfd --config {}'.format(self.confFile), logfile=self.logFile)
|
||||
Minindn.sleep(2)
|
||||
Minindn.sleep(0.5)
|
||||
@@ -34,6 +34,7 @@ import json
|
||||
import operator
|
||||
from collections import defaultdict
|
||||
from tqdm import tqdm
|
||||
from joblib import Parallel, delayed
|
||||
|
||||
from mininet.log import info, debug, error, warn
|
||||
from minindn.helpers.nfdc import Nfdc as nfdc
|
||||
@@ -295,13 +296,22 @@ class NdnRoutingHelper(object):
|
||||
|
||||
def globalRoutingHelperHandler(self):
|
||||
info('Creating faces and adding routes to FIB\n')
|
||||
for host in tqdm(self.net.hosts):
|
||||
neighborIPs = self.getNeighbor(host)
|
||||
self.createFaces(host, neighborIPs)
|
||||
self.routeAdd(host, neighborIPs)
|
||||
|
||||
res = Parallel(n_jobs=-1, require='sharedmem',
|
||||
prefer="threads")(delayed(self.addNodeRoutes)(host) for host in tqdm(self.net.hosts))
|
||||
|
||||
info('Processed all the routes to NFD\n')
|
||||
|
||||
def addNodeRoutes(self, node):
|
||||
"""
|
||||
Create faces to neighbors and add all routes for one node
|
||||
|
||||
:param Node node: Node from net object
|
||||
"""
|
||||
neighborIPs = self.getNeighbor(node)
|
||||
self.createFaces(node, neighborIPs)
|
||||
self.routeAdd(node, neighborIPs)
|
||||
|
||||
def addOrigin(self, nodes, prefix):
|
||||
"""
|
||||
Add prefix/s as origin on node/s
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
from mininet.log import debug
|
||||
from minindn.minindn import Minindn
|
||||
|
||||
SLEEP_TIME = 0.2
|
||||
# If needed (e.g. to speed up the process), use a smaller (or larger value)
|
||||
# based on your machines resource (CPU, memory)
|
||||
SLEEP_TIME = 0.1
|
||||
|
||||
class Nfdc(object):
|
||||
STRATEGY_ASF = 'asf'
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
python-igraph
|
||||
setuptools
|
||||
tqdm
|
||||
tqdm
|
||||
joblib
|
||||
Reference in new issue
Block a user