TCP/IP is an integral part of the internet and how it works, but few people actually know what TCP/IP is in the first place. If you want a deeper understanding of the technology that connects the planet, you’re in luck, cause we’ve put this guide together on what it is and how it all works.
What is TCP/IP?
Before delving into how TCP/IP actually works, it might help to have a brief understanding of what it is. As the name implies, there are two parts to TCP/IP — TCP, and IP.
TCP, also known as Transmission Control Protocol, is the basic communication language of the internet. It’s basically responsible for taking chunks of data — which could be text, images, videos, and so on — compiling them into smaller packets of data, and then sending them to where they can be received by another TCP layer.
IP, also known as Internet Protocol, is responsible for defining exactly where data needs to be sent and ensuring that packets of data are sent and received to the same place. In other words, IP is basically the internet version of a GPS.
Of course, TCP/IP isn’t the only internet transfer protocol. Another is called UDP, and it replaces TCP in particular circumstances. Instead of using signals to tell senders that data has been received, UDP just sends the data, resulting in a slightly smaller packet. For that reason, it’s sometimes used in applications like gaming and video communications.
So how do TCP and IP work together? Well, in simple terms, TCP is related to the actual data, while IP is related to where that data is sent.
Of course, things aren’t exactly that simple. We’ll take a deeper look at TCP/IP in the next section.
So how exactly does TCP/IP work?
TCP/IP goes beyond simply two layers — in reality the protocol uses four layers. Here’s a quick outline of those layers.
- The Link Layer is used to physically connect networks using hardware like a server.
- The Internet Layer connects different hosts together on different networks.
- The Transport Layer is used to resolve host-to-host connections.
- The Application Layer makes sure that applications on a network are able to communicate.
The Application Layer
Let’s start with the Application Layer, which ensures communication between different programs and applications. The Application Layer itself uses a range of protocols to ensure communication — examples of these include HTTP, SMTP, FTP, and so on. You’ve probably heard of at least some of those. With SMTP, for example, when your email client wants to download an email from a hosted server, it requests the task from the Application Layer, which uses the SMTP protocol to complete the request.
The Application Layer completes these requests through what are called Ports, and most applications always use the same port. That port number is what allows the transport protocol, or TCP, to know exactly which application should be used to deliver the data. In other words, TCP knows that port 25 is used for the SMTP protocol, which delivers mail to your email client.
The Transport Layer
When data is being uploaded, it’s received by the Application Layer and is then divided by the Transport Layer into a number of different data packets. Conversely, when data is being downloaded, it’s sent from the Internet Layer in different packets, after which the Transport layer arranged those packets in the correct order, after which it sends an acknowledgement signal to the transmitter alerting it that the data arrived at its destination.
The Internet Layer
Next up is the Internet Layer. To understand the Internet Layer, you need to understand that your computer is identified through the internet using what’s called an IP address. The Internet Layer is where the target IP address and the source IP address is added in a header to packets of data, so the data ends up in the right place.
The Link Layer
Last but not least is the Link Layer, which is where data generated by the Internet Layer is sent. The Link Layer largely depends on the kind of network the computer is connected to.
The Link Layer is actually built up of three sub-layers itself. The first is the Logic Link Control, or LLC, which adds information to the data describing which protocol the data should be transmitted through. The second is called the Media Access Control layer, or MAC layer, and it is in charge of adding the source MAC address (address of a physical network card) and the target MAC address. The third and final layer is the physical layer, which converts the frame generated by the MAC layer into either electricity (if a wired network is being used), or electromagnetic waves (if it’s being transmitted over a wireless network).
As you can see, TCP/IP is actually a pretty complex protocol, but it’s instrumental in how we use the internet today. All of the layers really work together to make it happen. Of course, things can always get even more complex, but this should serve as a good guide on the basics of TCP/IP.