<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kellot Hermes on Medium]]></title>
        <description><![CDATA[Stories by Kellot Hermes on Medium]]></description>
        <link>https://medium.com/@kellothermes?source=rss-22b12d859b55------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Jp8W1RkU5t8vW4FQNb8arQ.jpeg</url>
            <title>Stories by Kellot Hermes on Medium</title>
            <link>https://medium.com/@kellothermes?source=rss-22b12d859b55------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:09:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kellothermes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OSI | The blueprint of the internet]]></title>
            <link>https://medium.com/@kellothermes/osi-the-blueprint-of-the-internet-8f7c7bdb28d?source=rss-22b12d859b55------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f7c7bdb28d</guid>
            <category><![CDATA[osi-model-explained]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Kellot Hermes]]></dc:creator>
            <pubDate>Sun, 14 May 2023 11:40:37 GMT</pubDate>
            <atom:updated>2023-05-14T11:49:11.208Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*luIgXNnG0aouPhAtrdizrA.png" /><figcaption>Image of how <a href="https://www.submarinecablemap.com/">submarine cables</a> are connected across the world</figcaption></figure><p>Have you ever wondered what happens when you type “YouTube.com” in your browser and hit <strong>Enter</strong>?</p><p>How does your browser know where to get the data that you want and how does it get it?</p><p>The simplest answer would be your computer will find where YouTube is located on the internet. Once it found the location, it will send a message to that location. However, your computer cannot send the data directly from your home network to YouTube, it will have to travel through different networks before finally reaches to YouTube. The whole process would look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*i8W212GfCVEm0cx7r9ca0w.png" /><figcaption>Sending a request to YouTube.com</figcaption></figure><p>In this article, we will look at how your browser can send a request to YouTube and how YouTube can respond back to you with a web page. I will try my best not to bog you down with technical mumbo-jumbo but rather to keep things simple and make you understand how these things work from a high-level view.</p><p>Before we start looking at how all of these technologies work, we have to take a look at their history to understand why we need them in the first place. There is a good reason why these technologies were invented, and I promise it won’t be a boring history lesson. So, stick with me for a bit here.</p><p>Let’s jump back into the past !</p><p>Back in the 1960s, computers were the size of a room, and sharing information between them was a nightmare. Engineers had to travel to different computer sites just to transfer data from one site to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Dy0Mvl5g7UZfy2Nygve5kQ.jpeg" /><figcaption>Image from <a href="https://en.wikipedia.org/wiki/History_of_computing_hardware">Wikipedia</a> with a little twist :)</figcaption></figure><p>But then some smart people came up with the idea of “packet switching.” . They figured out how we could transmit data as electric signals through wires. But it was just a conceptual model, and there is no solid technical implementation.</p><p>Different technology companies started developing their own proprietary networks based on this networking model. However, these networks work perfectly as long as you transfer data between devices from the same manufacturer. But what if you want to send data to another computer brand?</p><p>Nope, that is not happening. They can only talk to devices from the same manufacturer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*_36kPELFlybLXg-6_xsE6w.png" /></figure><p>We need a standard that could standardize the communication protocol between computers and make it easy for them to communicate with each other.</p><p>So, back to the present, we now have two similar network models: the OSI model and the TCP/IP model. The modern internet uses TCP/IP because it is much simpler and has fewer abstraction layers than the OSI model. However, the OSI model is useful to visualize how each layer in the model works. We will stick to the OSI model.</p><h3>What is the OSI model ?</h3><p>OSI, or Open System Interconnection, is a networking model that shows how data communication should happen between different computers. It is a layer-based model that splits the entire communication stack into seven different abstract layers. Each layer has its own functionalities and is independent of other layers. This reduces the complexity for the developers to interact with the model and enables them to use different protocols interchangeably.</p><p>Here is the commonly used mnemonics for memorizing the name and order of all these OSI layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*Aw2KDeMALtLX0C1vnhMVRw.png" /><figcaption>The mnemonics of OSI layers</figcaption></figure><h3>Let’s unpack how each layer works !</h3><p>We will look at how each layer works along with the scenario that I gave at the beginning of the article. I will also show you how the request is going to look like in each layer.</p><p>In the scenario, we are trying to send a request to YouTube. But before we send it, we need to format our request in a particular way that YouTube can understand, and vice versa.</p><h4>1. The application layer</h4><p>The seventh layer of the OSI model, also known as the application layer, is the layer where most of the users directly interact. It specifies the data format that should be sent and received between two computers using standard protocols.</p><p>One thing to note here is that “application” in the application layer does not mean software applications like web browsers or email clients. Those software programs are not in the application layer; instead, they interact with the application layer protocols to make requests and fetch data that can be represented to the users.</p><p>HTTP (Hyper Text Transfer Protocol), FTP (File Transfer Protocol), and SMTP (Simple Mail Transfer Protocol) are some well-known and widely used application protocols.</p><p>For making a request to YouTube, we’ll use the HTTP protocol, which is the most widely used protocol for transferring data and files between computers. Our request will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*zvPZVCOkPqHb-IvjLPU-fQ.png" /><figcaption>An HTTP request with some headers</figcaption></figure><h4>2. The presentation layer</h4><p>Once the application layer’s protocol has been chosen, the data will be passed down to the presentation layer. The main purpose of the presentation layer is to translate and prepare the data to make it usable in the other layer. The presentation layer will encode data coming from the lower layers to make it presentable in the application layer, and vice versa.</p><p>The reason we need to do this is because different devices communicate using different data encoding methods, and to make the data representable to those devices, the request must be encoded in a way that the receiving computer can understand.</p><p>The presentation layer also encrypts data on the sender side and decrypts the encrypted data on the receiver side if the protocol allows encryption. This enables to safely transmit data and information over the internet.</p><p>Since our request is an HTTPS request, which is a secured version of the HTTP protocol, it will be both encrypted and encoded.</p><h4>3. The Session layer</h4><p>The next layer is the session layer. The session layer manages the communication session between the computers.</p><p>It opens the communication session once we make the request to YouTube and terminates it as soon as the data transmission is completed. The way it does this is by adding a session ID to our request and One important feature of the session layer is that it sets checkpoints on the data. This prevents data loss and corrupted data by continuing the data transmission from the last checkpoint in case a network error happens while transmitting the data in the previous session.</p><h4>4. The Transport layer</h4><p>This is the most important layer in the OSI model in my opinion and it is where most backend developers or network engineers will be working with. It an end-to-end communication layer that transfer data between different hosts.</p><p>It takes the data from the application layer and spliced into smaller pieces called “segments”.</p><p>This improves the network efficiency and bandwidth as the data don’t have to send as a whole unit instead send in multiple parts. However, sending multiple segments mean that the receiver has to reassemble all those segments to get the original data. On the other hand, the segments might not arrive to the receiving end in the correct order or would not arrive at all which could corrupt the data. To solve these issues, each segment has a sequence number that can identify the order in which the segment belongs to the original data. This enables to implement an error checking mechanism in the transport layer which is the core mechanism that is being used in one of the transport layer protocols.</p><p>During the segmentation of application data , the source and destination port numbers are added to each segment to ensure the data is returned to the correct application.</p><p>But why do we need to add port numbers to our data and what the port number actually is ?</p><p>In a nutshell, the port number is a way to identify a specific process that listens to the corresponding network requests. Most of the well-known network protocols have their own port number to be able to communicate with other protocols. For the HTTPS protocol, it listens the network request on the port number 80. However, the source port number would be a temporary one that our computer sends the network request from.</p><p>Imagine that your computer is like a really big apartment building with thousand residents which are the applications running in the computer. When those applications send network requests to remote hosts or servers, it like sending mails outside the building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*OqPFDt_EBT4-nIx67g8H7Q.png" /></figure><p>The problem with this is that all the requests have the same delivery address, which is your computer’s IP address. In this case, the servers don’t know which response is related to which application. So they just send it back to the same IP address. This creates some potential issues, like getting mixed response data.</p><p>Port numbers solve this problem by making each application listen to a specific port number and specifying that port number in the network requests. This enables the server to send back the correct response to the correct application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*shCya4ktcXrenrKXT4DlnA.png" /></figure><p>This is what our request would look like with both source and destination port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*4fSlW-wfbCvSyQW_Fa5KlQ.png" /></figure><p>Just like all the other layers, the transport layer also has two protocols called Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). I am not going to talk about how each of these protocols works in this article.</p><p>For now, just understand that TCP is a connection-oriented protocol that guarantees the delivery of data from the source to the destination. It also uses the acknowledgement mechanism to ensure every data segment is delivered in the correct order and retransmits the missing segments by checking the sequence number on each segment. Because of this, the TCP protocol is used where the safety and integrity of the data are important, like in HTTP and FTP.</p><p>UDP, on the other hand, is a connection-less protocol and does not guarantee the delivery of the data segments. It also does not retransmit the missing segments or transmit the data in the correct sequence. Due to this reason, UDP can transmit data faster than TCP and is used in applications that require continuous data transmission, such as video streaming, VoIP, and video games.</p><p>The HTTP protocol uses TCP as the underlying data transmission layer. However, this has changed in the latest HTTP versions.</p><h4>3. Network layer</h4><p>The network layer handles transferring data between two different networks. The way it works is by breaking up the segments from the transport layer into smaller units called packets, which add the sender and receiver IP addresses. To understand more about how IP addresses and routers work, I recommend checking out this YouTube playlist . This enables our data to be routed by the router through different networks until it reaches its destination.</p><h4>2.Data Link layer</h4><p>Since the network layer transfers data between different networks. The data link layer is the layer that transfers data within the same network. Data from the network layer is further broken down into smaller pieces called frames, and the destination and source MAC (Media Access Control) addresses are added. MAC addresses are similar to IP addresses, but they only work inside the network, and each computer has a unique MAC address.</p><h4>1. Physical layer</h4><p>After passing through all the upper layers, our data is ready to be sent through physical mediums. The physical layer converts the digital signals into a binary stream that contains only 1s and 0s. Their values are then converted into analog data and transmitted as electric signals, radio waves, or light signals.</p><p>When our data reaches YouTube, the same process happens but in reverse order. The physical layer receives the analog signals and converts them into binary values. These values are then sent up to the upper layers until the server can read the original data at the application layer.</p><p>Here is how our data would look like when passing through each OSI layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*-yHFzOYzIXm1BavYwhTMqA.png" /></figure><h3>Conclusion</h3><p>In this article, we discussed the OSI network model and the functionalities of each layer in this model. We also look at how an HTTP request has to pass through the OSI layers in order to transmit and receive data between two computers. I hope you get the basic idea of how data communication works between computers. If you want to get a better understanding of the OSI model, I highly recommend checking out this videos on <a href="https://www.youtube.com/watch?v=7IS7gigunyI">OSI model</a> and <a href="https://www.youtube.com/watch?v=S7MNX_UD7vY&amp;list=PLIhvC56v63IJVXv0GJcl9vO5Z6znCVb1P">the basic of networking</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f7c7bdb28d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>