TCP

Question 1
A TCP server application is programmed to listen on port number P on host S. A TCP client is connected to the TCP server over the network. Consider that while the TCP connection was active, the server machine S crashed and rebooted. Assume that the client does not use the TCP keepalive timer. Which of the following behaviours is/are possible?
A
If the client was waiting to receive a packet, it may wait indefinitely.
B
If the client sends a packet after the server reboot, it will receive a RST segment.
C
The TCP server application on S can listen on P after reboot.
D
If the client sends a packet after the server reboot, it will receive a FIN segment.
Question 1 Explanation: 
  1. True
    Since broken connections can only be detected by sending data, the receiving side will wait forever. This scenario is called a “half-open connection” because one side realizes the connection was lost but the other side believes it is still active.
  2. True
    The situation resolves itself when client tries to send data to server over the dead connection, and server replies with an RST packet (not FIN).
  3. True
    Yes, a TCP Server can listen to the same port number even after reboot.  For example, the SMTP service application usually listens on TCP port 25 for incoming requests. So, even after reboot the port 25 is assigned to SMTP.
  4. False
    The situation resolves itself when client tries to send data to server over the dead connection, and server replies with an RST packet (not FIN), causing client to finally to close the connection forcibly.
    FIN is used to close TCP connections gracefully in each direction (normal close of connection), while TCP RST is used in a scenario where TCP connections cannot recover from errors and the connection needs to reset forcibly.
Question 2

Consider the following statements about the timeout value used in TCP.
(i) The timeout value is set to the RTT (Round Trip Time) measured during TCP connection establishment for the entire duration of the connection.
(ii) Appropriate RTT estimation algorithm is used to set the timeout value of a TCP connection.
(iii) Timeout value is set to twice the propagation delay from the sender to the receiver.
Which of the following choices hold?

A
(i) is false, but (ii) and (iii) are true
B
(i) and (iii) are false, but (ii) is title
C
(i) and (ii) are false, but (iii) is true
D
(i), (ii) and (iii) are false
Question 2 Explanation: 
Statement-I: It is False.
The timeout value cannot be fixed for entire duration as it will turn timer to static timer, we need dynamic timer for timeout.
Statement-II: It is True.
Basic algorithm, Jacobson's algorithm, Karl's modification; these three algorithms are to be appropriate to RTT estimation algorithm used to set timeout value dynamically.
Statement-III: It is False.
Because timeout value is set to twice the propagation delay in data link layer where hop to hop distance is known, not in TCP layer.
Question 3

Consider a TCP connection in a state where there are no outstanding ACKs. The sender sends two segments back to back. The sequence numbers of the first and second segments are 230 and 290 respectively. The first segment was lost, but the second segment was received correctly by the receiver. Let X be the amount of data carried in the first segment (in bytes), and Y be the ACK number sent by the receiver. The values of X and Y (in that order) are

A
60 and 290
B
230 and 291
C
60 and 231
D
60 and 230
Question 3 Explanation: 
In the 1st segment data is from byte number 230 to byte number 289, that is 60 bytes. As 1st segment is lost, so TCP will send ACK for the next-in-order segment receiver is to be expecting. So, it will be for 230.
Question 4

A firewall is to be configured to allow hosts in a private network to freely open TCP connections and send packets on open connections. However, it will only allow external hosts to send packets on existing open TCP connections or connections that are being opened (by internal hosts) but not allow them to open TCP connections to hosts in the private network. To achieve this the minimum capability of the firewall should be that of

A
A combinational circuit
B
A finite automaton
C
A pushdown automaton with one stack
D
A pushdown automaton with two stacks
Question 4 Explanation: 
Pushdown automata with two stacks which is the Turing machine.
Turing machine can do everything as the normal computer can do, so firewall can be created by the TM.
Question 5

The three way handshake for TCP connection establishment is shown below.

Which of the following statements are TRUE? (S1) Loss of SYN + ACK from the server will not establish a connection (S2) Loss of ACK from the client cannot establish the connection (S3) The server moves LISTEN → SYN_RCVD → SYN_SENT → ESTABLISHED in the state machine on no packet loss (S4) The server moves LISTEN → SYN_RCVD → ESTABLISHED in the state machine on no packet loss.

A
S2 and S3 only
B
S1 and S4
C
S1 and S3
D
S2 and S4
Question 5 Explanation: 
S1 → True.
S2 → False, because if after ACK client immediately sends data then everything goes on without worry.
S3 → False.
S4 → True.
There are 5 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access