04 Try it yourself Interactive

Watch one host decide who gets what

One host, 10.0.0.5, running the three processes from section 02: nginx with a listening socket on port 80 and two established client connections, sshd listening on 22, and a DNS resolver bound to UDP 53. Segments arrive one per press. The top row is the arriving segment’s full four-tuple, and where one field alone turned the decision that field is tinted amber; the table below is the host’s socket list, with candidate sockets in indigo and the socket that receives it in green. TCP runs the four-field rule over all five sockets; UDP runs the two-field one over a trimmed table holding only the DNS socket and the nginx listener, and the sockets-matched counter is where the difference shows. Watch for step 2, where the destination IP and port are identical to step 1 and the segment still lands somewhere else. Nothing plays on its own: Next, Back and Reset, or the arrow keys.

TCP · four-field demultiplex
no segment received yet
Indigo rows are sockets whose protocol, local address and local port all match, so they are candidates. A green row received the payload. A red row means nothing owned that port.
Press Next to deliver the first segment. Each press handles one arrival.


      
Segment
Sockets matched
Delivered0
Rejected0
step 0 / 0