OFTest(三):如何排除干擾報(bào)文

前言

  • 關(guān)于OFTest的介紹,請(qǐng)戳這里
  • 總的來(lái)說(shuō),就是用python寫的測(cè)試Openflow協(xié)議一致性的測(cè)試套件
  • 可以將OFTest擴(kuò)展為測(cè)試Openflow的測(cè)試平臺(tái),例如做壓力測(cè)試

常見(jiàn)干擾報(bào)文:IPv6報(bào)文

  • 例如在測(cè)試過(guò)程中發(fā)現(xiàn)
======================================================================
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,發(fā)現(xiàn)eth4有ipv6設(shè)置,port flapping的時(shí)候會(huì)自行發(fā)出報(bào)文干擾抓包
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)
  • 需要關(guān)掉eth4的ipv6,下面是ubuntu的解決方法,在/etc/sysctl.conf 加入下面內(nèi)容
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,發(fā)現(xiàn)已經(jīng)沒(méi)有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$ 

常見(jiàn)干擾報(bào)文:DHCP報(bào)文

  • tcpdump發(fā)現(xiàn)
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                           ......
  • 該報(bào)文會(huì)干擾OFTest的測(cè)試,參數(shù)Unexpected packet的錯(cuò)誤
  • 如果暫不需要DHCP,就把dhcp-client卸載掉
centec@centec-28:/etc/default$ sudo apt-get remove isc-dhcp-client isc-dhcp-common

本文首發(fā)于SDNLAB http://www.sdnlab.com/16874.html

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容