in Computer Networks edited by
1,692 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
in Computer Networks edited by
by
1.7k views

4 Comments

It is because you need ack for data which was sent.
0
0

yes got

chk this one

https://gateoverflow.in/114995/networking

I think 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

rt?

0
0

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

In the question, it is given that Client chose Seq no as 100, so it will not send from seq any 1. Instead In connection establishment state, Client will send seq no 100, server responds this packet and send ack 101, now from this point client will use seq no 101 for pckt transmission not 1.

And moreover it is given in the question, that client is sending two packets not three.

0
0

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 vote
1 vote
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!

3 Comments

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.
0
0

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)

1
1
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
0
0
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