Internet Services  «Prev  Next»

Lesson 4 TCP/IP and UDP/IP
Objective Relate TCP and UDP protocols to IP.

Relate TCP and UDP Protocols to IP and Linux Internet Services

Internet Protocol is a simple protocol, and by itself, is insufficient for most users' demands. To meet these demands, two other protocols work in conjunction IP:
  1. (TCP) Transmission Control Protocol: a set of rules that governs the delivery of data over the Internet or other network that uses the Internet Protocol, and sets up a connection between the sending and receiving computers.
  2. (UDP) User Datagram Protocol:[1] UDP (User Datagram Protocol) is an alternative communications protocol to Transmission Control Protocol (TCP) used primarily for establishing low-latency and loss tolerating connections between applications on the Internet.


Any applications that require reliable data transfer use TCP. TCP keeps track of individual IP packets as they arrive. Once all packets arrive, TCP assembles them into a single unit. TCP makes sure the packets are arranged in the sent order before giving the data to the operating system.
If packet delivery or corruption errors occur with TCP transitions, the sending host will either receive a negative acknowledgement (a NACK) or it will not receive an acknowledgment (an ACK). Either way, the source host will re-transmit the TCP packet to the destination host.
TCP is a connection-oriented protocol. This means that TCP constantly checks the status of both the sender's and the receiver's connections, which flows alongside the transmitted data, for any inconsistencies.
Irregularities signal a problem with the connection; when TCP detects any connection inconsistencies, it takes steps to correct the problem.


UDP is often used by applications that require rapid transmittal of data and don't mind if a few packets are lost. For example, the Domain Name System (DNS), trivial file transfer protocol (TFTP), and Internet multi-media applications typically use UDP.
UDP provides a wrapper around IP that allows the operating system to verify the packet arrived intact by computing a checksum[2] and comparing it to the sent checksum. Unlike TCP, UDP is a connection-less protocol. It does not use status information to take corrective action. Because of this lack of connection, UDP is often referred to as an "unreliable" protocol.
The next lesson defines port numbers.

[1]User Datagram Protocol (UDP): Transfers data without first making a persistent connection between two systems the way TCP does. Sometimes called unreliable transport.
[2]Checksum: A value computed from a quantity of data and transmitted alongside the data. The receiver can verify the data's integrity by computing the checksum again and comparing the newly computed value to the transmitted one.