0% found this document useful (0 votes)
8 views70 pages

Unit 3 CN

The document discusses the Network Layer, focusing on design issues and routing algorithms, including adaptive and non-adaptive methods. It explains various routing algorithms such as shortest path, distance vector, and flooding, along with their advantages and disadvantages. Additionally, it covers IP addressing, including static and dynamic IP addresses, and the classification of IP addresses into classes A, B, C, D, and E.

Uploaded by

venniisrinivas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views70 pages

Unit 3 CN

The document discusses the Network Layer, focusing on design issues and routing algorithms, including adaptive and non-adaptive methods. It explains various routing algorithms such as shortest path, distance vector, and flooding, along with their advantages and disadvantages. Additionally, it covers IP addressing, including static and dynamic IP addresses, and the classification of IP addresses into classes A, B, C, D, and E.

Uploaded by

venniisrinivas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 70

UNIT- III

Network Layer

Network Layer: Design issues, Routing algorithms:


shortest path routing, Flooding, Hierarchical routing,
Broadcast, Multicast, distance vector routing, Congestion
Control Algorithms, Quality of Service, Internetworking.
[REFERENCE-1&2]
Network Layer Design
Issues
Routing
Algorithms
Routing Algorithm
► Routing is the process of forwarding the packets from
source to the destination but the best route to send the
packets is determined by the routing algorithm.
► A routing algorithm is a procedure that lays down the route
or path to transfer data packets from source to the
destination. They help in directing Internet traffic
efficiently.
► After a data packet leaves its source, it can choose among
the many different paths to reach its destination.
► Routing algorithm mathematically computes the best path,
i.e. “least – cost path” that the packet can be routed
through.
Classification of a Routing Algorithm
Adaptive Routing algorithm

An adaptive routing algorithm is also known as dynamic routing algorithm.


This algorithm makes the routing decisions based on the topology and network traffic.
The main parameters related to this algorithm are hop count, distance and estimated transit
time.

An adaptive routing algorithm can be classified into three parts:

► Centralized algorithm: It is also known as global routing algorithm as it computes the


least-cost path between source and destination by using complete and global knowledge
about the network. This algorithm takes the connectivity between the nodes and link cost as
input, and this information is obtained before actually performing any calculation. Link state
algorithm is referred to as a centralized algorithm since it is aware of the cost of each link in
the network.

► Isolation algorithm: It is an algorithm that obtains the routing information by using local
information rather than gathering information from other nodes.

► Distributed algorithm: It is also known as decentralized algorithm as it computes the least-


cost path between source and destination in an iterative and distributed manner. In the
decentralized algorithm, no node has the knowledge about the cost of all the network links.
In the beginning, a node contains the information only about its own directly attached links
and through an iterative process of calculation computes the least-cost path to the
destination. A Distance vector algorithm is a decentralized algorithm as it never knows the
complete path from source to the destination, instead it knows the direction through which
the packet is to be forwarded along with the least cost path.
Non-Adaptive Routing algorithm
Non Adaptive routing algorithm is also known as a static
routing algorithm. When booting up the network, the
routing information stores to the routers. Non Adaptive
routing algorithms do not take the routing decision based
on the network topology or network traffic.
The Non-Adaptive Routing algorithm is of two
types:
► Flooding: In case of flooding, every incoming packet is
sent to all the outgoing links except the one from it has
been reached. The disadvantage of flooding is that
node may contain several copies of a particular packet.
► Random walks: In case of random walks, a packet
sent by the node to one of its neighbors randomly. An
advantage of using random walks is that it uses the
alternative routes very efficiently.
Differences b/w Adaptive and Non-
Adaptive RoutingAdaptive
Basis Of Comparison
Algorithm
Routing algorithm Non-Adaptive Routing algorithm

Define Adaptive Routing algorithm The Non-Adaptive Routing


is an algorithm that algorithm is an algorithm
constructs the routing that constructs the static
table based on the network table to determine which
conditions. node to send the packet.

Usage Adaptive routing algorithm The Non-Adaptive Routing


is used by dynamic algorithm is used by static
routing. routing.

Routing decision Routing decisions are Routing decisions are the


made based on topology static tables.
and network traffic.

Categorization The types of adaptive The types of Non Adaptive


routing algorithm, are routing algorithm are
Centralized, isolation and flooding and random
distributed algorithm. walks.

