codeblock

2016年4月7日 星期四

Mininet Walkthrough

See also: http://mininet.org/walkthrough/

- Start wireshark:
  • "sudo wireshark &", an error message showed up: "Lua: Error during loading: dofile has been disabled due to running wireshark as superuser..."
  • Seems everybody tried to stop me to run run wireshark as root.
  • By https://forums.kali.org/showthread.php?20639-Fixing-wireshark-superuser-error-quot-Lua-Error-during-loading-quot, edit /usr/share/wireshark/init.lua file and set disable_lua as true could solve this problem.
  • "In the Wireshark filter box, enter this filter, then click Apply: of", but I couldn't find a filter named "of". Press the "Expression" button, I think they want me to choose an openflow filter. After testing, the filter "openflow_v1" works.
  • "Click Capture, then Interfaces, then select Start on the loopback interface (lo)"
- Test connectivity between hosts (default simple topology)
  • "pingall" will work and can see the package-in and package-out events in the wireshark.
- Run a simple web server
  • Run a simple web server on h1: "h1 python -m SimpleHTTPServer 80 &", and can see a thread running on h1 by "h1 jobs"
  • Connect h1 from h2: "h2 wget -O - h1", while "wget -O -" means "get as a file and redirect to STDOUT", then a simple html file shows.
  • Shut down the server: "h1 kill %python"
- Run a regression test
  • No need to enter CLI to start a test: "sudo mn --test iperf", this command also could test TCP bandwidth between h1 and h2.
- Changing topology size and type
  • "sudo mn --test pingall --topo linear,4", try to understand the links between switches and hosts
  • Also cloud try "--topo tree,depth=2,fanout=3" to form a tree network
- Link variations
  • Create a simple topology and set the link limitations by bandwidth = 10Mbits/sec and delay = 10ms: "sudo mn --link tc,bw=10,delay=10ms"
  • Try to ping a host from the other, the time will be around 40ms
- Adjustable Verbosity: skipped
- Custom Topologies
  • Change directory to mininet/custom and a file topo-2sw-2host.py shows up. Try to modify it to create a special topology for self.
  • To use own topology: "sudo mn --custum urfilename.py --topo urtopologyname"
- ID = MAC
  • By default, hosts start with randomly assigned MAC addresses. This can make debugging tough.
  • Set MAC address of hosts as a small, readable number: "sudo mn --mac"
  • Note that the MAC address of switches remains random
- XTerm Display
  • Open XTerm windows for each instances (switches, hosts, controllers)
  • "sudo mn -x"
  • Don't know the exactly usage (maybe later...)
- Other switch types: user-space switch and ovsk switch, skipped
- Mininet Benchmark: to record the time to set up and tear down a topology, skipped
- Everything in its own Namespace: skipped
- Display Options
  • "sudo mn" to build mininet, and "help"
- Python Interpreter
  • A command starts with "py" will call puthon interpreter directly
  • Try "py dir(s1)", "py s1.IP()"
- Link UP/Down
  • "link s1 h1 up/down" could open/close a link for failure testing
  • also see a port status change event in wireshark console
- XTerm Display: skipped
- SSH daemon per host
  • See "mininet/examples/ssh.py" for more information 
  • ssh to 10.0.0. and try to ping 10.0.0.2/3/4
- Congratulation! Walkthrough is DONE! See also:

沒有留言:

張貼留言