View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > TCP

From LQWiki

Jump to: navigation, search

TCP (Transmission Control Protocol) is a network communication protocol, used on the Internet, as well on many local networks. It is governed by a suite of protocols generally referred to as TCP/IP. The IP part refers to the transport part of the protocol, that is the part that moves data packets from one computer to another. A related protocol (which also relies on IP) is UDP.

The TCP/IP stack is similar to the OSI model, in that it consists of a stack of protocols which communicate with each other. The TCP protocol is operates at the transpot level of both the OSI model and the TCP/IP stack. Transport level protocols, such as TCP, are responsible for breaking data streams into packets, checking the reliablity of the connection, retransmitting packets if they don't arrive, and reassembling the packets back into a data stream.

TCP is a connection-oriented protocol. A related connectionless protocol is UDP. Under TCP, a small number of packets are transmitted. The source computer waits for an acknowledgement from the destination computer before sending anything more. UDP just blasts packets out. TCP is used for almost all traffic, since in most traffic, it is considered a bad thing for data to go missing in the middle. UDP is used for very small files (such as with TFTP) were the entire file can be retransmitted in case of data loss, or applications such as streaming audio or video where latency is more of an issue than data quality.

TCP (and UDP) allow for ports which allows data for different applications that are running on the same computer to get where they need to go. An application "listens" for data on a particular port. For example, if you have two browser session and a mail client open then data packets for all three of them will be arriving at the same network interface. The TCP protocol ensures that the packets get marshaled to the correct destination. Normally this is done by the TCP protocol, which is a connection-oriented protocol.

There is also a connectionless protocol that may be used on IP which is known as UDP. As in nearly all network traffic is handled by TCP, the name for this type of networking in general is normally referred to as TCP/IP irrespective of the fact that UDP/IP is sometimes used.

The IP, TCP and UDP levels only determine how data gets from A to B. A and B are correctly referred to as endpoints, but more commonly referred to as sockets which is the name programmers give to the interfaces they normally use to create and access these endpoints.

The content of these data packets is defined further by service protocols, such as www and ftp.


Personal tools