Thomas Vachuska | 82041f5 | 2014-11-30 22:14:02 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | """ |
| 4 | """ |
| 5 | from mininet.topo import Topo |
| 6 | from mininet.net import Mininet |
| 7 | from mininet.node import RemoteController |
| 8 | from mininet.node import Node |
| 9 | from mininet.node import CPULimitedHost |
| 10 | from mininet.link import TCLink |
| 11 | from mininet.cli import CLI |
| 12 | from mininet.log import setLogLevel |
| 13 | from mininet.util import dumpNodeConnections |
| 14 | |
| 15 | class AttMplsTopoExt( Topo ): |
| 16 | "Internet Topology Zoo Specimen." |
| 17 | |
| 18 | def __init__( self ): |
| 19 | "Create a topology." |
| 20 | |
| 21 | # Initialize Topology |
| 22 | Topo.__init__( self ) |
| 23 | |
| 24 | # add nodes, switches first... |
| 25 | MINE = self.addSwitch( 's31', dpid='0000001000000001') # 44.977862, -93.265427 |
| 26 | BISM = self.addSwitch( 's32', dpid='0000001000000002') # 46.817887, -100.786109 |
| 27 | BOIS = self.addSwitch( 's33', dpid='0000001000000003') # 43.617834, -116.216903 |
| 28 | RENO = self.addSwitch( 's34', dpid='0000001000000004') # 39.533310, -119.796940 |
| 29 | ALBU = self.addSwitch( 's35', dpid='0000001000000005') # 35.109657, -106.626698 |
| 30 | |
| 31 | # ... and now hosts |
| 32 | MINE_host = self.addHost( 'h31', mac='00:10:00:00:00:01' ) |
| 33 | BISM_host = self.addHost( 'h32', mac='00:10:00:00:00:02' ) |
| 34 | BOIS_host = self.addHost( 'h33', mac='00:10:00:00:00:03' ) |
| 35 | RENO_host = self.addHost( 'h34', mac='00:10:00:00:00:04' ) |
| 36 | ALBU_host = self.addHost( 'h35', mac='00:10:00:00:00:05' ) |
| 37 | |
| 38 | # add edges between switch and corresponding host |
| 39 | self.addLink( MINE , MINE_host ) |
| 40 | self.addLink( BISM , BISM_host ) |
| 41 | self.addLink( BOIS , BOIS_host ) |
| 42 | self.addLink( RENO , RENO_host ) |
| 43 | self.addLink( ALBU , ALBU_host ) |
| 44 | |
| 45 | # add edges between switches |
| 46 | self.addLink( MINE , BISM, bw=10, delay='0.979030824185ms') |
| 47 | self.addLink( BISM , BOIS, bw=10, delay='0.806374975652ms') |
| 48 | self.addLink( BOIS , RENO, bw=10, delay='0.686192970166ms') |
| 49 | self.addLink( BOIS , ALBU, bw=10, delay='0.605826192092ms') |
| 50 | self.addLink( RENO , ALBU, bw=10, delay='1.4018238197ms') |
| 51 | self.addLink( RENO , MINE, bw=10, delay='0.232315346482ms') |
| 52 | self.addLink( BISM , ALBU, bw=10, delay='1.07297714274ms') |
| 53 | |
| 54 | topos = { 'att': ( lambda: AttMplsTopoExt() ) } |