Add flag to allow topologies to choose whether to use FPM or not.
Most Quaggas won't have FPM available because it needs a specially
compiled Quagga, so they'll break if they encounter FPM configuration.
diff --git a/routinglib.py b/routinglib.py
index 430ced9..8650016 100644
--- a/routinglib.py
+++ b/routinglib.py
@@ -528,11 +528,13 @@
"""Runs the internal BGP speakers needed for ONOS routing apps like
SDN-IP."""
- def __init__(self, onosIps, numBgpSpeakers=1, asNum=65000, externalOnos=True, peerIntfConfig=None):
+ def __init__(self, onosIps, numBgpSpeakers=1, asNum=65000, externalOnos=True,
+ peerIntfConfig=None, withFpm=False):
super(SdnAutonomousSystem, self).__init__(asNum, numBgpSpeakers)
self.onosIps = onosIps
self.numBgpSpeakers = numBgpSpeakers
self.peerIntfConfig = peerIntfConfig
+ self.withFpm = withFpm
self.externalOnos= externalOnos
self.internalPeeringSubnet = ip_network(u'1.1.1.0/24')
@@ -577,7 +579,7 @@
neighbors=router.neighbors,
interfaces=intfs,
defaultRoute=str(natIp.ip),
- fpm=self.onosIps[0] )
+ fpm=self.onosIps[0] if self.withFpm else None )
topology.addLink( bgp, controlSwitch )
topology.addLink( bgp, connectAtSwitch )
diff --git a/vrouter.py b/vrouter.py
index 8c6b7f7..2b6f156 100755
--- a/vrouter.py
+++ b/vrouter.py
@@ -4,7 +4,7 @@
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel
-from mininet.node import RemoteController, OVSBridge
+from mininet.node import RemoteController, OVSBridge, UserSwitch
from routinglib import BasicAutonomousSystem
from routinglib import SdnAutonomousSystem, AutonomousSystem
from routinglib import generateRoutes
@@ -16,11 +16,11 @@
def __init__( self, *args, **kwargs ):
Topo.__init__( self, *args, **kwargs )
# Router switch
- s1 = self.addSwitch('s1', dpid='00000000000000b1')
+ s1 = self.addSwitch('s1', dpid='000000000b1')
# SDN AS
onosIps = ['192.168.56.11']
- sdnAs = SdnAutonomousSystem(onosIps, numBgpSpeakers=1, asNum=65000)
+ sdnAs = SdnAutonomousSystem(onosIps, numBgpSpeakers=1, asNum=65000, withFpm=True)
numRoutesPerAs = 1
@@ -61,6 +61,8 @@
net = Mininet(topo=topo, controller=None)
net.addController(RemoteController('c0', ip='192.168.56.11'))
+ net.addController(RemoteController('c1', ip='192.168.56.12'))
+ net.addController(RemoteController('c2', ip='192.168.56.13'))
net.start()