ODL Summit
Seattle - Sep 2016
NetVirt - Advanced Tutorials
Alon Kochba (alonko@hpe.com)
Josh Hershberg (jhershbe@redhat.com)
Sridhar Gaddam (sgaddam@redhat.com)
Aswin Suryanarayanan (asuryana@redhat.com)
Victor Pickard (vpickard@redhat.com)
Introduction
We’ll get back to this later..
OpenStack Networks
(and Provider Network Types)
VxLAN Networks
Provider Network Type: VxLAN
When a user creates a new network, the default network type used is VxLAN.
ITM (Internal Tunnel Manager)
Configuration Modes
ITM - Automatic Tunnel Creation
Boot a VM, automatic tunnel creation
OpenFlow rules
Flat and VLAN
Provider Networks
Flat/VLAN Provider Network Overview
Flat/VLAN Provider Networks
Provider Network Type: Flat/VLAN
OVS encapsulates any traffic between compute/control nodes in a VLAN (for VLAN network type), or sends without tagging (for Flat network type).
The packets exit via the “Physical Network”.
Let’s create a VLAN network.
Note two new mandatory parameters:
When creating a new network from the Admin tab, the provider network type can be chosen.
Flat and VLAN provider networks
... table=0,in_port=1,dl_vlan=1010 actions=pop_vlan, write_metadata:0x20000000001/0xffffff0000000001, goto_table:17
... table=220,reg6=0x200 actions=push_vlan:0x8100, set_field:5106->vlan_vid, output:1
Provider Mappings - Advanced Use Cases
other_config:provider_mappings=physnet1:eth1
This causes eth1 port to be added to the br-int bridge.
(screenshot 1)
NetVirt supports providing a bridge name instead of eth1, by connecting the bridge via a patch port to br-int.
other_config:provider_mappings="physnet1:br-dpdk0"
Routing
Routing
Two networks are defined.
Two VMs are booted, each with an interface on a separate network.
A router is defined, with an interface in each of these networks.
Routing between networks
External Networks
External Networks
External networks typically provide internet access to instances, via an OpenStack router.
By default, this network only allows internet access from instances using SNAT (N:1 NAT).
Internet access to individual instances can be enabled using floating IPs (1:1 NAT).
NetVirt supports multiple routers sharing the same external network.
External Networks - Routers
Floating IPs (1:1 NAT)
Connectivity originating from and to instances.
10.64.99.4 <-> 10.0.123.4
SNAT (N:1 NAT, NAPT)
Connectivity originating only from instances.
Support is expected in OVS 2.6 - not certain about OVS-DPDK.
Outbound Packet:
table=21, priority=10,ip,metadata=0x222e6/0xfffffffe actions=goto_table:26
table=26, priority=5,ip,metadata=0x222e6/0xfffffffe actions=goto_table:46
table=46, idle_timeout=300, send_flow_rem priority=10,tcp,metadata=0x222e6/0xfffffffe,nw_src=10.0.123.4,tp_src=36567 actions=set_field:10.64.99.2->ip_src,set_field:49152->tcp_src,write_metadata:0x222e0/0xfffffffe,goto_table:47
table=46, priority=5,ip,metadata=0x222e6/0xfffffffe actions=CONTROLLER:65535,write_metadata:0x222e6/0xfffffffe
Inbound Packet:
table=21, priority=42,ip,metadata=0x222e0/0xfffffffe,nw_dst=10.64.99.2 actions=goto_table:44
table=44, send_flow_rem priority=10,tcp,nw_dst=10.64.99.2,tp_dst=49152 actions=set_field:10.0.123.4->ip_dst,set_field:36567->tcp_dst,write_metadata:0x222e6/0xfffffffe,goto_table:47
table=47, priority=6,ip,metadata=0x222e0/0xfffffffe,nw_src=10.64.99.2 actions=group:200004,write_metadata:0x222e0/0xfffffffe
External Networks:
Under the Hood
The external network interface is represented as additional interface on the ELAN attached to the physical network
ELAN Instance
eth1
br-int
ELAN Interface
IETF Interface
provider_mappings=“physnet1:eth1”
Open_vSwitchTable
other-config
ELAN (L2) model for networks - Flat
The external interface can be attached to provider bridge
In this case the attached ELAN interface will be the integration bridge patch port
ELAN Instance
dpdk0
br-dpdk
ELAN Interface
IETF Interface
provider_mappings=“external-vm-physnet:br-dpdk0”
Open_vSwitchTable
other-config
br-int
br-dpdk0-patch
ELAN (L2) model for networks - VLAN
External interface implementation details
VPN instance is created for each provider network. The external interface is represented as an additional VPN interface for this instance.
VPN Instance
eth1
VPN Interface
L3VPN model for external provider networks
Security Groups
Security Groups
Stateful Security Groups
Stateful - using OVS 2.5+ using conntrack features.
Potential issues to expect when using Stateful SG
Stateful Security Groups
Implementation using OVS conntrack
table=40, priority=61010,ct_state=-trk,ip,dl_src=fa:16:3e:41:94:59,nw_src=10.100.5.3 actions=ct(table=41,zone=5000)
table=40, priority=0 actions=drop
table=41, priority=62020,ct_state=-new+est-rel-inv+trk actions=resubmit(,17)
table=41, priority=62020,ct_state=-new-est+rel-inv+trk actions=resubmit(,17)
table=41, priority=61010,ct_state=+new+trk,ip,metadata=0x20000000000/0x1fffff0000000000 actions=ct(commit,zone=5000),resubmit(,17)
table=41, priority=36007,ct_state=+new+trk actions=drop
table=41, priority=36007,ct_state=+inv+trk actions=drop
table=251, priority=61010,ct_state=-trk,ip,dl_dst=fa:16:3e:41:94:59,nw_dst=10.100.5.3 actions=ct(table=252,zone=5000)
table=251, priority=62020,ct_state=+trk,ip,dl_dst=fa:16:3e:41:94:59,nw_dst=10.100.5.3 actions=goto_table:252
table=251, priority=0 actions=drop
table=252, priority=62020,ct_state=-new+est-rel-inv+trk actions=resubmit(,220)
table=252, priority=62020,ct_state=-new-est+rel-inv+trk actions=resubmit(,220)
table=252, priority=61010,ct_state=+new+trk,ip,metadata=0x20000000000/0x1fffff0000000000,nw_src=10.100.5.4 actions=ct(commit,zone=5000),resubmit(,220)
table=252, priority=36007,ct_state=+new+trk actions=drop
table=252, priority=36007,ct_state=+inv+trk actions=drop
Learn Security Groups
Learn based - for OVS without conntrack support.
Uses an OVS action called “learn”, which is a Nicira extension to the OpenFlow spec.
This action allows configuring rules in the reverse flow automatically.
For example a packet pinging the IP destination 8.8.8.8, can automatically trigger a rule to allow traffic originating from the source IP 8.8.8.8
Learn Security Groups
Implementation using OVS learn action
table=40, priority=61010 actions=resubmit(,41),resubmit(,42)
table=42, priority=61010,reg6=0x1 actions=resubmit(,17)
table=42, priority=61010,tcp,metadata=0x30000000000/0x1fffff0000000000,tp_dst=80 actions=learn(table=252,idle_timeout=18000,fin_idle_timeout=60,fin_hard_timeout=60,priority=61010,cookie=0x6900000,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[]=NXM_OF_IP_DST[],NXM_OF_IP_DST[]=NXM_OF_IP_SRC[],NXM_OF_TCP_SRC[]=NXM_OF_TCP_DST[],NXM_OF_TCP_DST[]=NXM_OF_TCP_SRC[],load:0x1->NXM_NX_REG6[0..7]),resubmit(,17)
table=42, priority=0 actions=drop
table=251, priority=61010 actions=resubmit(,252),resubmit(,253)
table=252, idle_timeout=3600, hard_timeout=3600, priority=61010,tcp,nw_src=8.8.8.8,nw_dst=10.0.123.3,tp_src=80,tp_dst=44291 actions=fin_timeout(idle_timeout=60),load:0x1->NXM_NX_REG6[0..7]
table=253, priority=61010,reg6=0x1 actions=resubmit(,220)
table=253, priority=0 actions=drop
IPv6
IPv6 Tenant Networks
ipv6-ra-mode: This attribute is used to specify if networking service should transmit the Router Advertisements.
ipv6-address-mode: This attribute is used to control how addressing is handled.
IPv6 Service
IPv6 Current Status
Ping6: VM1 to VM2
Ping6 from VM1 to VM2 GUA
Ping6 from VM2 to VM1 LLA
IPv6 Roadmap
IPv6 High level architecture, gap analysis, current status and roadmap activities are captured at the following document.
https://docs.google.com/document/d/1siQUwfMi-Q9r4XcTLDkBIP01iL3PwQvFJ9UW-cC_jLg/edit
L2 Gateway
L2 Gw Basics
Architecture
DC Infrastructure
OF + OVSDB
OVSDB
Neutron
OVS
Virtual Network* (VxLAN)
OVS
Virtual Network* (VxLAN)
ODL
Compute Blade
Compute Blade
OpenStack
VMs on compute connected to remote appliances and remote VMs part of same Virtual Network (VxLAN)
VN* (VxLAN)
HWVTEP
Servers/Appliances
VxLAN tunnel provisioning
MAC@ table population
Slide title
44 pt
Text and bullet level 1
minimum 24 pt
Bullets level 2-5
minimum 20 pt
Characters for Embedded font:�!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«¬®¯°±²³´¶·¸¹º»¼½ÀÁÂÃÄÅÆÇÈËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂăąĆćĊċČĎďĐđĒĖėĘęĚěĞğĠġĢģĪīĮįİıĶķĹĺĻļĽľŁłŃńŅņŇňŌŐőŒœŔŕŖŗŘřŚśŞşŠšŢţŤťŪūŮůŰűŲųŴŵŶŷŸŹźŻżŽžƒȘșˆˇ˘˙˚˛˜˝ẀẁẃẄẅỲỳ–—‘’‚“”„†‡•…‰‹›⁄€™ĀĀĂĂĄĄĆĆĊĊČČĎĎĐĐĒĒĖĖĘĘĚĚĞĞĠĠĢĢĪĪĮĮİĶĶĹĹĻĻĽĽŃŃŅŅŇŇŌŌŐŐŔŔŖŖŘŘŚŚŞŞŢŢŤŤŪŪŮŮŰŰŲŲŴŴŶŶŹŹŻŻȘș−≤≥fifl
ΆΈΉΊΌΎΏΐΑΒΓΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΪΫΆΈΉΊΰαβγδεζηθικλνξορςΣΤΥΦΧΨΩΪΫΌΎΏ
ЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯЁЂЃЄЅІЇЈЉЊЋЌЎЏѢѢѲѲѴѴҐҐәǽẀẁẂẃẄẅỲỳ№
Do not add objects or text in the footer area
L2 Gateway
--tenant-id = tenant id
--device name = this is the name of the Physical Switch on the device
--device interface_names = this is the name of the physical port on the device where Bare Metal servers are connected.
Neutron L2GW API allows bridging two or more networks together to make them look at a single broadcast domain. A typical use case is bridging the virtual with the physical networks
Example:
neutron l2-gateway-create gw1 --tenant_id 21cce60dfe7d4e04a8f9b0f32d90959c --device name=hwvtep,interface_names=hwvtep-eth1,interface_names=hwvtep-eth2�
neutron l2-gateway-create [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--noindent] [--prefix PREFIX]
[--request-format {json}]
[--tenant-id TENANT_ID]
[--device name=name,interface_names=INTERFACE-DETAILS]
<GATEWAY-NAME>
L2 GW Connection
--default-segmentation-id = default segmentation-id that will be applied to interfaces for which seg id was not specified in l2-gateway-create command
--GATEWAY-NAME = this is the name of the logical gateway
--NETWORK-NAME = network name or uuid
Neutron L2GW Connection API associates the L2 GW with a network.
Example:
neutron l2-gateway-connection-create gw1 vx-net --default-segmentation-id 0�
neutron l2-gateway-connection-create [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN]
[--max-width <integer>]
[--noindent] [--prefix PREFIX]
[--request-format {json}]
[--default-segmentation-id SEG_ID]
<GATEWAY-NAME/UUID>
<NETWORK-NAME/UUID>
Want to learn more about L2 GW?
L2 GW Wiki
Topology: After Adding VMs and L2GW wiki setup
odl32-compute
odl31-control
br-int
vmvx1
10.100.5.3
192.168.56.10
dhcp
10.100.5.2
vxlan-192.168.254.32
tap883f9022-bd
tapd0d15959-1f
eth1
br-int
eth2
vmvx2
10.100.5.4
192.168.56.11
vxlan-192.168.254.31
tap5d62515a-be
eth1
OpenDaylight
router-node
eth1
eth0
192.168.56.1
External: VB Internal: 192.168.56.0/24
eth3
Data: VB Internal: 192.168.254.0/24
eth3
Management: VB Host-only: 192.168.50.0/24
eth2
192.168.254.31
192.168.254.32
192.168.50.31
192.168.50.32
HW VTEP
BM1
10.100.5.20
BM2
10.100.5.21
192.168.254.20
HWVTEP Emulator - Wiki on next slide
Debugging
Debugging - OVS
sudo ovs-appctl ofproto/trace br-int in_port=13,ip,dl_dst=ff:ff:ff:ff:ff:ff,nw_src=0.0.0.0 | grep “Rule\|actions”
Debugging - ofproto/trace
Debugging - ODL
OpenDaylight - NetVirt Pipeline
VM Dest IP
(21) L3 - FIB
Floating Dest IP
IP - Default Route
Non IP
Group
Local VM
Group
Remote VM
Associated SFIP
(28)
SNAT (FIP)
Associated DIP
(27)
DNAT (FIP)
(220)
Egress Dispatcher
(36) Internal Tunnel
(19) DMAC Service Filter
ARP
(80)
Non IP
Non-ARP
Ing. ACL Service (1)
(17) Dispatcher
L2 Service (4)
L3 Service 3)
(44) NAPT Inbound
(46) NAPT Outbound
(47)
NAPT FIB
Unknown NAPT
Known NAPT
Other DMAC
L3 DMAC
VM port
(0) Classifier
Provider Network
Internal Tunnel
BGPoMPLS GW
(18*) BGPoMPLS DHCP
(38*) BGPoMPLS (Ext Tunnel)
Output to Controller
Resubmit to Dispatcher (17)
Known SMAC
(50) L2 SMAC Learning
Unknown SMAC
Known DMAC
(51) L2 DMAC Filter
Unknown DMAC
Tunnel In Port
(52) L2 Unknown DMACs
VM In Port
Group
Full BC
Group
Local BC
L.Register + Egress
(55)
Filter Equal
? Match - Drop
(42*)
Ingress ACL 3
(41)
Ingress ACL 2
Match Allowed
(40)
Ingress ACL
Match Allowed
Match Allowed
(251)
Egress ACL
Match Allowed
(252)
Egress ACL 2
(253*)
Egress ACL 3
(25)
PDNAT (FIP)
Associated DFIP
Associated SIP
(26)
PSNAT (FIP)
Unknown SIP
DHCP
Non-DHCP
Output to OpenFlow port
Group
Provider Network
IPv6 Service (2)
OpenDaylight - NetVirt Pipeline
IPv6 ND for Router Interface
(45) IPv6
Other packets
(20) LFIB
Questions?
View this presentation: https://goo.gl/sWkjKQ
NetVirt Project Wiki: https://wiki.opendaylight.org/view/NetVirt
Mailing List: https://lists.opendaylight.org/mailman/listinfo/netvirt-dev