Properly forward traffic between two hosts connected

Assignment Help Computer Networking
Reference no: EM131310379

Project Assignment: Software Defined Networks

1 Introduction

In this assignment you will learn how to use the OpenFlow protocol to program an SDN controller in a Mininet emulated network using POX. The following sections will first introduce you to the tools you will need to complete the assignment, guide you on how to install and use then, and lastly outline what you will have to do.

2 Software Definined Networks (SDN)

A Software Defined Network (SDN) is a network with a centralized controller that dictates the flow of network traffic. Unlike convention networks where each individual router or switch decided how to forward packets, in an SDN a centralized controller tells each router or switch how to forward packets. In this assignment you will have to write your own SDN controller.

3 OpenFlow

OpenFlow proposes a way for researchers to run experimental protocols in the networks they use every day. It is based on an Ethernet switch, with an internal flow-table, and a standardized interface to add and remove flow entries. OpenFlow exploits the fact that most modern Ethernet switches and routers contain flow-tables (typically built from TCAMs) that run at line-rate to implement firewalls, NAT, QoS, and to collect statistics. An OpenFlow Switch consists of at least three parts:

a. a flow table, which keeps an entry for every flow and tells each switch how to process the flow.

b. a secure channel that connects the switch to a remote control process, namely the controller that adds and removes flow entries from the flow table for different experiments allowing commands and packets to be sent between a controller and the switch by using

c. a protocol, which provides an open and standard way for a controller to communicate with a switch.

In the context of OpenFlow, a flow can be a TCP connection, or all packets from a particular MAC address or IP address, or all packets with the same VLAN tag, or all packets from the same switch port. Every flow entry in the flow table has 3 basic actions associated with it:

a. Forward the flows packets to a given port or ports, which means packets are to be routed through the network.

b. Encapsulate and forward the flows packets to a controller, which either processes them or decides if the flow needs to be added as a new entry to the flow table (i.e. if the packet is the first in a new flow).

c. Drop the flows packets, which can be used for security issues, to curb denial-of-service attacks and so on.

Read the OpenFlow whitepaper [1] and familiarize yourselves with the basic OpenFlow elements, before continuing.

4 Mininet & POX

Mininet is a python-based network emulation tool that you will use in this assignment to emulate your own networks. Mininet has built in commands to create network topologies as well as an python API to create your own custom topologies. For this assignment you will not need to learn how to use the Mininet API. However, it is highly recommended that you read the first part of the Mininet walkthrough and tutorial in order to learn how to use Mininet [3].

Although Mininet allows you to create almost any network topology you can think of, it only provides you with a basic SDN controller. In order to get the most out of Mininet you will need to write your own. Fortunately Mininet includes POX, a python-based API used to write SDN controllers using the OpenFlow protocol. You will use POX in this assignment to write your own controller. If you have questions about how to use POX, consult the wiki [4]. Although the POX wiki contains a lot of useful information, the Stock Components subsection and the OpenFlow with POX section will be the most useful to you.

5 Required Software

Almost everything needed for this assignment can run in a Mininet virtual machine. Step-by-step instructions for installing Mininet can be found in [2]. Of special interest to you will be the following sections:

a. Overview
b. Install Required Software
c. Set up Virtual Machine

Additionally, read the following sections in order to better understand the basics of Mininet and the POX library will use for the assignment:

a. Learn Development Tools
b. Create Learning Switch - POX

Once you've read the tutorials and have Mininet up and running you will have to log into your Mininet virtual machine (Username: mininet, Password: mininet) and execute the following commands from the Mininet home directory:

cd pox

wget https://raw.githubusercontent.com/CSC451/Project4/master/gen host list.py wget https://raw.githubusercontent.com/CSC451/Project4/master/binary switch.py wget https://raw.githubusercontent.com/CSC451/Project4/master/single switch.py
The files above will help you program your controller later on.

6 Assignment Description

This project consists of two parts, packet forwarding in a single switch topology and forwarding in a binary tree topology.

Single Switch Forwarding

Your first task is to properly forward traffic between two hosts connected to a single switch. Using Mininet you should create a binary tree topology of depth 1, which will create two hosts (h1 and h2) and a single switch (s1). The switchs datapath identifier (DPID) that is reported to the controller will be 1. On the switch, h1 will be connected to port 1 and h2 will be connected to port 2. Rather than hard coding the ports, you should use the IP address of a packet to determine which port it should be sent to. Your controller should read in a comma-separated variable (CSV) file called hostlist.csv that contains three columns: IP address, switch DPID, and switch port. For this first task, the file will contain:

10.0.0.1,1,1
10.0.0.2,1,2

The file should be placed in the top-level pox directory. We have provided you a Python script gen host list.py, which you should have downloaded already, to automatically generate this file for a given topology. It takes one argument: the depth of the tree. To generate the file for this first task, you will would run:

./gen host list.py 1 > hostlist.csv

