Internet Protocols (TCP/IP and UDP)

Internet Protocols (TCP/IP and UDP)

Internet traffic is composed of data transfers — lots of them — between servers and devices. That data is transferred via two protocols: TCP and UDP.

Introduction

A network protocol sets rules that govern how devices transmit data on a network. It enables devices to communicate with each other, even if they have different hardware, software, or internal processes. For example, when you study at your school, you follow certain rules. If you break these rules, you step outside this particular protocol and create your own new protocol. The Internet Protocol works similarly; the internet has its own protocols. Protocols like these are followed everywhere, just like some internet protocols.

  • Visible data for everyone

  • Network tab visibility

There are more than 7,000 protocols globally, and their number is still increasing. some examples: TCP, IP, UDP, FTP

What is the OSI Model?

OSI stands for Open Systems Interconnection and provides a conceptual framework for how applications communicate over a network.

The model includes seven layers, which help users identify what happens within a networking system. Read on as we explain the OSI Model.

We typically describe the OSI model layers from the top layer down.

We describe the layers as Application, Presentation, Session, Transport, Network, Data Link, and Physical.

The seven layers of the Open Systems Interconnection (OSI) model are:

  • Physical: This layer transmits signals over media using the actual hardware.

  • Data Link: This layer translates binary into signals and allows upper layers to access media.

  • Network: This layer determines how data is sent to the receiving device.

  • Transport: This layer manages the transmission of data between nodes, including error-checking and data recovery.

  • Session: This layer creates communication channels between devices and determines which packets belong to which files.

  • Presentation: This layer prepares data for the application layer, translating application formatting to network formatting and vice versa.

  • Application: This layer includes protocols designed for end-users, such as web browsers and email clients.

TCP Protocol

TCP (Transmission Control Protocol) is one of the main protocols of the TCP/IP suite. It sits between the Application and Network Layers and provides reliable delivery services. Transmission Control Protocol (TCP) ensures reliable and efficient data transmission over the internet. TCP uses a 3-way handshake to communicate from client to server. When the client sends a request, TCP first sends a SYN-1 request, similar to calling someone and saying hello to confirm you are available. The opposite side responds, "Yes, I can hear you," just like the server sends back a response ACK-1 and a SYN-200 to confirm that the SYN-1 is delivered. The client then sends back an ACK-200 to the request, and the connection is established. Then the request-response model starts.

UDP Protocol

UDP (User Datagram Protocol) is one of the main protocols in the TCP/IP suite. It sits between the Application and Network Layers, offering connectionless and faster delivery services. Unlike TCP, UDP does not ensure reliable delivery, making it suitable for situations where speed is more important than reliability, such as video streaming, gaming, and VoIP.

UDP doesn't use a 3-way handshake or any connection setup. Instead, it operates in a fire-and-forget manner, where data packets (called datagrams) are sent directly to the recipient without confirming delivery or order.

When the client sends a request, UDP simply sends the data packet to the server, like throwing a message in a bottle—there's no delivery confirmation. The server processes the packet if it arrives and may or may not send a response back, depending on the application's needs.

UDP works by firing data from server to device until all data is transferred or the connection is terminated.

TCP VS UDP

TCPUDP
Requires an established connection before transmitting dataNo connection is needed to start and end a data transfer
Use 3-way handshakedon't use a 3-way handshake
Over head highOver head low
Delivery is guaranteedDelivery is not guaranteed
Arrange data before processingNo arrangement of data before processing, delivered directly.
Reliable high, time highReliable low, time taken low
No data packet lossChance of data packet loss

Which protocol is better: TCP or UDP?

Overall, TCP and UDP are both useful protocols, so to think in terms of TCP vs UDP is a bit misleading. But depending on the type of data transfer, TCP or UDP might be better for the job. Here are some examples:

TCP is best for:

  • Email or texting

  • File transfers

  • Web browsing

UDP is best for:

  • Live streaming

  • Online gaming

  • Video chat

What is an IP Address?

An IP address, or Internet Protocol address, is a unique string of numbers assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves as an identifier that allows devices to send and receive data over the network, ensuring that this data reaches the correct destination.

Conclusion

This article explores popular protocols for interacting between devices and software across networks. In reality, hundreds of protocols are used by just your PC alone, each designed for specific tasks. Details about a protocol’s tasks and operating principles can be found in a document known as an RFC Standard.