Adding trellis HAG topology
Change-Id: I8a90e8b6520a4399221faf1ae62e817d6c182718
diff --git a/trellis/bgpdbgp1.conf b/trellis/bgpdbgp1.conf
index 8870fb4..da74da9 100644
--- a/trellis/bgpdbgp1.conf
+++ b/trellis/bgpdbgp1.conf
@@ -8,6 +8,9 @@
ip prefix-list 1 seq 20 permit 10.1.2.0/24
ip prefix-list 1 seq 30 permit 10.0.3.0/24
ip prefix-list 1 seq 40 permit 10.0.4.0/24
+ip prefix-list 1 seq 40 permit 10.5.6.0/24
+ip prefix-list 1 seq 50 permit 10.11.1.0/24
+ip prefix-list 1 seq 60 permit 10.11.2.0/24
!
route-map NEXTHOP41 permit 10
match ip address prefix-list 1
@@ -22,6 +25,9 @@
!
ipv6 prefix-list 2 seq 10 permit 2000::200/120
ipv6 prefix-list 2 seq 20 permit 2000::300/120
+ipv6 prefix-list 2 seq 30 permit 2000::a00/120
+ipv6 prefix-list 2 seq 40 permit 2000::b00/120
+
!
route-map NEXTHOP61 permit 10
match ipv6 address prefix-list 2
@@ -68,12 +74,17 @@
network 10.1.2.0/24
network 10.0.3.0/24
network 10.0.4.0/24
+network 10.5.6.0/24
+network 10.11.1.0/24
+network 10.11.2.0/24
!
! IPv6
!
address-family ipv6
network 2000::200/120
network 2000::300/120
+network 2000::a00/120
+network 2000::b00/120
neighbor 2000::101 activate
neighbor 2000::101 route-map NEXTHOP61 out
neighbor 2000::701 activate
diff --git a/trellis/bgpdbgp2.conf b/trellis/bgpdbgp2.conf
index e554de4..c9f747f 100644
--- a/trellis/bgpdbgp2.conf
+++ b/trellis/bgpdbgp2.conf
@@ -8,6 +8,9 @@
ip prefix-list 1 seq 20 permit 10.1.2.0/24
ip prefix-list 1 seq 30 permit 10.0.3.0/24
ip prefix-list 1 seq 40 permit 10.0.4.0/24
+ip prefix-list 1 seq 40 permit 10.5.6.0/24
+ip prefix-list 1 seq 50 permit 10.11.1.0/24
+ip prefix-list 1 seq 60 permit 10.11.2.0/24
!
route-map NEXTHOP45 permit 10
match ip address prefix-list 1
@@ -22,6 +25,8 @@
!
ipv6 prefix-list 2 seq 10 permit 2000::200/120
ipv6 prefix-list 2 seq 20 permit 2000::300/120
+ipv6 prefix-list 2 seq 30 permit 2000::a00/120
+ipv6 prefix-list 2 seq 40 permit 2000::b00/120
!
route-map NEXTHOP65 permit 10
match ipv6 address prefix-list 2
@@ -68,12 +73,17 @@
network 10.1.2.0/24
network 10.0.3.0/24
network 10.0.4.0/24
+network 10.5.6.0/24
+network 10.11.1.0/24
+network 10.11.2.0/24
!
! IPv6
!
address-family ipv6
network 2000::200/120
network 2000::300/120
+network 2000::a00/120
+network 2000::b00/120
neighbor 2000::501 activate
neighbor 2000::501 route-map NEXTHOP65 out
neighbor 2000::601 activate
diff --git a/trellis/dhcpd.conf b/trellis/dhcpd.conf
index aa559d2..c57426c 100644
--- a/trellis/dhcpd.conf
+++ b/trellis/dhcpd.conf
@@ -29,6 +29,22 @@
subnet 10.0.99.3 netmask 255.255.255.255 {
}
+subnet 10.5.6.0 netmask 255.255.255.0 {
+ range 10.5.6.100 10.5.6.240;
+ option routers 10.5.6.254;
+}
+
+subnet 10.11.1.0 netmask 255.255.255.0 {
+ range 10.11.1.100 10.11.1.240;
+ option routers 10.11.1.254;
+}
+
+subnet 10.11.2.0 netmask 255.255.255.0 {
+ range 10.11.2.100 10.11.2.240;
+ option routers 10.11.2.254;
+}
+
+
host h1 {
hardware ethernet 00:aa:00:00:00:01;
fixed-address 10.0.2.1;
@@ -53,3 +69,18 @@
hardware ethernet 00:cc:00:00:00:01;
fixed-address 10.1.2.1;
}
+
+host dh2 {
+ hardware ethernet 00:cc:00:00:00:02;
+ fixed-address 10.5.6.1;
+}
+
+host rpd5 {
+ hardware ethernet 00:dd:00:00:00:01;
+ fixed-address 10.11.1.5;
+}
+
+host rpd6 {
+ hardware ethernet 00:dd:00:00:00:02;
+ fixed-address 10.11.2.15;
+}
\ No newline at end of file
diff --git a/trellis/dhcpd6.conf b/trellis/dhcpd6.conf
index 526de85..dc90e4f 100644
--- a/trellis/dhcpd6.conf
+++ b/trellis/dhcpd6.conf
@@ -16,6 +16,17 @@
subnet6 2000::9903/128 {
}
+subnet6 2000::a00/120 {
+ range6 2000::a60 2000::afe;
+ option dhcp6.next-hop 2000::aff;
+}
+
+subnet6 2000::b00/120 {
+ range6 2000::b60 2000::bfe;
+ option dhcp6.next-hop 2000::bff;
+}
+
+
host h1v6 {
hardware ethernet 00:bb:00:00:00:01;
fixed-address6 2000::201;
@@ -35,3 +46,13 @@
hardware ethernet 00:bb:00:00:00:04;
fixed-address6 2000::302;
}
+
+host rpd5v6 {
+ hardware ethernet 00:ee:00:00:00:01;
+ fixed-address6 2000::a0a;
+}
+
+host rpd6v6 {
+ hardware ethernet 00:ee:00:00:00:02;
+ fixed-address6 2000::b0b;
+}
diff --git a/trellis/trellis_hag.json b/trellis/trellis_hag.json
new file mode 100644
index 0000000..da19f9a
--- /dev/null
+++ b/trellis/trellis_hag.json
@@ -0,0 +1,411 @@
+{
+ "ports" : {
+ "of:0000000000000203/5" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.1.2.254/24", "2001::2ff/120" ],
+ "vlan-tagged": [21]
+ }
+ ]
+ },
+ "of:0000000000000203/6" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.1.2.254/24", "2001::2ff/120" ],
+ "vlan-untagged": 21
+ }
+ ]
+ },
+ "of:0000000000000204/5" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.1.2.254/24", "2001::2ff/120" ],
+ "vlan-tagged": [21]
+ }
+ ]
+ },
+ "of:0000000000000204/6" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.2.254/24" ],
+ "vlan-untagged": 20
+ }
+ ]
+ },
+ "of:0000000000000204/7" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.2.254/24" ],
+ "vlan-untagged": 20
+ }
+ ]
+ },
+ "of:0000000000000204/8" : {
+ "interfaces" : [
+ {
+ "ips" : [ "2000::2ff/120" ],
+ "vlan-untagged": 40
+ }
+ ]
+ },
+ "of:0000000000000204/9" : {
+ "interfaces" : [
+ {
+ "ips" : [ "2000::2ff/120" ],
+ "vlan-untagged": 40
+ }
+ ]
+ },
+ "of:0000000000000204/10" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.1.2.254/24", "2001::2ff/120" ],
+ "vlan-untagged": 21
+ }
+ ]
+ },
+ "of:0000000000000205/6" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.3.254/24" ],
+ "vlan-untagged": 30
+ }
+ ]
+ },
+ "of:0000000000000205/7" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.3.254/24" ],
+ "vlan-untagged": 30
+ }
+ ]
+ },
+ "of:0000000000000205/8" : {
+ "interfaces" : [
+ {
+ "ips" : [ "2000::3ff/120" ],
+ "vlan-untagged": 50
+ }
+ ]
+ },
+ "of:0000000000000205/9" : {
+ "interfaces" : [
+ {
+ "ips" : [ "2000::3ff/120" ],
+ "vlan-untagged": 50
+ }
+ ]
+ },
+ "of:0000000000000205/10" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.3.254/24", "2000::3ff/120" ],
+ "vlan-untagged": 30
+ }
+ ]
+ },
+ "of:0000000000000205/11" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.1.254/24", "2000::1ff/120" ],
+ "vlan-tagged": [110]
+ }
+ ]
+ },
+ "of:0000000000000205/12" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.1.254/24", "2000::1ff/120" ],
+ "vlan-untagged": 110
+ }
+ ]
+ },
+ "of:0000000000000205/13" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.5.6.254/24" ],
+ "vlan-untagged": 56
+ }
+ ]
+ },
+ "of:0000000000000205/5" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.5.6.254/24" ],
+ "vlan-tagged": [56]
+ }
+ ]
+ },
+ "of:0000000000000206/5" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.5.6.254/24" ],
+ "vlan-tagged": [56]
+ }
+ ]
+ },
+ "of:0000000000000206/6" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.6.254/24", "2000::6ff/120" ],
+ "vlan-tagged": [160]
+ }
+ ]
+ },
+ "of:0000000000000206/8" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.5.6.254/24"],
+ "vlan-untagged": 56
+ }
+ ]
+ },
+ "of:0000000000000206/7" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.6.254/24", "2000::6ff/120" ],
+ "vlan-untagged": 160
+ }
+ ]
+ },
+
+ "of:0000000000000207/3" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.11.1.254/24" ],
+ "vlan-untagged": 1000
+ }
+ ]
+ },
+ "of:0000000000000207/4" : {
+ "interfaces" : [
+ {
+ "ips" : [ "2000::aff/120" ],
+ "vlan-untagged": 1001
+ }
+ ]
+ },
+ "of:0000000000000208/3" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.11.2.254/24" ],
+ "vlan-untagged": 1002
+ }
+ ]
+ },
+ "of:0000000000000208/4" : {
+ "interfaces" : [
+ {
+ "ips" : [ "2000::bff/120" ],
+ "vlan-untagged": 1003
+ }
+ ]
+ }
+
+ },
+ "devices" : {
+ "of:0000000000000203" : {
+ "segmentrouting" : {
+ "name" : "s203",
+ "ipv4NodeSid" : 203,
+ "ipv4Loopback" : "192.168.0.203",
+ "ipv6NodeSid" : 213,
+ "ipv6Loopback" : "2000::c0a8:0203",
+ "routerMac" : "00:00:00:00:02:03",
+ "isEdgeRouter" : true,
+ "pairDeviceId" : "of:0000000000000204",
+ "pairLocalPort" : 5,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s203",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "36.766",
+ "longitude" : "-111.359"
+ }
+ },
+ "of:0000000000000204" : {
+ "segmentrouting" : {
+ "name" : "s204",
+ "ipv4NodeSid" : 204,
+ "ipv4Loopback" : "192.168.0.204",
+ "ipv6NodeSid" : 214,
+ "ipv6Loopback" : "2000::c0a8:0204",
+ "routerMac" : "00:00:00:00:02:03",
+ "isEdgeRouter" : true,
+ "pairDeviceId" : "of:0000000000000203",
+ "pairLocalPort" : 5,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s204",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "36.766",
+ "longitude" : "-106.359"
+ }
+ },
+ "of:0000000000000205" : {
+ "segmentrouting" : {
+ "name" : "s205",
+ "ipv4NodeSid" : 205,
+ "ipv4Loopback" : "192.168.0.205",
+ "ipv6NodeSid" : 215,
+ "ipv6Loopback" : "2000::c0a8:0205",
+ "routerMac" : "00:00:00:00:02:05",
+ "isEdgeRouter" : true,
+ "adjacencySids" : [],
+ "pairDeviceId": "of:0000000000000206",
+ "pairLocalPort": 5
+ },
+ "basic" : {
+ "name": "s205",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "36.766",
+ "longitude" : "-96.89"
+
+ }
+ },
+ "of:0000000000000206" : {
+ "segmentrouting" : {
+ "name" : "s206",
+ "ipv4NodeSid" : 206,
+ "ipv4Loopback" : "192.168.0.206",
+ "ipv6NodeSid" : 216,
+ "ipv6Loopback" : "2000::c0a8:0206",
+ "routerMac" : "00:00:00:00:02:05",
+ "isEdgeRouter" : true,
+ "adjacencySids" : [],
+ "pairDeviceId": "of:0000000000000205",
+ "pairLocalPort": 5
+ },
+ "basic" : {
+ "name": "s206",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "36.766",
+ "longitude" : "-92.029"
+ }
+ },
+ "of:0000000000000226" : {
+ "segmentrouting" : {
+ "name" : "s226",
+ "ipv4NodeSid" : 226,
+ "ipv4Loopback" : "192.168.0.226",
+ "ipv6NodeSid" : 236,
+ "ipv6Loopback" : "2000::c0a8:0226",
+ "routerMac" : "00:00:00:00:02:26",
+ "isEdgeRouter" : false,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s226",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "44.15",
+ "longitude" : "-107.679"
+ }
+ },
+ "of:0000000000000227" : {
+ "segmentrouting" : {
+ "name" : "s227",
+ "ipv4NodeSid" : 227,
+ "ipv4Loopback" : "192.168.0.227",
+ "ipv6NodeSid" : 237,
+ "ipv6Loopback" : "2000::c0a8:0227",
+ "routerMac" : "00:00:00:00:02:27",
+ "isEdgeRouter" : false,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s227",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "44.205",
+ "longitude" : "-96.359"
+
+ }
+ },
+
+ "of:0000000000000207" : {
+ "segmentrouting" : {
+ "name" : "s207",
+ "ipv4NodeSid" : 207,
+ "ipv4Loopback" : "192.168.0.207",
+ "ipv6NodeSid" : 217,
+ "ipv6Loopback" : "2000::c0a8:0207",
+ "routerMac" : "00:00:00:00:02:07",
+ "isEdgeRouter" : true,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s207",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "36.766",
+ "longitude" : "-122.359"
+ }
+ },
+ "of:0000000000000208" : {
+ "segmentrouting" : {
+ "name" : "s208",
+ "ipv4NodeSid" : 208,
+ "ipv4Loopback" : "192.168.0.208",
+ "ipv6NodeSid" : 218,
+ "ipv6Loopback" : "2000::c0a8:0208",
+ "routerMac" : "00:00:00:00:02:08",
+ "isEdgeRouter" : true,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s208",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "36.766",
+ "longitude" : "-116.029"
+ }
+ },
+ "of:0000000000000246" : {
+ "segmentrouting" : {
+ "name" : "s246",
+ "ipv4NodeSid" : 246,
+ "ipv4Loopback" : "192.168.0.246",
+ "ipv6NodeSid" : 256,
+ "ipv6Loopback" : "2000::c0a8:0246",
+ "routerMac" : "00:00:00:00:02:46",
+ "isEdgeRouter" : false,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s246",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "40.15",
+ "longitude" : "-121.679"
+ }
+ },
+ "of:0000000000000247" : {
+ "segmentrouting" : {
+ "name" : "s247",
+ "ipv4NodeSid" : 247,
+ "ipv4Loopback" : "192.168.0.247",
+ "ipv6NodeSid" : 257,
+ "ipv6Loopback" : "2000::c0a8:0247",
+ "routerMac" : "00:00:00:00:02:47",
+ "isEdgeRouter" : false,
+ "adjacencySids" : []
+ },
+ "basic" : {
+ "name": "s247",
+ "driver" : "ofdpa-ovs",
+ "latitude" : "40.205",
+ "longitude" : "-117.359"
+
+ }
+ }
+
+ },
+ "apps" : {
+ "org.onosproject.dhcprelay" : {
+ "default": [
+ {
+ "dhcpServerConnectPoint": "of:0000000000000205/10",
+ "serverIps": ["10.0.3.253", "2000::3fd"]
+ }
+ ]
+ }
+ }
+}
diff --git a/trellis/trellis_hag.py b/trellis/trellis_hag.py
new file mode 100755
index 0000000..b981f00
--- /dev/null
+++ b/trellis/trellis_hag.py
@@ -0,0 +1,238 @@
+#!/usr/bin/python
+
+import sys
+sys.path.append('..')
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.node import RemoteController, OVSBridge, Host, OVSSwitch
+from mininet.link import TCLink
+from mininet.nodelib import NAT
+from ipaddress import ip_network
+from routinglib import BgpRouter
+from routinglib import RoutedHost, RoutedHost6
+from trellislib import DhcpClient, Dhcp6Client, DhcpRelay, DhcpServer, Dhcp6Server
+from trellislib import DualHomedDhcpClient
+from functools import partial
+
+class Trellis( Topo ):
+ "Trellis basic topology"
+
+ def __init__( self, *args, **kwargs ):
+ Topo.__init__( self, *args, **kwargs )
+
+ # Spines
+ s226 = self.addSwitch('s226', dpid='226')
+ s227 = self.addSwitch('s227', dpid='227')
+
+ # Leaves
+ s203 = self.addSwitch('s203', dpid='203')
+ s204 = self.addSwitch('s204', dpid='204')
+ s205 = self.addSwitch('s205', dpid='205')
+ s206 = self.addSwitch('s206', dpid='206')
+
+ # Leaf-Spine Links
+ self.addLink(s226, s203)
+ self.addLink(s226, s203)
+ self.addLink(s226, s204)
+ self.addLink(s226, s204)
+ self.addLink(s226, s205)
+ self.addLink(s226, s205)
+ self.addLink(s226, s206)
+ self.addLink(s226, s206)
+ self.addLink(s227, s203)
+ self.addLink(s227, s203)
+ self.addLink(s227, s204)
+ self.addLink(s227, s204)
+ self.addLink(s227, s205)
+ self.addLink(s227, s205)
+ self.addLink(s227, s206)
+ self.addLink(s227, s206)
+
+ # Leaf-Leaf Links
+ self.addLink(s203, s204)
+ self.addLink(s205, s206)
+
+ # NOTE avoid using 10.0.1.0/24 which is the default subnet of quaggas
+ # NOTE avoid using 00:00:00:00:00:xx which is the default mac of host behind upstream router
+ # IPv4 Hosts
+ h1 = self.addHost('h1', cls=DhcpClient, mac='00:aa:00:00:00:01')
+ h2 = self.addHost('h2', cls=DhcpClient, mac='00:aa:00:00:00:02')
+ h3 = self.addHost('h3', cls=DhcpClient, mac='00:aa:00:00:00:03')
+ h4 = self.addHost('h4', cls=DhcpClient, mac='00:aa:00:00:00:04')
+ self.addLink(h1, s204)
+ self.addLink(h2, s204)
+ self.addLink(h3, s205)
+ self.addLink(h4, s205)
+
+ # IPv6 Hosts
+ h1v6 = self.addHost('h1v6', cls=Dhcp6Client, mac='00:bb:00:00:00:01')
+ h2v6 = self.addHost('h2v6', cls=Dhcp6Client, mac='00:bb:00:00:00:02')
+ h3v6 = self.addHost('h3v6', cls=Dhcp6Client, mac='00:bb:00:00:00:03')
+ h4v6 = self.addHost('h4v6', cls=Dhcp6Client, mac='00:bb:00:00:00:04')
+ self.addLink(h1v6, s204)
+ self.addLink(h2v6, s204)
+ self.addLink(h3v6, s205)
+ self.addLink(h4v6, s205)
+
+ # Dual-homed IPv4 Host 203-204
+ dh1 = self.addHost('dh1', cls=DualHomedDhcpClient, mac='00:cc:00:00:00:01')
+ self.addLink(dh1, s204)
+ self.addLink(dh1, s203)
+
+ # DHCP server
+ dhcp = self.addHost('dhcp', cls=DhcpServer, mac='00:99:00:00:00:01', ips=['10.0.3.253/24'], gateway='10.0.3.254')
+
+ # DHCPv6 server
+ dhcp6 = self.addHost('dhcp6', cls=Dhcp6Server, mac='00:99:66:00:00:01', ips=['2000::3fd/120'], gateway='2000::3ff')
+
+ # Dataplane L2 plane switch (for DHCP servers)
+ cs1 = self.addSwitch('cs1', cls=OVSBridge)
+ self.addLink(cs1, s205)
+ self.addLink(dhcp, cs1)
+ self.addLink(dhcp6, cs1)
+
+ # Control plane switch (for quagga fpm)
+ cs0 = self.addSwitch('cs0', cls=OVSBridge)
+
+ # Control plane NAT (for quagga fpm)
+ nat = self.addHost('nat', cls=NAT,
+ ip='172.16.0.1/12',
+ subnet=str(ip_network(u'172.16.0.0/12')), inNamespace=False)
+ self.addLink(cs0, nat)
+
+ # Internal Quagga bgp1
+ """
+ intfs = {'bgp1-eth0': [{'ipAddrs': ['10.0.1.2/24', '2000::102/120'], 'mac': '00:88:00:00:00:03', 'vlan': '110'},
+ {'ipAddrs': ['10.0.7.2/24', '2000::702/120'], 'mac': '00:88:00:00:00:03', 'vlan': '170'}],
+ 'bgp1-eth1': {'ipAddrs': ['172.16.0.3/12']}}
+ """
+ intfs = {'bgp1-eth0': {'ipAddrs': ['10.0.1.2/24', '2000::102/120'], 'mac': '00:88:00:00:00:03', 'vlan': '110'},
+ 'bgp1-eth1': {'ipAddrs': ['172.16.0.3/12']}}
+ bgp1 = self.addHost('bgp1', cls=BgpRouter,
+ interfaces=intfs,
+ quaggaConfFile='./bgpdbgp1.conf',
+ zebraConfFile='./zebradbgp1.conf')
+ self.addLink(bgp1, s205)
+ self.addLink(bgp1, cs0)
+
+ # Internal Quagga bgp2
+ """
+ intfs = {'bgp2-eth0': [{'ipAddrs': ['10.0.5.2/24', '2000::502/120'], 'mac': '00:88:00:00:00:04', 'vlan': '150'},
+ {'ipAddrs': ['10.0.6.2/24', '2000::602/120'], 'mac': '00:88:00:00:00:04', 'vlan': '160'}],
+ 'bgp2-eth1': {'ipAddrs': ['172.16.0.4/12']}}
+ """
+ intfs = {'bgp2-eth0': {'ipAddrs': ['10.0.6.2/24', '2000::602/120'], 'mac': '00:88:00:00:00:04', 'vlan': '160'},
+ 'bgp2-eth1': {'ipAddrs': ['172.16.0.4/12']}}
+ bgp2 = self.addHost('bgp2', cls=BgpRouter,
+ interfaces=intfs,
+ quaggaConfFile='./bgpdbgp2.conf',
+ zebraConfFile='./zebradbgp2.conf')
+ self.addLink(bgp2, s206)
+ self.addLink(bgp2, cs0)
+
+ # External Quagga r1
+ intfs = {'r1-eth0': {'ipAddrs': ['10.0.1.1/24', '2000::101/120'], 'mac': '00:88:00:00:00:01'},
+ #'r1-eth1': {'ipAddrs': ['10.0.5.1/24', '2000::501/120'], 'mac': '00:88:00:00:00:11'},
+ 'r1-eth1': {'ipAddrs': ['10.0.99.1/16']},
+ 'r1-eth2': {'ipAddrs': ['2000::9901/120']},
+ 'r1-eth3': {'ipAddrs': ['2000::7701/120']}}
+ r1 = self.addHost('r1', cls=BgpRouter,
+ interfaces=intfs,
+ quaggaConfFile='./bgpdr1.conf')
+ self.addLink(r1, s205)
+ #self.addLink(r1, s206)
+
+ # External IPv4 Host behind r1
+ rh1 = self.addHost('rh1', cls=RoutedHost, ips=['10.0.99.2/24'], gateway='10.0.99.1')
+ self.addLink(r1, rh1)
+
+ # External IPv6 Host behind r1
+ rh1v6 = self.addHost('rh1v6', cls=RoutedHost, ips=['2000::9902/120'], gateway='2000::9901')
+ self.addLink(r1, rh1v6)
+
+ # Another external IPv6 Host behind r1
+ rh11v6 = self.addHost('rh11v6', cls=RoutedHost, ips=['2000::7702/120'], gateway='2000::7701')
+ self.addLink(r1, rh11v6)
+
+ # External Quagga r2
+ intfs = {'r2-eth0': {'ipAddrs': ['10.0.6.1/24', '2000::601/120'], 'mac': '00:88:00:00:00:02'},
+ #'r2-eth1': {'ipAddrs': ['10.0.7.1/24', '2000::701/120'], 'mac': '00:88:00:00:00:22'},
+ 'r2-eth1': {'ipAddrs': ['10.0.99.1/16']},
+ 'r2-eth2': {'ipAddrs': ['2000::9901/120']},
+ 'r2-eth3': {'ipAddrs': ['2000::8801/120']}}
+ r2 = self.addHost('r2', cls=BgpRouter,
+ interfaces=intfs,
+ quaggaConfFile='./bgpdr2.conf')
+ self.addLink(r2, s206)
+ #self.addLink(r2, s205)
+
+ # External IPv4 Host behind r2
+ rh2 = self.addHost('rh2', cls=RoutedHost, ips=['10.0.99.2/24'], gateway='10.0.99.1')
+ self.addLink(r2, rh2)
+
+ # External IPv6 Host behind r2
+ rh2v6 = self.addHost('rh126', cls=RoutedHost, ips=['2000::9902/120'], gateway='2000::9901')
+ self.addLink(r2, rh2v6)
+
+ # Another external IPv6 Host behind r1
+ rh22v6 = self.addHost('rh22v6', cls=RoutedHost, ips=['2000::8802/120'], gateway='2000::8801')
+ self.addLink(r2, rh22v6)
+
+ # Dual-homed IPv4 Host for 205-206
+ dh2 = self.addHost('dh2', cls=DualHomedDhcpClient, mac='00:cc:00:00:00:02')
+ self.addLink(dh2, s205)
+ self.addLink(dh2, s206)
+
+ # ----- Secondary fabric -----
+
+ # Spines(HAG)
+ s246 = self.addSwitch('s246', dpid='246')
+ s247 = self.addSwitch('s247', dpid='247')
+
+ # Leaves(DAAS)
+ s207 = self.addSwitch('s207', dpid='207')
+ s208 = self.addSwitch('s208', dpid='208')
+
+ # HAG-DAAS Links
+ self.addLink(s246, s207)
+ self.addLink(s246, s208)
+ self.addLink(s247, s207)
+ self.addLink(s247, s208)
+
+ # HAG - Spine Links
+ self.addLink(s246, s226)
+ self.addLink(s247, s227)
+
+ # IPv4 Hosts - RPDs
+ rpd5 = self.addHost('rpd5', cls=DhcpClient, mac='00:dd:00:00:00:01')
+ rpd6 = self.addHost('rpd6', cls=DhcpClient, mac='00:dd:00:00:00:02')
+ self.addLink(rpd5, s207)
+ self.addLink(rpd6, s208)
+
+ # IPv6 Hosts - RPDs
+ rpd5v6 = self.addHost('rpd5v6', cls=Dhcp6Client, mac='00:ee:00:00:00:01')
+ rpd6v6 = self.addHost('rpd6v6', cls=Dhcp6Client, mac='00:ee:00:00:00:02')
+ self.addLink(rpd5v6, s207)
+ self.addLink(rpd6v6, s208)
+
+
+
+
+
+topos = { 'trellis' : Trellis }
+
+if __name__ == "__main__":
+ setLogLevel('debug')
+ topo = Trellis()
+
+ switch = partial(OVSSwitch, protocols='OpenFlow13')
+ net = Mininet(topo=topo, controller=None, switch=switch)
+ #net.addController(RemoteController('c0', ip='10.192.19.161'))
+ #net.addController(RemoteController('c1', ip='10.192.19.162'))
+ #net.addController(RemoteController('c2', ip='10.192.19.163'))
+
+ net.start()
+ CLI(net)
+ net.stop()