Questions regarding Exam 2017 - Task 2.2

Questions regarding Exam 2017 - Task 2.2

by Devrim Celik -
Number of replies: 2

I was wondering, in task 2 (second sub-task) of the 2017 exam, the question was how many Sockets Alice needs to perform the communications listed in the sub-task before. Generally, she performs

  • one DNS lookup for www.epfl.ch
  • one DNS lookup for www.ethz.ch
  • one TCP connection with www.epfl.ch
  • one TCP connection with www.ethz.ch
The sample solution states that she needs a minimum of 3 sockets:
  • UDP socket for communicating to the local DNS server
  • TCP socket for communication to www.epfl.ch
  • TCP socket for communication to www.ethz.ch
My questions are:
  1. I was under the impression that both, client and server, need 2 TCP sockets for communicating, one listening and one sending socket.  Is that incorrect?
  2. Why is only one UDP socket required, although we are performing to separate DNS queries. It our DNS client running an open UDP socket all time?
Thanks in advance!
In reply to Devrim Celik

Re: Questions regarding Exam 2017 - Task 2.2

by Katerina Argyraki -

1. No, a TCP client needs only one TCP connection socket. It's the TCP server that needs a listening socket and a connection socket. (The client has no need for a listening socket. It does not need to wait and listen for incoming connection-setup requests.)

2. Because the question is asking what the *minimum* number of sockets is. So, yes, in principle, a DNS client may always use the same socket (that it keeps open) to make all its DNS requests. This may or may not be the case, of course, depending on the implementation.

In reply to Katerina Argyraki

Re: Questions regarding Exam 2017 - Task 2.2

by Devrim Celik -

Thank you very much. I think the 2nd question ties together with the other question I posed.