当前位置:网站首页>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】
List of articles
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 ;
(2) Enter the command “help”, Check out the help list .
1.2 View network components
(1) Enter the command “net” View the components of the network ;
(2) Enter the command “nodes” View the components of the network .
1.3 Open the terminal ( host 、 controller ), View terminal information
(1) Enter the command “xterm h1” Open host ;
(2) Input “ifconfig” Check the host's IP Information ;
(3) Input “arp -a” Check the host's ARP Information .
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 ;

(2) stay mininet Enter the command “h1 ping h2”;
(3) adopt wireshark see ICMP Conversation process ;


(4) At terminal h1 On the input “arp -a” Check the host's ARP Information , Contrast with 1.3 Medium ARP Different information .
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 ;
(2) stay mininet Enter the command “h1 ping h2”;
(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”;
(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;
(8) Enter the command “mn -c” eliminate mininet Configuration information .
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 ;
(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 ;
(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 ;
(4) stay mininet Enter the command “h1 ping h2”;
(5) Input “ovs-ofctl dump-flows s1” Check the switch s1 Stream table entry information on ;
(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 ;
(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 )
① 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);
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 .
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 .


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 .

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 
(1) see packet-in、packet-out news , Analyze the contents and functions of the above messages .
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 .

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 .
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 .
边栏推荐
- GTF/GFF文件的差异及其相互转换(转载)
- Use testeract to recognize text in pictures
- Elk is not fragrant! I use grayog, which is much lighter
- La seconde guerre mondiale a été piégée dans ces 4 points d'erreur, un an de plus pour rien!
- Solution reference for web page loading waiting (ttfb) taking too long
- 问题 D: 马走日
- 冰峰上市IPO,能冲破“本地品牌”的束缚吗?
- UEditor图片跨域上传解决方案
- 如何解决WARNING: There was an error checking the latest version of pip.
- 姑娘,你为什么要编程呢
猜你喜欢

ArcGIS Pro优化方法

Phalapi framework improvement scheme: manage multiple API applications on a set of phalapi system

姑娘,你为什么要编程呢

Leetcode 1967. 作为子字符串出现在单词中的字符串数目

10 questions that must be asked in software testing interview

Swagger登录地址(首次登录可能会报错)

5年“研究”3年“实战” 之后的满分答卷

Kali intranet penetration shell

Use testeract to recognize text in pictures

With so many universities, the number of people taking the postgraduate entrance examination has risen sharply! Up to 70%!
随机推荐
pyepics Device:PVs的集合
存储器概念
Written test question Huawei computer test ~ to be continued
C#/VB. Net to generate directory bookmarks when word is converted to PDF
【无标题】
Vulnstack series range I
使用PrimeCache加速你的电脑!
Without regret, appium automation environment is built perfectly
不看后悔,appium自动化环境完美搭建
海通证券是安全的吗
Redis进阶知识点(可学习,可复习,可面试)
Kali intranet penetration shell
Under the epidemic situation, four points of cognition help you grow!
[East China Normal University] information sharing for the first and second examinations
pyepics数组 -- 4
在华为写了十几年代码,一个程序员的自我修养
八连冠!浪潮云连续8年蝉联中国政务云市场第一位
『忘了再学』Shell基础 — 28、AWK中条件表达式说明
leetcode:189. Rotation array
如何训练你的准确率?