Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Open vSwitch ソースコードの全体像
Search
Sho Shimizu
April 29, 2012
Technology
1
230
Open vSwitch ソースコードの全体像
Sho Shimizu
April 29, 2012
Tweet
Share
More Decks by Sho Shimizu
See All by Sho Shimizu
OpenFlowとは何か
oshothebig
2
140
OpenFlowコントローラとその実装
oshothebig
1
130
OpenFlowコントローラを取り巻く状況とその実装
oshothebig
1
95
Floodlightのモジュール機構
oshothebig
1
380
Other Decks in Technology
See All in Technology
Formal Development of Operating Systems in Rust
riru
1
380
スケールし続ける事業とサービスを支える組織とアーキテクチャの生き残り戦略 / The survival strategy for Money Forward’s engineering.
moneyforward
0
240
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
250
OCI技術資料 : ファイル・ストレージ 概要
ocise
3
12k
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
3
180
.NET 9 のパフォーマンス改善
nenonaninu
0
2.2k
Fearsome File Formats
ange
0
550
Bring Your Own Container: When Containers Turn the Key to EDR Bypass/byoc-avtokyo2024
tkmru
0
470
AI×医用画像の現状と可能性_2024年版/AI×medical_imaging_in_japan_2024
tdys13
0
1.2k
rootful・rootless・privilegedコンテナの違い/rootful_rootless_privileged_container_difference
moz_sec_
0
110
ヤプリQA課題の見える化
gu3
0
150
Storage Browser for Amazon S3を触ってみた + α
miura55
0
110
Featured
See All Featured
Scaling GitHub
holman
459
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Speed Design
sergeychernyshev
25
720
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Transcript
Open vSwitch ιʔείʔυͷશମ૾ ਗ਼ਫɹᠳ (@oshothebig)
ιʔείʔυͷೖखํ๏ • ϦϦʔε൛ (v.1.4.0) • http://openvswitch.org/releases/openvswitch-1.4.0.tar.gz • ։ൃ൛ • git
clone git://openvswitch.org/openvswitch • git clone http://openvswitch.org/git/openvswitch
σΟϨΫτϦߏ
ͱΓ͋͑ͣنΛݟΔ • *.c, *.h, *.pyͷϑΝΠϧͷҰཡ commit: 8a5b3cfd91841c97fbc8a003857cacbd602646ed • https://gist.github.com/2111386 •
478ϑΝΠϧ, ߹ܭ164700ߦ
ߦτοϓ10 6494 ./ofproto/ofproto-dpif.c 4551 ./lib/netdev-linux.c 4096 ./ofproto/ofproto.c 3953 ./lib/ofp-util.c 3924
./utilities/ovs-vsctl.c 3749 ./vswitchd/bridge.c 2461 ./lib/meta-flow.c 2350 ./python/compat/argparse.py 2263 ./lib/ovsdb-idl.c 2241 ./datapath/datapath.c
• README • INSTALL.* • ͦͷଞςΩετ • build-aux/ • datapath/
• debian/ • include/ • lib/ • m4/ • ofproto/ • ovsdb/ • python/ • rhel/ • tests/ • third-party/ • utilities/ • vswitchd/ • xenserver/
• ίϯϙʔωϯτͷઆ໌ • ovs-vswitchd • ovsdb-server • ovs-brcompatd • ovs-dpctl
• ovs-appctl • ovsdbmonitor • ovs-controller • ovs-ofctl • ovs-pki • patch for tcpdump • scripts for RPM READMEΛಡΉ
ovs-vswitchd • LinuxΧʔωϧϞδϡʔϧͱҰॹʹͳͬͯϑϩʔʹج ͍ͮͨεΠονϯάΛߦ͏ͨΊͷσʔϞϯ
ovsdb-server • ܰྔσʔλϕʔεαʔό • ovs-vswitchd͕ઃఆใΛऔಘ͢ΔͨΊʹ͍߹Θͤ Λߦ͏ઌͷαʔό
ovs-brcompatd • ovs-vswitchd͕LinuxϒϦοδΛஔ͖͑ΔܗͰಈ࡞͞ ͤΔͨΊͷσʔϞϯ • LinuxΧʔωϧϞδϡʔϧͱҰॹʹͳͬͯಈ࡞͠ɺϒ Ϧοδʹର͢ΔioctlΛΠϯλʔηϓτ͢Δ
ovs-dpctl • ΧʔωϧϞδϡʔϧͷઃఆΛߦ͏ͨΊͷπʔϧ
ovs-vsctl • ovs-vswitchdͷઃఆͷ͍߹Θͤͱߋ৽Λߦ͏Ϣʔ ςΟϦςΟ
ovs-appctl • ಈ࡞தͷOpen vSwitchσʔϞϯʹίϚϯυΛૹΔϢʔ ςΟϦςΟ
ovsdbmonitor • OVSσʔλϕʔεͱOpenFlowςʔϒϧΛ֎෦͔ΒݟΔ ͨΊͷGUIπʔϧ
ovs-controller • ୯७ͳOpenFlowίϯτϩʔϥ
ovs-ofctl • OpenFlowεΠον͓Αͼίϯτϩʔϥʹ͍߹Θͤ Λߦ͏ͨΊͷϢʔςΟϦςΟ
ovs-pki • OpenFlowεΠονͷͨΊͷެ։伴ج൫Λ࡞ɺཧ ͢ΔϢʔςΟϦςΟ
ovs-appctl ovs-controller ovs-dpctl ovs-pki ovs-vsctl utilities/ ovs-ofctl
ovs-vswitchd ovs-brcompatd vswitchd/
ovsdb-server ovsdb/
ovsdbmonitor ovsdb/ovsdbmonitor/
patch for tcpdump third-party/
DESIGN
Design Decision In Open vSwitch
OpenFlowʹؔ͢Δ ઃܭํʁ
PORTING
ଞϓϥοτϑΥʔϜ ͷҠ২ํ๏ͷઆ໌
ΞʔΩςΫνϟͷ આ໌͋Γ
ॏཁ
༻ޠղઆʢฆΒΘ͍͠ʣ datapath/ vport --------- vswitchd/ iface port ofproto/ port bundle
lib/bond.c slave bond lib/lacp.c slave lacp lib/netdev.c netdev --------- database Interface Port
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
ofproto • OpenFlowίϯτϩʔϥͱΓͱΓ • ofproto providerΛ௨ͯ͠εΠονͷ࣮ͱΓͱΓ • ofproto/ʹ֨ೲ͞Ε͍ͯΔ
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
netdev • ωοτϫʔΫσόΠεͱͷΓͱΓΛநԽ • EthernetΠϯλʔϑΣΠε • netdev providerͷബ͍ϨΠϠʔͱͯ͠ಇ͘ • lib/netdev.cʹ͋Δ
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
netdev provider • ωοτϫʔΫσόΠε(e.g. eth0)ʹରͯ͠ͷOSϋʔ υΣΞʹಛ༗ͷΠϯλʔϑΣΠεΛ࣮ • εΠονͷ֤ϙʔτnetdevͱͯ͠ಈ࡞͠ͳ͚Εͳ Βͳ͍ •
lib/netdev-provider.hதͷnetdev_classߏମ͕ॏཁ • ଟ͘ͷؔϙΠϯλ͔Βߏ͞ΕΔ
netdevͷΠϯλʔϑΣΠε • OpenFlowͷػೳΛ࣮͢ΔͨΊʹ࠷ݶඞཁͳؔ • ϙʔτͷMACΞυϨεͷใࠂ • Open vSwitchͷΦϓγϣϯͷػೳΛ࣮͢ΔͨΊʹඞ ཁͳؔ •
ARPςʔϒϧͷݕࠪ(in-band੍ޚͷͨΊ) • ಛఆͷ࣮Λߦ͏ͨΊʹඞཁͱͳΔؔ
netdevͷ࣮ • lib/netdev-linux.c: LinuxͷΧʔωϧݺͼग़͠Λͬͨ LinuxͷωοτϫʔΫσόΠεͷͨΊͷ࣮ɻϑϧػ ೳΛ࣮ͨ͠netdev࣮ͱͯ͠ࢀߟʹͳΔ • lib/netdev-vport.c: datapathϞδϡʔϧ͕࣮͢ΔԾ ϙʔτػೳΛαϙʔτ࣮ͨ͠Ͱɺnetdevͷ࠷ݶͷ
࣮ͱͯ͠ࢀߟʹͳΔ • lib/netdev-dummy.c: ςετͰ༗༻ͳμϛʔ࣮
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
ovs-vswitchd ofproto netdev netdev provider ofproto provider ΞʔΩςΫνϟ ovsdb-server OpenFlow
controllers
ovs-vswitchd ofproto netdev netdev provider ofproto- dpif OpenFlow controllers ovsdb-server
dpif dpif provider datapath Userspace Kernel Implementation of ofproto provider Physical NIC
ΧʔωϧۭؒͱϢʔβۭؒ • ϢʔβۭؒͰͷ࣮ • Ұ൪ख͕͔͔ؒΒͳ͍͕ɺੑೳ͍ • ΧʔωϧۭؒͰͷ࣮ • ੑೳߴ͍͕ɺඞཁͳίʔυྔ͕ଟ͍ •
ೋͭͷબࢶ • ofproto provider • dpif provider
ofproto provider • OpenFlowεΠονΛϞχλʔͨ͠Γ੍ޚͨ͠Γ ͢ΔͨΊͷͷ • TCAMͷΑ͏ͳϫΠϧυΧʔυͷϋʔυΣΞͰͷ ϚονϯάʹରԠͤ͞Δ߹ • ofproto/ofproto-provider.hͷதͷofproto_classߏମͰ
ΠϯλʔϑΣΠε͕ఆٛ͞Ε͍ͯΔ
dpif provider • Open vSwitchͰαϙʔτ͞Ε͍ͯΔϘϯσΟϯάͳͲ ͷػೳΛ׆༻͢Δͷʹඞཁ • ௨ৗɺofproto providerΛ࣮͢ΔΑΓ༰қ •
lib/dpif-provider.hͷதͷdpif_classߏମͰΠϯλʔ ϑΣΠε͕ఆٛ͞Ε͍ͯΔ
dpifͷ࣮ • lib/dpif-linux.c: Linux༻ͷdpifͷ࣮ • ΧʔωϧϞδϡʔϧͱ࿈ܞͯ͠ಈ࡞͢Δ • lib/dpif-netdev.c: Ұൠతͳdpifͷ࣮ •
εΠονϯάಈ࡞Λશͯߦ͍ͬͯΔ • Ϣʔβʔۭؒͷ࣮ͰΘΕ͍ͯΔ
·ͱΊ
ovs-appctl ovs-controller ovs-dpctl ovs-pki ovs-vsctl utilities/ ovs-ofctl
ovs-vswitchd ovs-brcompatd vswitchd/
ovsdb-server ovsdb/
ovsdbmonitor ovsdb/ovsdbmonitor/
ϑΥϫʔσΟϯά datapath/
netdev provider netdev_classߏମ lib/netdev-provider.h
ofproto provider ofproto_classߏମ lib/ofproto-provider.h
dpif provider dpif_classߏମ lib/dpif-provider.h
• Linux 3.3ʹίʔυ͕औΓࠐ·Εͨ • MLͰͷ͓Βͤɿhttp://bit.ly/HEQntI • औΓࠐ·Εͨίʔυɿhttp://bit.ly/HEQzZM • OpenFlow 1.1,
1.2ͷରԠ • include/openflow/openflow-1.[012].h • ํɿhttp://bit.ly/HmVdCQ ࠷ۙͷ
ऴΘΓ