Midterm 2017, Problem 2, Q2

Re: Midterm 2017, Problem 2, Q2

by Katerina Argyraki -
Number of replies: 0
Hi Joyti,

The number of UDP sockets may differ, because a process may use a single UDP socket to communicate with many other processes, or it may use a different UDP socket per process.

When a DNS client wants to talk to a DNS server, both processes use sockets: The DNS client creates and uses a UDP socket (on the local computer) to send and receive DNS messages to/from the DNS server process; the DNS server uses a UDP socket (that it has created in its own local computer) to receive and send DNS messages from/to DNS client processes (and also other DNS server processes). A process can never create a socket on a remote computer; it always creates/uses a socket on the local computer where it is running.

The purpose of the TCP listening socket is to accept connection-setup requests. This is why only the web server needs it (the web client/browser does not receive connection-setup requests).

A web client uses the same TCP connection socket to send and receive traffic to a web server. The web server uses its TCP listening socket to receive connection-setup requests; as soon as it accepts a new connection, it creates a new TCP connection socket and uses it both to send and receive data.

Clear?