CS 2204 Written Assignment Unit 7
CS 2204 Written Assignment Unit 7
Question 1
While waiting for the application being served to respond for connection termination, the device
with the first FIN may experience more extended periods in the CLOSE-WAIT state (Duc,
2019). The TCP protocol does not make assumptions about the length of this period. While
waiting, the server continues delivering data with the client receiving it. Nevertheless, data is not
The server eventually sends FIN for termination of the connection from its end. The client from
whom the termination request originated sends the FIN'sFIN's ACK. The client does not
immediately switch to the CLOSED state since it has to wait for the server to receive the ACK.
Two reasons justify the necessity of the TIME-WAIT state and its length. First, it ensures
sufficient time is provided, ensuring that the other device receives the ACK and retransmission
when lost. It ensures that ACK and the packet have the required time for traveling from one end
to another. Second, it ensures a buffering period in the current and following connections
preventing confusion and duplication due to connection mix-ups. Duplication and loss of data
may result from packet delays and a smaller maximum lifetime compared to the processing time.
Question 2
The Nagle algorithm aims to minimize congestion of networks in TCP applications due to minor
packet issues. The algorithm has been a TCP standard characteristic since the 1980s.
Nagling is a technique adopted by the Nagle algorithm for processing data from the sender. It
functions by detecting small-sized packets and then accumulating them into large TCP messages.
The process prevents the production of unintended larger numbers of small messages. The
algorithm's general performance depends on its choices of the quantity of data accumulation and
During congestion, applications requiring quick network responses, such as online games and
video calls, show decreased performance when nagling is used. Delays are seen as the algorithm
uses additional time in assembling the small packets triggering lags noticeable in audio
streaming and on the screen. As such, the applications deactivate Nagle (Herrero, 2020).
Question 3
Data-less packets are sent regularly during idle connections, ensuring the said
A data-less TCP reset (RST) bit is sent for termination or resetting of the connection
Question 4
Generally, using the finish (FIN) bit sets, individual sides (server and client) terminate their
specific communication ends by sending specified messages. The request for termination
message, also known as FIN, similarly carries data as regular segments. The receiver of the FIN
message sends an ACK to the sender, indicating its receipt. Ideally, the termination process must
be completed for the entire connection to be regarded as terminated. This involves receiving the
i. FIN-WAIT-1 indicates the initial stage point where activation of the 4-way handshake
took place (Cluzel et al., 2021). The remote endpoint receives a request to terminate the
ii. FIN-WAIT-2 indicates an ACK from the remote endpoint has been sent due to the
previous request for termination of the connection. The remote endpoint is now required
to send a request for termination of active connection by the local endpoint. Generally,
CLOSE-WAIT, TIME-WAIT, and FIN_WAIT_2 are utilized since they have connection
relations. When there is an active connection between the client and server and needs to
References
Cluzel, G., Georgiou, K., Moy, Y., & Zeller, C. (2021, October). Layered Formal Verification of
a TCP Stack. In 2021 IEEE Secure Development Conference (SecDev) (pp. 86-93).
IEEE.
Duc, S. N., Mimura, M., & Tanaka, H. (2019, September). An analysis of TCP ACK Storm DoS
Herrero, R. (2020). Analysis of IoT mechanisms for media streaming. Internet of Things, 9,
100168.