首页 > > 详细

讲解Java、Java讲解、讲解留学生Java语言、Java编程解析

Assignment 8: Final Project

II. Objectives

Software-defined networking (SDN) is a new paradigm for running networks. As
per the Networking Layer topics covered in the course, the network is divided into
the control and data planes. The control plane provides a set of protocols and
configurations that set up the forwarding elements (hosts, switches, and routers)
so that they can forward packets. This includes, for example, ARP resolution,
DNS, DHCP, the Spanning Tree Protocol, MAC learning, NAT and access
control configuration, as well as all of the routing protocols. Usually, switches
and routers have to run all of these protocols, detect topology changes, issue
heartbeats, manage caches, timeouts, etc. Meanwhile, in many cases network
administrators achieve desired goals with the network indirectly, by tweaking
parameters in the routing protocols like link weights and local BGP preference.
While the data plane is nicely organized in the familiar layered scheme, the
aggregate structure of the control plane is a lot less clean.

SDN is a radical departure from this organization. The main idea is a separation
of the control plane from the forwarding elements. SDN switches and routers do
not run control plane protocols and mostly only forward packets based on
matching of packet predicates to a set of forwarding rules. They export a simple
API to configure these rules, as well as some feedback about current and past
packets. The currently accepted standard for this API is the OpenFlow protocol,
which has been implemented by dozens of switch vendors and has fostered a rich
software ecosystem. The intelligence of the control plane is (logically) centralized
in a network controller. The controller decides which rules to install based on its
configuration, and on a global view of the network topology and flows.

In this project, you will implement the logic in such a controller to manage the
following:

1. A layer-3 routing application that installs rules in SDN switches to forward
traffic to hosts using the shortest, valid path through the network. Your
application logic will manage the efficient switching of packets among hosts
in a large LAN with multiple switches and potential loops. You will write the
code for an SDN controller application that will compute and install shortest
path routes among all the hosts in your network. SDN as described is suitable
for networks under a single administrative domain (e.g., the network in a
single AS), but there are ongoing research projects to use its flexibility across
domains, integrating with and perhaps even replacing BGP.
2. A distributed load balancer application that redirect new TCP connections to
hosts in a round-robin order.

As always, the NYU and class policy about plagiarism must be followed in
this project. If you use ANY code in your project that is not of your own
creation, then you MUST attribute that code to the author, even if you
modify it (ANY modification).
You will run the code for this project in an emulated network inside of a
single Linux VM. You will use the Mininet network emulator, which is
designed to emulate arbitrary topologies of emulated OpenFlow switches and
Linux hosts. It uses container-based virtualization for very light-weight
emulated nodes. The switches in your network run the open source Open
vSwitch switch software, which implements the Openflow protocol. The
switches connect to an Openflow network controller, and you will use
Floodlight, a relatively mature Java-based controller. We will use OpenFlow
version 1.0 for this project. Your SDN applications will be written in Java and
run atop the Floodlight OpenFlow controller. You will use Mininet to emulate
a variety of network topologies consisting of OpenFlow switches and hosts.
Code you run on Mininet is ready to run with no changes in real networks.
2. Environment Setup:

a. Install Oracle VirtualBox as necessary.

b. Download the Virtual Box Image with all necessary software provided. It
is a .ova image that will enable you to run the necessary software on your
computer using the latest version of Oracle VirtualBox. To install the .ova
file go to File and Import Appliance on VirtualBox. This VM uses
“mininet” as username and password.

c. To ssh into the VM from your host computer, log in first using the GUI,
open a terminal, and type ifconfig. This will show you the IP addresses of
the VM. You will be able to connect to one of them from your host
computer via ssh. The VM also has Eclipse installed, which you can use
inside the VirtualBox graphical console or remotely via X. Once you’ve
ssh’d into the VM, you can go through the following steps to run your
control applications.

d. Optional (see acknowledgement in item 8 below):
Refactor edu.brown.cs.sdn.apps.sps to edu.nyu.cs.sdn.apps.sps

e. Compile Floodlight and your applications:

$ cd ~/project3/
$ ant

This will produce a jar file FloodlightWithApps.jar that includes the
compiled code for Floodlight and your SDN applications.

f. Start Floodlight and your SDN applications:

$ java -jar FloodlightWithApps.jar -cf l3routing.prop

The above command will start Floodlight and only your layer-3 routing
application. The .prop file configures your application.

Note: For future reference when working on part 4, you can start both your
layer-3 routing and load balancer applications by using
loadbalancer.prop for the -cf (configuration file) argument. The
loadbalancer application code is provided separately.

You should always start Floodlight and your SDN applications before
starting Mininet. Also, we recommend that you restart Floodlight and your
SDN applications whenever you restart Mininet.

Note: In the VirtualBox image, it is possible that the system will start an
openvswitch-controller process by default, which means your
Floodlight controller will not be able to bind to port 6633. To prevent it
from starting the next time you boot up, do:

$ sudo update-rc.d -f openvswitch-controller remove

When Floodlight starts, you should see output like the following:

23:18:45.874 INFO [n.f.c.m.FloodlightModuleLoader:main] Loading modules from file shortestPathSwitching.prop
23:18:46.277 INFO [n.f.c.i.Controller:main] Controller role set to MASTER
23:18:46.285 INFO [n.f.c.i.Controller:main] Flush switches on reconnect -- Disabled
23:18:46.302 INFO [ArpServer:main] Initializing ArpServer...
23:18:46.302 INFO [ShortestPathSwitching:main] Initializing ShortestPathSwitching...
23:18:48.533 INFO [n.f.l.i.LinkDiscoveryManager:main] Setting autoportfast feature to OFF
23:18:48.579 INFO [ArpServer:main] Starting ArpServer...
23:18:48.580 INFO [ShortestPathSwitching:main] Starting ShortestPathSwitching...
23:18:48.700 INFO [o.s.s.i.c.FallbackCCProvider:main] Cluster not yet configured; using fallback local configuration
23:18:48.701 INFO [o.s.s.i.SyncManager:main] [32767] Updating sync configuration
ClusterConfig [allNodes={32767=Node [hostname=localhost, port=6642, nodeId=32767,
domainId=32767]}, authScheme=NO_AUTH, keyStorePath=null, keyStorePassword is unset]
23:18:48.790 INFO [o.s.s.i.r.RPCService:main] Listening for internal floodlight RPC on localhost/127.0.0.1:6642
23:18:48.978 INFO [n.f.c.i.Controller:main] Listening for switch connections on 0.0.0.0/0.0.0.0:6633

Keep the terminal with Floodlight open, as you will need to see the output
for debugging. Use another terminal for the next step.

g. Start Mininet:

$ sudo ./run_mininet.py single,3


The above command will create a topology with a single SDN switch (s1)
and three hosts (h1 - h3) directly connected to the switch:

You can change the number of hosts by changing the numeric value
included in the arguments to the run_mininet.sh script. You can also start
Mininet with four other topologies:

linear,n: a chain of n switches with one host connected to each switch; for example,
linear,3 produces the following topology:

tree,n: a tree of depth n with a single root switch (s1) and two hosts
connected to each leaf switch; for example tree,2 produces the
following topology:

assign1: creates the following topology (the name is this way for historical reasons):

triangle: creates the following topology:mesh,n: a complete graph with n switches and one host attached to
each switch; for example, mesh,5 produces the following topology someloops: creates the following topology:
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!