Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lagopus+pcap pmd

1,895 views

Published on

Lagopus Day #2 YokohamaのLTで発表した資料です。

Published in: Technology
  • Be the first to comment

Lagopus+pcap pmd

  1. 1. Lagopus+PCAP PMD Sep 27, 2014 Masaru OKI @masaru0714 m-oki@stratosphere.co.jp
  2. 2. Lagopus ● 䜸䞊䝥䞁䝋䞊䝇䛾OpenFlow䝇䜲䝑䝏ᐇ⿦ ● Linux䛷ື䛟 (௒ᅇ䛿Ubuntu14.04LTS䜢౑⏝) ● Intel DPDK䜢㊊ᅇ䜚䛻౑䛳䛶䛔䜛 ● ௒ᅇ䛿DPDK䛾≉ᚩ䛷䛒䜛PMD䜢฼⏝䛩䜛 ● ᑐ㇟DPDK䛿1.7.0 ○ ྂ䛔䝞䞊䝆䝵䞁䛷䛿ᣦᐃ᪉ἲ䛺䛹㐪䛳䛶䛔䜛䛾䛷ὀព
  3. 3. PMD ● Poll Mode Driver ○ ㏻ᖖLAN䛾䝗䝷䜲䝞䛿䜹䞊䝛䝹䛜ᣢ䛳䛶䛔䜛 ○ DPDK䛷䛿䛣䜜䜢䜰䝥䝸䜿䞊䝅䝵䞁ഃ䛷ᐇ⾜䛩䜛 ○ 䛭䛾㝿䛻๭䜚㎸䜏㥑ື䛫䛪䚸䝫䞊䝸䞁䜾䛩䜛 ● ㏻ᖖPMD䛿≀⌮NIC䛾䝏䝑䝥ẖ䛻⏝ព䛥䜜䜛 ○ DPDK䛜NIC䛾✀㢮䛻ᛂ䛨䛶౑䛖PMD䜢⮬ື㑅ᢥ ● ≉Ṧ䛺PMD䛜䛔䛟䛴䛛⏝ព䛥䜜䛶䛔䜛 ○ ௒ᅇ䛿䛭䛾䛺䛛䛾୍䛴䛷䛒䜛PCAP PMD䜢౑䛖 ○ ௚䛻䛿bonding PMD, ring PMD䛜䛒䜛
  4. 4. PCAP PMD ● ㏻ᖖ䛾NIC⏝PMD ○ eth0䛺䛹䛾i/f䜢㏻ᖖ䛾䜹䞊䝛䝹⟶⌮䛛䜙እ䛧䛶䚸DPDK ᑓ⏝䛾uio䝗䝷䜲䝞䛻ᕪ䛧᭰䛘䛶౑䛖 ○ 䛱䜗䛳䜁䜔(ᛶ⬟䝏䝳䞊䝙䞁䜾䛥䜜䜎䛟䛳䛶䜛) ● PCAP PMD ○ eth0䛺䛹䜢䜹䞊䝛䝹⟶⌮䛾䜎䜎䚸libpcap䜢౑䛖䛣䛸䛷 PF_PACKET䜔BPF䛺䛹䜢⏝䛔䛶㏻ಙ䛩䜛PMD ○ ㏿ᗘ䛿ᮇᚅ䛷䛝䛺䛔௦䜟䜚䛻ᛂ⏝⠊ᅖ䛜ᗈ䛔
  5. 5. ⤮䛻䛩䜛䛸䛣䛖 䈜䛚䛚䜎䛛䛺䜲䝯䞊䝆䛷䛩 application eth0 packets DPDK application DPDK igb PMD eth0 igb_uio packets DPDK application DPDK pcap PMD eth0 packets userland kernel, driver 通常(DPDK未使用) DPDK+物理NIC DPDK+PCAP PMD
  6. 6. PCAP PMD䛾౑䛔᪉ app -c7 -n2 --vdev eth_pcap0,iface=eth0 ... ● --vdev PMDྡ,䝟䝷䝯䞊䝍[, …] ○ --vdev䛿」ᩘ᭩䛡䜛 (eth_pcap1, …) ● I/F䛾୪䜃䛸䛧䛶䚸≀⌮NIC䛾๓䛻ᤄධ䛥䜜䜛 ○ lagopus䛷ᣦᐃ䛩䜛䛸 PortID0=pcap0, PortID1=≀⌮NIC1ᮏ┠, 䛸䛺䜛䚹(lagopus.conf䛷䛿PortID0䜢eth0䛸⾲⌧䛩䜛) ○ 䝕䝣䜷䝹䝖䛷䛿OpenFlow Port1=PortID0
  7. 7. ືసᐇ㦂ᴫせ ● Host-DUT㛫䛷tunnel䜢3ᮏᙇ䜛(௒ᅇ䛿VXLAN) ○ L2encap䛩䜛tunnel I/F䛺䜙ูprotocol䛷䜒䛷䛝䜛䛿䛪 ● LagopusどⅬ䛷3ᮏ㊊䛻䛧䚸Ryu䝔䝇䝖䜢ᐇ⾜ ○ Host, DUT䛸䜒䛻PCAP PMD䜢౑䛖Lagopus ● ≀⌮⥺䛿1ᮏ䛷ᵓ⠏䛷䛝䜛 DUT target sw Host tester sw VXLAN VNI=0 (portid0) VXLAN VNI=1 (portid1) VXLAN VNI=2 (portid2)
  8. 8. ᐇ㦂๓䛻䚸䝝䝬䜚䛭䛖䛺䛸䛣䜝䛾☜ㄆ ● ᐇ䛿䚸PCAP PMD䛻䛿䝞䜾䛜䛒䜛 ○ ᑡ䛺䛟䛸䜒1.7.0䜎䛷䛾DPDK䛷䛿䚸PCAP PMDཷಙ䝟䜿䝑 䝖䝕䞊䝍䛾୰䛾ཷಙ䝫䞊䝖␒ྕ䛾್䛜䛩䜉䛶0xff䛻䛺䜛 ○ ⌧ᅾ䛾Lagopus䛿䛣䛾᝟ሗ䜢ཧ↷䛧䛶䛔䜛 ○ PCAP PMD䛾䝁䞊䝗䜢ಟṇ䛩䜛ᚲせ䛜䛒䜛(3⾜㏣ຍ) ● VXLAN䜢up䛧䛯䜙IPv6䛾DAD➼䜢䛧䜓䜉䜛䛛䜒 ○ v6䛜ὶ䜜䜛䛸Ryu䛾䝟䜿䝑䝖䛻⣮䜜䛶䝔䝇䝖䛜fail䛩䜛 ○ →Ubuntu䛷䜔䛳䛶䜏䛯䜙䚸䛧䜓䜉䜙䛺䛔ᶍᵝ䚹 ○ 䜘䛛䛳䛯䖪
  9. 9. PCAP PMD䜢౑⏝䛩䜛‽ഛ ● PCAP PMD䛿ᶆ‽䛷䝡䝹䝗䛥䜜䛶䛔䛺䛔 ○ DPDK䛾config䜢⦅㞟䛧䛶䝡䝹䝗䛧䛶䛚䛟 ■ RTE_SDK=$HOME/src/dpdk䛾䛸 䛝䚸$RTE_SDK/config/common_linuxapp䜢⦅㞟 ■ ୗグ䛾⾜䛜=n䛸䛺䛳䛶䛔䜛䛾䛷䚸=y䛻ኚ᭦ ■ CONFIG_RTE_LIBRTE_PMD_PCAP=y ○ ಟṇ䜢ᛀ䜜䛪䛻 ● DPDK䝡䝹䝗ᚋ䚸Lagopus䜢䝡䝹䝗
  10. 10. VXLAN I/F䛾సᡂ䚸タᐃ ● 䛔䜝䛔䜝䝃䝪䛳䛶䛔䜛䛸䛣䜝䛿Ẽ䛻䛧䛺䛔 ● ྂ䛔䛸䝃䝫䞊䝖䛥䜜䛶䛺䛔䛾䛷ὀព ip link add vxlan0 type vxlan id 0 ip link add vxlan1 type vxlan id 1 ip link add vxlan2 type vxlan id 2 ip link set up vxlan0 ip link set up vxlan1 ip link set up vxlan2
  11. 11. Ryu䝔䝇䝖䜰䝥䝸䛾㉳ື ● ᐇ⾜䝩䝇䝖䛿䛹䛱䜙䛷䜒䛔䛔 ○ lagopus.conf䛾controllerᣦᐃ䜢ྜ䜟䛫䜛 ● 䛒䜙䛛䛨䜑ryu䜢git clone䛧䛶䛒䜜䜀 cd src/ryu ryu-manager tester.py ● pip䛷䜲䞁䝇䝖䞊䝹䛧䛯ሙྜ䛿/usr/local/lib/䛾 ୗ䛒䛯䜚䛻tester.py䜔䝔䝇䝖䜿䞊䝇䛜ධ䛳䛶䛔䜛 䛾䛷䚸䛭䛣䛻cd䛧䛶ᐇ⾜䛩䜛䛛䚸䝟䝇䜢୚䛘䜛
  12. 12. Lagopus䛾㉳ື ● 4䝁䜰ᣦᐃ䛷㉳ື䛾ሙྜ sudo lagopus -d -- -cf -n2 --vdev eth_pcap0, iface=vxlan0 --vdev eth_pcap1,iface=vxlan1 --vdev eth_pcap2,iface=vxlan2 -- -p7 ● ධຊ᫬䛿1⾜䛷 ● lagopus.conf䛿␎ ● ཮᪉䝩䝇䝖䛷㉳ື䛧Ryu䛸䛴䛺䛜䜛䛸䝔䝇䝖㛤ጞ ● group,meter㎸䜏䛰䛸䝔䝇䝖᏶஢䜎䛷⣙30ศ
  13. 13. ᐇ⾜⤖ᯝ ᮏ᪥䛾ᐇ㦂……ኻᩋ ● ✺㈏సᴗ䛩䛞䛯(᫖ᬌᛮ䛔䛴䛔䛶ጞ䜑䛯) ● Fedora20-Ubuntu14.04LTS䛷䛴䛺䛤䛖䛸䛧䛯 ● VXLANタᐃ⮬యึ䜑䛶 ● Port␒ྕ䛜ྜ䛳䛶䛔䛺䛔␲ᝨ䚸ㄪᰝ᫬㛫ษ䜜 ● Ubuntuධ䜜䜘䛖䛸䛧䛶Fedora partitionቯ䛩 ● 䛒䜟䛶䜛䛸䜝䛟䛺䛣䛸䛜䛺䛔䚸సᴗ䛿ィ⏬ⓗ䛻

×