Container Networking
Container networking connects isolated containers to each other and to external networks. It covers bridge networks, overlay networks, port mapping, DNS-based service discovery, and the network namespaces that give each container its own network stack.
itVirtualization, containers, and orchestration | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Container Networking
Container networking is the machinery that lets an isolated process exchange packets without accidentally acquiring the entire host as a close personal friend. A container sees an interface, an address, routes, ports, and DNS. These are ordinary network objects. The runtime or orchestrator arranges them from outside the container, which is where the interesting consequences wait.
The first useful idea is the network namespace, a separate network view with its own interfaces, routes, firewall rules, and port space. Think of it as a small, determinedly private office with a network cable. The cable is often a veth pair, two virtual Ethernet ends joined together. One end lives with the container. The other can join a host bridge, which behaves like a local switch. Suddenly the packet has somewhere to go, which is progress by the standards of packets.
The second idea is that attachment is not reachability. A bridge connects local endpoints, but traffic to another network needs a route and usually host forwarding. Traffic to an external service may also pass through network address translation, so the remote service sees the host address rather than the container address. A cross-host design adds an underlay, the existing network between hosts, and perhaps an overlay carried across it. That extra wrapping costs packet space, so the maximum transmission unit matters even when every configuration file looks polite.
The third idea is that a listening process is not automatically public. A published port creates a host address and port that lead inward to a container port. This is an access decision, not a decorative annotation. DNS is similarly useful but not magical: a correct name-to-address answer says nothing about the listener, route, policy, translation, or return path. Networking offers many ways to be half right.
The Container Network Interface, or CNI, is the attachment contract used by compatible runtimes and plugins. It can connect an interface, allocate an address, add routes, and later remove the attachment. It does not, despite the temptation of its official-sounding name, supply a complete application network. Kubernetes adds Pods, Services, DNS, and NetworkPolicy above that foundation.
Read the intro when you need the full packet path and the distinction between bridge, host, overlay, and routed designs. Use the slides for the component map. Keep the cheatsheet nearby when a connection fails, then work inside out: listener, interface, route, DNS, forwarding, policy, translation, and finally the underlay. The packet has not become mystical. It has merely collected paperwork.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://man7.org/linux/man-pages/man7/network_namespaces.7.html
Supports
- Network namespace isolation of devices, protocol stacks, routes, firewall rules, and ports
- Use of virtual Ethernet pairs between namespaces and host networking
- https://man7.org/linux/man-pages/man4/veth.4.html
Supports
- Virtual Ethernet devices as interconnected pairs
- Use of virtual Ethernet devices between network namespaces
- https://docs.docker.com/engine/network/
Supports
- Container interfaces, addresses, gateways, routes, DNS, and network drivers
- User-defined network name resolution and multiple network attachments
- Port publication, address allocation, outbound masquerading, and container network sharing
- https://docs.docker.com/engine/network/drivers/bridge/
Supports
- Single-host bridge connectivity and isolation
- Outbound masquerading and configurable bridge behavior
- User-defined bridge DNS and the scope of published ports
- https://docs.docker.com/engine/network/packet-filtering-firewalls/
Supports
- Packet filtering backends, host forwarding, and firewall behavior
- Relationship among bridge networking, masquerading, and firewall rules
- https://docs.docker.com/engine/network/drivers/overlay/
Supports
- Overlay networks connecting workloads across Docker hosts
- Encapsulation overhead and maximum transmission unit considerations
- https://github.com/containernetworking/cni/blob/main/SPEC.md
Supports
- CNI configuration format and runtime-to-plugin protocol
- Plugin chains, attachment parameters, results, address management delegation, checks, and deletion
- Runtime creation of a network namespace before plugin execution
- CNI specification milestones from the initial version through version 1.0
- https://kubernetes.io/docs/concepts/workloads/pods/
Supports
- Shared network namespace, address, and port space for containers in one Pod
- Pod networking and localhost communication
- https://kubernetes.io/docs/concepts/services-networking/
Supports
- Cluster networking, Services, DNS, ingress, gateways, and network policy
- Higher-level Kubernetes networking abstractions
- https://man7.org/linux/man-pages/man2/clone.2.html
Supports
- CLONE_NEWNET availability since Linux 2.6.24
- https://kernel.googlesource.com/pub/scm/linux/kernel/git/markgross/linux/+/refs/tags/v2.6.24
Supports
- Linux 2.6.24 release date
- https://docs.docker.com/engine/release-notes/prior-releases/
Supports
- Docker 1.0 production support and Docker 1.9 network plugins
- https://kubernetes.io/blog/2024/06/06/10-years-of-kubernetes/
Supports
- Kubernetes first commit, announcement, and version 1.0 release dates
- https://cloudplatform.googleblog.com/2015/07/Kubernetes-V1-Released.html
Supports
- Kubernetes version 1.0 release
- https://github.com/containernetworking/cni/tree/spec-v0.3.0
Supports
- CNI 0.3 specification tag
- https://github.com/containernetworking/cni/tree/spec-v0.4.0
Supports
- CNI 0.4 specification tag
- https://github.com/containernetworking/cni/releases/tag/v1.0.1
Supports
- CNI version 1.0 API stability declaration
- https://docs.cilium.io/en/stable/operations/performance/tuning/
Supports
- MTU discovery and network black holes from incorrect MTU settings
- https://docs.podman.io/en/latest/markdown/podman-network.1.html
Supports
- Podman network creation and inspection
- https://docs.tigera.io/calico/latest/about
Supports
- Calico networking and policy implementation
- https://github.com/flannel-io/flannel
Supports
- Flannel cross-host Pod networking
- https://www.ovn.org/en/ovn-kubernetes/
Supports
- OVN-Kubernetes logical networking for Kubernetes
