Communication Networks/TCP and UDP Protocols

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Contents

[edit] TCP and UDP

The TCP and UDP protocols are 2 different protocols that handle data communications between terminals in an IP network (the internet). This page will talk about what TCP and UDP are, and what the differences are between them.

In the OSI model, TCP and UDP are "Transport Layer" Protocols.

[edit] Connection-Oriented vs Connectionless

[edit] TCP

TCP stands for Transmission Control Protocol, and is one of the most popular protocols on the internet. TCP is a "Connection-Oriented" transmission protocol, which means that it establishes a dedicated connection between 2 computers before sending data. TCP assigns each connection on a given computer a locally unique number called a "Port" number. Each TCP connection can be uniquely defined in the whole world by its combination of IP address and Port information for both the client and the server. In TCP, addresses are usually written as:

IPAddress:Port

When a terminal receives a TCP transmission, it sends back a receipt called an "Acknowledgment" (ACK) to the sender. The sender waits for the ACK, and if it doesn't receive an ACK after a certain amount of time, the sender will resend the information. In this way, TCP tries to provide for a guarantee: If it doesn't succeed the first time, try try again.

Common Examples of TCP in action are web-browsers, and the HTTP protocol.

[edit] TCP Headers

[edit] UDP

Unlike TCP, UDP doesn't establish a connection before sending data, it just sends. Because of this, UDP is called "Connectionless". UDP packets are often called "Datagrams". An example of UDP in action is the DNS service. DNS servers send and receive DNS requests using UDP.

[edit] UDP Headers