Each row in this table binds a logical port to a realization. For
most logical ports, this means binding to some physical location,
for example by binding a logical port to a VIF that belongs to a
VM running on a particular hypervisor. Other logical ports, such
as logical patch ports, can be realized without a specific
physical location, but their bindings are still expressed through
rows in this table.
For every Logical_Switch_Port
record in OVN_Northbound
database,
ovn-northd
creates a record in this table. ovn-northd
populates
and maintains every column except the chassis
column, which it
leaves empty in new records.
ovn-controller
/ovn-controller-vtep
populates the chassis
column
for the records that identify the logical ports that are located
on its hypervisor/gateway, which
ovn-controller
/ovn-controller-vtep
in turn finds out by
monitoring the local hypervisor's Open_vSwitch database, which
identifies logical ports via the conventions described in
IntegrationGuide.rst
. (The exceptions are for Port_Binding
records with type
of l3gateway
, whose locations are identified by
ovn-northd
via the options:l3gateway-chassis
column in this
table. ovn-controller
is still responsible to populate the
chassis
column.)
When a chassis shuts down gracefully, it should clean up the
chassis
column that it previously had populated. (This is not
critical because resources hosted on the chassis are equally
unreachable regardless of whether their rows are present.) To
handle the case where a VM is shut down abruptly on one chassis,
then brought up again on a different one,
ovn-controller
/ovn-controller-vtep
must overwrite the chassis
column with new information.
Summary:
Core Features:
datapath Datapath_Binding
logical_port
string (must be unique within
table)
encap
optional weak reference to Encap
chassis
optional weak reference to Chassis
gateway_chassis
set of Gateway_Chassis
s
ha_chassis_group
optional HA_Chassis_Group
tunnel_key
integer, in range 1 to 32,767
mac
set of strings
type
string
Patch Options:
options : peer
optional string
nat_addresses
set of strings
L3 Gateway Options:
options : peer
optional string
options : l3gateway-chassis
optional string
options : nat-addresses
optional string
nat_addresses
set of strings
Localnet Options:
options : network_name
optional string
tag
optional integer, in range 1 to
4,095
L2 Gateway Options:
options : network_name
optional string
options : l2gateway-chassis
optional string
tag
optional integer, in range 1 to
4,095
VTEP Options:
options : vtep-physical-switch
optional string
options : vtep-logical-switch
optional string
VMI (or VIF) Options:
options : requested-chassis
optional string
options : qos_max_rate
optional string
options : qos_burst
optional string
options : qdisc_queue_id
optional string, containing an
integer, in range 1 to 61,440
Chassis Redirect Options:
options : distributed-port
optional string
options : redirect-chassis
optional string
Nested Containers:
parent_port
optional string
tag
optional integer, in range 1 to
4,095
Naming:
external_ids : name
optional string
Common Columns:
external_ids
map of string-string pairs
Details:
Core Features:
datapath
: Datapath_Binding
The logical datapath to which the logical port belongs.
logical_port
: string (must be unique within table)
A logical port, taken from name
in the OVN_Northbound
database's Logical_Switch_Port
table. OVN does not
prescribe a particular format for the logical port ID.
encap
: optional weak reference to Encap
Points to supported encapsulation configurations to
transmit logical dataplane packets to this chassis. Each
entry is a Encap
record that describes the configuration.
chassis
: optional weak reference to Chassis
The meaning of this column depends on the value of the
type
column. This is the meaning for each type
(empty string)
The physical location of the logical port. To
successfully identify a chassis, this column must
be a Chassis
record. This is populated by
ovn-controller
.
vtep The physical location of the hardware_vtep gateway.
To successfully identify a chassis, this column
must be a Chassis
record. This is populated by
ovn-controller-vtep
.
localnet
Always empty. A localnet port is realized on every
chassis that has connectivity to the corresponding
physical network.
localport
Always empty. A localport port is present on every
chassis.
l3gateway
The physical location of the L3 gateway. To
successfully identify a chassis, this column must
be a Chassis
record. This is populated by
ovn-controller
based on the value of the
options:l3gateway-chassis
column in this table.
l2gateway
The physical location of this L2 gateway. To
successfully identify a chassis, this column must
be a Chassis
record. This is populated by
ovn-controller
based on the value of the
options:l2gateway-chassis
column in this table.
gateway_chassis
: set of Gateway_Chassis
s
A list of Gateway_Chassis
.
This should only be populated for ports with type
set to
chassisredirect
. This column defines the list of chassis
used as gateways where traffic will be redirected through.
ha_chassis_group
: optional HA_Chassis_Group
This should only be populated for ports with type
set to
chassisredirect
. This column defines the HA chassis group
with a list of HA chassis used as gateways where traffic
will be redirected through.
tunnel_key
: integer, in range 1 to 32,767
A number that represents the logical port in the key (e.g.
STT key or Geneve TLV) field carried within tunnel
protocol packets.
The tunnel ID must be unique within the scope of a logical
datapath.
mac
: set of strings
The Ethernet address or addresses used as a source address
on the logical port, each in the form xx:xx:xx:xx:xx:xx.
The string unknown
is also allowed to indicate that the
logical port has an unknown set of (additional) source
addresses.
A VM interface would ordinarily have a single Ethernet
address. A gateway port might initially only have unknown
,
and then add MAC addresses to the set as it learns new
source addresses.
type
: string
A type for this logical port. Logical ports can be used to
model other types of connectivity into an OVN logical
switch. The following types are defined:
(empty string)
VM (or VIF) interface.
patch
One of a pair of logical ports that act as if
connected by a patch cable. Useful for connecting
two logical datapaths, e.g. to connect a logical
router to a logical switch or to another logical
router.
l3gateway
One of a pair of logical ports that act as if
connected by a patch cable across multiple chassis.
Useful for connecting a logical switch with a
Gateway router (which is only resident on a
particular chassis).
localnet
A connection to a locally accessible network from
each ovn-controller
instance. A logical switch can
only have a single localnet
port attached. This is
used to model direct connectivity to an existing
network.
localport
A connection to a local VIF. Traffic that arrives
on a localport
is never forwarded over a tunnel to
another chassis. These ports are present on every
chassis and have the same address in all of them.
This is used to model connectivity to local
services that run on every hypervisor.
l2gateway
An L2 connection to a physical network. The chassis
this Port_Binding
is bound to will serve as an L2
gateway to the network named by
options
:network_name
.
vtep
A port to a logical switch on a VTEP gateway
chassis. In order to get this port correctly
recognized by the OVN controller, the
options
:vtep-physical-switch
and
options
:vtep-logical-switch
must also be defined.
chassisredirect
A logical port that represents a particular
instance, bound to a specific chassis, of an
otherwise distributed parent port (e.g. of type
patch
). A chassisredirect
port should never be used
as an inport
. When an ingress pipeline sets the
outport
, it may set the value to a logical port of
type chassisredirect
. This will cause the packet to
be directed to a specific chassis to carry out the
egress pipeline. At the beginning of the egress
pipeline, the outport
will be reset to the value of
the distributed port.
Patch Options:
These options apply to logical ports with type
of patch
.
options : peer
: optional string
The logical_port
in the Port_Binding
record for the other
side of the patch. The named logical_port
must specify
this logical_port
in its own peer
option. That is, the two
patch logical ports must have reversed logical_port
and
peer
values.
nat_addresses
: set of strings
MAC address followed by a list of SNAT and DNAT external
IP addresses, followed by is_chassis_resident("
lport")
,
where lport is the name of a logical port on the same
chassis where the corresponding NAT rules are applied.
This is used to send gratuitous ARPs for SNAT and DNAT
external IP addresses via localnet
, from the chassis where
lport resides. Example: 80:fa:5b:06:72:b7 158.36.44.22
158.36.44.24 is_chassis_resident("foo1")
. This would
result in generation of gratuitous ARPs for IP addresses
158.36.44.22 and 158.36.44.24 with a MAC address of
80:fa:5b:06:72:b7 from the chassis where the logical port
"foo1" resides.
L3 Gateway Options:
These options apply to logical ports with type
of l3gateway
.
options : peer
: optional string
The logical_port
in the Port_Binding
record for the other
side of the 'l3gateway' port. The named logical_port
must
specify this logical_port
in its own peer
option. That is,
the two 'l3gateway' logical ports must have reversed
logical_port
and peer
values.
options : l3gateway-chassis
: optional string
The chassis
in which the port resides.
options : nat-addresses
: optional string
MAC address of the l3gateway
port followed by a list of
SNAT and DNAT external IP addresses. This is used to send
gratuitous ARPs for SNAT and DNAT external IP addresses
via localnet
. Example: 80:fa:5b:06:72:b7 158.36.44.22
158.36.44.24
. This would result in generation of
gratuitous ARPs for IP addresses 158.36.44.22 and
158.36.44.24 with a MAC address of 80:fa:5b:06:72:b7. This
is used in OVS versions prior to 2.8.
nat_addresses
: set of strings
MAC address of the l3gateway
port followed by a list of
SNAT and DNAT external IP addresses. This is used to send
gratuitous ARPs for SNAT and DNAT external IP addresses
via localnet
. Example: 80:fa:5b:06:72:b7 158.36.44.22
158.36.44.24
. This would result in generation of
gratuitous ARPs for IP addresses 158.36.44.22 and
158.36.44.24 with a MAC address of 80:fa:5b:06:72:b7. This
is used in OVS version 2.8 and later versions.
Localnet Options:
These options apply to logical ports with type
of localnet
.
options : network_name
: optional string
Required. ovn-controller
uses the configuration entry
ovn-bridge-mappings
to determine how to connect to this
network. ovn-bridge-mappings
is a list of network names
mapped to a local OVS bridge that provides access to that
network. An example of configuring ovn-bridge-mappings
would be: .IP
$ ovs-vsctl set open . external-ids:ovn-bridge-mappings=physnet1:br-eth0,physnet2:br-eth1
When a logical switch has a localnet
port attached, every
chassis that may have a local vif attached to that logical
switch must have a bridge mapping configured to reach that
localnet
. Traffic that arrives on a localnet
port is never
forwarded over a tunnel to another chassis.
tag
: optional integer, in range 1 to 4,095
If set, indicates that the port represents a connection to
a specific VLAN on a locally accessible network. The VLAN
ID is used to match incoming traffic and is also added to
outgoing traffic.
L2 Gateway Options:
These options apply to logical ports with type
of l2gateway
.
options : network_name
: optional string
Required. ovn-controller
uses the configuration entry
ovn-bridge-mappings
to determine how to connect to this
network. ovn-bridge-mappings
is a list of network names
mapped to a local OVS bridge that provides access to that
network. An example of configuring ovn-bridge-mappings
would be: .IP
$ ovs-vsctl set open . external-ids:ovn-bridge-mappings=physnet1:br-eth0,physnet2:br-eth1
When a logical switch has a l2gateway
port attached, the
chassis that the l2gateway
port is bound to must have a
bridge mapping configured to reach the network identified
by network_name
.
options : l2gateway-chassis
: optional string
Required. The chassis
in which the port resides.
tag
: optional integer, in range 1 to 4,095
If set, indicates that the gateway is connected to a
specific VLAN on the physical network. The VLAN ID is used
to match incoming traffic and is also added to outgoing
traffic.
VTEP Options:
These options apply to logical ports with type
of vtep
.
options : vtep-physical-switch
: optional string
Required. The name of the VTEP gateway.
options : vtep-logical-switch
: optional string
Required. A logical switch name connected by the VTEP
gateway. Must be set when type
is vtep
.
VMI (or VIF) Options:
These options apply to logical ports with type
having (empty
string)
options : requested-chassis
: optional string
If set, identifies a specific chassis (by name or
hostname) that is allowed to bind this port. Using this
option will prevent thrashing between two chassis trying
to bind the same port during a live migration. It can also
prevent similar thrashing due to a mis-configuration, if a
port is accidentally created on more than one chassis.
options : qos_max_rate
: optional string
If set, indicates the maximum rate for data sent from this
interface, in bit/s. The traffic will be shaped according
to this limit.
options : qos_burst
: optional string
If set, indicates the maximum burst size for data sent
from this interface, in bits.
options : qdisc_queue_id
: optional string, containing an integer,
in range 1 to 61,440
Indicates the queue number on the physical device. This is
same as the queue_id
used in OpenFlow in struct
ofp_action_enqueue
.
Chassis Redirect Options:
These options apply to logical ports with type
of
chassisredirect
.
options : distributed-port
: optional string
The name of the distributed port for which this
chassisredirect
port represents a particular instance.
options : redirect-chassis
: optional string
The chassis
that this chassisredirect
port is bound to.
This is taken from options:redirect-chassis
in the
OVN_Northbound database's Logical_Router_Port
table.
Nested Containers:
These columns support containers nested within a VM.
Specifically, they are used when type
is empty and logical_port
identifies the interface of a container spawned inside a VM. They
are empty for containers or VMs that run directly on a
hypervisor.
parent_port
: optional string
This is taken from parent_name
in the OVN_Northbound
database's Logical_Switch_Port
table.
tag
: optional integer, in range 1 to 4,095
Identifies the VLAN tag in the network traffic associated
with that container's network interface.
This column is used for a different purpose when type
is
localnet
(see Localnet Options
, above) or l2gateway
(see
L2 Gateway Options
, above).
Naming:
external_ids : name
: optional string
For a logical switch port, ovn-northd
copies this from
external_ids:neutron:port_name
in the Logical_Switch_Port
table in the OVN_Northbound database, if it is a nonempty
string.
For a logical switch port, ovn-northd
does not currently
set this key.
Common Columns:
external_ids
: map of string-string pairs
See External IDs
at the beginning of this document.
The ovn-northd
program populates this column with all
entries into the external_ids
column of the
Logical_Switch_Port
table of the OVN_Northbound
database.