You are on page 1of 4

OSI is a model that is used to understand how network protocols work.

Usually when we are studying how networks work this is one of the first topics on the study guide. The problem, however, is that usually people dont understand why this model exists nor how it really works even people that memorized the names of all the seven layers of this model to take an exam at college or a certification exam still have no clue. In this tutorial we will explain you why the OSI model exists and how it works and we will also present a quick correlation between TCP/IP and the OSI model. When computer networks first appeared many years ago they usually used proprietary solutions, i.e. only one company manufactured all technologies used by the network, so this manufacturer was in charge of all systems present on the network. There is no option to use equipments from different vendors. In order to help the interconnection of different networks, ISO (International Standards Organization) developed a reference model called OSI (Open Systems Interconnection) in order to allow manufacturers to create protocols using this model. Some people get confused with these two acronyms, as they use the same letters. ISO is the name of the organization, while OSI is the name of the reference model for developing protocols. Protocol is a language used to transmit data over a network. In order to two computers talk to each other, they must be using the same protocol (i.e. language). When you send an e-mail from your computer, your e-mail program (called e-mail client) sends data (your e-mail) to the protocol stack, which does a lot of things we will be explaining in this tutorial, then this protocol stack sends data to the networking media (usually cable or air, on wireless networks) then the protocol stack on the computer on the other side (the e-mail server) gets the data do some processing we will explain later and sends data (your e-mail) to the e-mail server program. The protocol stack does a lot of things and the role of the OSI model is to standardize the order under which the protocol stack does these things. Two different protocols may be incompatible but if they follow the OSI model, both will do things on the same order, making it easier to software developers to understand how they work. You may have notice that we used the word stack. This is because protocols like TCP/IP arent really a single protocol, but several protocols working together. So the most appropriate name for it isnt simple protocol but protocol stack. The OSI model is divided into seven layers. It is very interesting to note that TCP/IP (probably the most used network protocol nowadays) and other famous protocols like IPX/SPX (used by Novell Netware) and NetBEUI (used by Microsoft products) dont fully follow this model, corresponding only to part of the OSI model. On the other hand, by studying the OSI model you will understand how protocols work in a general fashion, meaning that it will be easier for you to understand how real-world protocols like TCP/IP work. The basic idea of the OSI reference model is this: each layer is in charge of some kind of processing and each layer only talks to the layers immediately below and

above it. For example, the sixth layer will only talk to the seventh and fifth layers, and never directly with the first layer. When your computer is transmitting data to the network, one given layer will receive data from the layer above, process what it is receiving, add some control information to the data that this particular layer is in charge of, and sending the new data with this new control information added to the layer below. When your computer is receiving data, the contrary process will occur: one given layer will receive data from the layer below, process what it is receiving, removing control information from the data that this particular layer is in charge of, and sending the new data without the control information to the layer above. What is important to keep in mind is that each layer will add (when your computer is sending data) or remove (when your computer is receiving data) control information that it is in charge of. Lets now see the 7-layer OSI model. OSI Reference Model: On Figure 1 you can see an illustration of the OSI reference model. Programs only talk to the seventh layer, Application, while the layer below the first layer is the network physical media (for example, cable or air, in the case of wireless networks). The network cabling is thus sometimes referred as layer 0.

Figure 1: The OSI reference model.

The seven layers can be grouped into three groups, Application, Transport and Network, as you can see on Figure 1:

Network: Layers from this group are low-level layers that deal with the transmission and reception of the data over the network. Transport: This layer is in charge of getting data received from the network and transforming them in a format nearer to the data format understandable by the program. When your computer is transmitting data, this layer gets the data and divides it into several packets to be transmitted over the network. When your computer is receiving data, this layer gets the received packets and put them back together. Application: These are high-level layers that put data in the data format used by the program. Below we will explain each layer from the OSI reference model. On our examples we are assuming that our computer is sending data to the network for example, you are sending out an e-mail thru your e-mail program. Layer 7 - Application: The application layer makes the interface between the program that is sending or is receiving data and the protocol stack. When you download or send e-mails, your e-mail program contacts this layer. Layer 6 - Presentation: Also called translation layer, this layer converts the data format received by the application layer to a common format used by the protocol stack. For example, if the program is using a non-ASCII code page, this layer will be in charge of translating the received data into ASCII. This layer can also be used to compress data and add encryption. Data compression increases network speed, as less data will be sent to the layer below (layer 5). If encryption is used, your data will be encrypted while in transit between layers 5 and 1 and they will only be decrypted on the layer 6 of the computer at the other end. Layer 5 - Session: This layer allows two programs in different computers to establish a communication session. In this session these two programs define how data transmission will be done, adding progress markers to the transmitted data. If the network fails, the two computers restart the transmission from the last received marker instead of retransmitting all data again. For example, you are downloading e-mail and your network fails. Instead of downloading all e-mails again, your program would automatically restart from the last downloaded e-mail. Note that not all protocols implement this feature. Layer 4 - Transport: On networks data is divided into several packets. When you are transferring a big file, this file is sliced into several small packets, and then the computer at the other end gets these packets and put the file back together. The Transport layer is in charge of getting data sent by the Session layer and dividing them into packets that will be transmitted over the network. At the receiving computer, this layer is also in charge of putting the packets in order, if they arrived out-of-order (this task is known as flow control), and also checking data integrity, usually sending a control signal to the transmitter called acknowledge or simply ack telling it that the packet arrived and data is intact. This layer separates the Application layers (layers 5 to 7) from the Network layers (layers 1 to 3). Network layers are concerned with how data is transmitted and received over the network, i.e. how data packets are transmitted, while Application layers are concerned with what is inside the packets, i.e. if the data itself. Layer 4, Transport, makes the interface between these two groups. Layer 3 - Network: This layer is in charge of packet addressing, converting logical addresses into physical addresses, making it possible to data packets

to arrive at their destination. This layer is also in charge of setting the route the packets will use to arrive at their destination, based on factors like traffic and priorities. Layer 2 - Data Link: This layer gets the data packets send by the network layer and convert them into frames that will be sent out to the network media, adding the physical address of the network card of your computer, the physical address of the network card of the destination, control data and a checksum data, also known as CRC. The frame created by this layer is sent to the physical layer, where the frame will be converted into an electrical signal (or electromagnetic signal, if you are using a wireless network). The Data Link layer on the receiving computer will recalculate the checksum and see if the new calculated checksum matches the value sent. If they match, the receiving computer sends an acknowledge signal (ack) to the transmitting computer. Otherwise the transmitting computer will re-send the frame, as it didnt arrive at destination or it arrived with its data corrupted. Layer 1 - Physical: This layer gets the frames sent by the Data Link layer and convert them into signals compatible with the transmission media. If a metallic cable is used, then it will convert data into electrical signals; if a fiber optical cable is used, then it will convert data into luminous signals; if a wireless network is used, then it will convert data into electromagnetic signals; and so on. When receiving data, this layer will get the signal received and convert it into 0s and 1s and send them to the Data Link layer, which will put the frame back together and check for its integrity. Refer the following link for IP Addressing and subnetting concepts: http://www.tcpipguide.com/free/t_IPAddressing.htm

You might also like