COMP3331/9331— Computer Networks and Applications
Computer Networks and Applications
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
COMP3331/9331— Computer Networks and Applications
Practice Final Examination
Instructions:
1. TIME ALLOWED: 2 hours and 10 minutes (Reading Time).
2. TOTAL MARKS AVAILABLE: 40 marks worth 40% of the total marks for the course. You must score at
least 16 marks on the exam to pass the course.
3. MARKS AVAILABLE FOR EACH QUESTION ARE SHOWN IN THE EXAM. YOU MUST ANSWER ALL
QUESTIONS. THERE ARE A TOTAL OF 29 QUESTIONS.
4. STUDENTS ARE ADVISED TO READ THE EXAMINATION QUESTION BEFORE ATTEMPTING TO
ANSWER THE QUESTION.
5. THIS EXAM CANNOT BE COPIED, FORWARDED, OR SHARED IN ANY WAY.
6. STUDENTS ARE REMINDED OF THE UNSW RULES REGARDING ACADEMIC INTEGRITY AND
PLAGIARISM.
7. YOUR WORK WILL BE SAVED PERIODICALLY THROUGHOUT THE EXAM AND WILL BE
AUTOMATICALLY SUBMITTED PROVIDED YOU ARE CONNECTED TO THE INTERNET.
COMP3331/9331 Practice Final Exam
2/37
Suppose two hosts have a long-lived TCP session over a path with a 100 msec round-trip time
(RTT). Then, a link fails, causing the traffic to flow over a longer path with a 500 msec RTT. This
scenario is depicted in the figure below. The original path is the straight path at the bottom. The new
path is at the top.
Answer the following two questions.
COMP3331/9331 Practice Final Exam
3/37
1 TCP Path Change Q1
Suppose the router on the left recognises the failure immediately and starts forwarding data packets over the
new path, without losing any packets. (Assume also that the router on the right recognises the failure
immediately and starts directing ACKs over the new path, without losing any ACK packets.) Why might the
TCP sender retransmit some of the data packets anyway?
Fill in your answer here
Maximum marks: 1.5
TCP bases its retransmission timeout (RTO) on an estimate of the round-trip time between the sending
and receiving hosts. In this example, the RTT is 100 msec before the failure. As this connection has
been active for some time, the sender’s RTT estimate should pretty accurate and close to 100 msec. The
DevRTT should be a very low value (close to 0) The RTO will thus be very similar to the RTT estimate.
When the failure occurs, the increase in the actual round-trip time implies that the ACK packets will not
arrive before the RTO expires. This causes the sender to presume the data packets have been lost,
leading to retransmissions, despite the fact that no packets were actually lost.
COMP3331/9331 Practice Final Exam
4/37
2 TCP Path Change Q2
Suppose instead that the routers do not switch to the new paths all that quickly, and the data packets (and ACK
packets) in flight are all lost. What new congestion window size does the TCP sender use? Explain your
answer.
Fill in your answer here
Maximum marks: 1.5
The TCP sender’s adjustment of the congestion window depends on how the packet losses were
detected. If a triple-duplicate-ACK occurs, the congestion window would be divided in half.
However, in this case, all packets in flight are lost, so no ACKs are received, forcing the sender to
detect the loss via a timeout. Timeout-based loss detection leads the sender to set the congestion
window to 1 (i.e., 1 MSS).
COMP3331/9331 Practice Final Exam
5/37
3 TCP SYN
Why does a TCP sender use a very large retransmission timeout (e.g., several seconds) for the SYN segment?
Answer in 2 sentences at most.
Fill in your answer here
Maximum marks: 1
The TCP sender does not have any initial estimate of the round-trip time (RTT). Starting with a
conservative retransmission timeout (RTO) of several seconds prevents the excessive
retransmissions that would result from using an RTO that is smaller than the actual RTT.
COMP3331/9331 Practice Final Exam
6/37
4 TCP 3 Way Handshake
Why is it necessary to have a 3 way handshake for connection establishment in TCP? Why is a 2 way
handshake not sufficient?
Fill in your answer here
Maximum marks: 2
TCP is a bi-directional communication protocol, which means either end ought to be able to send data reliably.
Both parties need to establish an Initial Sequence Number (ISN), and both parties need to acknowledge the
other's ISN. Thus a two-way handshake is required in each direction as follows:
1) Alice picks an ISN and SYNchronises it with Bob.
2) Bob ACKnowledges the ISN.
3) Bob picks an ISN and SYNchronises it with Alice.
4) Alice ACKnowledges the ISN.
Steps 2 and 3 can be combined in a SYN-ACK segment, which reduces this to a 3 way handshake.
A two way handshake would only allow one party to establish an ISN, and the other party to acknowledge it.
Which means only one party can send data.
COMP3331/9331 Practice Final Exam
7/37
Assume that the SendBase for a TCP Reno sender is currently 4000. The TCP sender has sent four
TCP segments with sequence numbers 4000, 4500, 5500 and 7000. The sender then receives a
segment with an acknowledgement number 7500 and a receive window 6000. The congestion
window, CongWin, is set to 10000 bytes after this ACK is processed. Answer the first three questions
assuming that this ACK is processed and no further ACKs are received.
COMP3331/9331 Practice Final Exam
8/37
5 TCP Sequence Q1
What is the value of SendBase? Only enter the numeric value in the space provided: .(7500)
Maximum marks: 0.75
The sender has received an ACK for 7500, so the sender would have moved the base of the
window up to that point. Thus SendBase = 7500.
COMP3331/9331 Practice Final Exam
9/37
6 TCP Sequence Q2
How many bytes in total are sent in the four TCP segments? Only enter the numeric value in the space
provided: .(3500)
Maximum marks: 0.75
The first segment carries 500 bytes, the second segment carries 1000 bytes, the third one carries 1500
bytes and the last segment carries 500 bytes. Thus, the total data in the four segments is 3500 bytes.
COMP3331/9331 Practice Final Exam
10/37
7 TCP Sequence Q3
What is the last byte (number) that the TCP sender can send with certainty that the receiver's buffer will not
overflow? Assume that the sender always has data to send. Explain your answer in 1-2 sentence.
Fill in your answer here
Maximum marks: 1
The window size is set to the minimum of the congestion window and receive window.
Hence, the window size will now be set to 6000 bytes. Since current SendBase is 7500,
this implies that the last byte that the sender can send with certainty is 13499.
COMP3331/9331 Practice Final Exam
11/37
8 TCP Sequence Q4
Now assume that the sender receives three more TCP segments, such that all three segments have TCP
acknowledgement number 7500.
Answer the this question and the next question assuming that all three ACKs are processed and no further
ACKs are received.
What is the value of CongWin and why?
Fill in your answer here
Maximum marks: 1
Since the sender receives three duplicate ACKs, the CongWin is reduced to half the current value
(current value = 10000 bytes), which is 5000 bytes.