How Container Networking Shapes Modern Cloud‑Native Architectures
This article explains why containers and Docker are popular, outlines the network and security challenges of building container cloud platforms, compares bridge, host, container and none networking modes, reviews major CNI solutions such as Calico, Flannel, Weave and Macvlan, and discusses how service mesh complements CNI in multi‑cluster environments.
Container technology is booming, especially the open‑source tool Docker, which is widely used in data centers. Containers standardize software packaging and its dependencies, isolate applications, and run on many operating systems, offering app‑level isolation compared to the resource‑level isolation of virtual machines. Often containers and VMs are combined in modern data centers.
When enterprises build container cloud platforms, they face many challenges; CNCF surveys highlight networking and security as the top hurdles. Insufficient network and security controls can threaten business continuity when core applications migrate to containers.
Beyond basic container networking security, linking isolated Kubernetes clusters and heterogeneous container clouds presents additional network problems. Container networking has evolved from Docker’s dynamic port‑mapping model to CNCF’s CNI (Container Network Interface) and further to Service Mesh + CNI hierarchical SDN.
Port Mapping
Bridge mode (Linux bridge) is the default Docker network: Docker creates a Linux bridge named docker0 with a subnet, and each container gets a virtual Ethernet device (veth) that connects one end to the bridge and the other to the container’s network namespace, receiving an IP address from the virtual subnet.
Host mode shares the host’s network namespace, IP and ports.
Container mode uses an existing container’s network namespace, allowing multiple containers in a pod to share the same network stack.
None mode leaves networking unspecified, letting the user configure it later.
Container Network Interface
CNI, led by Google and CoreOS, is a standard for container networking that builds on the RKT network proposal and addresses flexibility, scalability, IP allocation, and multi‑NIC support, aiming to provide standardized networking for container platforms.
Different container platforms (Kubernetes, Mesos, RKT) can invoke various network plugins through the same CNI interface, which handles tasks such as creating network namespaces, attaching interfaces, and assigning IPs.
CNI solutions are generally categorized into tunnel and routing approaches.
Calico
Calico provides a pure Layer‑3 network model without overlay encapsulation; each container communicates directly via IP. It uses BGP routing so every node and network device knows the full cluster routes, though this can generate many routes and requires high‑spec routing hardware.
Traffic flows from the source container through its host, the data‑center routers, to the destination host and container, all routed by BGP without packet encapsulation, resulting in higher forwarding efficiency.
Flannel
Flannel, proposed by CoreOS, is an overlay network that encapsulates TCP traffic for cross‑host container communication, supporting UDP, VXLAN, AWS VPC, GCE routing, etc., with VXLAN being the most popular.
Flannel assigns each host a subnet; containers obtain IPs from this subnet, enabling routing across hosts without NAT or port mapping. It creates a cluster‑wide unique virtual IP space, allowing containers on different nodes to communicate directly via internal IPs. While it introduces encapsulation overhead, Flannel integrates well with SDN and is suitable for new data‑center network deployments.
Weave
Weave is also an overlay network that virtualizes inter‑host container connections into a single logical network. Containers use standard ports (e.g., MySQL 3306) and can be addressed by DNS names without NAT or port mapping, requiring no code changes.
Weave runs a virtual router on each host, forming an interconnected topology. Deployment requires Linux kernel ≥ 3.8, Docker ≥ 1.10, and open firewall ports TCP 6783 and UDP 6783/6784. It operates at the overlay layer, unlike Flannel’s approach.
Macvlan
Macvlan, a newer Linux kernel feature, allows multiple virtual interfaces with independent MAC addresses on a single physical NIC. Containers share the host’s broadcast domain and can be assigned IPs directly, simplifying configuration compared to bridge mode and supporting VLANs.
Different container network solutions suit different scenarios; Calico is the simplest, followed by Flannel, with Weave being the most complex. From a networking perspective, Weave and Flannel are both encapsulation technologies, differing in whether encapsulation occurs on the host or the network device.
Challenges of CNI Solutions
Missing enterprise‑grade container cloud security isolation controls
CNI lacks native load balancing required for microservice deployments
Supports only a single Kubernetes cluster
Cannot extend to existing virtualization or bare‑metal strategies
Lack of comprehensive health‑status visualization, operation, and troubleshooting tools for container cloud networks
Service Mesh + CNI
Service mesh is a hot topic and is sometimes described as the next‑generation SDN, but it does not replace CNI; instead, it works alongside CNI to provide higher‑level (L5‑L7) network services.
CNI must deliver L2‑L4 connectivity, routing, security isolation, and load balancing to each pod, while service mesh adds L5‑L7 capabilities such as intelligent routing, distributed load balancing, traffic management, blue‑green and canary releases, resilience, rate limiting, retries, and observability. Service mesh deploys a sidecar Envoy proxy per container, but it cannot operate without CNI. Gartner predicts that by 2020 almost all container clouds will embed service mesh, yet open‑source Istio still only supports a single Kubernetes cluster and lacks cross‑cloud capabilities.
The evolution from physical servers to VMs to containers has introduced increasingly complex networking requirements; container networking solutions have emerged to address these needs at the network layer. This article aims to introduce the landscape so that industry peers can better navigate the containerization wave.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
