Open vSwitch Introduction

HungWei Chiu
HungWei ChiuProduct Developer
Open vSwitch
Introduction
HungWei Chiu
Who Am I
• HungWei Chiu (hwchiu)
• Open Networking Foundation
• Member of Technical Staff
• https://hwchiu.com
• Kubernetes/Container
• Networking/Linux/Kernel
• Co-Organizer of SDNDS-TW/
CNTUG
Agenda
• What/How
• TCP/IP Model
• Linux Bridge
• What/How
• Open vSwitch
• Open vSwitch in Kubernetes
We all learned
Data Link
Switch v.s Router
TCP/IP Model
Network
Transport
Application
Physical
Data Link
Physical
Data Link
Network
Physical
Data Link
Network
Transport
Application
Physical
Client Server
Switch
Router
Router v.s Switch
• Both
• Store and forward packets
• Network layer
• Data Link layer
• Router:
• Routing table
• Routing algorithms
• Switch
• Switch table
• Learning algorithms
Docker
eth0
Linux Bridge
br0
Container
172.17.8.1
172.17.8.56
10.1.2.3
Linux Host
Container
172.17.8.57
Can You Explain
Data Link
Switch v.s Router
TCP/IP Model
Network
Transport
Application
Physical
Data Link
Physical
Data Link
Network
Physical
Data Link
Network
Transport
Application
Physical
Client Server
Switch
Router
eth0
Linux Bridge
br0
Container
172.17.8.1
172.17.8.56
10.1.2.3
Linux Host
Container
172.17.8.57
Container to WAN
Linux Host
Switch v.s Router
TCP/IP Model
Data Link
Network
Transport
Application
Physical
Data Link
Physical
Data Link
Network
Physical
Data Link
Network
Transport
Application
Physical
Client Server
Switch
Router
Container WAN
Linux
Bridge
Linux Bridge
Instances
veth
function call function call
Docker
eth0
Linux Bridge br0
Container
172.17.8.1
172.17.8.56
10.1.2.3
Linux Host
Container
172.17.8.57
net_dev
Kernel object
Packet
Linux Bridge br0
• Received Packets
• ebtables
• iptables
• Forward to net_dev (172.17.9.1)
Packet:
172.17.8.56 -> 172.17.8.1
Docker
eth0
Linux Bridge br0
Container
172.17.8.1
172.17.8.56
10.1.2.3
Linux Host
Container
172.17.8.57
net_dev
Kernel object
Linux Kernel
• Received Packet
• Iptables
• Routing tables
• ARP tables
• Forward to eth0 (10.1.2.3)
Packet:
172.17.8.56 -> 172.17.8.1
Packet
Tables
• Arp Table (Learning MAC/IP)
• Linux Bridge
• Forwarding Table (Forward by MAC)
• Netfilter
• Iptables (Layer 3, NAT…etc)
• Ebtables (Layer 2 filter…etc)
• Linux Kernel
• Routing table (Routing by IP (Destination/Source))
Control
• Arp
• arp
• Forwarding
• brctl show/brctl showman’s
• Routing
• route
• ip route
• netfilter
• iptables/ebtables
• iptables-save/iptables-restore …etc
Multiple Nodes
Host
Agent
• No Standard Protocol
Host
Agent
Host
Agent
Host
Agent
Host
Controller
Agent
• Execute commands
• API Call (netlink)
Open vSwitch
Introduction
https://www.openvswitch.org/
Openflow
• Maintained by Open Networking Foundation (ONF)
• The first standard communication interface defined
between control and forwarding layers of an SDN
architecture.
https://en.wikipedia.org/wiki/OpenFlow
Openflow
controller
Openflow Enabled Switch
Security Channel
Flow Table
Openflow Enabled Switch
Security Channel
Flow Table
Openflow protocol
Architecture
Format
Rule Action Stats
• Forward packet to ports
• Encapsulate and forward to controller
• Modify fields
• Normal Pipeline
• Extension
Packet/Bytes counter
Switch Port Layer 2 Header Layer 3 Header Layer 4 Header
Example
Switch Port dst_mac Layer 3 Layer 4src_mac Action
port 3*** * 00:11:32:….
Switching
Switch Port src_ip Layer 4Layer 2 Action
port 4*** *
Routing
dst_ip
140.113.2.4
Switch Port src_ip Layer 4Layer 2 Action
drop*1.2.0.0/16* *
Firewall
dst_ip
140.113.2.4
Compare
• Linux
• Arp Table (Learning MAC/IP)
• Linux Bridge
• Forwarding Table (Forward by
MAC)
• Netfilter
• Iptables (Layer 3, NAT…etc)
• Ebtables (Layer 2 filter…etc)
• Linux Kernel
• Routing table (Routing by IP
(Destination/Source))
• Openflow
• Rules
• Switch Port
• Layer 2/3/4 Header
• Action
• Forward/Drop
• Normal Pipeline
• Modify fields
• …etc
• Stats
• Counter
Docker example again
Docker
eth0
Open vSwith
Ovsbr0
Container
172.17.8.1
172.17.8.56
Linux Host
Container
172.17.8.57
Flows
Switch Port Layer 2 Layer 3 Layer 4eth_type Action
…*…* Arp
ARP
Switch Port Layer 3 Header Layer 4 HeaderLayer2 Action
• Change src/dst Mac
• Forward to port…..…..* *
Routing
Switch Port Layer 3 Header Layer 4 Action
* *
NAT
*
Layer2
….. …..
• Change src/dst IP
• Forward to port
Open vSwtich
• Need to prepare all flow rules
• Without Linux Kernel (mostly)
• Openflow controller
• Program your logic
• CLI
• Difficult to maintain all logics.
Other functions
• Linux
• Tunneling
• GRE/VXLAN/GRE/
STT/NVGRE
• iptables extension
• nfqueue ..etc
• 802.1q VLAN
• Linux
• Link Aggregation with/
without LACP
• QoS
• Traffic Shaping
• Socket Applications
• VPN, other
networking functions.
Multiple Nodes
Host
OVS
Host
OVS
Host
OVS
Host
OVS
Host
Openflow
Controller
Kubernetes & OVS
Kubernetes & Networking
• Pod communication
• Pod to Pod
• Pod to Wan
• Service
• ClusterIP
• NodePort
• NetworkPolicy
CNI Flannel
• Linux Bridge
• ARP Table
• Routing Table
• Iptables
Iptables
Implemented by
CNI.
Challenge
• CNI
• Pod to Pod
• Same Node
• Different Node
• Overlay ?
• Pod to Wan
• NAT
Challenge
• Kube-proxy (service)
• Monitor service object
• Create/Update/Remove rules
• Translate policy to OpenFlow rules and apply to all switches.
• NetworkPolicy
• Monitor network policy object
• Create/Update/Remove rules
• Translate policy to OpenFlow rules and apply to all switches.
Challenge
• Additional controller
• Open vSwitch controller
• Openflow
• OVSDB
• …etc
• Kubernetes controller
Projects
• K-vswitch
• SONA-CNI
• Ovn-kubernetes
• ..etc
https://github.com/k-vswitch/k-vswitch
k-vswitch
sona-cni
https://wiki.onosproject.org/display/ONOS/SONA-CNI+Installation
Why OVS?
Why
• Networking performance?
• Open vSwitch + DPDK (Kernel Bypass)
• Hardware offloading
• Service chain?
• Rewrite packets header
• Redirect packets within different Pods
• Networking Traffic Monitor?
• Latency
• Counters
K8S Node
Pod Pod Pod
eth0
Openflow Switch Openflow Switch Openflow Switch
Data network
K8S Node
Pod Pod Pod
eth0
K8S Node
Pod Pod Pod
eth0
Openflow Controller
Reference Architecture
Do I Need It?
One
• Learn how system works
• Computing/Storage/Networking
• Linux
• Increase your value
• Don’t rely on Framework or Tools
• Helm/Operator …etc
• Never be the Yaml Engineer
Q&A
1 of 42

