OpenvSwitch Code Flow
Packet flowin openvswitch
VISHAL KAPOOR
Openvswitch 2.7.2 implementation Vishal Kapoor
 Architecture of Open vSwitch
Two Main components –
vswitchdinuserspace for configurationandconnectiontocontroller.
datapathin Kernel space forpacketforwardingbasedonflow
The datapath module inthe kernel receivesthe packetsfirst,fromaphysical NICora VM’svirtual
NIC.Eitherovs-vswitchdhas instructedthe datapathhow tohandle packetsof thistype,or ithas
not. In the formercase,the datapathmodule simplyfollowsthe instructions,calledactions,givenby
ovs-vswitchd,whichlistphysical portsortunnelsonwhichtotransmitthe packet.Actionsmayalso
specifypacketmodifications,packetsampling,orinstructionstodropthe packet.In the othercase,
where the datapathhas notbeentoldwhatto do withthe packet,itdeliversittoovs-vswitchd.In
userspace,ovs-vswitchddetermineshow the packetshouldbe handled, andthen itpassesthe
packetback to the datapath withthe desiredhandling.Usually,ovs-vswitchdalsotellsthe datapath
to cache the actions,forhandlingsimilarfuture packets.
Openvswitch 2.7.2 implementation Vishal Kapoor
ovs_vport_receive
ovs_vport_receive
ovs_dp_process_packet
ovs_vport_receive
ovs_flow_tbl_lookup_stats
ovs_vport_receive
ovs_dp_upcall
!flow
ovs_execute_actions
flow_lookup()
ovs_vport_receive
masked_flow_lookup()
ovs_vport_receive
flow
queue_userspace_packet
do_execute_actions
Various operations based on
action attribute
push_mpls pop_mpls push_vlan pop_vlan
do_output ovs_vport_send
send(skb)
netdev_frame_hook
ovs_vport_receive
netdev_port_receive
ovs_vport_receive

Open vswitch datapath implementation

  • 1.
    OpenvSwitch Code Flow Packetflowin openvswitch VISHAL KAPOOR
  • 2.
    Openvswitch 2.7.2 implementationVishal Kapoor  Architecture of Open vSwitch Two Main components – vswitchdinuserspace for configurationandconnectiontocontroller. datapathin Kernel space forpacketforwardingbasedonflow The datapath module inthe kernel receivesthe packetsfirst,fromaphysical NICora VM’svirtual NIC.Eitherovs-vswitchdhas instructedthe datapathhow tohandle packetsof thistype,or ithas not. In the formercase,the datapathmodule simplyfollowsthe instructions,calledactions,givenby ovs-vswitchd,whichlistphysical portsortunnelsonwhichtotransmitthe packet.Actionsmayalso specifypacketmodifications,packetsampling,orinstructionstodropthe packet.In the othercase, where the datapathhas notbeentoldwhatto do withthe packet,itdeliversittoovs-vswitchd.In userspace,ovs-vswitchddetermineshow the packetshouldbe handled, andthen itpassesthe packetback to the datapath withthe desiredhandling.Usually,ovs-vswitchdalsotellsthe datapath to cache the actions,forhandlingsimilarfuture packets.
  • 3.
    Openvswitch 2.7.2 implementationVishal Kapoor ovs_vport_receive ovs_vport_receive ovs_dp_process_packet ovs_vport_receive ovs_flow_tbl_lookup_stats ovs_vport_receive ovs_dp_upcall !flow ovs_execute_actions flow_lookup() ovs_vport_receive masked_flow_lookup() ovs_vport_receive flow queue_userspace_packet do_execute_actions Various operations based on action attribute push_mpls pop_mpls push_vlan pop_vlan do_output ovs_vport_send send(skb) netdev_frame_hook ovs_vport_receive netdev_port_receive ovs_vport_receive