How Is Online Data Transmission Controlled?

by Carson
9 views

In online communication, data is transferred from one computer to another. In a perfect world, every bit of data is sent from one computer and received by the other perfectly. But this is often not the case, as many problems, such as problems with the data connection, accidental bit flips, or things like program crashes, can jeopardize this perfect model. Therefore, instead of sending a continuous bit stream, we need a way to ensure that all data is transferred from one computer to another. In this article, we’ll explore how computer networks do that.

Splitting the Data

The first step in ensuring the safe transmission of data is to split it up. Instead of sending the entire file as a stream of 0’s and 1’s containing the content, you first split it up into packets, which are about a few kilobytes long, depending on the service you are using.

A packet is a container of a short data stream, consisting of a header, a data stream, and a footer. The headers and footers have specific values that are recognized by the software reading these packets, such that it knows where a packet starts and ends, and where a packet is in the data stream. The header marks the beginning a packet, while the footer (or trailer) ends it.

The concept of packets will become very important on how data transmission is controlled, but first we will need to talk about the transmission control protocol (TCP).

Transmission Control Protocol (TCP)

The transmission control protocol (TCP) is a connection-based protocol that controls how data is sent. To start a connection, it uses a three-way handshake, which comprises three messages being sent. First, the client sends an initial synchronization (SYN) message to a server, starting to establish a connection. Then, the server sends an acknowledgment message and a synchronization message back to the client (SYN+ACK). After that, the client sends another acknowledgment message to the server (ACK) and then starts sending the packets. Essentially, both the client and server have synchronized and acknowledged the connection. This is shown in the diagram below:

The process of the TCP three-way handshake

This makes sure that the client and server can send and receive data reliably. But even in a connection, sometimes things could go wrong. This is why the TCP also organizes the packets in the transmission and sends them to the presentation layer. In case one or more of the packets are missing, the client or server would also ask for it to be resent. This is also the importance of packets — in case some of the data is missing, it doesn’t require the entire piece of data (which can sometimes be megabytes or even gigabytes!) to be re-downloaded. Instead, only the missing packet will be retransmitted.

The TCP is also responsible for closing a connection. When the client wants to terminate a connection, it sends a FIN message to the server, which responds with an acknowledgment. Then, the server sends another FIN message back to the client. Note that the FIN and ACK messages from the server are usually sent as two separate messages, not one. This makes it a four-way handshake instead of three, ending with an ACK message from the client back to the server to formally close the connection.

The process of the TCP four-way handshake

TCP/IP

That’s all there is in the TCP, but why does the name of that connection mechanism also include IP (the Internet Protocol)? That’s because the TCP is a high-level controller for the IP (which carries out data transmissions).

The IP provides an address for each computer in a network (the IP address) to allow computers to be identified and data to be sent. It is also responsible for routing packets — planning the journey that takes them from the origin to the destination.

But IP does not rely on formal connections — for example, it is not responsible for sending acknowledgment or synchronization messages. That’s where TCP comes in to control data transmission and ensure the data is safely transmitted.

Why Can’t You Send Continuous Data Streams?

But if you’re clever, you might ask, “Why can’t we just allow some room for error and send a continuous data stream? That would avoid all the time-consuming acknowledgments and checking.” And you would be right. Sometimes, it’s better to tolerate some error than sacrifice transmission speed. For instance, when you’re streaming videos, some missing pixels and frames every now and then might not affect the general viewing experience. But a slow streaming speed and a livestream that takes forever to load certainly do.

And therefore, other than TCP, there is also another protocol called the User Datagram Protocol (UDP). This protocol does not rely on establishing a formal connection (using SYN and ACK commands), and the server simply returns a stream of packets on request. This paradigm is usually used for actions that require a large data throughput, such as video streaming or playing some games that require fast communication of the users’ actions with other users.

The simple request-response connectionless architecture of the UDP

Conclusion

To conclude, data transmission is controlled with different methods on the Internet. There is the TCP protocol, which establishes formal connections. There is also the UDP, which does not rely on connections, and the IP, which supports all the data sending and receiving work. They are handled in the network and transport layers, in which data is fetched from deeper down the datalink or physical layer and sent towards the session and presentation layers to display the information. 

The seven-layer OSI networking model; the TCP and UDP lives on the transport layer, while the IP lives on the network layer.

References

  1. (n.d.). What Are IP & TCP. Retrieved April 30, 2024, from https://www.cloudflare.com/learning/ddos/glossary/tcp-ip/
  2. (2021, Oct 26). TCP 3-Way Handshake Process. Retrieved April 30, 2024, from https://www.geeksforgeeks.org/tcp-3-way-handshake-process/
  3. (2022, Apr 19). Why TCP Connect Termination Need 4-Way-Handshake? Retrieved April 30, 2024, from https://www.geeksforgeeks.org/why-tcp-connect-termination-need-4-way-handshake/
  4. (n.d.). What Is IP? Retrieved April 30, 2024, from https://www.javatpoint.com/ip

Related Posts

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.