summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/unit_tests/test.py
blob: dac765d672fd0308ca03bea3825c93d3a75b5c22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from mininet.topo import Topo
from mininet.link import TCLink
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel

class MyTopo( Topo ):
    "Simple topology example."

    def __init__( self ):
        "Create custom topo."

        # Initialize topology
        Topo.__init__( self )

        # Add hosts and switches
        leftHost = self.addHost( 'h1' )
        rightHost = self.addHost( 'h2' )
        Switch = self.addSwitch( 's1' )

        # Add links
        self.addLink( leftHost, Switch ,bw=10, delay='5ms')
        self.addLink( Switch, rightHost  )


topos = { 'mytopo': ( lambda: MyTopo() ) }

# 1. http server example
# 
#mininet> h1 python -m SimpleHTTPServer 80 &
#mininet> h2 wget -O - h1
# 2. limit mss example 
#decrease the MTU ifconfig eth0 mtu 488