=========================preview======================
(COMP361)midterm_spring04_solutions.pdf
Back to COMP361 Login to download
======================================================
COMP 361 Computer Communications Networks
Spring Semester 2004 - Midterm Examination C Solution key
Date March 25, 2004, Time 19:00 C21:00
Name:______________________Student ID:________________Email:_______________
Instructions:
1.
This is a closed book exam
2.
This examination paper consists of 15 pages and 8 questions
3.
Please write your name, student ID and Email on this page.
4.
For each subsequent page, please write your student ID at the top of the page in the space provided.
5.
Please answer all the questions within the space provided on the examination paper. You may use the back of the pages for your rough work. Each question is on a separate page. This is for clarity and is not meant to imply that each question requires a full page answer. Many can be answered using only a few lines.
6.
Please read each question very carefully and answer the question clearly and to the point. Make sure that your answers are neatly written, readable and legible.
7.
Show all the steps you use in deriving your answer, where ever appropriate.
8.
For each of the questions assume that the concepts are known to the graders. Concentrate on answering to the point what is asked. Do not define or describe the concepts unless specifically asked to do so.
Question Points Score
1 5
2 15
3 15
4 10
5 8
6 12
7 20
8 15
TOTAL 100
Department of Computer Science The Hong Kong University of Science and Technology Student ID___________________
1. Answer the following true/false questions by circling either T or F (5 points)
(a) HTTP servers listen for client requests on port 80 T F
(b) DNS runs on top of UDP T F
(c) HTTP uses out-of-band control T F
(d) Port 20 is used by FTP to transfer data T F
(e) The sender in the TCP protocols keeps an individual timer for each unacknowledged packet. T F
2. (15 pts)
Consider the client-server JAVA code studied in class. In this question you need to
describe the different types of sockets used by that code. It is only necessary to describe
the types; you do not have to remember what they are called in JAVA.
(a)
First consider the TCP code.
How many different types of sockets does the server have?
What is/are the function(s) of this/these socket(s).
If there is more than one type of socket please explain the difference between the types.
How many different types of sockets does the client have.?
What is/are the function of this/these socket(s).
If there is more than one type of socket please explain the difference between the types.
(b)
Now consider the UDP code. Answer the same questions as in (a) for the client and the server.
(a)
The TCP server has two different types of sockets. The first type of socket is a server socket that sits waiting for a request from a clie