Saturday, February 9, 2008

Sequence number and Acknowledgment number

The Sequence number, or sequence number, serves to posizionare the payload of segment TCP to the inside of the data traffic.

TCP expects to receive the successive segment to the last segment received in order, that is that one whose number of sequence is equal to the number of sequence of the last segment received in order more the dimension of the payload of the same segment (that is of its Given field).

In reception, TCP it controls if the received number of sequence is that waited for one and in affirmative case it can directly send the payload to the process of applicativo level and to free the own ones buffer.

If instead it receives a number of greater sequence of that attending, deduces that or more previous segments to it have gone lost or delays to you from the level of below net. Therefore, memorizza temporary in buffer a payload of the segment for being able to deliver it to the applicativo process after to have received and delivered also to all those previous ones. From the applicativo process point of view, therefore, the data will arrive in order even if the net has altered per.qualsiasiasi.motivo this order, realizing therefore requirement of the tidy delivery of the data.

If finally the received number of sequence is inferior to that attending, the segment comes considered a duplicate of one already received and already sended to the applicativo layer, and therefore discarded. This allows to realizethe elimination of duplicates you of net.

In every segment moreover, it comes sended a Acknowledgment Number, or number of reply. The number of present reply in a segment regards the data traffic in the opposite direction. In particular, the number of sended reply gives To to B is equal to the attended number of sequence gives To and, therefore, it regards the data traffic from B to To.

Protocol TCP adopts politics of cumulative Confirmation, that means simply that the arrival of reply number indicates to receiving that the sender has received and correctly forwarded to just the applicativo process, the having segment number of equal sequence to the number of indicated reply (-1) and also all the precendenti segments to it. Therefore, in transmission, TCP temporary maintains a copy of all the data sendes to you but not still it finds to you. When it receives a number of reply for a segment, it deduces some that all the data previous to that number have been receipts correctly and therefore free just buffer from these data.

For every sended segment, TCP starts a timer, said timer of rebroadcast RTO (Retransmission Time Out). If the segment does not receive a ACK before that the timer it expires, TCP assumes that all the transmitted segments beginning from that one have gone lost and therefore ritrasmette them.

You notice yourself that, in TCP, the mechanism of the reply numbers it does not allow the receiver to communicate to the emitter that a segment has been lost, but some of the successes have been receipts (mechanism to Acknowledgment Number denied to you), therefore it is possible that for a single package lost some many must ritrasmessi. This not optimal behavior is compensated from the semplicità of the protocol. This technique is said Go-Back-N; the alternative, that is to plan the protocol of transport so that only the packages effectively lost come ritrasmessi, is said Selective Repeat (selective repetition); I use but of some optional fields I affixed allows to you I use it of the selective repetition.

The numbers of reply and the relati ones timer allow to you therefore to realize the reliable delivery, that is to guarantee that all the data send to you are delivered even if some packages they come lost from the net.

1 comment:

ARUSHI said...

Good info. Update ur profile. Grading done