当前位置:网站首页>SDN environment usage and openflow protocol flow analysis of software defined network experiment

SDN environment usage and openflow protocol flow analysis of software defined network experiment

2022-06-09 16:57:00 Xiao Xu needs to learn

Name of the experiment

SDN Environmental use and OpenFLow Protocol flow analysis experiment

Purpose and requirements of the experiment

1. be familiar with SDN Environmental Science
2. Use the packet capture tool to analyze OpenFlow The basic flow of the agreement

Experimental content

One 、Mininet The basic operation of

Includes creating a network 、 View network components ( Switch 、 host 、 controller )、 View terminal ( host 、 controller ) Information 、 To break off / Turn on the network link 、 View switch information ( Flow meter items )、 Initiate and view ICMP Conversation process 、 Exit and clear mininet Information .

Two 、OpenFlow Protocol communication flow analysis

Includes establishing connections (hello news 、feature news )、 Maintenance connection (echo news )、 The switch reports messages (packet-in news )、 The controller adds a flow table entry on the switch (configuration news )

The experimental steps

One 、Mininet Basic operation application experiment

Follow these steps
1.1 Use Mininet Create a basic topology
(1) Open command line terminal ( Right click or use ctrl+alt+t Shortcut key ), Run the command “sudo mn”, Input password , Create a containing a controller 、 A switch 、 Simple topology of two hosts ;
 Insert picture description here
(2) Enter the command “help”, Check out the help list .
 Insert picture description here
1.2 View network components
(1) Enter the command “net” View the components of the network ;
 Insert picture description here
(2) Enter the command “nodes” View the components of the network .
 Insert picture description here
1.3 Open the terminal ( host 、 controller ), View terminal information
(1) Enter the command “xterm h1” Open host ;
 Insert picture description here
(2) Input “ifconfig” Check the host's IP Information ;
 Insert picture description here
(3) Input “arp -a” Check the host's ARP Information .
 Insert picture description here
1.4 Initiate and view ICMP Conversation process
(1) open wireshark( Command line terminal input command “sudo wireshark”, Input password ), Grab s1 On the port ;
 Insert picture description here  Insert picture description here
(2) stay mininet Enter the command “h1 ping h2”;
 Insert picture description here
(3) adopt wireshark see ICMP Conversation process ;
 Insert picture description here  Insert picture description here  Insert picture description here
(4) At terminal h1 On the input “arp -a” Check the host's ARP Information , Contrast with 1.3 Medium ARP Different information .
 Insert picture description here

contrast 1.3 Medium arp Information ,1.4 Added a arp Information , It includes h1 Of IP Address and MAC Address information .

1.5 To break off / Turn on the network link
(1) Enter the command “link s1 h2 down” To break off s1 and h2 The link between ;
 Insert picture description here
(2) stay mininet Enter the command “h1 ping h2”;
 Insert picture description here
(3) Check whether the session can communicate normally ;

The packet loss rate is 100%, Therefore, the session cannot communicate normally

(4) Enter the command “link s1 h2 up” Turn on s1 and h2 The link between ;
(5) stay mininet Enter the command “h1 ping h2”;
 Insert picture description here
(6) Check whether the session can communicate normally ;

ICMP The message can be received normally , So the session can communicate normally

(7) Enter the command “EOF” Or use shortcut keys “ctrl+D” sign out mininet;
 Insert picture description here
(8) Enter the command “mn -c” eliminate mininet Configuration information .
 Insert picture description here
1.6 View switch flow table entry information
(1) Run the command “sudo mn --topo linear,2” Create a containing a controller 、 Two switches 、 Simple topology of two hosts ;
 Insert picture description here
(2) Enter the command “xterm s1” Turn on the switch s1, Input “ovs-ofctl dump-flows s1” Check the switch s1 Stream table entry information on ;
 Insert picture description here
(3) Enter the command “xterm s2” Turn on the switch s2, Input “ovs-ofctl dump-flows s2” Check the switch s2 Stream table entry information on ;
 Insert picture description here
(4) stay mininet Enter the command “h1 ping h2”;
 Insert picture description here
