4 years ago

Understanding the OSI Model Part 3

The network Layer

This is a write up on the third layer of the OSI model; the Network Layer. The aim of this article is to give you an overview of what the layer is responsible for and how it contributes in connecting you to devices on another network (not exactly the internet because the internet uses the TCP/IP suite; but comparable ).

If you haven’t read the previous ones; please give them a read!

Network Layer

This is the third layer of the OSI model; placed above the data link layer and below the transport layer in the vertical hierarchy of the OSI model.  The main responsibility of this layer is to ensure end to end communication between two network devices. It is within the responsibility of this layer to govern secure communication between them not just within the same network but also the communication spanning across networks.

Lets take a few minutes to understand all the responsibilities the network layer withholds

Responsibilities of the Network Layer

Routing

One of the main responsibilities of the network layer is to route its data (referred to as packets) from source to destination.

Typically when the communication is not within the same network we use devices such as routers, switches or gateways to connect these packets end-to-end and in case the communication is within the same network; the layer is as good as invisible with very little actual purpose.

There are three key terms you need to know as far as routing is concerned and let’s take this one step at a time.

  1. First, one needs to discuss and configure how the packet is going to be handled by the underlying layers. –> This is referred to as Delivery.
  2. Second there needs to be a mechanism in place to handle packets while going through the intermediary stations (routers, gateways, any network device) in its way to the final destination.–> This is referred to as Forwarding.
  3. All these functionalities need to be stored somewhere; rather someone needs to keep track of which packet is going through where and when; this is governed by the concept of routing tables.–> Routing thus, refers to the way these tables are created in order for this forwarding and delivery to happen seamlessly.

Thus, to summarize the three key terms associated with routing

  1. Delivery.
  2. Forwarding.
  3. Routing.

Delivery

When we talk of delivery; there are mainly two types of delivery

  1. Direct Delivery
  2. Indirect Delivery

Direct Delivery: This kind of delivery happens when the communication happens within the same network or when the communication happens between the last router in the path and the destination.

Indirect Delivery: This kind of delivery is when the communication is to the next router in line. Typically this is the case in internet communication.

Forwarding

There are several forwarding techniques in place to overcome the realistic challenges the size of the network poses on the communication.

Few of them to name are as follows

  1. Next-Hop Method and Route Method. à Coupled together as they vary in terms of the implementation.
  2. Network Specific Method and Host specific method.
  3. Default method.

In depth explanation of these is beyond the scope of this article.

Routing

Protocols that are used for routing

Let’s take a look at few protocols that are used for routing

  1. Unicast Routing Protocol
  2. Multicast Routing Protocol

Again each of these are subdivided into appropriate techniques; used based on the use-case. The internet being so large; one standard routing protocol cannot be used to cover all the use cases. This context being set; deep diving into each would be difficult; knowing these is good enough to begin with.

There are a number of routing table techniques; each of them have their advantages and disadvantages.

In short there are static routing tables and dynamic routing tables. In the real world, dynamic ones are used wherein real time updated values are stored and modified.

More on routing on another write-up..  🙂

Addressing

The next major concept and responsibility to be discussed is the addressing that happens at this layer. This is possibly the most important concept to have a grasp of; to make sense of the internet!

Any network device has two addresses that are commonly associated with it.

  1. Physical Address –> MAC Address
  2. Logical Address –> IP Address

We will not be discussing in depth about the physical address as this done by layer 2 of the OSI, the DLL; but just to give a brief overview, the NIC is fused with an address by the vendor which is commonly referred to as the MAC address or the physical address of the device and this is unique.

In this article, we are more concerned with the logical addressing; let’s dive in!

WHATS THE IP ADDRESS OF YOUR DEVICE???

I’m positive you must have posed this question or at some point questioned. The logical address is what is referred to as the IP address.

Why do we need a logical address?

The answer is straight forward; you need an IP address because you need to be located on the internet. Thus, this layer takes the responsibility of giving you a presence in the internet; by assigning your device with an IP address; and henceforth using this address to communicate with the world outside, be it within the city or across the country!

This is important because we need a universal addressing scheme; something that can be understood independent of the networking device and the number of devices used in the communication process.

This is the very reason why this is an important concept and within which complexity unfolds like a Christopher Nolan’s Movie 😉

Please note the concepts discussed hence; are more relevant to the TCP/IP protocol suite, but good to know either ways..

THE IPV4 Addressing

This is the first version of the IP address used. This is a 32 bit string (or 4 bytes) of numbers that determines your location in the internet.

Something that looks like

192.168.1.2

Binary which consists of 0’s or 1’s; there are 2^32 (= 4,294,967,296) addresses that are possible to generate. Which means there can be 2^32 unique devices connected to the internet capable of communicating with each other without a conflict.

It is now simple to device that; no two devices can have the same IP at the same instance of time. Yes, IP addresses are not necessarily static unlike the MAC. They are subject to change or they could just be left static, depends on your network configuration; this essentially means this is a use case and thus there are complex algorithms and mechanisms in place to accommodate this.

THE IPV6 Addressing

To accommodate the growing internet population; more devices need to be assigned with an IP and thus came the IPV6 addressing.

Please note; this is more to do with the TCP/IP protocol and thus it makes sense to stop at this point.

The gist is that; the network layer irrespective of whether in OSI or TCP/IP has two major responsibilities

  1. Routing
  2. Addressing

And its ultimate goal is to connect the packet from source to destination which also means there are some error check mechanisms in place to ensure error free transmission of data from source to destination.

There are other important concepts such as sub-netting and DHCP; but for now I will restrict the content to mere overview of the OSI model.

Layer 3 Devices

Devices today as discussed; are typically capable of handling data at different layers. It is really about where it is placed in the network and what it is placed to do.

For the sake of completeness;one device that is worth discussing are routers.

Routers

Routers are network devices that route packets from source to destination. It primarily takes care of end to end routing using different protocols and this is the network device you would be using at home to connect to the internet.

The routers can be used in both a LAN and WAN setup but would be quite unnecessary if used for a LAN configuration. In case of a WAN; the routers sort of acts as the gateway to all the data that goes from you and comes to you. It then forwards it to the appropriate network device based on the destination IP address. This is done by referring to the routing table as discussed earlier.

Pictorially the network layer can be summarized to do the following

The end objective is to communicate with computer B; despite belonging to a different network. This is possible with the internet and this is how layer 3 contributes to this process.  

This brings us to the end of this write-up; as always feel free to reach out in case of doubts and leave your comments if you did have a take away.

Thanks for Reading!

Written by BootUP

A Technology enthusiast eager to learn and teach!

Categories Technical ContentTags

Comments are closed.

One Thought on “Understanding the OSI Model Part 3”