Home |
Sockets, IP, and Port Addresses Blocking and Non-Blocking Sockets TCP Data Transfer |
TCP Data TransferEach data byte sent to a remote host is numbered (i.e. the sequence number in the packet specifies the number of the first data byte in the packet). Upon receipt of data, a host acknowledges the data by sending a reply packet with the acknowledge field set to the sequence number of the next data byte expected (i.e. the sequence number of the next data byte which has not been received). The acknowledge value states that every byte preceding this byte has been received; therefore, if an out of order packet is received, that packet cannot be acknowledged until all previous packets have been received. An acknowledgment packet is sent for every packet received unless delayed ack is enabled (see TCP Delayed Ack). Please note that the Sync bit and FIN packets are counted as a byte, i.e. the sequence number is incremented by 1 for the Sync bit and 1 for the FIN bit.
|