Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab2: SDN Assignment (Due: 5 PM, November 17, Wednesday, 2021) 40 points Goal Understanding how SDN works and gaining hands-on experience through Mininet and POX

Lab2: SDN Assignment (Due: 5 PM, November 17, Wednesday, 2021) 40 points
  1. Goal
Understanding how SDN works and gaining hands-on experience through Mininet and POX controller.
  1. Projet Description
Answer all the questions at the end of the lab description.
  1. Setup
  1. You will need to download the following required components:
    1. VirtualBox: https://www.virtualbox.org/wiki/Downloads
    2. Mininet:
https://github.com/mininet/mininet/wiki/Mininet-VM-Images
  1. Follow the instruction here: https://github.com/mininet/openflow-tutorial
/wiki/Set-up-Virtual-Machine to configure Virtualbox so that you can access the Mininet VM via SSH.
  1. Creating an SDN Network with Mininet
In this section of the lab, you will learn how to create and emulate an SDN network in Mininet. First, lets create the network in Figure 1.
Figure 1: 3 Hosts - 1 Switch Topology
  • (S1) Open a new terminal window in your computer and SSH into the Mininet VM with the following command:
$ ssh -X mininet@ If you have the VM configured as instructed, you should be able to find the IP address of the host-only interface of your VM easily (type ifconfig -a while in the VM to list all the available network interfaces of your VM). The -X option is used when you want to enable X server with your current SSH session.
  • In the terminal window, enter:
$ sudo controller ptcp:6633 This will start the Mininet built-in tutorial controller at port 6633. Dont be alarmed if you do not see anything printed out at this point.
  • (S2) Open another SSH terminal window and enter:
$ sudo mn topo single,3 --mac --switch ovsk --controller remote After this, Mininet will create a 3 hosts, single switch topology. You should be able to see an output similar to Figure 2.
Figure 2
  • Note: You want to run the controller before creating the network (with Mininet). Otherwise, there will be an error message stating that Mininet cannot connect to the controller.
  • At this point, there are several things you can do:
    • If you had started capturing packets with Wireshark (you can do this by running the following command in a separated SSH terminal window: $ sudo Wireshark & -- Note: You need to enable X11 forwarding for this to work), you would be able to observe the Start-up exchange between the Controller and Switch (when applying the OpenFlow OF protocol filter on Wireshark).
  • You can also enter the following command in a separated SSH terminal window: $ sudo ovs-ofctl show s1
ovs-ofctl is a utility that comes with Open vSwitch, and it enables visibility and control over a single switch flow table. The show command will display the status and capabilities of all available ports of the switch. (S3) You can also enter: $ sudo ovs-ofctl dump-flows s1 to display the current flow table of the switch (s1). (Note: at this point, the flow-table should be empty).
  • (S4) Next, you can try to test the connectivity between the hosts using the ping command. In the window running Mininet, enter: mininet> h1 ping c3 h2. This will generate 3 ICMP messages from host 1 to host 2. If there is a path from h1 to h2, you will be able to obtain some statistics of that path. An example of this is shown in Figure 3.
Figure 3: Ping Response
  • (S5) Lastly, you can try to check the network's current performance with the command iperf. This Mininet command will run an iperf TCP server on one virtual host and an iperf TCP client on a second virtual host. Once connected, they will exchange packets with each other and report the results. An example of this is shown in Figure 4.
Figure 4: Iperf Result That is a straightforward example of how you can create and run an SDN network using Mininet. Next, you will learn how to control the SDN network using a POX controller.
  1. Using POX Controller with Mininet
POX is a Python-based SDN controller platform that is mainly used for research and education purposes. Since we are using the Mininet VM, POX has already been installed and is ready to use right away.
  • To start, open a SSH terminal window and enter:
$ cd pox $ ./pox.py log.level DEBUG forwarding.hub (S6) This will enable POXs verbose logging and start the hub component (the controller will act as a hub). POX will print out something like this:
Figure 5: POX controller on start up
  • (S7) Open another SSH terminal window and enter:
$ sudo mn topo single,3 --mac --switch ovsk --controller remote Now on the controller window, you should be able to see that a switch has been connected to the controller:
Figure 6: A switch connected to POX controller
  • Next, we are going to verify the hub behavior. In the mininet window, please type:
mininet> xterm h1 h2 h3 This will create 3 separate xterm windows for each host (Note: for this command to work, X Server must be enabled when SSH into the VM). While in the xterm window, you can issue an individual command and run applications in each host like you do with a regular computer.
  • (S8) & (S9) In the xterms for h2 and h3, please type:
tcpdump XX n i h2-eth0 and: tcpdump XX n i h3-eth0 These will make h2 and h3 print out the content of any TCP packet they receive.
  • (S10) In the xterm for h1, please type:
ping c1 10.0.0.2 This will send 1 ping message from h1 to h2. The switch will notify the controller of the corresponding packets, and since the controller is running the hub module, the switch should flood them out of all interfaces except the sending one. You should see identical ARP and ICMP packets corresponding to the ping in both xterm windows running tcpdump. That is an example of how you can control an SDN network with a POX controller.
  1. Questions
  • Use the following command to create a network:
$ sudo mn topo tree,3 --mac --switch ovsk --controller remote Q1: Provide a graph showing the topology of the network you just created.
  • Start the POX SDN controller with the hub module:
$ ./pox.py log.level DEBUG forwarding.hub Q2: In the mininet window, have h1 send 5 ping messages each to h2, h4, and h8, respectively (Using the command: mininet> h1 ping c5 ) Provide the results of these pings. Briefly explain the result. Q3: Run iperf between h1 and h2, h1 and h4, and h1 and h8. What is the result? Q4: In a separate SSH window, use ovs-ofctl dump-flows on s3. How many rules are there and why?
  • Close the current controller (with CTRL + C) and mininet (type exit). Start the POX SDN controller again, but with the l2_learning module this time:
$ ./pox.py log.level DEBUG forwarding.l2_learning Create the same network again with mininet. Q5: Repeat the steps in question 2 again. What are the results of the pings? Compare the result to the hub controller. Q6: Repeat the steps in question 3 again. What are the results? Compare the result to the hub controller. Q7: In the mininet window, have h1 send 5 ping messages to h3. In a separate SSH window, use ovs-ofctl dump-flows on s3. How many rules are there and why?
  1. Deliverables
  1. Do practice the problems from S1 to S10 and submit a screen shot of each problem.
  1. Answer all questions from Q1 to Q6 and submit a screen shot of each problem.

Attachments:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Do I have evidence for this statement?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

2. Javid went to the store with Joe and (I, me) ________.

Answered: 1 week ago