Complexity Adaptive Routing Non-Adaptive Routing


algorithms are more algorithms are simple.
complex.
Optimality Principle
A general statement is made about optimal routes without regard to
network topology or traffic. This statement is known as the optimality
principle( Bellman,1975).
Statement of the optimality principle :
► It states that if the router J is on the optimal path from router I to
router K, then the optimal path from J to K also falls along the
same route. Call the route from I to J r1 and the rest of the
route r2. it could be concatenated with r1 to improve the route
from I to K, contradicting our statement that r1r2 is optimal only if
a route better than r2 existed from J to K.
Sink Tree for routers :
► We can see that the set of optimal routes from all sources to a
given destination from a tree rooted at the destination as a
directed consequence of the optimality principle. This tree is called
a sink tree
Examples of Routing
Algorithms

▪ Shortest Path Routing Algorithm


▪ Distance Vector Routing Algorithm
▪ Link State Routing Algorithm
▪ Flooding Algorithm
Shortest Path Routing
Algorithm
► Consider that a network comprises of N vertices
(nodes or network devices) that are connected by M
edges (transmission lines).
► Each edge is associated with a weight,
representing the physical distance or the
transmission delay of the transmission line.
► The target of shortest path algorithms is to find a
route between any pair of vertices along the edges,
so the sum of weights of edges is minimum.
► If the edges are of equal weights, the shortest path
algorithm aims to find a route having minimum
number of hops.
Example : Dijkstra’s Algorithm
Dijkstra’s Algorithm
Input − A graph representing the network; and a source node, s
Output − A shortest path tree, spt[], with s as the root node.

Initializations :

► An array of distances dist[] of size |V| (number of nodes), where dist[s] =


0 and dist[u] = ∞ (infinite), where u represents a node in the graph except s.
► An array, Q, containing all nodes in the graph. When the algorithm runs into
completion, Q will become empty.
► An empty set, S, to which the visited nodes will be added. When the algorithm runs into
completion, S will contain all the nodes in the graph.
► Repeat while Q is not empty −
► Remove from Q, the node, u having the smallest dist[u] and which is not in S. In the first
run, dist[s] is removed.
► Add u to S, marking u as visited.
► For each node v which is adjacent to u, update dist[v] as −
► If (dist[u] + weight of edge u-v) < dist[v], Then
► Update dist[v] = dist[u] + weight of edge u-v

The array dist[] contains the shortest path from s to every other node.
Dijkstra’s Algorithm: Example

Input: src = 0, the graph is shown below.

Output: 0 4 12 19 21
11 9 8 14
Step Step Step
1: 2: 3:

Step
Step 5:
4:

Outp 0 4 12 19 21 11 9
ut: 8 14
Distance Vector Routing
Algorithm
A router transmits its distance vector to each of its neighbors
in a routing packet.
Each router receives and saves the most recently received
distance vector from each of its neighbors.
A router recalculates its distance vector when:
► It receives a distance vector from a neighbor
containing different information than before.
► It discovers that a link to a neighbor has gone down.
Dx(y) = Estimate of least cost from x to y
C(x,v) = Node x knows cost to each neighbor v
Dx = [Dx(y): y ∈ N ] = Node x maintains distance vector
Node x also maintains its neighbors' distance vectors
For each neighbor v, x maintains Dv = [Dv(y): y ∈ N ]
Distance vector routing Algorithm : Example

Example – Consider 3-routers X, Y and Z as


shown in figure. Each router have their routing
table. Every routing table will contain distance to
the destination nodes.
Advantages of Distance Vector routing
It is simpler to configure and maintain than link state routing.

Disadvantages of Distance Vector routing


► It is slower to converge than link state.
► It is at risk from the count-to-infinity problem.
► It creates more traffic than link state since a hop count change
must be propagated to all routers and processed on each
router. Hop count updates take place on a periodic basis, even
if there are no changes in the network topology, so bandwidth-
wasting broadcasts still occur.
Flooding Agorithm

► Flooding is a non-adaptive routing technique following this


simple method: when a data packet arrives at a router, it is sent to
all the outgoing links except the one it has arrived on.
► For example, let us consider the network in the figure, having six
routers that are connected through transmission lines.

An incoming packet to A, will be sent to B, C and D.


B will send the packet to C and E.
C will send the packet to B, D and F.
D will send the packet to C and F.
E will send the packet to F.
F will send the packet to C and E.
Types of Flooding

