Mininet (lightweight software defined network and test platform) II

Source: Internet
Author: User

Mininet-2 Perform regression testing mn --test

The --test established topology can be tested by

pingpairYou can test whether the connection between the hosts is normal (Ping between first, useful for testing)
[email protected]:~# mn --test pingpair*** Creating network*** Adding controller*** Adding hosts:h1 h2 *** Adding switches:s1 *** Adding links:(h1, s1) (h2, s1) *** Configuring hostsh1 h2 *** Starting controllerc0 *** Starting 1 switchess1 ...*** Waiting for switches to connects1 h1 -> h2 h2 -> h1 *** Results: 0% dropped (2/2 received)*** Stopping 1 controllersc0 *** Stopping 2 links..*** Stopping 1 switchess1 *** Stopping 2 hostsh1 h2 *** Donecompleted in 5.681 seconds
iperf(Simple iperf TCP test between, optionally specified) hosts. Usage:iperf Node1 Node2)
[email protected]:~# mn --test iperf*** Creating network*** Adding controller*** Adding hosts:h1 h2 *** Adding switches:s1 *** Adding links:(h1, s1) (h2, s1) *** Configuring hostsh1 h2 *** Starting controllerc0 *** Starting 1 switchess1 ...*** Waiting for switches to connects1 *** Iperf: testing TCP bandwidth between h1 and h2 .*** Results: [‘36.3 Gbits/sec‘, ‘36.3 Gbits/sec‘]*** Stopping 1 controllersc0 *** Stopping 2 links..*** Stopping 1 switchess1 *** Stopping 2 hostsh1 h2 *** Donecompleted in 10.987 seconds
Adjust the topology with parameters --topo
--topo=TOPO           linear|minimal|reversed|single|torus|tree[,param=value                        ...] linear=LinearTopo torus=TorusTopo tree=TreeTopo                        single=SingleSwitchTopo                        reversed=SingleSwitchReversedTopo minimal=MinimalTopo
Single

Single refers to the individual, this type of topology only a switch, and the number of hosts can be arbitrarily assigned, extension Piao star type

[email protected]:~# mn --topo=single,3*** Creating network*** Adding controller*** Adding hosts:h1 h2 h3 *** Adding switches:s1 *** Adding links:(h1, s1) (h2, s1) (h3, s1) *** Configuring hostsh1 h2 h3 *** Starting controllerc0 *** Starting 1 switchess1 ...*** Starting CLI:mininet> neth1 h1-eth0:s1-eth1h2 h2-eth0:s1-eth2h3 h3-eth0:s1-eth3s1 lo:  s1-eth1:h1-eth0 s1-eth2:h2-eth0 s1-eth3:h3-eth0c0
Linear

Linear refers to a straight line, a switch with a host, and the number of hosts and switches can be arbitrarily specified, the topology shape into a straight type

[email protected]:~# mn --topo=linear,3*** Creating network*** Adding controller*** Adding hosts:h1 h2 h3 *** Adding switches:s1 s2 s3 *** Adding links:(h1, s1) (h2, s2) (h3, s3) (s2, s1) (s3, s2) *** Configuring hostsh1 h2 h3 *** Starting controllerc0 *** Starting 3 switchess1 s2 s3 ...*** Starting CLI:mininet> neth1 h1-eth0:s1-eth1h2 h2-eth0:s2-eth1h3 h3-eth0:s3-eth1s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth2s2 lo:  s2-eth1:h2-eth0 s2-eth2:s1-eth2 s2-eth3:s3-eth2s3 lo:  s3-eth1:h3-eth0 s3-eth2:s2-eth3c0
Tree

Tree refers to trees, such as the shape of the topology of the tree, the switch into a tree-like scattered, the bottom layer of the tree to hang two hosts

  [email protected]:~# mn--topo=tree,3*** Creating network*** Adding controller*** Adding hosts:h1 H2 H3 h 4 h5 h6 H7 H8 * * * Adding SWITCHES:S1 S2 S3 S4 S5 S6 S7 * * * Adding Links: (S1, S2) (S1, S5) (S2, S3) (S2, S4) (S3, H1) S3, H2 (S4, H3) (S4, H4) (S5, S6) (S5, S7) (S6, H5) (S6, H6) (S7, H7) * * S7 H8 Configuring HOSTSH1 H2 H3 h4 h5 h6 * * * Starting CONTROLLERC0 * * * Starting 7 SWITCHESS1 S2 S3 S4 S5 S6 S7 ... * * * starting cli:mininet> neth1 h1-eth0:s3-eth1 H2 h2-eth0:s3-eth2h3 h3-eth0:s4-eth1h4 h4-eth0:s4-eth2h5 h5-eth0:s6-eth1h6 h6-eth0:s6-eth2h7 h7-eth0:s7-eth1h8 h8-eth0:s7-eth2s1 lo:s1-eth1:s2-eth3 s1-eth2:s5-eth3s2 lo:s2-eth1:s3-eth3 s2-eth2:s4-eth3 s2-eth3:s1-eth1s3 lo:s3-et H1:h1-eth0 s3-eth2:h2-eth0 s3-eth3:s2-eth1s4 lo:s4-eth1:h3-eth0 s4-eth2:h4-eth0 s4-eth3:s2-eth2s5 lo:s5-eth1:s6-eth3 S5-eth2:s7-eth3 s5-eth3:s1-eth2s6 lo:s6-eth1:h5-eth0 s6-eth2:h6-eth0 s6-eth3:s5-eth1s7 lo:s7-eth1:h7-eth0 s7-eth2: H8-eth0 s7-eth3:s5-eth2c0  
Minimal

Minimal refers to the smallest and mininet default topology, connecting two hosts to a single switch

[email protected]:~# mn --topo=minimal*** Creating network*** Adding controller*** Adding hosts:h1 h2 *** Adding switches:s1 *** Adding links:(h1, s1) (h2, s1) *** Configuring hostsh1 h2 *** Starting controllerc0 *** Starting 1 switchess1 ...*** Starting CLI:mininet> neth1 h1-eth0:s1-eth1h2 h2-eth0:s1-eth2s1 lo:  s1-eth1:h1-eth0 s1-eth2:h2-eth0c0
--mac

Mininer is created by default to every device (Host,switch, etc.). ) assigns a MAC address, but each time the assigned Mac location changes, and the adjustment is more difficult. --macis to keep your Mac location simple and understandable.

Not yet tuned:

mininet> h1 ifconfig | grep HWaddrh1-eth0   Link encap:Ethernet  

Join--mac

mininet> h1 ifconfig | grep HWaddrh1-eth0   Link encap:Ethernet  HWaddr 00:00:00:00:00:01
Terminal to open individual hosts xterm

mn -xThe terminal of each device will be turned on when Mininet is turned on
To turn on Xtrem for a single device, after opening the topology, performxterm (设备)

Mininet (lightweight software defined network and test platform) II

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.