Kbase P73432: TCP Features
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/5/2009 |
|
Status: Unverified
GOAL:
TCP Features
FIX:
An end-to-end connection actually extends up through the TCP layer to the application that is using the network services. Note the ports in Figure T-1. The most common applications such as HTTP (Web services) and FTP (File Transfer Protocol) use ports that are "well known," so clients can connect to them to access a particular service without having to query on what port that service is running. For example, Web browsers automatically connect with port 80, FTP uses port 21, and Gopher use port 70.
A typical session involves sending packets from a source IP address and port to a destination IP address and port. The combination port and IP address is called a socket. You can think of a socket as the end of a connection. If a connection is like a circuit or wire, then the socket is the end of that wire, much like a telephone exists at the end of a voice circuit. Packets flow across networks between sockets. These packet flows can be identified by an IP address/port number combination.
TCP Segment Properties
A TCP segment is the packet of information that TCP uses to exchange data with its peers (TCP running on other hosts). The segment is what gets encapsulated into an IP datagram and transmitted across the network.
Segments have a 20-byte header and a variable-length Data field. The fields of the TCP segment are described here. Keep in mind that either station may send a segment that contains just header information and no data to provide the other system with session control information, such as an acknowledgment that a segment was received.
Source and Destination Ports
Contains the port numbers of the sockets at the source and destination sides of the connection.
Sequence Number
This field contains a sequential number for the receiver, which is a sequential number that identifies the data in the segment and where it belongs in the stream of data that has already been sent. The receiver can use the sequence number to reorder packets that have arrived out of order or to determine that a segment is missing. This field is used by the sliding-window algorithm.
Acknowledgment Number
This field is used by the receiver to indicate to the sender in a return message that it has received a previously sent packet. The number in this field is actually the sequence number for the next segment that the receiver expects. That number is calculated by incrementing the value in the Sequence Number field. This field is used by the sliding-window algorithm.
TCP Header Length
Specifies the length of the header.
Codes
This field is reserved.
URG (urgent)
This bit is set to 1 if there is information in the Urgent Pointer field of the header.
ACK (acknowledgment)
If ACK is set to 1, it indicates that the segment is part of an ongoing conversation and the number in the Acknowledgment Number field is valid. If this flag is set to 0 and SYN is set to 1, the segment is a request to establish a connection.
PSH (push)
A bit set by the sender to request that the receiver send data directly to the application and not buffer it.
RST (reset)
When set, the connection is invalid for a number of reasons and must be reset.
SYN (synchronize)
Used in conjunction with ACK to request a connection or accept a connection. SYN=1 and ACK=0 indicates a connection request. SYN=1 and ACK=1 indicates a connection accepted. SYN=0 and ACK=1 is an acknowledgment of the acknowledgment.
FIN (finish)
When set, this bit indicates that the connection should be terminated.
Sliding Window Size
Indicates how much space is avai.lable in the receiver's buffers. The field is used by the receiver to inform the sender that it needs to speed up or slow down its transmissions. If the receiver wants the sender to stop transmitting altogether, it can return a segment with 0 in this field.
Checksum
Provides an error-checking value to ensure the integrity of the segment.
Urgent Pointer
This field can be used by the sender to indicate a location in the data where some urgent data is located.
Options
A variable set aside for special options.
Data
A variable-length field that holds the messages or data from applications.
These many different fields are used to set up and control connections, as well as to provide the reliability services that guarantee data delivery..