The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
149 views

On TCP connection, consider FIN, SYN packets will take 1 byte and ACK packets will take 0 bytes. Assume client and server are working on this connection. Client and server selected random numbers for sequence numbers 100 and 500 respectively. After connection is established, client sent 100 bytes of two data packets. While giving acknowledgement to client from server for those two data packets, what is SEQ NUM (sequence number) and ACK NUM (acknowledgement number)?

   
 

(A) SEQ NUM = 501 and ACK NUM = 300

 

(B) SEQ NUM = 500 and ACK NUM = 299

 

(C) SEQ NUM = 500 and ACK NUM = 300

 

(D) SEQ NUM = 501 and ACK NUM = 301

asked in Computer Networks by Junior (653 points) | 149 views

2 Answers

+1 vote
For connection establishment Client consume one sequence number i.e 100 and Server consume one sequence number i.e 500.

Now client send the 1st segment (101 to 200) with sequence number 101

Client send the 2nd segment (201-300) with sequence number 201.

So,server sent the ack packet with SEQ=501 and ACK = 301(as the last byte it receieve is 300)

So, Answer is D only.
answered by Active (2.3k points)
0 votes

Option C (according to me)

At client ends

1) sends SEQ# 100- 299 (200 B) data  to server

At Server's end

1) SEQ# 500- (not given) sends to client 

2) and sends ACK # 300 (Ensuring that data till 299 is recieved successfully)

TCP can accept out of order segments,but sends inorder acks!

I didn't found need of Fin/syn packets here..as its given we have to assume client and server are in working condition!

Correct me if I am wrong!

answered by Loyal (3.7k points)
Even I had marked C,and assumed the same logic as yours,but the answer given was D.So need to know the correct one.

 

C  sends seq# 100 to S

S sends seg( SYN(500) + ACK(101)) to C

C sends ACK seq# 501

******connection established****** (yes its given in question....Client and server selected random numbers for sequence numbers 100 and 500 respectively. After connection is established, client........)

At client ends

1) sends SEQ# 101- 300 (200 B) data  to server

At Server's end

1) SEQ# 501- (not given) sends to client 

2) and sends ACK # 301 (Ensuring that data till 300 is recieved successfully)

 

 

 

 

 

first client will send data 1-100 , so, ack 101

2nd packet from 101-200 , so ack 201

3rd packet from 201 to 300, so ack 301

So, C not correct option


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,157 questions
36,984 answers
92,161 comments
34,824 users