To get started on this first task in POX, you should look at the files: pox/pox/misc/of tutorial.py

pox/pox/forwarding/l2 learning.py
For further details you can also consult the OpenFlow tutorial or wiki. If you have trouble viewing any of the POX files mentioned above, look

in the GitHub POX repository [5].

1446_Mininet Tree Topology of Depth 1.jpg
Figure 1: Mininet tree topology of depth 1

Binary Tree Forwarding

Your second task is to properly forward traffic between two hosts connected in a binary tree topology. You should create a binary tree topology of at least depth 2 in Mininet. You should also create the correct corresponding hostlist.csv file using the gen host list.py script. To complete this task in POX, you should rely on the discovery module which sends LLDP messages between OpenFlow switches and constructs a list of links between switches. The launch function in your POX module should include the following to start the discovery module:

import pox.openflow.discovery pox.openflow.discovery.launch()

You can access the list of links created by the discovery module by adding the following line of code within your POX module:
link list = core.openflow discovery.adjacency

The POX spanning tree module relies on the discovery module, so you should look at the file: pox/openflow/spanning tree.py

The file should provide you guidance on how to use the list of links created by the discovery module. You can also look at the source code for the discovery module in GitHub repository mentioned above.

2438_Mininet Tree Topology of Depth 3.jpg
Figure 2: Mininet tree topology of depth 3

7 Getting Started

The sections below will help you get started on the assignment as well provide you with hints on how to complete it.

Single Switch Forwarding

For this portion of the assignment you will be editing the single switch.py python file. To begin, log-on to your Mininet VM using VirtualBox and SSH into it from a separate window (if you don't know how to do this you didn't read the tutorial closely enough). Once that's done select the VirtualBox window and run the following command:

sudo mn - -topo tree,1 - -mac - -arp - -switch ovsk - -controller=remote

Note: There should be no spaces in between the dashes. Each part of the command does the following: sudo: runs as root
mn: runs Mininet commands

- -topo tree,1: creates a tree topology of depth 1 with the default fanout of 2 (i.e., binary)
- -mac: makes the mac address of Mininet hosts the same as their node number
- -arp: installs static ARP entries in all hosts

- -switch ovsk: uses Open vSwitch in kernel mode for each of the switches
- -controller=remote: tells Mininet to not use the default controller

Now you have a Mininet topology to work on. If you try to ping any of the hosts right now you'll find that your packets do not reach their destination. In order to fix that you must write your own controller. Select your SSH window and navigate to the pox sub-folder. Make sure you've downloaded gen host list.py and single switch.py before continuing. Now run gen host list.py using an argument of 1 in order to create a valid hostlist.csv for this portion of the assignment. You can hostlist.csv was created correctly using VIM or any other editor of your choice. To verify with VIM use:

vim hostlist.csv

Once you know the file is correct, open gen host list.py using your favorite editor and begin the assignment. Your controller must do the following:

1. Determine the packet destination IP address

2. If it has a valid IP address:

(a) Using hostlist.csv determine which port corresponds to the destination IP address
(b) Forward packet using forward packet

3. If the IP address is invalid or does not exist:

(a) Either do nothing or flood the packet on all ports in order continue the program, this is up to you

Once you're done editing the file, exit and test your controller. You can do this by using the following command in the pox directory:
python pox.py log.level - -DEBUG single switch

Note: sometimes POX throws an error and tells you that a controller is already running. If that's the case make sure you used the controller remote argument. If you did and you still get the error, restart your Mininet VM. Now ping a host using the Mininet window you opened previously and see whether or not your controller works. Note that if chose to use the flood method in case of a mismatch or invalid IP address, your packets will always get to their destination. Make sure that your packets are being forwarded by your own code if that is the case. Once you're packets have arrived to their destination with 0% packet loss you are done.

Binary Switch Forwarding

Restart your VM if you still have it opened from the previous section and SSH into Mininet from a separate window. In the VirtualBox window run the following command:

sudo mn - -topo tree,3 - -mac - -arp - -switch ovsk - -controller=remote

This command will create a binary tree with 3-layers of switches and 8 end-hosts. Next, run gen host list.py to create the appropriate hostlist.csv file. Now open the binary switch.py file and begin coding. For this part of the assignment you will have to:

1. Determine which type of packet you're dealing with

2. Extract the destination IP address

3. Create an algorithm that can determines which port a packet with a given address should be forwarded in order to get to its destination
Note: Do not flood all ports with the packet, you will not be given credit for that solution. Your forwarding algorithm will be the most difficult part of this section of the assignment. However, if you use the openflow.discovery module you can generate a list of links between switches. Your algorithm could then use those links to plot a path from the switch connecting to the destination host to your current switch. Once you've created your algorithm you can use the following command to test your controller:

python pox.py log.level - -DEBUG binary switch

Once your packets from any host can arrive to any other host, your are done.

8 What to Submit