More Related Content

What's hot(20)

OpenStack High AvailabilityOpenStack High Availability
OpenStack High Availability
Jakub Pavlik7.3K views
Meetup 23 - 02 - OVN - The future of networking in OpenStackMeetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStack
Vietnam Open Infrastructure User Group1.8K views
OpenStack Neutron TutorialOpenStack Neutron Tutorial
OpenStack Neutron Tutorial
mestery19K views
Open vSwitch 패킷 처리 구조Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조
Seung-Hoon Baek11.9K views
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
Julien Vermillard17.5K views
Packet flow on openstackPacket flow on openstack
Packet flow on openstack
Achhar Kalia241 views
Neutron packet logging frameworkNeutron packet logging framework
Neutron packet logging framework
Vietnam Open Infrastructure User Group351 views
VXLAN Practice GuideVXLAN Practice Guide
VXLAN Practice Guide
Prasenjit Sarkar16.1K views
Deploying IPv6 on OpenStackDeploying IPv6 on OpenStack
Deploying IPv6 on OpenStack
Vietnam Open Infrastructure User Group2.1K views
VXLAN and FRRoutingVXLAN and FRRouting
VXLAN and FRRouting
Faisal Reza1.4K views
OVN - Basics and deep diveOVN - Basics and deep dive
OVN - Basics and deep dive
Trinath Somanchi5K views
How VXLAN works on LinuxHow VXLAN works on Linux
How VXLAN works on Linux
Etsuji Nakai26.7K views
Routed Provider Networks on OpenStack Routed Provider Networks on OpenStack
Routed Provider Networks on OpenStack
Romana Project1.8K views
Ifupdown2: Network Interface ManagerIfupdown2: Network Interface Manager
Ifupdown2: Network Interface Manager
Cumulus Networks2.5K views
OpenStack NetworkingOpenStack Networking
OpenStack Networking
Ilya Shakhat9.2K views
OpenStack Architecture and Use CasesOpenStack Architecture and Use Cases
OpenStack Architecture and Use Cases
Jalal Mostafa7.3K views