► Uncontrolled flooding − Here, each router


unconditionally 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).
► Selective flooding − Here, the routers transmit the
incoming packets only along those paths which are heading
towards approximately in the right direction, instead of
every available paths.
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 malfunctioning of a
large number routers, the packets find a way to reach the
destination.
► All nodes which are directly or indirectly connected are
visited. So, there are no chances for any node to be left out.
This is a main criteria in case of broadcast messages.
► The shortest path is always chosen by flooding.
Congestion Control
Algorithms
Network layer in the
Internet
Internet Protocol
Internet protocol
● IP Address is short for Internet Protocol Address.
● It is a unique address assigned to each
computing device in an IP network.
● ISP assigns IP Address to all the devices present
on its network.
● Computing devices use IP Address to identify
and communicate with other devices in the IP
network.
IP Address
Types of IP Address
1. Static IP Address-
► Static IP Address is an IP Address that once assigned
to a network element always remains the same.
► They are configured manually.

NOTE
Some ISPs do not provide static IP addresses.
Static IP Addresses are more costly than dynamic IP Addresses.

2. Dynamic IP Address-
► Dynamic IP Address is a temporarily assigned IP
Address to a network element.
► It can be assigned to a different device if it is not in
use.
► DHCP or PPPoE assigns dynamic IP addresses.
IP Address Format
1. Network ID represents the IP Address of the network and is
used to identify the network.

2. Host ID represents the IP Address of the host and is used to


identify the host within the network.
Example of an IP Address is-

00000001.10100000.00001010.11110000
(Binary Representation)
OR
1.160.10.240
(Decimal Representation)
IP Addressing
Classful Addressing
Class A
If the 32 bit binary address starts with a bit 0, then IP Address belongs
to class A

In class A IP Address,
The first 8 bits are used for the Network ID.
The remaining 24 bits are used for the Host ID.
Total number of IP Addresses available in class A
= Numbers possible due to remaining available 31
bits
= 231
Total number of networks available in class A
= Numbers possible due to remaining available 7 bits
in the Net ID – 2
= 27 – 2= 126

Total number of hosts that can be configured in class


A= Numbers possible due to available 24 bits in the
Host ID – 2
= 224 – 2

(The reason of subtracting 2 is explained later.)


Range Of 1st Octet

Minimum value of 1st octet = 00000000 = 0


Maximum value of 1st octet = 01111111 = 127

From here,
Range of 1st octet = [0, 127]

But 2 networks are reserved and unused.

Uses
Class A is used by big organizations like NASA, Pentagon
etc.
Class B
If the 32 bit binary address starts with bits 10, then IP Address
belongs to class B

In class B IP Address,
The first 16 bits are used for the Network ID.
The remaining 16 bits are used for the Host ID.
Total number of IP Addresses available in class B
= Numbers possible due to remaining available 30 bits
= 230

Total number of networks available in class B


= Numbers possible due to remaining available 14 bits in
the Net ID
= 214

Total number of hosts that can be configured in class B


= Numbers possible due to available 16 bits in the Host ID
–2
= 216 – 2
Range Of 1st Octet

Minimum value of 1st octet = 10000000 = 128


Maximum value of 1st octet = 10111111 = 191
Range of 1st octet = [128, 191]

Uses
Class B is used by organizations requiring medium
size networks like IRCTC, banks etc.
Class C
If the 32 bit binary address starts with bits 110, then IP Address
belongs to class C.
In class C IP Address,
The first 24 bits are used for the Network ID.
The remaining 8 bits are used for the Host ID.
Total number of IP Addresses available in class C
= Numbers possible due to remaining available 29 bits
= 229

Total number of networks available in class C


= Numbers possible due to remaining available 21 bits in
the Net ID
= 221

Total number of hosts that can be configured in class C


= Numbers possible due to available 8 bits in the Host ID –
2
= 28 – 2
Range Of 1st Octet

Minimum value of 1st octet = 11000000 = 192


Maximum value of 1st octet = 110111111 = 223
So, Range of 1st octet = [192, 223]

Uses
Class C is used by organizations requiring small to
medium size networks.
For example- engineering colleges, small universities,
small offices etc
Class D
If the 32 bit binary address starts with bits 1110, then IP
Address belongs to class D.

Class D is not divided into Network ID and Host ID


