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
2. Goal and learning objectives
For this assignment, you are to implement a reliable transport protocol over the UDP protocol. We
will refer to the reliable transport protocol that you will be implementing in this assignment as
Simple Transport Protocol (STP). STP will include most (but not all) of the features that are
described in Sections 3.5.4 - 3.5.6 of the text Computer Networking by Kurose and Ross (7th or 8th
ed.) or equivalent parts from the Week 4/5 lecture notes. Examples of these features include
timeout, ACK, sequence numbers, sliding window, etc. Note that these features are commonly
found in many transport protocols. Therefore, this assignment will give you an opportunity to
implement some of these basic features of a transport protocol. In addition, you may have wondered
why the designer of the TCP/IP protocol stack includes such a feature-less transport protocol as
UDP. You will find in this assignment that you can design your own transport protocol and run it
over UDP. This is the case for some multimedia delivery services on the Internet, where they have
implemented their own proprietary transport protocol over UDP. QUIC, a newly proposed transport
protocol also runs over UDP and implements additional functionalities such as reliability.
3.3 State Diagram
The asymmetry between sender and receiver leads to somewhat different state diagrams for the two
endpoints. The state diagram for STP is shown below, which depicts the normal behaviour for both
end points.
Figure 2: State diagram depicting the normal behaviour of STP.
The receiver can be in four possible states: CLOSED, LISTEN, ESTABLISHED and TIME_WAIT.
Initially, it is in the CLOSED state. Upon issuing a passive open, it enters the LISTEN state. Note
that the receiver is the passive host in our protocol and is initiated first, while the sender is initiated
next and actively opens the connection. While in the LISTEN state, the receiver waits for a SYN
segment to arrive on the correct port number. When it does, it responds with an ACK, and moves to
the ESTABLISHED state. Should a duplicate SYN arrive while the receiver is in the
ESTABLISHED state, it reissues the ACK and remains in the ESTABLISHED state. The ACKs
sent by the receiver are cumulative (like TCP). After the sender has reliably transmitted all data 6
(and received acknowledgments), it will send a FIN segment to the receiver. Upon receipt of the
FIN, the receiver moves to the TIME_WAIT state. As in TCP, it remains in TIME_WAIT for two
maximum segment lifetimes (MSLs) before re-entering the CLOSED state. This is to ensure that
the receiver can respond to potentially retransmitted FIN segments from the sender. You may
assume that the MSL is 1 seconds. In other words, the receiver should remain in TIME_WAIT for 2
seconds and then transition to CLOSED.