Create multicast groups for NDP support

This commit is contained in:
Nico Schottelius 2019-02-26 15:08:53 +01:00
commit 6895a6ab34
2 changed files with 27 additions and 0 deletions

View file

@ -86,6 +86,21 @@ class L2Controller(object):
# Now add global address
subprocess.call(["mx", host, "ip", "addr", "add", ipaddr, "dev", dev])
def init_ndp(self):
""" initialise neighbor discovery protocol"""
all_ports = range(1,5)
# create multicast nodes
for rid in range(1,5):
ports = [ x for x in all_ports if not x == rid ]
n_handle = self.controller.mc_node_create(rid, ports)
log.debug("Creating MC node rid={} ports={} handle={}".format(rid, ports, n_handle))
g_handle = self.controller.mc_mgrp_create(rid)
log.debug("Creating MC group mgrp={} handle={} && associating afterwards".format(rid, g_handle))
self.controller.mc_node_associate(g_handle, n_handle)
def init_boilerplate(self, sw_name):
self.topo = Topology(db="topology.db")
self.sw_name = sw_name
@ -98,6 +113,8 @@ class L2Controller(object):
if self.cpu_port:
self.controller.mirroring_add(100, self.cpu_port)
self.init_ndp()
def config(self):
self.fill_tables()
self.config_hosts()