Mininet emulates a complete network of hosts, links, and switches on a single machine. To create a sample two-host, one-switch network, just run:
sudo mn
Mininet is useful for interactive development, testing, and demos, especially those using OpenFlow and SDN. OpenFlow-based network controllers prototyped in Mininet can usually be transferred to hardware with minimal changes for full line-rate execution.
*This project is a 3-part program. See Part A,B and C.
In this task, you will learn about Software Defined Networking (SDN). Using Virtualbox, Mininet, and Pox as the implementers of the OpenFlow protocol, you will build simple networks using SDN primitives.
- First, you will learn to use mininet, an SDN-enabled network emulator.
- Then, you will be using POX to implement a simple L2 firewall.
- Here you will be building an entire network, with multiple switches capable of handling ARP and other traffic.
- Lastly, you will be modifying your part 3 solution to implement an actual L3 IP router that handles ARP and routes traffic.
The network topology depicted in Fig.1 consists of 1 core switch (CS), 4 switches (s1, s2, s3, and s4), 4 hosts (h1, h2, h3, and h4), and one server (Server). All traffic arriving on a switch is forwarded to the controller. It learns the mapping between MAC addresses and ports and installs a flow rule on the switch to handle future packets. So, the only packets that should arrive at the controller are those the switch doesn’t have a flow entry.
- Have h1 ping h2 and h3 ping SERVER. How much time it took to ping?
- Run iperf h1 h2 and iperf h3 SERVER. What is the throughput?
- Run pingall to verify connectivity and dump the output. (Attah the Screenshot)
- Dump the output of the flow rules using ovs-ofctl dump-flows. (Attach the Screenshot)
- Topology file (topoa) and Controller file (contola).
Copy topoa.pyfile to “~/mininet/custom” directory directly by creating a new file using nano topoa.py OR use this command in window cmd to copy this file to vm mininet
scp [email protected] ./topoa.py ~/mininet/custom/
Copy controla.py file to “~/pox/pox/forwarding” directory directly by creating a new file using nano controla.py OR use this command in window cmd to copy this file to vm mininet
scp [email protected] ./controla.py ~/pox/pox/forwarding
RUN COMMANDS IN UBUNTU TERMINAL
Open a terminal to run controller file and in ~/pox directory run this command
mininet@mininet-vm: ~ /pox$./pox.py log. level --DEBUG forwarding. controla
Open new terminal to run topology file and in ~/ mininet/custom directory run this command
mininet@mininet-vm: ~/mininet/custom$sudo python topoa.py
Run this command in same mininet terminal
mininet>h1 ping -c5 h2
mininet>h3 ping -c5 SERVER
Run this command in same mininet terminal
mininet>iperf h1 h2
mininet>iperf h3 SERVER
Run this command in same mininet terminal
mininet>pingall
Now open another new terminal and run this commands one by one
mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s1
mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s2
mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s3
mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s4
mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s5
Modify the topology so that the host h1, h2, h3, and h4 have IP addresses 10.0.1.10/24, 10.0.1.20/24, 10.0.1.30/24, and 10.0.2.10/24 respectively. The SERVER has the IP address 10.0.4.10/24. Install IP-matching flow rules on switch CS. Let S1, S2, S3, and S4 stay as a MAC learning switch.
- Have h1 ping h2 and h3 ping SERVER. How much time it took to ping? How is it different from the previous controller?
- Run iperf h1 SERVER and iperf h4 SERVER. What is the throughput?
- Run pingall to verify connectivity and dump the output. (Attach the Screenshot)
- Dump the output of the flow rules using ovs-ofctl dump-flows for all switches. (Attach the Screenshot)
- Topology file (topob) and Controller file (controlb).
Copy topob.pyfile to “~/mininet/custom” directory directly by creating a new file using nano topoa.py or use this command in window cmd to copy this file to vm mininet
scp [email protected] ./topob.py ~/mininet/custom/
Copy controlb.py file to “~/pox/pox/forwarding” directory directly by creating a new file using nano controla.py or use this command in window cmd to copy this file to vm mininet
scp [email protected] ./controlb.py ~/pox/pox/forwarding
RUN COMMANDS IN UBUNTU TERMINAL
Open a terminal to run controller file and in ~/pox directory run this command
mininet@mininet-vm:~ /pox$./pox.py log.level --DEBUG forwarding.controlb
Open new terminal to run topology file and in ~/ mininet/custom directory run this command
mininet@mininet-vm:~/mininet/custom$sudo python topob.py
Run this command in same mininet terminal
mininet>h1 ping -c5 h2
mininet>h3 ping -c5 server
Run this command in same mininet terminal
mininet>iperf h1 server
mininet>iperf h4server
Run this command in mininet terminal
mininet>pingall
Now open another new terminal and run this commands one by one
mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s1
mininet@mininet-vm:~$sudo ovs-ofctl dump-flows s2
mininet@mininet-vm:~$sudo ovs-ofctl dump-flows s3
mininet@mininet-vm:~$sudo ovs-ofctl dump-flows s4
mininet@mininet-vm:~$sudo ovs-ofctl dump-flows cs12
Create a simple firewall at the switch CS. The firewall should allow arp and icmp traffic. Any other traffic should be dropped except IP traffic from h4. The IP addresses assigned to the hosts and server are same as previous problem (i.e., B).
- Run pingall to verify connectivity and dump the output. (Attach the Screenshot)
- Run iperf h1 SERVER and iperf h4 SERVER. What is the throughput for both cases?
- A screenshot of the output of the dpctl dump-flows for the switch CS.
- Controller file (controlc).
Copy controlc.py file to “~/pox/pox/forwarding” directory directly by creating a new file using nano controla.py or use this command in window cmd to copy this file to vm mininet
scp [email protected] ./controlc.py ~/pox/pox/forwarding
RUN COMMANDS IN UBUNTU TERMINAL
Open a terminal to run controller file and in ~/pox directory run this command
mininet@mininet-vm:~ /pox$./pox.py log.level --DEBUG forwarding.controlc
Open new terminal to run topology file and in ~/ mininet/custom directory run this command(topology file is same as part 2)
mininet@mininet-vm:~/mininet/custom$sudo python topob.py
Run this command in mininet terminal
mininet> pingall
Run this command in same mininet terminal
mininet>iperf h1 server
mininet>iperf h4 server
Run this command in same mininet terminal mininet>dpctl dump-flows
For any Information and Feedback, please do not hesitate to email me at: [email protected]