Network
Pod to Pod, same node
veth pairs and the bridge
Two Pods on one node talk through a pair of virtual cables and a Linux bridge. No overlay, no NAT. Everything between them is plain Ethernet switching on their shared subnet, 10.244.2.0/24 - the fastest network in the cluster.
- Sender
- web-…-x2kqp · 10.244.2.17
- Receiver
- web-…-p8m4z · 10.244.2.18:8080
- Shared subnet
- 10.244.2.0/24 on cni0 · node-2
- Round trip
- ≈ 0.3 ms · no overlay, no NAT
Read the whole lesson as text
1. Inside the sender
Zoom into web-…-x2kqp on node-2. Its app calls connect() for 10.244.2.18:8080 - its peer Pod, p8m4z, on the same node. The kernel picks ephemeral port 46118 and builds a 74-byte SYN, then parks it: it won't send until it knows which MAC address to hand it to.
- The app asks its kernel for a TCP connection to the peer Pod's IP.
- The kernel builds the SYN but holds it until it knows the neighbor's MAC address.
2. Find the next hop
The route table in the Pod's namespace has a connected route for its own subnet: 10.244.2.0/24 on eth0. So 10.244.2.18 is a neighbor, not a gateway hop - the kernel ARPs for the destination itself. The bridge floods the broadcast to every port, and p8m4z's kernel answers with its MAC 40 µs later.
- The route table says the destination is on this subnet: no gateway, no tunnel.
- Who owns 10.244.2.18? The question is broadcast to everyone on the bridge.
- p8m4z answers: that IP lives at MAC 5a:1d:…:18.
3. Across the bridge
Zoom out to node-2. Everything between two namespaces on one node is a veth pair: bytes written to eth0 inside the Pod come out on veth3b1c in the node's namespace. veth3b1c is a port on the cni0 bridge, and a bridge is a switch. It looks up 5a:1d:…:18 in its forwarding database and sends the frame out of exactly one port: veth7c92, the cable into p8m4z.
- The finished frame drops out of the Pod's eth0 and appears on the node side of the same cable.
- cni0 is a switch: it looks the destination MAC up and picks one port.
- The frame goes out of that port, toward the Pod on its far end.
4. Into the peer
The far end of that cable lives in p8m4z's network namespace, so the frame simply appears on its eth0. The app is listening on 0.0.0.0:8080 and accepts. It sees the client as 10.244.2.17:46118 - a real, routable Pod IP. No address was translated anywhere: both Pods are peers on the same subnet.
- The cable's far end is inside the other Pod's namespace: the frame just appears on its eth0.
- The app accepts and sees the sender exactly as it is: 10.244.2.17.
5. The mirror path
The SYN-ACK retraces the same three hops in reverse: p8m4z's veth, the bridge - same two FDB entries, other direction - and the sender's veth. connect() returns after 0.16 ms. The GET and its 200 OK cross the same bridge ports for as long as the connection lives.
- The reply takes the same road backwards: veth, bridge, veth.
- Same two bridge ports, opposite direction.
- The handshake completes, 0.16 ms after connect().
- The request crosses the bridge like any other frame.
- The answer comes back the same way, 0.3 ms after the connect().
6. Never left the node
Nothing about this exchange left node-2. Kubernetes turns on br_netfilter, so even bridged frames pass through iptables, and the Service chains were walked. But they match 10.96.120.15 - a ClusterIP - and this packet was addressed to a Pod IP, so nothing hit. The node's eth0 and the VXLAN device stayed idle; node-1 never saw a byte.
- kube-proxy's rules were consulted but matched nothing.
- The node's real network card never saw any of it, and node-1 saw nothing at all.
Summary
One connection, a few hops of plain Ethernet: app to eth0, veth to veth through the cni0 bridge, eth0 to app. Nothing was translated, nothing was wrapped, and no rule matched - the destination was a Pod IP, not a Service. To these two Pods the node is just a switch with very short cables.
Next lesson: Pod to Pod, across nodes