Computer Networks

Tutorial #6

  1. What is a socket? In what ways is a socket different from a file under Unix? In what ways is it similar? Why are these differences and similarities historically important?

  2. Are sockets the only conceivable way in which TCP connections can be managed? Why are they so commonly used?

  3. In the lecture, it was stated that the bind() system call was not normally needed in client software. Why not? Why is it needed for a server? NB: What this question is asking, in part, is what bind() actually does - if you understand this, you should know the answer.

  4. When[1] is the listen() call important?

  5. The read() system call specifies a maximum number of bytes which may be read from a socket. Do you think it can return less than this? Under what circumstances? What if the write() system call returned a different value from that given in its length argument?

  6. (Very difficult question[2]) The second last slide made brief mention of the way in which the accept() system call returned a new socket. How is this used, and why is it a pretty nifty trick? Note: the answer is not at all obvious.

Practical exercises:

[1] From Comer, P363.
[2] Seriously. You are not expected to understand this for this subject. However, people who have already taken a subject such as System Software will see what's going on here.
[Previous Tutorial] [Tutorial Index] [Next Tutorial]
Phil Scott