Clients A, B (and D) send segments to server C. C looks at the header to choose the socket: UDP only looks at the destination (IP_D, PD); TCP looks at the four values (IP_O, PO, IP_D, PD). Follow each segment into the socket table of C.
A visualization of transport-layer demultiplexing. Three client hosts (A, B and D) send segments with a visible header (Protocol, source and destination IP, source and destination port) to a server C, inside which the socket table is shown. With UDP the socket is identified only by the destination (IP_D, PD): every segment to the same port goes into a single socket, wherever it comes from. With TCP there is a welcome socket per listening port and one connection socket per distinct 4-tuple (IP_O, PO, IP_D, PD), so the same source port from two different IPs gives two sockets. A switch turns the same segments from UDP into TCP. The Reply button shows the server's reply with IPs and ports swapped: the source port is the return address. “New client” adds a segment with an ephemeral port chosen by the OS in the IANA range (49152–65535) or the Linux one (32768–60999). Scenarios from the slides: UDP with two clients and one socket, TCP “one to one” (one process per connection), “one to many” (threads), an event-driven web server with HTTP/2 and HTTP/1.1, and 443/TCP next to 443/UDP, with the three addressing levels view (IP, Protocol 6/17, port). It includes prediction mode, random exercises and a final question on how many sockets the server has.
Concepts: demultiplexing, multiplexing, UDP socket, TCP socket, welcome socket, connection socket, 4-tuple, source and destination port, ephemeral ports, return address, Protocol field (6/17), server processes and threads.
Formulas:
UDP socket = (IP_D, PD)TCP connection socket = (IP_O, PO, IP_D, PD)TCP sockets in the server = welcome sockets + number of distinct 4-tuplesReply: (IP_O, PO, IP_D, PD) → (IP_D, PD, IP_O, PO)Network Architecture I, Session 3.1 · Enrique de la Hoz, University of Alcalá · License CC BY-SA 4.0 · Source and catalogue on GitHub · DOI 10.5281/zenodo.23285664