Numerical Practice (TCP Protocol)

Question Comment on the TCP segment in which the value of the control field is 
 a. 000000      b. 000001    c. 010001
Solution:
a. 000000 -This segment is part of a data transmission without piggybacked acknowledgment
b. 000001 - This is a FIN segment request to terminate the connection.
c. 010001 - This is a FIN+ACK in response to a received FIN segment

Question An IP datagram is carrying a TCP segment destined for address 125.1.2.3/16. The destination port address is corrupted and it arrive at destination 125.1.2.5/16. How does the receiving TCP react to this error?
Solution
Since both destination IP address and  port number are corrupted. TCP calculates the checksum and drops the segment. An ICMP packet will be delivered to sender.
Question In a TCP connection, the value of (cwnd, rwnd) is (3000, 5000) respectively. The host has sent 2000 bytes which has not been acknowledged. How many more bytes can be sent?
Solution
Window size= minimum (cwnd ,rwnd) = 3000. Since the sent bytes are not acknowledged so it still sits in senders TCP buffer.
Therefore, more bytes can be sent= 3000 -2000 = 1000 bytes 

Question TCP opens a connection using an initial sequence number (ISN) of 14,534.The other party opens the connection with an ISN of 21,732.Show the three TCP segments during the connection establishment.
Solution

Question In a TCP connection, the initial sequence number (ISN) at the client site is 3,070. The client opens the connection, sends only one segment carrying 1,200 bytes of data, and closes the connection. What is the sequence number of segment sent by the client? 	
Solution
The SYN will use the ISN at the connection establishment phase.
So the sequence number of the first segment will be 3071

Question A TCP connection is established between two processes P1 and P2 running on different hosts. Segment size is set to 800 bytes for this connection.  Initially, the ssthresh at P1 is 7000 bytes. Then, P1 receives a TCP ACK reporting a rwnd size of 4000 bytes. After reception and processing of this ACK, the cwnd value is 7200 bytes. How many maximum-sized segments can P1 transmit now (i.e., after the ACK processing)?
Solution     
Given segment size = 800 bytes
New rwnd size = 4000 bytes(through ACK reporting)&  cwnd size=7200 bytes
Since window size= min(cwnd ,rwnd) => min(7200,4000)= 4000 bytes
Therefore, number of  maximum-size segment accommodated =4000/800= 5 segments

Question Assume that sequence number field in TCP is defined by 16 bits. TCP connection has been established and sender has assigned the initial sequence number as 33535.  TCP is sending data at 32MBps(megabyte per second). How long does it take until it goes again to zero? (write answer in miiliseconds)  
Solution
Total possible sequence possible with 16 bits = 216 = 65535 (i.e 0 to 65534)
Total data bytes represented=65535(bcoz each sequence represent one data byte)
Data transmission speed= 32MBps (i.e. 32*106 bytes in one sec)
As a rule, after completing 65534 sequences, it wrap round and start with 0
Given, ISN=33535, sequence remaining to reach last=65534-33535=31999+1=32000 
To generate 32000 sequence with a transmission speed of 32MBps =1*10-3sec= 1 ms 

Question A host has no data to send. It receives the following segments at the times shown (hour:minute:second:milliseconds after midnight). Show the acknowledgments sent by the host.
a. Segment 1 received at 0:0:0:000.	b. Segment 2 received at 0:0:0:027.
c. Segment 3 received at 0:0:0:400.	d. Segment 4 received at 0:0:1:200.
e. Segment 5 received at 0:0:1:208.
Solution
a. Segment 1 received at 0:0:0:000 => (No Acknowledgement)-Rule 2(wait 500ms)
b. Segment 2 received at 0:0:0:027 => (Ack sent)- (Ack:3)Rule 3
c. Segment 3 received at 0:0:0:400 => (Ack sent-Ack:4)Rule2(sent after 500 ms)      	
d. Segment 4 received at 0:0:1:200 => (No Acknowledgement)- Rule 2(wait 500ms)
e. Segment 5 received at 0:0:1:208 => (Ack sent - Ack:6 )- Rule 3
Refer to Rules of Acknowledgement Policy of TCP transmission
Rule-1. When one end sends a data segment to the other end, it must include an ACK.  That gives the next sequence number it expects to receive. (Piggyback)
Rule-2. The receiver needs to delay sending (until another segment arrives or 500ms) an ACK segment if there is only one outstanding in-order segment. It prevents ACK segments from creating extra traffic.
Rule-3. There should not be more than 2 in-order unacknowledged segments at any time. It prevent the unnecessary retransmission
Rule-4. When a segment arrives with an out-of-order sequence number that is higher than expected, the receiver immediately sends an ACK segment announcing the sequence number of the next expected segment. (for fast retransmission)
Rule-5. When a missing segment arrives, the receiver sends an ACK segment to announce the next sequence number expected.
Rule-6. If a duplicate segment arrives, the receiver immediately sends an ACK.























Published by Expert_Talk

I like sharing article and discussion on emerging technologies. Love to share my knowledge on various latest trends and technologies.

Leave a comment