Similar to Open vSwitch Introduction

OpenFlow TutorialOpenFlow Tutorial
OpenFlow TutorialJa-seop Kwak
391 views41 slides
Virt july-2013-meetupVirt july-2013-meetup
Virt july-2013-meetupnvirters
3K views34 slides
OpenFlow tutorialOpenFlow tutorial
OpenFlow tutorialopenflow
33.5K views41 slides

Similar to Open vSwitch Introduction(20)

Introduction to OpenNetwork and SDNIntroduction to OpenNetwork and SDN
Introduction to OpenNetwork and SDN
HungWei Chiu549 views
Open stackaustinmeetupsept21Open stackaustinmeetupsept21
Open stackaustinmeetupsept21
Brent Doncaster140 views
OpenFlow TutorialOpenFlow Tutorial
OpenFlow Tutorial
Ja-seop Kwak391 views
Virt july-2013-meetupVirt july-2013-meetup
Virt july-2013-meetup
nvirters3K views
Open v switch20150410bOpen v switch20150410b
Open v switch20150410b
Richard Kuo934 views
OpenFlow tutorialOpenFlow tutorial
OpenFlow tutorial
openflow33.5K views
Introduction to OpenFlowIntroduction to OpenFlow
Introduction to OpenFlow
Joel W. King10K views
CloudStack and SDNCloudStack and SDN
CloudStack and SDN
Sebastien Goasguen1.8K views
Scale Kubernetes to support 50000 servicesScale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 services
LinuxCon ContainerCon CloudOpen China6.6K views
Openflow overviewOpenflow overview
Openflow overview
openflowhub4.2K views
Networking in Docker ContainersNetworking in Docker Containers
Networking in Docker Containers
Attila Kanto2K views
Introduction to Software Defined Networking (SDN)Introduction to Software Defined Networking (SDN)
Introduction to Software Defined Networking (SDN)
Bangladesh Network Operators Group17.2K views
Introductionto SDN Introductionto SDN
Introductionto SDN
Md. Shariful Islam Robin380 views
OpenStack Networking and AutomationOpenStack Networking and Automation
OpenStack Networking and Automation
Adam Johnson2.9K views

More from HungWei Chiu(20)

Learn O11y from Grafana ecosystem.Learn O11y from Grafana ecosystem.
Learn O11y from Grafana ecosystem.
HungWei Chiu1.4K views
Learned from KIND Learned from KIND
Learned from KIND
HungWei Chiu102 views
Debug Your Kubernetes NetworkDebug Your Kubernetes Network
Debug Your Kubernetes Network
HungWei Chiu82 views
Jenkins & IaCJenkins & IaC
Jenkins & IaC
HungWei Chiu551 views
LifeLife
Life
HungWei Chiu928 views
Introduction to CRI and OCIIntroduction to CRI and OCI
Introduction to CRI and OCI
HungWei Chiu616 views
IP Virtual Server(IPVS) 101IP Virtual Server(IPVS) 101
IP Virtual Server(IPVS) 101
HungWei Chiu372 views
Opentracing 101Opentracing 101
Opentracing 101
HungWei Chiu353 views
iptables and Kubernetesiptables and Kubernetes
iptables and Kubernetes
HungWei Chiu345 views
IPTABLES IntroductionIPTABLES Introduction
IPTABLES Introduction
HungWei Chiu668 views
Load Balancing 101Load Balancing 101
Load Balancing 101
HungWei Chiu867 views
Introduction to CircleCIIntroduction to CircleCI
Introduction to CircleCI
HungWei Chiu981 views
Head First to Container&KubernetesHead First to Container&Kubernetes
Head First to Container&Kubernetes
HungWei Chiu376 views
Kubernetes 1001Kubernetes 1001
Kubernetes 1001
HungWei Chiu643 views
Application-Based RoutingApplication-Based Routing
Application-Based Routing
HungWei Chiu1.9K views

Recently uploaded(20)

DevsRankDevsRank
DevsRank
devsrank78610 views
Winter '24 Release Chat.pdfWinter '24 Release Chat.pdf
Winter '24 Release Chat.pdf
melbourneauuser9 views
Best Mics For Your Live StreamingBest Mics For Your Live Streaming
Best Mics For Your Live Streaming
ontheflystream6 views
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdf
Virendra Rai, PMP11 views
WebAssemblyWebAssembly
WebAssembly
Jens Siebert32 views

Open vSwitch Introduction