Redirected
edited by
1,650 views
3 votes
3 votes
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 the connection is established, the client sent $100$ bytes of two data packets. While giving acknowledgment to client from server for those two data packets, what are SEQ NUM (sequence number) and ACK NUM (acknowledgment 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
edited by

4 Answers

4 votes
4 votes
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.
1 votes
1 votes
ACK No is always next expected byte. Client sends two 100B packet's and initially seq no  of client 100 therefore server will send next expected byte as ack which is ( 100* + [100** + 100***] )    * initial sq number, **First Packet, ***second packet = 300 are received now i'm waiting for 301 next byte.
0 votes
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!

0 votes
0 votes

SYN flag used to create sequence number of a connection.

Here client has sequence number $100$ and server has sequence number $500$

So,

  • client send SYN flag of $100$ to server

           Server sends and SYN=$500$ to client. Server also wants to know next byte of client ,So, sends ACK=$101$

           Next client sends ACK  $501$

  • After that, two $100B$ packet sends by client.

           So, after first $100B$ packet server sends ACK $201$ and after next $100B$ packet server sends ACK $301$

So, at final stage client has ACK=$501$ and server has ACK=$301$

Related questions

3 votes
3 votes
1 answer
4
shane.126 asked Oct 13, 2017
5,171 views
TCP operates over a 40 Gbps link. If TCP uses the full bandwidth continuously, how long (in msec) would it take the sequence number to wrap around completely?