From 13d05bc8458758ee39cb829098241e89616717ee Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Wed, 9 Sep 2015 22:15:21 -0700 Subject: ONOS checkin based on commit tag e796610b1f721d02f9b0e213cf6f7790c10ecd60 Change-Id: Ife8810491034fe7becdba75dda20de4267bd15cd --- framework/src/onos/tools/test/topos/rftesttopo.py | 59 +++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 framework/src/onos/tools/test/topos/rftesttopo.py (limited to 'framework/src/onos/tools/test/topos/rftesttopo.py') diff --git a/framework/src/onos/tools/test/topos/rftesttopo.py b/framework/src/onos/tools/test/topos/rftesttopo.py new file mode 100644 index 00000000..9b975785 --- /dev/null +++ b/framework/src/onos/tools/test/topos/rftesttopo.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +""" +""" +from mininet.topo import Topo +from mininet.net import Mininet +from mininet.node import RemoteController +from mininet.node import Node +from mininet.node import CPULimitedHost +from mininet.link import TCLink +from mininet.cli import CLI +from mininet.log import setLogLevel +from mininet.util import dumpNodeConnections + +class ReactiveForwardingTestTopo( Topo ): + "Internet Topology Zoo Specimen." + + def __init__( self ): + "Create a topology." + + # Initialize Topology + Topo.__init__( self ) + + # add nodes, switches first... + s1 = self.addSwitch( 's1' ) + s2 = self.addSwitch( 's2' ) + s3 = self.addSwitch( 's3' ) + s4 = self.addSwitch( 's4' ) + s5 = self.addSwitch( 's5' ) + s6 = self.addSwitch( 's6' ) + s7 = self.addSwitch( 's7' ) + s8 = self.addSwitch( 's8' ) + s9 = self.addSwitch( 's9' ) + + # ... and now hosts + h1 = self.addHost( 'h1' ) + h2 = self.addHost( 'h2' ) + h3 = self.addHost( 'h3' ) + h4 = self.addHost( 'h4' ) + + # add edges between switch and corresponding host + self.addLink( s1 , h1 ) + self.addLink( s2 , h2 ) + self.addLink( s3 , h3 ) + self.addLink( s4 , h4 ) + + # add edges between switches + self.addLink( s1 , s5 ) + self.addLink( s2 , s5 ) + self.addLink( s2 , s8 ) + self.addLink( s3 , s4 ) + self.addLink( s3 , s7 ) + self.addLink( s4 , s5 ) + self.addLink( s6 , s8 ) + self.addLink( s6 , s7 ) + self.addLink( s5 , s9 ) + self.addLink( s6 , s9 ) + +topos = { 'att': ( lambda: ReactiveForwardingTestTopo() ) } -- cgit 1.2.3-korg