Unit 3
Unit 3
The network layer or layer 3 of the OSI (Open Systems Interconnec on) model is concerned
delivery of data packets from the source to the des na on across mul ple hops or links. It is
the lowest layer that is concerned with end − to − end transmission. The designers who are
concerned with designing this layer needs to cater to certain issues. These issues encompass
the services provided to the upper layers as well as internal design of the layer.
The design issues can be elaborated under four heads −
Store − and − Forward Packet Switching
Services to Transport Layer
Providing Connec on Oriented Service
Providing Connec onless Service
The transport layer needs to be protected from the type, number and topology of the
available router.
The network addresses for the transport layer should use uniform numbering pa ern
also at LAN and WAN connec ons.
Based on the connec ons there are 2 types of services provided:
Connec onless – The rou ng and inser on of packets into subnet is done individually.
No added setup is required.
Connec on-Oriented – Subnet must offer reliable service and all the packets must be
transmi ed over a single route.
When a data packet leaves its origin, it can take one of many different paths. It computes the
best path (least-cost path) to send the data.
What is Flooding:
Flooding is a sta c rou ng technique, based on the following principle:
“When a packet reaches the router, it is transferred to all the outgoing links, except only the
link that it has reached the router through.”
Flooding is used in rou ng protocols such as O.S.P.F. (Open Shortest Path First), peer-to-peer
file transfers, systems such as Usenet, bridging, etc. Let us have a look at an example for a
be er understanding. Assume there is a network with 6 routers connected through
transmission lines, as shown in the figure ahead.
Types of Flooding:
Flooding may be of three types −
Uncontrolled flooding − Here, each router uncondi onally transmits the incoming data
packets to all its neighbours.
Controlled flooding − They use some methods to control the transmission of packets
to the neighbouring nodes. The two popular algorithms for controlled flooding are
Sequence Number Controlled Flooding (SNCF) and Reverse Path Forwarding (RPF).
Selec ve flooding − Here, the routers don't transmit the incoming packets only along
those paths which are heading towards approximately in the right direc on, instead
of every available paths.
Characteris cs of Flooding:
Following are some features of flooding:
Every possible route between the source and the des na on for transmission is tried
in flooding.
There always exists a minimum of one route which is the shortest.
Any node that is connected, whether directly or indirectly, is explored.
Flooding does not require any informa on related to the network, such as the costs of
various paths, load condi ons, topology, etc. This is why it is non-adap ve.
Advantages of Flooding:
It is very simple to setup and implement, since a router may know only its neighbours.
It is extremely robust. Even in case of malfunc oning of a large number routers, the
packets find a way to reach the des na on.
All nodes which are directly or indirectly connected are visited. So, there are no
chances for any node to be le out. This is a main criteria in case of broadcast
messages.
The shortest path is always chosen by flooding.
5
Let's understand a few key points about the distance vector rou ng protocol:
Network Informa on:
Every node in the network should have informa on about its neighbouring node. Each node
in the network is designed to share informa on with all the nodes in the network.
Rou ng Pa ern:
In DVR the data shared by the nodes are transmi ed only to that node that is linked directly
to one or more nodes in the network.
Data sharing:
The nodes share the informa on with the neighbouring node from me to me as there is a
change in network topology.
Step 1:
Each router shares its rou ng table with every neighbour in this distance vector rou ng
network. As A will share its rou ng table with neighbours B and C, neighbours B and C will
share their rou ng table with A.
Rou ng table A:
7
8
9
Let see the full rou ng table for router 1A which has 17 entries, as shown below –
11
Explana on:
Step 1 − For example, the best path from 1A to 5C is via region 2, but hierarchical
rou ng of all traffic to region 5 goes via region 3 as it is be er for most of the other
des na ons of region 5.
Step 2 − Consider a subnet of 720 routers. If no hierarchy is used, each router will
have 720 entries in its rou ng table.
Step 3 − Now if the subnet is par oned into 24 regions of 30 routers each, then
each router will require 30 local entries and 23 remote entries for a total of 53
entries.
Example:
If the same subnet of 720 routers is par oned into 8 clusters, each containing 9 regions and
each region containing 10 routers. Then what will be the total number of table entries in
each router.
Solu on:
10 local entries + 8 remote regions + 7 clusters = 25 entries.
12
Conges on Control is a mechanism that controls the entry of data packets into the
network, enabling a be er use of a shared network infrastructure and avoiding
conges ve collapse.
Conges ve-Avoidance Algorithms (CAA) are implemented at the TCP layer as the
mechanism to avoid conges ve collapse in a network.
Similarly, each network interface contains a leaky bucket and the following steps are
involved in leaky bucket algorithm:
When host wants to send packet, packet is thrown into the bucket.
The bucket leaks at a constant rate, meaning the network interface transmits packets
at a constant rate.
Busty traffic is converted to a uniform traffic by the leaky bucket.
In prac ce the bucket is a finite queue that outputs at a finite rate.
Advantages of IPv4
It becomes easy to a ach mul ple devices across an outsized network while not NAT.
This is a model of communica on so provides quality service also as economical
knowledge transfer.
IP version 6
IPv6 was developed by Internet Engineering Task Force (IETF) to deal with the problem of IPv4
exhaus on. IPv6 is a 128-bits address having an address space of 2128, which is way bigger
than IPv4. IPv6 use Hexa-Decimal format separated by colon (:).
Components in Address format
IPv6 has new op ons to allow for addi onal func onali es.
4. Allowance for extension
IPv6 is designed to allow the extension of the protocol if required by new technologies or
applica ons.
5. Support for resource alloca on
In IPv6, the type of service field has been removed, but two new fields, traffic class and flow
label have been added to enables the source to request special handling of the packet. this
mechanism can be used to support traffic such as real- me audio and video.
6. Support for more security
The encryp on and authen ca on op ons in IPv6 provide confiden ality and integrity of the
packet.
Unicast
Mul cast
Anycast
Addressing methods
1. Unicast Address
Unicast Address iden fies a single network interface. A packet sent to a unicast address is
delivered to the interface iden fied by that address.
3. Anycast Address
Anycast Address is assigned to a group of interfaces. Any packet sent to an anycast address
will be delivered to only one member interface (mostly nearest host possible).
Note: Broadcast is not defined in IPv6.
18
Extension Headers
In IPv6, the Fixed Header contains only that much informa on which is necessary, avoiding
that informa on which is either not required or is rarely used. All such informa on is put
between the Fixed Header and the Upper layer header in the form of Extension Headers. Each
Extension Header is iden fied by a dis nct value.
When Extension Headers are used, IPv6 Fixed Header’s Next Header field points to the first
Extension Header. If there is one more Extension Header, then the first Extension Header’s
‘Next-Header’ field points to the second one, and so on. The last Extension Header’s ‘Next-
Header’ field points to the Upper Layer Header. Thus, all the headers’ points to the next one
in a linked list manner.
If the Next Header field contains the value 59, it indicates that there are no headers a er this
header, not even Upper Layer Header.
The following Extension Headers must be supported as per RFC 2460:
Extension Headers are arranged one a er another in a linked list manner, as depicted in the
following diagram:
20
IP addresses
All the computers of the world on the Internet network communicate with each other with
underground or underwater cables or wirelessly. If I want to download a file from the internet
or load a web page or literally do anything related to the internet, my computer must have an
address so that other computers can find and locate mine in order to deliver that par cular
file or webpage that I am reques ng. In technical terms, that address is called IP Address or
Internet Protocol Address.
Let us understand it with another example, like if someone wants to send you a mail then
he/she must have your home address. Similarly, your computer too needs an address so that
other computers on the internet can communicate with each other without the confusion of
delivering informa on to someone else’s computer. And that is why each computer in this
world has a unique IP Address. Or in other words, an IP address is a unique address that is
used to iden fy computers or nodes on the internet. This address is just a string of numbers
wri en in a certain format. It is generally expressed in a set of numbers for example
[Link]. Here each number in the set is from 0 to 255 range. Or we can say that a full IP
address ranges from [Link] to [Link]. And these IP addresses are assigned by IANA
(known as Internet Corpora on for Internet Assigned Numbers Authority).
Working of IP addresses
It can also use some set of rules to send informa on. Using these protocols, we can easily
send, and receive data or files to the connected devices. There are several steps behind the
scenes. Let us look at them
Your device directly requests your Internet Service Provider which then grants your
device access to the web.
And an IP Address is assigned to your device from the given range available.
Your internet ac vity goes through your service provider, and they route it back to you,
using your IP address.
Your IP address can change. For example, turning your router on or off can change your
IP Address.
When you are out from your home loca on your home IP address doesn’t accompany
you. It changes as you change the network of your device.
Types of IP Address
IP Address is of two types:
1. IPv4:
21
Internet Protocol version 4. It consists of 4 numbers separated by the dots. Each number can
be from 0-255 in decimal numbers. But computers do not understand decimal numbers, they
instead change them to binary numbers which are only 0 and 1. Therefore, in binary, this (0-
255) range can be wri en as (00000000 – 11111111). Since each number N can be
represented by a group of 8-digit binary digits. So, a whole IPv4 binary address can be
represented by 32-bits of binary digits. In IPv4, a unique sequence of bits is assigned to a
computer, so a total of (2^32) devices approximately = 4,294,967,296 can be assigned with
IPv4.
IPv4 can be wri en as:
[Link]
2. IPv6:
But there is a problem with the IPv4 address. With IPv4, we can connect only the above
number of 4 billion devices uniquely, and apparently, there are much more devices in the
world to be connected to the internet. So, gradually we are making our way to IPv6 Address
which is a 128-bit IP address. In human-friendly form, IPv6 is wri en as a group of 8
hexadecimal numbers separated with colons (:). But in the computer-friendly form, it can be
wri en as 128 bits of 0s and 1s. Since, a unique sequence of binary digits is given to
computers, smartphones, and other devices to be connected to the internet. So, via IPv6 a
total of (2^128) devices can be assigned with unique addresses which are actually more than
enough for upcoming future genera ons.
IPv6 can be wri en as:
[Link]
Classifica on of IP Address
An IP address is classified into the following types:
1. Public IP Address:
This address is available publicly and it is assigned by your network provider to your router,
which further divides it to your devices. Public IP Addresses are of two types,
available range. Since IP Address keeps on changing every me when you connect to
the internet, it is called a Dynamic IP Address.
Sta c IP Address: Sta c address never changes. They serve as a permanent internet
address. These are used by DNS servers. What are DNS servers? Actually, these are
computers that help you to open a website on your computer. Sta c IP Address
provides informa on such as device is located on which con nent, which country,
which city, and which Internet Service Provider provides internet connec on to that
par cular device. Once, we know who is the ISP, we can trace the loca on of the device
connected to the internet. Sta c IP Addresses provide less security than Dynamic IP
Addresses because they are easier to track.
2. Private IP Address:
This is an internal address of your device which are not routed to the internet and no exchange
of data can take place between a private address and the internet.
3. Shared IP addresses:
Many websites use shared IP addresses where the traffic is not huge and very much
controllable, they decide to rent it to other similar websites so to make it cost-friendly. Several
companies and email sending servers use the same IP address (within a single mail server) to
cut down the cost so that they could save for the me the server is idle.
4. Dedicated IP addresses:
A dedicated IP Address is an address used by a single company or an individual which gives
them certain benefits using a private Secure Sockets Layer (SSL) cer ficate which is not in the
case of a shared IP address. It allows to access the website or log in via File Transfer Protocol
(FTP) by IP address instead of its domain name. It increases the performance of the website
when the traffic is high. It also protects from a shared IP address that is black-listed due to
spam.
The value of any segment (byte) is between 0 and 255 (both included).
There are no zeroes preceding the value in any segment (054 is wrong, 54 is correct).
Classful Addressing
The 32-bit IP address is divided into five sub-classes. These are:
Class A
Class B
Class C
Class D
Class E
Each of these classes has a valid range of IP addresses. Classes D and E are reserved for
mul cast and experimental purposes respec vely. The order of bits in the first octet
determines the classes of IP address.
IPv4 address is divided into two parts:
Network ID
Host ID
The class of IP address is used to determine the bits used for network ID and host ID and the
number of total networks and hosts possible in that par cular class. Each ISP or network
administrator assigns IP address to each device that is connected to its network.
24
Class A:
IP address belonging to class A are assigned to the networks that contain a large number of
hosts.
2^7-2= 126 network ID (Here 2 address is subtracted because [Link] and 127.x.y.z are
special address.)
2^24 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x
25
Class B:
IP address belonging to class B are assigned to the networks that ranges from medium-sized
to large-sized networks.
Class C:
IP address belonging to class C are assigned to small-sized networks.
Class D:
IP address belonging to class D are reserved for mul -cas ng. The higher order bits of the first
octet of IP addresses belonging to class D are always set to 1110. The remaining bits are for
the address that interested hosts recognize.
Class D does not possess any sub-net mask. IP addresses belonging to class D ranges from
[Link] – [Link].
Class E:
IP addresses belonging to class E are reserved for experimental and research purposes. IP
addresses of class E ranges from [Link] – [Link]. This class doesn’t have any sub-
net mask. The higher order bits of first octet of class E are always set to 1111.
OSPF
h ps://[Link]/topics/ospf-protocol/
h ps://[Link]/ospf-protocol
BGP
h ps://[Link]/topics/computer-network/bgp-border-gateway-protocol/