retagged by
6,810 views
10 votes
10 votes

Consider the three-way handshake mechanism followed during $\text{TCP}$ connection establishment between hosts $P$ and $Q$. Let $X$ and $Y$ be two random $32$-bit starting sequence numbers chosen by $P$ and $Q$ respectively. Suppose $P$ sends a $\text{TCP}$ connection request message to $Q$ with a $\text{TCP}$ segment having $\text{SYN}$ bit $=1$, $\text{SEQ}$ number $=X$, and $\text{ACK}$ bit $=0$. Suppose $Q$ accepts the connection request. Which one of the following choices represents the information present in the $\text{TCP}$ segment header that is sent by $Q$ to $P$?

  1. $\text{SYN}$ bit $=1$, $\text{SEQ}$ number $=X+1$, $\text{ACK}$ bit $=0$, $\text{ACK}$ number $=Y$, $\text{FIN}$ bit $=0$
  2. $\text{SYN}$ bit $=0$, $\text{SEQ}$ number $=X+1$, $\text{ACK}$ bit $=0$, $\text{ACK}$ number $=Y$, $\text{FIN}$ bit $=1$
  3. $\text{SYN}$ bit $=1$, $\text{SEQ}$ number $=Y$, $\text{ACK}$ bit $=1$, $\text{ACK}$ number $=X+1$, $\text{FIN}$ bit $=0$
  4. $\text{SYN}$ bit $=1$, $\text{SEQ}$ number $=Y$, $\text{ACK}$ bit $=1$, $\text{ACK}$ number $=X$, $\text{FIN}$ bit $=0$
retagged by

5 Answers

Best answer
18 votes
18 votes

Host $P$ sends the first SYN packet with $SEQ$ number $= X$,  $SYN$ flag $= 1$ and $ACK$ flag $=0$ as it’s a connection request.

Host $Q$ will reply back with a SYN packet and acknowledging the arrival of $P’s$  SYN packet.

Host $Q$ will send a packet with $\textbf{SYN flag =1}$$\textbf{SEQ number = Y}$ ,  to synchronize and establish the connection,

and $\textbf{ACK flag = 1}$ to acknowledge the $P’s$ SYN packet, with $\textbf{ACK number = X+1}$ because ACK number denotes the sequence number of next expecting Byte.

Then $P$ will reply back with an $ACK$ packet to complete the three-way handshake. (not asked here)

$FIN$ flag is used to terminate the connection, and will not be used here, $\textbf{FIN flag = 0}$.

Hence C is correct.

selected by
7 votes
7 votes
SYN bit is used for Synchronize Sequence Number.

FIN bit used for End of transmission.

ACK bit used whenever you’re sending Acknowledgement of received Data.

 

Q accepted the connection request of P, So Q should send the acknowledment.

P sent the Data with Sequence number X, So Q acknowledge it as X+1. i.e., My requirement is X+1 now.

ACK bit = 1, and ACK = X+1.

 

Since it is three way hand-shaking, when P sent as SYN=1, then Q need to sent SYN=1 and FIN=0.

after that, Whenever Someone wants to end the transmission, then they will send FIN=1.

 

Option C is correct.
7 votes
7 votes

There are three phase in TCP data transfer protocol

  1. Connection Establishment
  2. Data Transfer
  3. Connection Termination

Connection Establishment phase look like this

There are more TCP/IP  which i not mention 

1 votes
1 votes
Syn bit is Synchronization bit which will be 1 for the initial transmissions from both sides.

SEQ number:- Will be the number which Q wants to send to P so It will be Y.

ACK bit:- It will be 1 because Q received seq number X from P.

Ack number:- The number which Q expect from P in the next transmission so will be X+1.

FIN bit will be 0 Because there is no initiation for ending the connection.

So Answer is:- C
Answer:

Related questions

31 votes
31 votes
5 answers
4
Arjun asked Feb 18, 2021
7,674 views
Gauri said that she can play the keyboard __________ her sister.as well asas better asas nicest asas worse as