How internet works? pt - 2 (OSI MODEL)

How internet works? pt - 2 (OSI MODEL)

Created
Jun 19, 2024 05:50 PM
Tag
In the previous article, we explored the fundamental role of Internet Service Providers (ISPs) in connecting our devices to the vast network of the internet. We talked about the physical infrastructure that facilitates this connection, such as cables and routers. Now, let's delve deeper into how information travels across this network, from your machine to a friend's house, by introducing the OSI (Open Systems Interconnection) model.

Recap: The Path of Information

Imagine you want to send a message from your computer at home to your friend's computer in another city. This process involves multiple steps and layers of technology, all orchestrated to ensure your data reaches its destination efficiently and securely.
 

Introducing the OSI Model

The OSI model is a conceptual framework used to understand how data is transmitted over a network. It divides this process into seven distinct layers, each responsible for specific functions. Let's break down these layers and see how they work together using your example:
The OSI model typically consists of seven layers, but for simplicity, we'll focus on five essential layers that are crucial in understanding how data is transmitted over the internet:
 

Application Layer

The Application layer in the OSI model is where communication between applications and the network happens. It's incredibly important in web programming because it directly interfaces with end-user applications like web browsers and email clients. As a web developer, this layer is crucial because it abstracts away much of the complexity involved in implementing protocols like HTTP within our applications.
When we develop web applications, we often rely on frameworks and programming languages that provide libraries and APIs to handle communication protocols like HTTP. These libraries take care of tasks such as establishing connections, sending data to servers, receiving responses, and parsing data. This abstraction allows us to focus more on building the functionality and user experience of our applications without getting bogged down in the intricacies of network communication.
For example, whether we're using JavaScript on the client-side or languages like Python, Ruby, PHP, or Java on the server-side, there are robust libraries available that simplify how we interact with HTTP. They ensure reliable communication while handling details like data integrity and security, which are critical for developing responsive and secure web applications.
By leveraging these libraries and APIs, we can streamline development processes and improve the overall quality of our applications. We don't have to reinvent the wheel when it comes to implementing communication protocols; instead, we can focus on delivering features that matter to our users.
I will talk about protocols in the part 3 of this series of networks (:

Transport Layer

The Transport Layer, within the OSI model, serves as a vital bridge between the Application Layer and the underlying network infrastructure. It's an essential component for ensuring reliable and efficient data transmission across networks, which is particularly crucial in web programming and other forms of application development.
As a web developer, understanding the Transport Layer is fundamental because it directly impacts how data is delivered between applications over the network. One of the key protocols operating at this layer is the Transmission Control Protocol (TCP). TCP establishes reliable connections between devices, ensuring that data packets sent from one endpoint are received correctly by the destination. It manages aspects like flow control, error correction through retransmission of lost packets, and sequence numbering to ensure data integrity.
In contrast, another important protocol at the Transport Layer is the User Datagram Protocol (UDP). UDP is faster but less reliable compared to TCP because it doesn't establish a direct connection or guarantee packet delivery. It's commonly used in applications where occasional packet loss is acceptable, such as in video streaming, online gaming, or DNS (Domain Name System) queries.
As developers, we often choose between TCP and UDP based on the specific requirements of our applications. TCP is favored for applications that require high reliability and data integrity, while UDP is preferred for applications prioritizing speed and efficiency.
 

Network Layer

At the heart of the Network Layer is the Internet Protocol (IP), which provides the addressing scheme and logical structure necessary for devices to locate and communicate with each other across a network. IP addresses uniquely identify devices (such as computers, servers, and routers) on the internet, enabling data packets to be correctly routed from one node to another.
For instance, when you send a request from your web browser to access a website, the Network Layer ensures that your request is correctly addressed and routed across multiple network segments until it reaches its destination server. This process involves routers, which are devices that operate at the Network Layer and make decisions based on IP addresses to forward data packets towards their intended destinations.
 

Data Layer

The Data Link Layer focuses on the physical transmission of data between nodes on the same network segment. As always (everything is about protocols) there are protocols that provide reliable communication within a single network segment. One of the most common protocols at this layer is the Ethernet protocol, which governs how data frames are formatted and addressed for transmission over Ethernet networks. Ethernet frames encapsulate data along with destination and source MAC (Media Access Control) addresses, allowing devices to identify where the data should be sent and ensuring it reaches the intended recipient. For example, when you send a request from your computer to a local server within your office network, the Data Link Layer ensures that the data is formatted into Ethernet frames, which are then transmitted through the network switches to the correct destination based on MAC addresses.

Physical Layer

The Physical Layer is the lowest layer in the OSI model, responsible for the actual transmission of raw bits over a physical medium. It establishes the physical connection between devices and ensures that data can be reliably transmitted across this connection
 
So, when I send a message or request to my friend's house, it travels down through these layers, getting wrapped up, addressed, routed, and delivered—all thanks to the OSI model's structured approach to network communication. It'ss pretty incredible how these layers work together to make sure our internet connections are reliable and efficient.
Understanding this process not only helps me appreciate the technology behind our digital interactions but also gives me a better grasp of how networks function in our connected world. Next time you send a message to a friend online, think about the layers of the OSI model working behind the scenes to make it happen!
 
 
Alright, now that we've covered the essential layers needed to understand how data travels from my computer to my friend's machine via the internet. Lets review it and check all the steps and how they are integrated!

Finally… the data journey !

 
This is where our journey begins. When I type a message on my computer, it starts at the Application Layer. This layer interacts with apps like web browsers or email clients. It’s like getting everything ready to send out.
Next up is the Transport Layer. Here, my message is broken into smaller chunks called segments. Think of it like splitting a long message into smaller parts to send more easily.
Now, my message needs to find its way across different networks to reach my friend's computer. The Network Layer uses IP addresses to route my data through routers and switches. It’s like navigating through different roads to get to my friend’s house. As my message gets closer to my friend’s city, it’s wrapped up in frames at the Data Link Layer. These frames have MAC addresses that help direct my message to the right place within our local network. It’s like putting my friend’s specific address on the package so it arrives at their doorstep. Finally, at the Physical Layer, my message is sent as raw bits over cables or through wireless signals. This layer makes sure the bits of data are transmitted reliably from my computer to my friend’s computer.
So, once my message reaches my friend's computer, the process works in reverse to unwrap the data and present it in their application. Here’s how it happens: Physical Layer → Data Layer → Network Layer → Transport Layer → Application Layer
 
notion image