Total number of IP Addresses available in class D
= Numbers possible due to remaining available 28 bits
= 228

Range Of 1st Octet


Minimum value of 1st octet = 11100000 = 224
Maximum value of 1st octet = 11101111 = 239
So, Range of 1st octet = [224, 239]

Uses
Class D is reserved for multicasting.
In multicasting, there is no need to extract host address
from the IP Address.
This is because data is not destined for a particular host.
Class E
If the 32 bit binary address starts with bits 1111, then IP
Address belongs to class E
Total number of IP Addresses available in class E
= Numbers possible due to remaining available 28 bits
= 228

Range Of 1st Octet

Minimum value of 1st octet = 11110000 = 240


Maximum value of 1st octet = 11111111 = 255
So, Range of 1st octet = [240, 255]

Uses
Class E is reserved for future or experimental purposes.
IPV6
Format of an IPv6 address
An IPv6 address is 128 bits long and is arranged in eight groups, each
of which is 16 bits.
Each group is expressed as four hexadecimal digits and the groups are
separated by colons.

An example of a full IPv6 address could be:


FE80:CD00:0000:0CDE:1257:0000:211E:729C
An IPv6 address is split into two parts:

The network component is the first 64 bits of the address and is used for routing.

The node component is the later 64 bits and is used to identify the address of
the interface. It is derived from the physical, or MAC address, using the 64-bit
extended unique identifier (EUI-64) format defined by the Institute of Electrical
and Electronics Engineers (IEEE).

The network component can be split even further into a block of 48 bits and a
block of 16 bits.

The upper 48-bit section is used for global network addresses.

The lower 16-bit section is controlled by network administrators and is used for
subnets on an internal network.

An address can be shortened, as the addressing scheme allows the omission of


any leading zero, as well as any sequences consisting of only zeros.

The shortened version would look like:

FE80:CD00:0:0CDE:1257:0:211E:729C
Subnetting
and
Internetworking
IP Subnetting
In networking,
► The process of dividing a single network into multiple sub
networks is called as subnetting.
► The sub networks so created are called as subnets.
Example-
Following diagram shows the subnetting of a big single
network into 4 smaller subnets-
Contd.,
Advantages
The two main advantages of subnetting a network are
⮚ It improves the security.
⮚ The maintenance and administration of subnets is easy.
Subnet ID
⮚ Each subnet has its unique network address known as its
Subnet ID.
⮚ The subnet ID is created by borrowing some bits from the
Host ID part of the IP Address.
⮚ The number of bits borrowed depends on the number of
subnets created.
Types of Subnetting
Contd.,
1. Fixed Length Subnetting
Fixed length subnetting also called as classful subnetting
divides the network into subnets where-
⮚ All the subnets are of same size.
⮚ All the subnets have equal number of hosts.
⮚ All the subnets have same subnet mask.
2. Variable Length Subnetting
Variable length subnetting also called as classless subnetting
divides the network into subnets where-
⮚ All the subnets are not of same size.
⮚ All the subnets do not have equal number of hosts.
⮚ All the subnets do not have same subnet mask.
Subnetting Examples
Consider, we have a big single network having IP Address
200.1.2.0.
We want to do subnetting and divide this network into 2
subnets.
Clearly, the given network belongs to class C.
Contd.,
For creating two subnets and to represent their subnet IDs,
we require 1 bit.
So,
⮚ We borrow one bit from the Host ID part.
⮚ After borrowing one bit, Host ID part remains with only
7 bits.
Contd.,
Contd.,
Contd.,
Contd.,
Example-02:
Consider-
We have a big single network having IP Address 200.1.2.0
We want to do subnetting and divide this network into 4
subnets.
Clearly, the given network belongs to class C.
Contd.,
Contd.,
Contd.,
Contd.,
Contd.,
Disadvantages of Subnetting-
During subnetting,
⮚ We have to face a loss of IP Addresses.
⮚ This is because two IP Addresses are wasted for each
subnet.
⮚ One IP address is wasted for its network address.
⮚ Other IP Address is wasted for its direct broadcasting
address.
⮚ After subnetting, the communication process becomes
complex
Problem-01:
Suppose a network with IP Address 192.16.0.0. is divided
into 2 subnets, find number of hosts per subnet.

Also for the first subnet, find-

► Subnet Address
► First Host ID
► Last Host ID
► Broadcast Address
Contd.,
Thank You…

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy