The network service can fail to deliver a segment. The network can potentially deliver duplicated segments, and can deliver segments out of order. TCP buffers or discards out of order or duplicated segments appropriately, using the byte count for identification. The TCP timeout algorithm uses observed round trip times, and measures of their variability, to calculate a continuously updated best estimate of when to resend. See the tutorial for a discussion on this.
Sequence Numbers identify last byte of data sent and received.
To do this, it defines an abstract address called a port number . Two processes can communicate by agreeing on the port numbers they will use for communications. By definition, such a process is called a server . A client process which needs to connect to the server asks its local TCP software to allocate an unused port number and establish the connection. Once the connection is established, the two processes can communicate.