In: Computer Science
Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 99. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments contain 30 and 70 bytes of data, respectively. In the first segment, the sequence number is 100, the source port number is 4321, and the destination port number is 80. Host B sends an ACK whenever it receives a segment from Host A, i.e., no delayed ACK.
1.Tcp is the connection oriented protocol It provides a realible ,stream-oriented service to the application.
2.It reserves the resources both side sender and reciver so whenever we needs resources we can use it.
3.Tcp provides the full duplex communication.
In Above
Host A and B are communicating over a TCP connection.
Host B has already received from A all bytes up through byte 99. meaning host B recive the 99 byte then 99+1 =100 is acknowldgement number send to host A then 100 is the sequence number of first segment
sequence number : the number identifies the segment if the reciver recives the x byte from sender then acknowldgement number is x+1 and After that x+1 is the sequence number of next byte.
Host A then sends two segments to Host B back-to-back.
First segment contain: 30 bytes.
In the first segment, the sequence number is 100, the source port number is 4321, and the destination port number is 80
Second segment contain: 70 bytes.Host B sends an ACK whenever it receives a segment from Host A
a.In the second segment sent from Host A to B, what is the sequence number?
So First segment sequence number is 100 and 30 bytes sends then it sends Acknowlegement number is seqno+ bytes 100+30 =130 to Host A why seqno+ bytes because the sequence number of a segment is the byte number of the first byte in the segment
In Second Segment:
So Host A recives 130 acknowlegement number
if the reciver recives the x byte from sender then acknowldgement number is x+1 and After that x+1 is the sequence number of next byte so 130 is sequence number of second segment sent from A to B.
b.If the first segment arrives before the second segment, in the ACKs of two arriving segments, what are the acknowledgment numbers of the first and second arriving segment, respectively? What are the source port number and the destination port number in ACK?
The First segment arrives before the second segment : Host A sends 30 byte data and sequence number is 100 source port number =4321 ,destination port number =80 so first segment recives 130 ACK number before second segment and second segment ACK no is 130+70=200(seq no+bytes)send to Host A. when first segment sends ACK traverse from B to A so source port number=80 and the destination port number =4321 in ACK.
c.If the second segment arrives before the first segment, in the ACKs of two arriving segments, what are the acknowledgment numbers of the first and second arriving segment, respectively?
If the second segment arrives before the first segment, After that Host A then sends two segments to Host B back-to-back. but fistly its sends ACK to second segment
in the acknowledgement of the first arriving segment, (99+1)the acknowledgement number is 100is the ACK of second Segment number because second segment arrives before the first segment, then ACK number of First Segment number is 230 .
d.Suppose the two segments sent by A arrive in order at B. The first ACK is lost and the second ACK arrives before the first timeout interval. What will happen at Host A? If Host A needs to retransmit some segment, what are the sequence number and the number of bytes of the data? Now assume the first ACK is lost and the second ACK arrives after the first timeout interval. What will happen at Host A? If Host A needs to retransmit some segment, what are the sequence number and the number of bytes of the data?
Host A then sends two segments to Host B back-to-back..
First segment sequence number is 100 byte =30
Second Segment sequence number is 130 byte =70
The first ACK is lost the second ACK arrives before the first timeout interval.
sequence the first Ack lost that time host A sends Ack no is 130. after that it sends the ACK of second segment is 200 before the first timeout interval
sends If Host A needs to retransmit some segment the sequence number is 100 and number of byte data is 30.
it sends Ack number is 200.