OFTest(三):如何排除干扰报文

作者: ljyfree | 来源:发表于2016-05-03 08:21 被阅读74次

前言

  • 关于OFTest的介绍,请戳这里
  • 总的来说,就是用python写的测试Openflow协议一致性的测试套件
  • 可以将OFTest扩展为测试Openflow的测试平台,例如做压力测试

常见干扰报文:IPv6报文

  • 例如在测试过程中发现
======================================================================
FAIL: stress_abnormal.StressAbnormal_2_3
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/centec/workshop/oftest-new/tests-1.3/stress_abnormal.py", line 531, in runTest
    verify_packets(self, str(exp_pkt), [out_port2])
  File "/home/centec/workshop/oftest-new/src/python/oftest/testutils.py", line 1820, in verify_packets
    verify_no_other_packets(test)
  File "/home/centec/workshop/oftest-new/src/python/oftest/testutils.py", line 1800, in verify_no_other_packets
    test.assertTrue(rcv_pkt == None, "Unexpected packet on port %r" % rcv_port)
  File "/home/centec/workshop/oftest-new/src/python/oftest/base_tests.py", line 97, in assertTrue
    unittest.TestCase.assertTrue(self, cond, msg)
AssertionError: Unexpected packet on port 4
  • 检查ethx,发现eth4有ipv6设置,port flapping的时候会自行发出报文干扰抓包
centec@centec-28:~/workshop/oftest-new$ sudo ifconfig eth4
eth4      Link encap:Ethernet  HWaddr 00:10:18:4a:c6:ac  
          inet6 addr: fe80::210:18ff:fe4a:c6ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4825 errors:0 dropped:0 overruns:0 frame:0
          TX packets:178235 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1109308 (1.1 MB)  TX bytes:33826306 (33.8 MB)
  • 需要关掉eth4的ipv6,下面是ubuntu的解决方法,在/etc/sysctl.conf 加入下面内容
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
  • syctl并查看eth4,发现已经没有ipv6的配置了
centec@centec-28:~/workshop/oftest-new$ sudo sysctl -p           
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth4.disable_ipv6 = 1
centec@centec-28:~/workshop/oftest-new$ 
centec@centec-28:~/workshop/oftest-new$ 
centec@centec-28:~/workshop/oftest-new$ ifconfig eth4
eth4      Link encap:Ethernet  HWaddr 00:10:18:4a:c6:ac  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4825 errors:0 dropped:0 overruns:0 frame:0
          TX packets:178394 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1109308 (1.1 MB)  TX bytes:33856048 (33.8 MB)

centec@centec-28:~/workshop/oftest-new$ 

常见干扰报文:DHCP报文

  • tcpdump发现
centec@centec-28:~/workshop/oftest-new$ sudo tcpdump -i eth3 -eXXXX
tcpdump: WARNING: eth3: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth3, link-type EN10MB (Ethernet), capture size 65535 bytes
01:37:25.602294 00:10:18:4a:c6:ae (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 342: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:10:18:4a:c6:ae (oui Unknown), length 300
        0x0000:  ffff ffff ffff 0010 184a c6ae 0800 4510  .........J....E.
        0x0010:  0148 0000 0000 8011 3996 0000 0000 ffff  .H......9.......
        0x0020:  ffff 0044 0043 0134 2af1 0101 0600 a326  ...D.C.4*......&
        0x0030:  bd78 0023 0000 0000 0000 0000 0000 0000  .x.#............
        0x0040:  0000 0000 0000 0010 184a c6ae 0000 0000  .........J......
        0x0050:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0060:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0070:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0080:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0090:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0110:  0000 0000 0000 6382 5363 3501 010c 0963  ......c.Sc5....c
        0x0120:  656e 7465 632d 3238 3712 011c 0203 0f06  entec-287.......
        0x0130:  770c 2c2f 1a79 2a79 f921 fc2a ff00 0000  w.,/.y*y.!.*....
        0x0140:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0150:  0000 0000 0000                           ......
  • 该报文会干扰OFTest的测试,参数Unexpected packet的错误
  • 如果暂不需要DHCP,就把dhcp-client卸载掉
centec@centec-28:/etc/default$ sudo apt-get remove isc-dhcp-client isc-dhcp-common

本文首发于SDNLAB http://www.sdnlab.com/16874.html

相关文章

  • OFTest(三):如何排除干扰报文

    前言 关于OFTest的介绍,请戳这里 总的来说,就是用python写的测试Openflow协议一致性的测试套件 ...

  • 如何排除干扰?

    时间就是生命!浪费时间就是不要命! 昨天的文章中写到,每天拥有48小时的奥秘就是——排除干扰,用好黄金时间。那究竟...

  • 4组-包晓光-如何阅读读后感

    如何阅读,教会我们定下心来阅读,如何加速阅读。 阅读,要排除干扰,第三章介绍各种因素和如何排除因素。...

  • 感觉懂了就真懂了吗?不是

    排除信息干扰 排除干扰信息

  • 菜鸟手绘练习26

    排除干扰,提高效率。 排除干扰,提高效率。 排除干扰,提高效率。 排除干扰,提高效率。 排除干扰,提高效率。 排除...

  • 排除干扰

    听了万维刚老师讲的《为什么佛学是真的》这本书觉得非常的有意思,特别是在对“色即是空”的解释。我们对万物赋...

  • 排除干扰

    出活的重点其实是排除干扰,而不是加班。 我要习惯于:“不好意思,我现在有事儿。” 只有拒绝,才能提高效率。

  • 排除睡眠干扰

    睡眠就像滑滑梯,通过增加睡眠的驱动力和减小睡眠的阻力来提高睡眠质量。 酒,咖啡,安眠药和午觉都是睡眠的阻力。 喝酒...

  • 排除 干扰 调整

    干 干=(长柄树杈)(十,“又”的变形,表示抓握), 表示手握树杈利器。 造字本义:远古时代用尖利的树杈为武器进行...

  • 如何排除写作的干扰因素?

    10月第9篇,1034字,共9093字 进入10月份以来,写作就开始有点断断续续,除了国庆忙着玩,回来忙着工作,干...

网友评论

    本文标题:OFTest(三):如何排除干扰报文

    本文链接:https://www.haomeiwen.com/subject/dmilrttx.html