The document provides an introduction to Open vSwitch (OVS) by Hungwei Chiu, explaining its function in networking and its integration with Kubernetes. It details the differences between routers and switches, outlines the TCP/IP model, and discusses the OpenFlow protocol as a communication interface between control and forwarding layers in a software-defined networking architecture. The document also addresses challenges in Kubernetes networking with OVS, including pod communication and policy management.
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
Data Link
Switch v.sRouter
TCP/IP Model
Network
Transport
Application
Physical
Data Link
Physical
Data Link
Network
Physical
Data Link
Network
Transport
Application
Physical
Client Server
Switch
Router
6.
Router v.s Switch
•Both
• Store and forward packets
• Network layer
• Data Link layer
• Router:
• Routing table
• Routing algorithms
• Switch
• Switch table
• Learning algorithms
Data Link
Switch v.sRouter
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
10.
Linux Host
Switch v.sRouter
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
Openflow
• Maintained byOpen Networking Foundation (ONF)
• The first standard communication interface defined
between control and forwarding layers of an SDN
architecture.
https://en.wikipedia.org/wiki/OpenFlow
Flows
Switch Port Layer2 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
26.
Open vSwtich
• Needto prepare all flow rules
• Without Linux Kernel (mostly)
• Openflow controller
• Program your logic
• CLI
• Difficult to maintain all logics.
27.
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.
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.
31.
Challenge
• CNI
• Podto Pod
• Same Node
• Different Node
• Overlay ?
• Pod to Wan
• NAT
32.
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.
K8S Node
Pod PodPod
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
One
• Learn howsystem works
• Computing/Storage/Networking
• Linux
• Increase your value
• Don’t rely on Framework or Tools
• Helm/Operator …etc
• Never be the Yaml Engineer