SPONSORED LINKS
 
 
Google
 
     END-TO-END SERVICE AND DATAGRAMS

  END-TO-END SERVICE AND DATAGRAMS
TCP is called an end-to-end protocol because it provides a connection directly from an application on one computer to an application on a remote computer. The applications can request that TCP form a connection, send and receive data and close the connection.
The connections provided by TCP are called virtual connections because they are achieved in software. Indeed, the underlying Internet system does not provide hardware or software support for connections. Instead the TCP software modules on two machines exchange messages to achieve the illusion of a connection.
TCP uses IP to carry messages. Each TCP message is encapsulated in an IP datagram and sent across the Internet. When the datagram arrives on the destination host, IP passes the contents to TCP. Note that although TCP uses IP to carry messages, IP does not read or interpret the messages. Thus, TCP treats IP as a packet communication system that connects hosts at two endpoints of a connection, while IP treats each TCP message as data to be transferred.
TCP-an end-to-end transport protocol.

From Figure 11.2, it is evident that TCP views IP as a mechanism that allows TCP software on a host to exchange messages with TCP software on a remote host. The figure also shows that TCP software is needed at each end of a virtual connection, but not on intermediate routers. From TCP's point of view, the entire Internet is a communication system that can accept and deliver messages without changing or interpreting their contents.
  TRANSMISSION CONTROL PROTOCOL
TCP provides a connection-oriented user-to-user byte stream service. This means it provides a logical connection between two sites and is capable of transmitting a sequence of bytes between them. It divides a byte stream into a sequence of segments and sends them to the destination via a variation on a sliding window flow control protocol.
A good way to begin a description of TCP operation is to examine the TCP header format. TCP uses only a single type of protocol data unit, called a TCP segment. The header is shown in Figure 11.3. Because one header must serve to perform all protocol mechanisms, it is rather large, with a minimum length of 20 octets.

Figure 11.3 TCP and UDP headers. The fields are as follows:
Source port (16 bits): Source TCP user specifies the application sending the segment.
Destination port (16 bits): Destination TCP user identifies the application to which the segment is sent.Sequence number (32 bits): Each byte in the stream that TCP sends is numbered. Sequence number of first data octet in this segment except when SYN (synchronize the sequence number) flag is set. If SYN is set, this field is the initial sequence number (ISN) and the first data octet is ISN+l.
Acknowledgement number (32 bits):    A piggybacked acknowledgement. Contains the sequence number of the next data octet that the TCP entity expects to receive.
Header length (4 bits):   Specifies the size of the TCP header as a multiple of four bytes. Number of 32-bit words in the header.
Reserved (6 bits):    Reserved for further use. Flags (6 bits): These are:
• URG: Urgent pointer, field significant
• ACK: Acknowledgement, field significant • PSH: Push function
• RST: Reset the connection
• SYN: Synchronize the sequence number • FIN: No more data from sender.
Window (16 bits):    Flow control credit allocation (in octets). Contains the number of data octets beginning with the one indicated in the acknowledgement field that the sender is willing to accept.
Checksum (16 bits):  Used for transport layer error detection.
Urgent pointer (16 bits):  Points to the last octet in a sequence of urgent data. This allows the receiver to know how much urgent data is coming.
Options (variable): Specifies optional features.
The sequence number and acknowledgement number are bound to octets rather than the entire segments. For example, if a segment contains sequence number 1001 and includes 600 octets of data, the sequence number refers to the first octet in the data field; the next segment in logical order will have sequence number 16001. Thus, TCP is logically stream oriented: it accepts a stream of octets from the user, groups them into segments as it sees fit, and numbers each octet in the stream.
The PUSH and URGENT flags implement two TCP services:
(1) Data stream push: Ordinarily, TCP decides when sufficient data have accumulated to form a segment for transmission. The TCP user can require TCP to transmit all outstanding data up to and including that labeled with a PUSH flag. On the receiving end, TCP will deliver these data to the user in the same manner. A user might request this if it has come to a logical break in the data.
(2) Urgent data signaling:      This provides a means of informing the destination TCP user that significant or Urgent data are in the upcoming data stream. It is up to the destination user to determine approximate action.
A TCP user issues a SEND command to pass a block of data to TCP, which places the data in the send buffer. If the PUSH flag is set, any outstanding data in the send buffer, including the data that have just been submitted, are immediately sent out in one or more segments, with the last segment marked with the PUSH flag. If the PUSH flag is not set, TCP may hold the data in the send buffer and send the data out in one or more segments as convenient. For example, TCP may wait until more data are submitted in order to send larger, more efficient segments. The user may associate an URGENT flag with the data in a SEND command. In such a case, the resulting segment is marked with an URGENT flag.
The data in segments arriving across a connection to a TCP entity are similarly stored in a deliver buffer associated with that connection. If the incoming data are marked with a PUSH flag, the data together with any data currently in the deliver buffer, are immediately submitted to the destination user in a RECEIVE command. If the incoming data are not marked with a PUSH flag, TCP delivers the data as convenient. For example, TCP may wait until more incoming data accumulate to minimize system interrupts. If the incoming data are marked with an URGENT flag, the user is signalled that urgent data are present.
The checksum field applies to the entire segments plus a pseudoheader prefixed to the header at the time of calculation (at both transmission and reception). The pseudoheader includes the following fields from the IP header: source and destination Internet address and protocol, plus a segment length field. By including the pseudoheader, TCP protects itself from mis-delivery by IP. That is, if IP delivers a segment to the wrong host, even if the segment contains no bit errors the receiving TCP entity will detect the delivery error. The TCP checksum is calculated as the 16-bit ones complement addition of all 16-bit words in the pseudoheader. The checksum field itself is initialized to a value of zero.
16-bit option may only be used in the initial connection request segments; it specifies the maximum segment size (in octets) that will be accepted on this connection.

BACK

SPONSORED LINKS