Layers Of TCP/IP Suite
We all use Internet on day-to-day basis for texting, calling, watching videos and stuff. But have you ever wondered what happens under the hood? Well, in this blog let's learn about everything in detail.
Let's say you are texting your friend, the text you send goes through 5 different layers to leave your device and another 5 layers before your friend sees it. These texts are split into tiny packets of data that travel all the way to the receiver. Every packet of data should follow certain protocols/rules while travelling across the globe.
What is a Network?
Communication amongst multiple devices is a Network. Communication amongst multiple networks is the Internet. There are 2 networking models.
TCP/IP model
OSI model
TCP/IP model
TCP/IP model serves as a backbone to our modern internet. TCP stands for Transmission Control Protocol and IP stands for Internet Protocol. It consists of 5 layers. Physical Layer, Data Link Layer, Network Layer, Transport Layer and Application Layer. Some of the sources mention 4 Layers too, i .e Data Link Layer and Network Layer are together called Internet Layer. This model was developed by United States Department Of Defense.
Physical layer:
It is the actual physical connection which generates data at one end and gets received at the other end. Here is where the ethernet cables, co-axial cables, optical fibers come into act. In this layer, the data is completely split into bits.
Data Link Layer:
This is responsible for error-free data transmission. It deals with the encoding and decoding of the data. This layer is further divided into two sub layers. Network devices like switches are used in this layer.
Logical Link Control
Media Access Control
Logical Link Control(LLC):
This layer basically checks the errors and deals with the data multiplexing stuff.
Media Access Control(MAC):
Every device in the internet has a unique MAC address. It just acts like a name for the devices. In this layer the data bits are called Frames. Packets from the network layer(which we will be studying further) are divided into frames and further divided into bits and sends these bits to the physical layer.
Data link layer is also responsible for the Abstraction. Abstraction is a process of hiding the complexity of it's upper layers. Because, there is no need for the physical layer to know what protocols are used in the upper layers to send bits.
Network Layer:
This layer plays one of the key roles in the data transmission. This is where the routers come into play. Till the data link layer, data can be transmitted in a single network. But what if we want to share data to a different network? Switches have no role in transmitting data to a different network. This is where the routers step up and have our back! Routers have their own routing tables in which they store the IP addresses and their associated MAC addresses. These tables are also called ARP Tables. ARP stands for Address Resolution Protocol. This protocol is used to resolve the IP adresses to their respective MAC addresses. Routers also have several columns in it's routing table, but we are not going deeper in this blog.
Transport Layer:
This Layer is responsible for managing traffic. When you request for a webpage,you expect the browser to provide you with the data of a webpage and when you e-mail someone you expect the mail to be sent to the mail server and then to their inboxes and not to a web server. How is this happening? Because, the Transport layer segregates the traffic to the respective servers. Every device has more than 65000 ports. Ports are something which takes a certain type of traffic. A website holds ports 80 and 443, DNS holds port 53. These are just the default port numbers,but in general, any port can be used to send a particular traffic.
There are predominantly 2 protocols in this layer,
Transmission Control Protocol(TCP)
User Datagram Protocol(UDP)
Application Layer:
This is the final layer of the TCP/IP suite. This layer is responsible for providing the content without any loss. This layer is also responsible for reliable session establishment and presenting the data to the users. Some of the protocols used in this layer are HTTP,HTTPS,DNS,SSH etc.
Every layer encapsulates the payload with it's header while sending the data, this data is decapsulated at the receivers' end. Encapsulation and Decapsulation are used to reach the right destination without errors and data loss.
The OSI model is just a reference model. It stands for Open Systems Interconnection. This model has 7 layers. One of the main differences between TCP/IP and OSI is that the presentation and the session layers are 2 different layers in the OSI model but combined in the Application Layer in the TCP/IP model. However,it's just a reference model but made a revolution in the world of Internet.