Once you're done with the assignment, you should submit the two python files, single switch.py and binary switch.py, to Blackboard. In order to transfer files out of Mininet, you can either use scp command in the Mininet terminal or use an SCP client.

9 References

1. Nick McKeown, Tom Anderson, Hari Balakrishnan, Guru Parulkar, Larry Peterson, Jennifer Rexford, Scott Shenker, and Jonathan Turner. OpenFlow: enabling innovation in campus net- works. ACM SIGCOMM Computer Communication Review, 38(2):6974, 2008.

https://archive.openflow.org/documents/openflow-wp-latest.pdf [Last visited: 2016-10-13]

2. OpenFlow Tutorial.

https://archive.openflow.org/wk/index.php/OpenFlow Tutorial. [Last visited on 2016-10-13].

3. Mininet Walkthrough.

https://mininet.org/walkthrough/ [Last visited on 2016-10-13].

4. POX Wiki

https://openflow.stanford.edu/display/ONL/POX+Wiki [Last visited 2016-10-19]

5. GitHub Pox Repository

https://github.com/noxrepo/pox/tree/carp/pox [Last visited 2016-10-21]

Reference no: EM131310379

Questions Cloud

Understanding and full development of the concepts : Answer in about two paragraphs with reference. Must be 200-400 words and show an understanding and full development of the concepts. Must be substantive, clear, and informative (provide support).
What types of motherboards processors and memory would tell : What types of motherboards, processors, and memory would you tell them about? Your group has been asked to present to a high school computer science class. They want to know about internal PC hardware installation and what needs to be considered.
Discuss about the health services utilization : Describe the health care demand and supply as it relates to your chosen determinants.What will be your recommendation on how to reduce or eliminate this determinant?Ensure that you integrate economic terms, frameworks, and models throughout your revi..
Can a system provide integrity without confidentiality : A noted computer security expert has said that without integrity, no system can provide confidentiality.
Properly forward traffic between two hosts connected : Your first task is to properly forward traffic between two hosts connected to a single switch. Using Mininet you should create a binary tree topology of depth 1, which will create two hosts (h1 and h2) and a single switch (s1).
Why is the administrative region above the user region : Prove that any file in the DG/UX system with a link count greater than 1 must have an explicit MAC label.
What is your best estimate of the velocity on the centerline : Write down (in text, not Matlab code) how you are solving this problem. I want the numerical details on how you construct your matrix equation etc. What is your best estimate of the velocity on the centerline, i.e., u(0)
What would the fourth field of the tripwire database contain : Tripwire does not provide a wildcard mechanism suitable for saying, "all files in the directory /usr/spool/lpd beginning with cf or df." Suggest a modification of the tripwire configuration file that would allow this.
What is the present value of this commitment : When Marilyn Monroe died, ex-husband Joe DiMaggio vowed to place fresh flowers on her grave every Sunday as long as he lived. The week after she died in 1962, a bunch of fresh flowers that the former baseball player thought appropriate for the star c..

Reviews

Write a Review

Computer Networking Questions & Answers

  Create a visio drawing of the network

Focus on topologies, any internetworking or segmentation, and additional support of other services (e.g.: video, telephonic etc.) You may use part of first paper to connect ideas. Create a Visio drawing of the network to the point of presence (PO..

  Explain each layer of osi model-how it associates to network

Explain each layer of OSI model and how it associates to network in 200 to 300 words. Your response should include answers to the following:o On which layers of OSI model do WAN protocols operate?

  What is desktop management and why is it important

What is desktop management and why is it important? What is performance and fault management? What does a help desk do? What do trouble tickets report?

  Cloud computing like elastic scalability and outsourcing

It also help business to use the best features of cloud computing like, elastic scalability and outsourcing. what are your toughts on the above statement? Do you agree or disagree?

  Difference between symmetric and public key system

What is the most important difference between a symmetric key system and a public key system and in what way does a hash function provide a better message integrity check than a checksum

  Compare and contrast the design process of a cell phone

Compare and contrast the design process of a cell phone interface using paper prototyping versus a tool such as Microsoft Visio, open source wireframing or mockup tools. Identify which method you would prefer to use, and why

  Assume that you can access the caches in the local dns

suppose you can access the caches in the local dns servers of your department. can you propose a way to roughly

  Developing a detailed risk assessment methodology

Developing a detailed risk assessment methodology. You are a senior information technology analyst at your company. Your company has 250 employees. Each employee has his or her own terminal to access the company's network.

  Could you reduce the amount of data that would be lost

Could you get enough information from the Internet to take out a loan in another person's name? You should provide any recent cases in Australia to support your explanation.

  Directaccess and remote access benefits

DirectAccess and Remote Access Benefits

  Multi-step protocols

Often a multi-step protocols the pipeline concept is applied. What does this mean? give an example, Explain it pictorially.

  Develop a form to capture the lessons learned

Calculate the project's earned value (see reading - Kloppenborg ) and discuss how this affects your project. Develop a form to capture the lessons learned from this project, to be completed by all project team members

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd