实验3:OpenFlow协议分析实践

一、实验目的

能够运用 wireshark 对 OpenFlow 协议数据交互过程进行抓包;
能够借助包解析工具,分析与解释 OpenFlow协议的数据包交互过程与机制。

二、实验环境

下载虚拟机软件Oracle VisualBox;
在虚拟机中安装Ubuntu 20.04 Desktop amd64,并完整安装Mininet;

三、实验要求

(一)基本要求

搭建下图所示拓扑,完成相关 IP 配置,并实现主机与主机之间的 IP 通信。用抓包软件获取控制器与交换机之间的通信数据包。
主机 IP地址
h1 192.168.0.101/24
h2 192.168.0.102/24
h3 192.168.0.103/24
h4 192.168.0.104/24
实验3:OpenFlow协议分析实践

查看抓包结果,分析OpenFlow协议中交换机与控制器的消息交互过程,画出相关交互图或流程图。

hello

控制器6633端口(我最高能支持OpenFlow 1.0) ---> 交换机47688端口
实验3:OpenFlow协议分析实践

交换机47688端口(我最高能支持OpenFlow 1.3)---> 控制器6633端口
实验3:OpenFlow协议分析实践

于是双方建立连接,并使用OpenFlow 1.0

Features Request / Set Conig

控制器6633端口(我需要你的特征信息) ---> 交换机47688端口
实验3:OpenFlow协议分析实践

控制器6633端口(请按照我给你的flag和max bytes of packet进行配置) ---> 交换机47688端口
实验3:OpenFlow协议分析实践

Port_Status

当交换机端口发生变化时,告知控制器相应的端口状态。
实验3:OpenFlow协议分析实践

Features Reply

交换机47688端口(这是我的特征信息,请查收)--- 控制器6633端口
实验3:OpenFlow协议分析实践

Packet_in

• 有两种情况: • 交换机查找流表,发现没有匹配条目时
• 有匹配条目但是对应的action是OUTPUT=CONTROLLER时
交换机35534端口(有数据包进来,请指示)--- 控制器6633端口
实验3:OpenFlow协议分析实践

Flow_mod

分析抓取的flow_mod数据包,控制器通过6633端口向交换机端口、交换机
47688端口下发流表项,指导数据的转发处理

Packet_out

控制器6633端口(请按照我给你的action进行处理) ---> 交换机47688端口
实验3:OpenFlow协议分析实践

回答问题:交换机与控制器建立通信时是使用TCP协议还是UDP协议?
答: tcp协议

点击查看代码
{
    "application": {
        "dpctl": "",
        "ipBase": "10.0.0.0/8",
        "netflow": {
            "nflowAddId": "0",
            "nflowTarget": "",
            "nflowTimeout": "600"
        },
        "openFlowVersions": {
            "ovsOf10": "1",
            "ovsOf11": "1",
            "ovsOf12": "1",
            "ovsOf13": "1"
        },
        "sflow": {
            "sflowHeader": "128",
            "sflowPolling": "30",
            "sflowSampling": "400",
            "sflowTarget": ""
        },
        "startCLI": "1",
        "switchType": "ovs",
        "terminalType": "xterm"
    },
    "controllers": [
        {
            "opts": {
                "controllerProtocol": "tcp",
                "controllerType": "ref",
                "hostname": "c0",
                "remoteIP": "127.0.0.1",
                "remotePort": 6633
            },
            "x": "314.0",
            "y": "150.0"
        }
    ],
    "hosts": [
        {
            "number": "1",
            "opts": {
                "defaultRoute": "255.255.255.0",
                "hostname": "h1",
                "ip": "192.168.0.101",
                "nodeNum": 1,
                "sched": "host"
            },
            "x": "137.0",
            "y": "235.0"
        },
        {
            "number": "2",
            "opts": {
                "hostname": "h2",
                "ip": "192.168.0.102",
                "nodeNum": 2,
                "sched": "host"
            },
            "x": "142.0",
            "y": "395.0"
        },
        {
            "number": "3",
            "opts": {
                "hostname": "h3",
                "ip": "192.168.0.103",
                "nodeNum": 3,
                "sched": "host"
            },
            "x": "536.0",
            "y": "225.0"
        },
        {
            "number": "4",
            "opts": {
                "hostname": "h4",
                "ip": "192.168.0.104",
                "nodeNum": 4,
                "sched": "host"
            },
            "x": "524.0",
            "y": "399.0"
        }
    ],
    "links": [
        {
            "dest": "s1",
            "opts": {},
            "src": "h1"
        },
        {
            "dest": "s1",
            "opts": {},
            "src": "h2"
        },
        {
            "dest": "s2",
            "opts": {},
            "src": "h3"
        },
        {
            "dest": "s2",
            "opts": {},
            "src": "h4"
        },
        {
            "dest": "s2",
            "opts": {},
            "src": "s1"
        }
    ],
    "switches": [
        {
            "number": "1",
            "opts": {
                "controllers": [
                    "c0"
                ],
                "hostname": "s1",
                "nodeNum": 1,
                "switchType": "default"
            },
            "x": "243.0",
            "y": "316.0"
        },
        {
            "number": "2",
            "opts": {
                "controllers": [
                    "c0"
                ],
                "hostname": "s2",
                "nodeNum": 2,
                "switchType": "default"
            },
            "x": "415.0",
            "y": "315.0"
        }
    ],
    "version": "2"
##(二)进阶要求 将抓包结果对照OpenFlow源码,了解OpenFlow主要消息类型对应的数据结构定义。
上一篇:easyui-combobox 下拉框及下拉框支持模糊搜索


下一篇:tomcat部署项目时页面中文乱码