(5) Input “ovs-ofctl dump-flows s1” Check the switch s1 Stream table entry information on ;
 Insert picture description here
(6) Enter the command “xterm s2” Turn on the switch s2, Input “ovs-ofctl dump-flows s2” Check the switch s2 Stream table entry information on ;
 Insert picture description here
(7) Compare the results of two view flow table entries .( Take a flow table entry as an example , Flow table item analysis — Group header field 、 Counter 、 Action sheet 、 priority 、 Timeout time ; Why are there four flow items ; Analyze why the first ICMP Long delay )
 Insert picture description here

① The flow table item in the above figure is taken as an example ,cookie The value is 0x0, Duration is 23.025s, The flow table number is 0, The number of matching messages is 1, The number of bytes is 42, The soft timeout time is 60, The priority for 65535, The input port is 2, The execution action is from 1 Port forwarding .
②openflow1.0 Agreement , Each switch or director has only one flow table
③ first ICMP The delay is long because the first time ping When I met DNS Reverse parsing problem ,
If in ping Add after -n, close DNS analysis , The delay is relatively reduced .

Two 、OpenFlow Protocol communication flow analysis experiment

Follow these steps .
2.1 open wireshark( Command line terminal input command “wireshark”), Grab all ports (any);
 Insert picture description here 2.2 Use Mininet Create a basic topology
Open command line terminal ( Right click or use ctrl+alt+t Shortcut key ), Run the command “sudo mn” Create a containing a controller 、 A switch 、 Simple topology of two hosts .

2.3 see wireshark Message captured in
(1) see hello news 、feature news , Analyze the contents and functions of the above two messages .
 Insert picture description here

hello The message only includes OpenFlow head , It includes openflow Agreement version No 、 Message type 、 Length and transaction ID. The function is that the controller and the switch pass through hello Message establishment secure channel .

 Insert picture description here  Insert picture description here

Features_Request The message contains only OpenFlow head ,Features_Reply The message contains the data path 、 Capacity and action information is the characteristic information of the switch .
When establishing a transport security session , The controller actively sends a message to the switch Features_Request news , Request the characteristic information of the switch , Switch through Features_Reply The features supported by message replies

(2) see echo news , Analyze the contents and functions of the above messages .
 Insert picture description here  Insert picture description here

echo Messages are divided into echo_request News and echo_reply news , from OpenFlow The head is made up of . By sending Echo Request a message to confirm whether the two are connected 、 Detect communication delay 、 Measure the communication bandwidth, etc . receive echo The party requesting the message will return to the other party echo The response message .

2.4 stay mininet Enter the command “h1 ping h2”
2.5 see wireshark Message captured in
 Insert picture description here
(1) see packet-in、packet-out news , Analyze the contents and functions of the above messages .
 Insert picture description here

packet-in The message contains fields Buffer Id, Express OpenFlow Cache of packets stored in the switch id;Total length, Indicates the length of the frame ;In port, Indicates the port that accepts frames ;Reason, Means to send packet-in The reason for the news ( The reason for the illustration is that there are no matching flow table entries );Pad, Fill fields for adjusting alignment ; Also included are encapsulated Ethernet frames and ARP agreement .
The function is to arrive at OpenFlow The data packets of the switch are handed over OpenFlow Controller processing .

 Insert picture description here

packet-out Messages are cached ID Buffer Id、 Input port In port、 Action information length Action length、 Output port Output port And other fields .
Role is to OpenFlow The data packet established by the controller is sent to OpenFlow Switch .

(2) see flow-mod news , Analyze the contents and functions of the above messages .
 Insert picture description here

flow-mod Message by OpenFlow Head 、12 Mask bits of tuples Wildcards、12 Tuples ( Access port In port、 source address 、 Destination address 、 Source port 、 Destination port 、 Survival time, etc ) Field composition .
effect : The controller passes Flow-mod Add or delete the flow table entry of the message switch

Summary of the experiment

Understand the experimental environment and master some basic commands through this experiment , Know how to use mininet and wireshark, understand openflow Protocol communication process .

原网站

版权声明
本文为[Xiao Xu needs to learn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206091629207349.html