The second SDN contest--must answer 1
Section 1 Small topic: Simple Network
First, Experimental Purpose
Build the Simple network shown in 1.1, through the flow table operation to achieve the ping between two different hosts or not.
Figure 1.1: Simple Network topology
Second, Construction of experimental environment
(a) Design ideas
As shown in 1.1, the Simple network consists of a Controller, two switch and two hosts . We add the flow table through the Controller so that the two hosts cannot ping .
(ii) Equipment and platforms
We choose to install vmware workstation 10 sdn hub ( Span style= "Font-family:times New Roman" >sdnhub.org ) built ALL-IN-ONE TUTORIAL VM (hereinafter Span style= "Font-family:times New Roman" >sdn virtual machine) and import to vmware sdn related software and tools 64 ubuntu 12.10 virtual machine image. The built-in software and tools are as follows:
· SDN Controller: Opendaylight , Ryu , Floodlight , Pox and the Trema
· shown Example code: hub,2-Layer learning switches and other applications
· Open VSwitch 1.11: Support Openflow 1.0, experimental support Openflow 1.2 and 1.3
· mininet : Create and run a sample topology
· E Clipse and Maven
· W Ireshark: Protocol Packet Analysis
The controller we use is floodlight.
Third, experimental process and results
(i) Initial environment
First enter the SDN virtual machine, open the terminal, enter the following command to compile and run the floodlight :
>>CD floodlight
>>ant
>>java-jar Target/floodlight.jar
The floodlight starts listening on the switch and 6633 ports (shown in 1.2 and 1.3 ).
Figure 1.2: Compiling and running floodlight
Figure 1.3: A running floodlight
(ii) mininet Create a topology
Create the topology by entering the following command in the terminal:
>>sudo mn--custom/home/ubuntu/mininet/custom/topo-2sw-2host.py--topo mytopo--switch Ovsk--controller=remote , ip=192.168.181.142,port=6633
The topo-2sw-2host.py file is an existing file in the system and can be used directly, with the same topology as the topic. The contents of the file are as follows:
"" "Custom Topology Example
Directly connected switches plus a host for each switch:
Host---SWITCH---switch---host
Adding the ' topos ' dict with a key/value pair to generate our newly defined
Topology enables one to pass in '--topo=mytopo ' from the command line.
"""
From Mininet.topo Import topo
Class Mytopo (Topo):
"Simple topology example."
def __init__ (self):
"Create Custom topo."
# Initialize topology
Topo.__init__ (self)
# ADD hosts and switches
Lefthost = Self.addhost (' H1 ')
Righthost = Self.addhost (' h2 ')
Leftswitch = Self.addswitch (' S3 ')
Rightswitch = Self.addswitch (' S4 ')
# Add Links
Self.addlink (Lefthost, Leftswitch)
Self.addlink (Leftswitch, Rightswitch)
Self.addlink (Rightswitch, Righthost)
topos = {' Mytopo ': (Lambda:mytopo ())}
As shown in the results 1.4 , this topology consists of two host H1,H2 and two switch s3,s4 , as shown in topology diagram 1.1 .
Figure 1.4:mininet establishing a topology
Open Browser Input http://localhost:8080/ui/index.html , enter the graphical mininet Visual Interface ( 1.5 and 1. 6 shown below).
Figure 1.5:mininet Graphical interface
Figure 1.6:mininet Graphical topology interface
(iii) test whether the host Ping
Enter the following command in mininet to test whether H1 and H2 can ping the (as shown in 1.7 ):
>>Pingall
Figure 1.7: Testing The connection of H1 and H2
at this point the packet loss rate is 0% , that is, two host computers H1 with the H2 can be Ping The .
(iv) adding flow tables makes it impossible to ping between hosts
in the Terminal , enter the following command:
>>ovs-ofctl dump-flows S3
>>ovs-ofctl Add-flow S3 Priority=1,in_port=2,actions=drop
1.8 and figure 1.9 are shown. The flow table shown in Figure 1.8 is the temporary flow table added by the controller, and is automatically invalidated after 5s.
Figure 1.8: viewing The flow table for switch S3
Figure 1.9: Adding a flow table to make H1,H2 not connected
Figure 1.10: Added flow table information
shown in Figure 1.10, after adding the flow table, enter the Pingall command, the packet loss rate of 100%, the host H1 and H2 can not ping through, Achieve the requirements of the topic.
The second SDN contest--must answer 1