This repository is lab for NCTU course "Introduction to Computer Networks 2018".
In this lab, we are going to write a Python program which can generate a network topology using Mininet and use iPerf to measure the bandwidth of the topology.
- Learn how to create a network topology with Mininet
- Learn how to measure the bandwidth in your network topology with iPerf
TODO:
- Describe how to execute your program
- Show the screenshot of using iPerf command in Mininet
- First run the topology.py by " [sudo] chmod +x topology.py "
- then can run by " [sudo] ./topology.py "
- after running , it will enter to Mininet's CLI mode
- use iPerf command to measure the topology
screenshot for using iPerf command in Mininet
TODO:
- Describe the meaning of Mininet API in Python you used in detail
-
Mininet(topo= , link= , controller= ): Create Mininet object
-
addSwitch(): Add switch to topo
-
addHost(): Add host to topo
-
addLink(node1 , node2, bw= , delay= , loss= ): node2 link with node1 (bidirectional)
-
setLogLevel(): Setup loglevel (Convenience function to support lowercase names) 參數: 'info' / 'debug' / 'output'
-
dumpNodeConnections(): dump connections to/from a set of nodes
-
pingAll(): Ping between all hosts >> 檢測網路互通性
- start(): Start controller and switches
- stop(): Stop the controller(s), switches and hosts
- CLI(Mininet object): Start and run interactive or batch mode CLI
- TClink & OvScontroller for creating Mininet object's parameter
TODO:
- Describe the meaning of iPerf command you used in detail
- iPerf is a tool for measuring bandwidth on IP networks
for topo2.png , should use "h6 iperf -s -u -i 1 > ./out/result & " and "h3 iperf -c 10.0.0.6 -u -i 1"
- -s: start up with server mode
- -u: using UDP portocol
- -i 1: interval time with 1 sec
- -c 10.0.0.6: host start up with client mode (10.0.0.6 is server's address)
TODO:
- Describe how you finish this work step-by-step in detail
- Environment Setup
- clone initial repository from github and login to container by SSH
- run Mininet with OvS's controller ( to support topos )
if not using OvS, it will get error . By solving this error, use " service openvswitch-switch start ".
- Example of Mininet
- change directory
- change the .py into executable mode by " chmod +x example.py "
since the data in Mininet have no permission initial. +x : execute
- Topology Generator
- view topo2.png
- generate topology.py by " touch topology.py " under /src/.
- refer to example.py, finish topology.py
- code part:
- create switches(numbers = 5) and hosts( = 10)
- construct each links (total 14 links) and set up bandwideth, delay, loss rate
- define simpleTest() and add two requirement in here (i) Dump every connections information (ii) Enter CLI mode instead of end the network immediatly
- Measurement
- change topology.py executable as task 2 done with example.py
- execute topology.py
- after running , it will autoly enter into Mininet CLI mode
- use iPerf command to test topology.py by " h6 iperf -s -u -i 1 > ./out/result & " and " h3 iperf -c 10.0.0.6 -u -i 1 "
- it is success if loss rate is in range 13%~18%.
TODO:
- Please add your references in the following
- Mininet
- Python
- Others
TODO:
- Please replace "YOUR_NAME" and "YOUR_GITHUB_LINK" into yours
GNU GENERAL PUBLIC LICENSE Version 3