Layer 3 is one of the important Layers of OSI Model. This layer corresponds Internet Layer of TCP/IP Model. Layer 3 or Internet Layer handles end to end delivery of the data. In other words it provides Routing. Routing is one of the main lessons of computer network world. In this lesson, we will focus on layer 3 lessons like Routing Protocols, Administrative Distance etc.
Layer 3 provides Routing with the help of a Routed Protocol and unique addresses. There are some Layer 3 Routed Protocols like IP, IPX, Apple Talk, CLNX etc. exist. For now, almost all networks use IP (Internet Protocol) as a Layer 3 Routed Protocol. And IP provides unique IPv4 and IPv6 Addresses. Beside Routed Protocol IP and IP Addresses, there is also other protocols that helps Routing. These Protocols are Routing Protocols.
There are also other protocols that work on Layer 3 like ICMP, IGMP etc. We will talk about them specificaly later.
Layer 3 provides the communication of the devices that works with different Layer 2 technologies. It do not interested in what Layer 2 Protocol is used in the networks. It only looks the L3 Address and according to it, it sends the data to the destination.
Table of Contents
IP (Internet Protocol) is the main Layer 3 Routed Protocol. It encapsulates the coming Segment from Layer 4 with its own IP Header and convert the Segment to a Packet. Then it sends the packet to Layer 2. In the reverse direction, it delivers the packet to the Layer 4.
There are two versions of IP. IPv4 and IPv6. Each versions has a different Header Areas. You can check these areas below:
IP provides end to end data delivery with the help of IP Addresses and Routing Protocols. IP Addresses provide being unique in the network and in the Internet. This is like the address of your home. Think about it, how your posts are coming to your house and never mixed with other posts? Because your address is unique and there is only one address for your house in the world. IP addresesing is like this. By the way, some same addresses (Private address blocks) can be used times and times, we will talk about them later.
The first and common version of IP is IPv4. IPv4 uses 32 bits IPv4 Addresses. IPv4 Addresses are still used in most of the networks in the World. Beside IPv4, IPv6 is also introduced because IPv4 addresses are exhausted. And with the development of the technology, more IP addresses are required. One of the main idea behind IPv6 is, providing IP Addresses to this need.This nee version of IP, IPv6 uses 128 bits IPv6 Addresses.
We will talk about IPv4 and IPv6 more in the following articles.
In Layer 3, to calculate the routes to the destinations, Routing Protocols are used. Routing Protocols are also work on Layer 3. These Routing Protocols are :
You can find routing protocols table below.
As you can see above, we can divide routing protocols into two as Interior Gateway Protocols (IGP) and Exterior Routing Protocols (EGP). IGPs are also divided into three as Distance Vector, Link-State and Hybrid Protocols. RIP and IGRP are disance vector protocols, OSPF and IS-IS are link-state protocols and EIGRP is hybrid protocol. There is only one EGP, Path Vector BGP is used today. There is also other old EGP protocol called also as EGP. But it is not used in today’s networks anymore.
By the way above Routing Protocols work with IPv4. There are also new versions of this Routing Protocols with enhancements. These enhancements are done for IPv6 support. So, the Routing Protocols that support IPv6 are given below:
You can checked the IPv4 and IPv6 Routing Protocol lessons for detailed explanations.
Layer 3, uses Routing Tables. From the source to the destination, data is send according to these Routing Tables. These tables has routes to different destinations, different hops. This is like “Address Recipe”. “If you want to go Z, then you need to go V. And for this go through with my third interface”. And if it goes to the V, in V, there is another route for Z. “If you want to go Z, then you need to go through my second interface.
In Routing Tables, there can be different routes for a specific destination. This routes are provided by different routing protocols.To a destination, all Routing Protocols may has more than one route. But with their path calculation, they select the “best path” and adds this to the Routing Protocol. Like this, all Routing Protocols calculate and add the “Best Route” to the Routing Table. When a router need to decide, sending a packet to that destination, it looks the Routing Table and checks the below parameters in order. And determine the path that it willl send.
Prefix Lenght is the first parameter that is checked. This is checking the destination IP Address in the Routing Table to determine the most specific route.
Metric is the value of the link cost. This can be hop caunt in RIP and cost in OSPF. Metric value changes according to Routing Protocol.
Administrative Distance is the specific trust value of each Routing Protocol. Preference name is also used instead of Administrative Distance. Cisco uses AD and Alcatel-Lucent and Juniper uses Preference. And for different vendors, these values can change.
More trusted in other words the lower Administrative Distance value is selected as the route.For example there are multiple routes to a destination. One for RIP and the other for OSPF.
You can find the Administrative Distance (Preference) values for Cisco, Juniper, Alcatel-Lucent and Huawei below.