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.

TCP Protocol

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 Protocol

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.

HTTP Protocols

The HTTP (Hypertext Transfer Protocol) is an essential protocol used for transmitting data over the internet. Here are its essential characteristics:
  1. Stateless: Each HTTP request from a client to server is independent. The server does not store any state about the client. This means each request must contain all the information necessary to understand and process it.
  2. Connectionless: After making a request, the client disconnects from the server and waits for a response. The server processes the request and re-establishes the connection to send the response.
  3. Resource Identification: HTTP uses Uniform Resource Identifiers (URIs) to identify resources. These resources can be documents, images, files, and other types of content.
  4. Request-Response Model: The protocol works on a request-response model where the client sends an HTTP request to the server, and the server sends back an HTTP response.
  5. Methods: HTTP defines several methods indicating the desired action to be performed on the resource. Common methods include:
    • `GET`: Retrieve data from the server.
    • `POST`: Send data to the server.
    • `PUT`: Update a resource on the server.
    • `DELETE`: Remove a resource from the server.
    • `HEAD`: Similar to `GET` but only retrieves the headers and not the body.
    • `OPTIONS`: Describes the communication options for the target resource.
  6. Headers: HTTP requests and responses include headers that provide metadata about the request or response. These headers can include information about content type, length, encoding, and more.
  7. Status Codes: HTTP responses include status codes that indicate the outcome of the request. These codes are grouped into categories:
    • `1xx`: Informational responses.
    • `2xx`: Successful responses (e.g., `200 OK`).
    • `3xx`: Redirection messages (e.g., `301 Moved Permanently`).
    • `4xx`: Client errors (e.g., `404 Not Found`).
    • `5xx`: Server errors (e.g., `500 Internal Server Error`).
  8. Content Negotiation: HTTP supports content negotiation, allowing clients and servers to agree on the best format for the response (e.g., JSON, XML, HTML).
  9. Security: HTTP can be secured with HTTPS (HTTP Secure), which uses SSL/TLS to encrypt the data transmitted between the client and server, ensuring privacy and data integrity.
  10. Extensibility: HTTP is designed to be extensible, allowing for custom methods, headers, and status codes to be defined as needed.
These characteristics make HTTP a flexible, reliable, and widely-used protocol for web communication.
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.

SEMrush Software4