edited by
643 views
1 votes
1 votes
When we have a segment of say 100 bytes and my last ACK number is assume 4000,

Now my current sequence number will be (4000-4099) for 100 bytes segment. This is what we generally use a notation.

But in one segment we have only one field  as sequence number.So how can we specify Range?
 

Ip has length fields in Ipv4/V6/UDP but why not in TCP?
edited by

2 Answers

0 votes
0 votes
well the tcp udp packet are sent after encapsulating in IP datagram..therefore total length not given in case of TCP...whenever you come across such a question definitely the total length and header leghth of IP would be given subtract it and you will get the tcp toatal length....
0 votes
0 votes

There is a procedure of 3-way handshake which is for the purpose of establishment of connection in case of TCP , now in that procedure, the different parameters are exchanged b/w server and client and the random initial sequence number is also communicated.[If the SYN flag is set (1), then this is the initial sequence number. The sequence number of the actual first data byte and the acknowledged number in the corresponding ACK are then this sequence number plus 1.]

Protocols operations : 

LISTEN

(server) represents waiting for a connection request from any remote TCP and port.

SYN-SENT

(client) represents waiting for a matching connection request after having sent a connection request.

SYN-RECEIVED

(server) represents waiting for a confirming connection request acknowledgment after having both received and sent a connection request.

ESTABLISHED

(both server and client) represents an open connection, data received can be delivered to the user. The normal state for the data transfer phase of the connection.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now after completion of sending the segment the Tcp invokes another segment which is for the closing of connection.FIN (1 bit) is set to 1 which indicates last bit from sender.

FIN-WAIT-1

(both server and client) represents waiting for a connection termination request from the remote TCP, or an acknowledgment of the connection termination request previously sent.

FIN-WAIT-2

(both server and client) represents waiting for a connection termination request from the remote TCP.

CLOSE-WAIT

(both server and client) represents waiting for a connection termination request from the local user.

CLOSING

(both server and client) represents waiting for a connection termination request acknowledgment from the remote TCP.

LAST-ACK

(both server and client) represents waiting for an acknowledgment of the connection termination request previously sent to the remote TCP (which includes an acknowledgment of its connection termination request).

TIME-WAIT

(either server or client) represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request. 

CLOSED

(both server and client) represents no connection state at all.

Reference :https://en.wikipedia.org/wiki/Transmission_Control_Protocol

edited by

Related questions