:_mod-docs-content-type: CONCEPT
[id="ovn-kubernetes-logical-architecture-con_{context}"]
= OVN-Kubernetes logical architecture

[role="_abstract"]
OVN-Kubernetes is a network virtualization solution that creates logical switches and routers across cluster nodes. These virtual infrastructure components interconnect to construct distinct network topologies.

.OVN-Kubernetes router and switch components
image::299_OpenShift_OVN-Kubernetes_arch_1023_2.png[OVN-Kubernetes logical architecture]

The key components involved in packet processing are:

Gateway routers:: Gateway routers sometimes called L3 gateway routers, are typically used between the distributed routers and the physical network. Gateway routers including their logical patch ports are bound to a physical location (not distributed), or chassis. The patch ports on this router are known as l3gateway ports in the ovn-southbound database (`ovn-sbdb`).

Distributed logical routers:: Distributed logical routers and the logical switches behind them, to which virtual machines and containers attach, effectively reside on each hypervisor.

Join local switch:: Join local switches are used to connect the distributed router and gateway routers. It reduces the number of IP addresses needed on the distributed router.

Logical switches with patch ports:: Logical switches with patch ports virtualize the network stack. These components connect remote logical ports through network encapsulation tunnels.

Logical switches with localnet ports:: Logical switches with localnet ports connect the OVN layout to the physical network. These elements connect remote logical ports by bridging packets to directly attached physical Layer 2 segments.

Patch ports:: Patch ports provide connectivity between logical switches and logical routers, or between peer logical routers. A single connection uses a pair of patch ports at each connectivity intersection, one on each side.

`l3gateway` ports:: Port binding entries in the `ovn-sbdb` for logical patch ports used in gateway routers. They are called `l3gateway` ports rather than patch ports because these ports are bound to a chassis similar to the gateway router itself.

localnet ports:: localnet ports are present on the bridged logical switches that allows a connection to a locally accessible network from each `ovn-controller` instance. This helps model the direct connectivity to the physical network from the logical switches. A logical switch can only have a single localnet port attached to it.

[NOTE]
====
Executing `ovnkube-trace` with the log level configuration set to `2` or `5` exposes these internal OVN-Kubernetes logical routing components for analysis.
====
