OpenDaylight-Boron学习笔记: 3 L2Switch模块

环境及软件版本说明

===

SN-Controller:

CPU: 2 Cores

RAM: 4GB

Disk: 32GB

Operating System: CentOS7 x86_64 1611(Linux 3.10.0-514) Infrastructure Server

IP1: 10.0.3.100/24 (Public Network)

IP2: 172.16.3.100/24 (SDN Network)

===

OpenDaylight: Boron

下载地址

参考文献

L2 Switch User Guide

《OpenDaylight应用指南》(唐宏 等编著)

L2 Switch架构

L2 Switch项目包含以下几个部分:

  • Packet Handler (包处理) :对发往控制器的数据包进行解析并将数据包正确地转发
  • Loop Remover (环路消除) :消除网络链路中的环路
  • Arp Handler (ARP处理) :解析并处理ARP数据包
  • Address Tracker (地址跟踪) :学习网络中的MAC或IP
  • Host Tracker (主机跟踪) :跟踪网络中的主机位置
  • L2 Switch Main (二层交换主要部件) :根据网络流量对每一个交换机下发流表

安装L2Switch模块

进入karaf控制台,进行以下的指令安装:

opendaylight-user@root>feature:install odl-l2switch-all

odl-l2switch-all包含以下几个模块:

  • odl-l2switch-switch
  • odl-l2switch-switch-rest
  • odl-l2switch-switch-ui
  • odl-l2switch-hosttracker
  • odl-l2switch-addresstracker
  • odl-l2switch-arphandler
  • odl-l2switch-loopremover
  • odl-l2switch-packethandler

功能体验

使用Mininet创建拓扑

Mininet虚拟机参数:

  • HostName:mininet-vm1
  • CPU: 2核
  • RAM: 4GB
  • IP1:10.0.3.101(Public Network)
  • IP2: 172.16.3.101(SDN Network)

在mininet-vm1中创建包含3个交换机,每台交换机各连1台主机的拓扑,并产生网络流量(Ping):

mininet@mininet-vm1:~$ sudo mn --controller=remote,ip=10.0.3.100 --mac --topo=linear,3 --switch ovsk,protocols=OpenFlow13
mininet> pingall

此时在ODL的控制页面中的Topology标签中可以看到网络拓扑。

地址学习检测

在本地使用Rest调试工具(如Opera的RestMan)往ODL控制器发送以下Rest请求,按提示输入用户名(admin)和密码(admin)后,可以查看第一个交换机第一个端口所学习到的MAC和IP地址。

http://10.0.3.100:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1

可以看到响应部分的内容:

{
    "node-connector": [
        {
            "id": "openflow:1:1",
            "flow-node-inventory:state": {
                "link-down": false,
                "live": false,
                "blocked": false
            },
            "flow-node-inventory:name": "s1-eth1",
            "flow-node-inventory:maximum-speed": 0,
            "flow-node-inventory:configuration": "",
            "flow-node-inventory:supported": "",
            "flow-node-inventory:peer-features": "",
            "flow-node-inventory:port-number": "1",
            "flow-node-inventory:advertised-features": "",
            "flow-node-inventory:current-feature": "ten-gb-fd copper",
            "flow-node-inventory:hardware-address": "12:ea:18:e9:ee:28",
            "flow-node-inventory:current-speed": 10000000,
            "opendaylight-port-statistics:flow-capable-node-connector-statistics": {
                "transmit-drops": 0,
                "receive-frame-error": 0,
                "receive-drops": 0,
                "receive-crc-error": 0,
                "bytes<
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值