Pod-to-Pod Across Nodes
A packet goes from a Pod to a Pod on another Node, though the network between Nodes may know only Node addresses. How does it cross, what does an outer header around it cost, and can it go unwrapped?
Play the animation 4 steps, animated, plays on a computer or a tablet
Pod-to-Pod Across Nodes, step by step
-
Pod A sends to 10.244.2.7 out its eth0. The frame rides the veth into the Node-1 network stack, which consults its routing table. The destination is not in the local Pod subnet, so the route hands the frame to the CNI dataplane that carries off-Node traffic.
Play from step 1 -
In overlay mode the CNI dataplane wraps the original frame inside a VXLAN header carried over UDP to the Node-2 address. The outer IP header carries Node IPs the physical network already knows how to route. For flannel the UDP dport defaults to 8472, and the inner Pod IPs ride untouched. The wrapped packet crosses the underlay to Node-2.
Play from step 2 -
Node-2 receives the UDP packet on the VXLAN port and its kernel strips the outer headers. The bare inner frame, still addressed to 10.244.2.7, is routed out of the local dataplane and over the veth into Pod B, the same last hop a same-node frame takes.
Play from step 3 -
Not every CNI encapsulates. A routed plugin such as Calico with BGP advertises the Pod subnet of each Node to its BGP peers, so the packet crosses the underlay carrying its real Pod IPs with no outer headers at all. It travels Pod A to Pod B in one routed path. This drops the encapsulation cost and the MTU overhead, at the price of an underlay that has to be aware of Pod IPs.
Play from step 4