Skip to content

Bridges and veth pairs: how containers share a network

Select an icon to see what it is.

Step 5 of 6

The frame crosses the bridge

web sends a TCP SYN to 172.18.0.3:3000 inside an Ethernet frame addressed to api's MAC. The bridge looks the MAC up in its table and forwards the frame out of api's port only. Nothing is rewritten, so the TTL stays 64.

Frame as it crosses the bridge (Ethernet 14 B + IPv4 20 B + TCP 20 B)

02:42:ac:12:00:02 -> 02:42:ac:12:00:03
172.18.0.2:41234 -> 172.18.0.3:3000 flags=SYN

Ethernet · 14 B

Destination MAC 48b
02:42:ac:12:00:03
Source MAC 48b
02:42:ac:12:00:02
EtherType 16b
0x0800 (IPv4)

IPv4 · 20 B

Version 4b
4
IHL 4b
5 (20 B)
DSCP/ECN 8b
0
Total length 16b
40
Identification 16b
0x0000
Flags 3b
DF
Fragment offset 13b
0
TTL 8b
64
Protocol 8b
6 (TCP)
Header checksum 16b
0xe2a6
Source IP 32b
172.18.0.2
Destination IP 32b
172.18.0.3

TCP (simplified: options omitted) · 20 B

Source port 16b
41234
Destination port 16b
3000
Sequence number 32b
0x2b3c4d5e
Acknowledgment number 32b
0
Data offset 4b
5 (20 B)
Reserved 3b
0
Flags 9b
SYN
Window 16b
64240
Checksum 16b
0x3763
Urgent pointer 16b
0