本无天意 2023-03-13 21:55 采纳率: 0%
浏览 64

mininet搭建网络拓扑后,新添加的主机不能被ping通的问题

mininet搭建网络拓扑后,新添加的主机不能被ping通的问题。

首先、建立了一个线性拓扑,如下:

root@sdnhubvm:/home/ubuntu# mn --topo=linear,2 
*** No default OpenFlow controller found for default switch!
*** Falling back to OVS Bridge
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 
*** Adding switches:
s1 s2 
*** Adding links:
(h1, s1) (h2, s2) (s2, s1) 
*** Configuring hosts
h1 h2 
*** Starting controller

*** Starting 2 switches
s1 s2 ...
*** Starting CLI:

然后、添加一台主机h3,并建立连接和配置IP

mininet> py net.addHost('h3')
<Host h3:  pid=3034> 
mininet> py net.addLink(s1,net.get('h3'))
<mininet.link.Link object at 0x7f7b8acec150>
mininet> py s1.attach('s1-eth3')
mininet> py net.get('h3').cmd('ifconfig h3-eth0 10.3')

如果不指定控制器,使用mininet自带控制器,那么新添加的主机就能够被ping通。如果指定控制器(我这里是在同一个虚拟机内安装的mininet和ODL控制器),创建网络时加上--controller=remote,ip=127.0.0.1,port=6633(控制器运行正常),那么新建主机就不能被ping通。通过抓包发现,用h1 ping h3时,连接h3的s1交换机的s1-eth3口没有抓到ARP请求,其他端口正常。流表如下:

*** s1 ------------------------------------------------------------------------
NXST_FLOW reply (xid=0x4):
 cookie=0x2b00000000000000, duration=89.255s, table=0, n_packets=18, n_bytes=1530, idle_age=4, priority=100,dl_type=0x88cc actions=CONTROLLER:65535
 cookie=0x2b00000000000000, duration=83.811s, table=0, n_packets=10, n_bytes=448, idle_age=28, priority=2,in_port=1 actions=output:2,CONTROLLER:65535
 cookie=0x2b00000000000001, duration=83.802s, table=0, n_packets=2, n_bytes=140, idle_age=80, priority=2,in_port=2 actions=output:1
 cookie=0x2b00000000000001, duration=89.255s, table=0, n_packets=9, n_bytes=710, idle_age=48, priority=0 actions=drop
*** s2 ------------------------------------------------------------------------
NXST_FLOW reply (xid=0x4):
 cookie=0x2b00000000000003, duration=89.230s, table=0, n_packets=18, n_bytes=1530, idle_age=4, priority=100,dl_type=0x88cc actions=CONTROLLER:65535
 cookie=0x2b00000000000002, duration=83.804s, table=0, n_packets=11, n_bytes=518, idle_age=28, priority=2,in_port=2 actions=output:1
 cookie=0x2b00000000000003, duration=83.800s, table=0, n_packets=1, n_bytes=70, idle_age=80, priority=2,in_port=1 actions=output:2,CONTROLLER:65535
 cookie=0x2b00000000000000, duration=89.313s, table=0, n_packets=8, n_bytes=640, idle_age=84, priority=0 actions=drop

不知道是什么原因,为什么用mininet内部控制器就没事,连接指定控制器就不行。请教各位。

  • 写回答

2条回答 默认 最新

  • threenewbee 2023-03-14 00:55
    关注

    检查下网络相关的设置是否正确。

    评论

报告相同问题?

问题事件

  • 修改了问题 3月16日
  • 创建了问题 3月13日

悬赏问题

  • ¥20 微信小程序 canvas 问题
  • ¥15 系统 24h2 专业工作站版,浏览文件夹的图库,视频,图片之类的怎样删除?
  • ¥15 怎么把512还原为520格式
  • ¥15 MATLAB的动态模态分解出现错误,以CFX非定常模拟结果为快照
  • ¥15 求高通平台Softsim调试经验
  • ¥15 canal如何实现将mysql多张表(月表)采集入库到目标表中(一张表)?
  • ¥15 wpf ScrollViewer实现冻结左侧宽度w范围内的视图
  • ¥15 栅极驱动低侧烧毁MOSFET
  • ¥30 写segy数据时出错3
  • ¥100 linux下qt运行QCefView demo报错