0% found this document useful (0 votes)
21 views

Module 3 - CN - AIML

Uploaded by

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

Module 3 - CN - AIML

Uploaded by

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

The material in this presentation belongs to SIES GST and is solely for educational purposes.

Distribution and modifications of the content is prohibited.

Computer Networks(CN)
Subject code : CSC501

Module 3 :Network Layer

Subject In-charge
Ms. Gigi Joseph
Assistant Professor(ECS Dept.)
Lab No. 220

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 1
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Syllabus
Module
Topic Sub-topics Weightage
no.
• Network Layer: Communication
Primitives
• IPv4 Addressing (classful and classless)
• Subnetting
• IPv4 Protocol
• Network Address Translation (NAT)
Network
3. • IPv6 addressing ≈ 14 Marks
Layer
• IPv4 vs IPv6 addressing
• Routed vs Routing protocols
• Classification of Routing algorithms
• Shortest Path algorithms (Dijkastra‗s)
• Link state routing
• Distance Vector Routing
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 2
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

NETWORK LAYER
• Layer 3 on the OSI reference model

• Responds to service requests from the transport layer and issues service requests
to the data link layer.

• layer at which routing occurs - responsible for source-to-destination delivery of a


packet, across multiple networks/links Whereas the data link layer oversees the
delivery of the packet between two systems on the same network, the network
layer ensures that each packet gets from its point of origin to its final destination
- One of the functions of the network layer is to provide a routing mechanism

• Implements routing of frames (packets) through the network.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 3
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

NETWORK LAYER
• Adds a header that includes the logical address of the sender and the receiver to
the packet coming from the upper layer.

• Defines the most optimum path the packet should take from the source to the
destination

• Defines logical addressing so that any endpoint can be identified.

• Handles congestion in the network.

• Facilitates interconnection between heterogeneous networks (Internetworking).

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 4
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Connection-oriented Vs Connectionless service


Connection-oriented Connectionless
• Creation and termination of the • Transfer data packets without
connection for sending data creating any connection
• creates virtual path • Doesn’t create a virtual path
• Requires authentication • Doesn’t require authentication
• Data packets are received in same • Not received in same order
order as sent by the sender
• Requires low bandwidth to transfer
• Requires higher bandwidth data
• More reliable • Not a reliable service
• No congestion • May cause congestion

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 5
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

NETWORK LAYER SERVICES


• The network layer also defines how to fragment a packet into smaller packets to
accommodate different media.

• The network layer must know the topology of the subnet and choose appropriate
paths through it

• The services provided by network layer need to be designed with the following
goals:
 The services should be independent of the router technology
 The transport layer should be shielded from the number, type, and topology
of the routers present
 The network addresses made available to the transport layer should use a
uniform numbering plan, even across LANs and WANs

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 6
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

NETWORK LAYER SERVICES


• The network services should be either connectionless, with primitives SEND
PACKET and RECEIVE PACKET, or it should provide a reliable connection-
oriented service

• If connectionless service is offered – packets are injected into the network


individually and routed independently of each other – no advance set up is
needed – here data packets are called datagrams and the network is called
datagram network

• If connection- oriented service is used – a path from the source router all the
way to the destination router must be established before any data packets can be
sent - This connection is called a VC (virtual circuit) and the network is called
a virtual-circuit network.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 7
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

NETWORK LAYER PERFORMANCE


The characteristics that measure the performance of a network are:

 Latency : time required to successfully send a packet across a network


Delay = Transmission time + Propagation time + Queuing time + Processing
delay

 Throughput : number of packets successfully transmitted per unit time

 Packet loss : Number of packets lost during transmission severely affects the
performance of network - packet will have to be retransmitted - lead to
overflow and causes more packet loss

 Congestion control : is related to throughput and delay

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 8
Communication Primitives: Unicast, Multicast, Broadcast
Feature Unicast Broadcast Multicast

A communication where A communication


A communication where a
a message is sent from where a message is
Definition message is sent from one
one sender to one sent from one sender to
sender to all receivers.
receiver. a group of receivers

Data is sent to a single Data is sent to all Data is sent to a group


Transmission
recipient recipients in a network of recipients

Uses a unique destination Uses a special broadcast Uses a special


Addressing
address address multicast address

Not all devices may be Not all devices may be


Delivery Guaranteed delivery
interested in the data interested in the data

Computer Networks
Department of Electronics and Computer Science (ECS) Ms. Gigi Joseph 9
Feature Unicast Broadcast Multicast

Generates the least Generates the most Generates moderate


Network Traffic
amount of network traffic amount of network traffic network traffic

Moderately secure
More secure because data Less secure because data
because data is sent to a
Security is sent to a specific is sent to all devices in the
specific group of
recipient network
devices

DHCP requests, ARP Video streaming, online


Examples Email, file transfer
requests gaming

Destination Single receiver All receivers Grop of receivers

Bandwidth usage Moderate High Moderate

Latency Low High Moderate

Computer Networks
Department of Electronics and Computer Science (ECS) Ms. Gigi Joseph 10
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 addressing
• IP address is assigned to each and every host and router on the network which
is referred in the source as well as destination address fields of IP packets – it
actually doesn’t refer to a host but to a network interface

• IPv4 address is a 32 bit address that uniquely and universally defines the
connection of a device to the internet
They are unique in the sense that They are universal in the
each address defines one, and sense that the addressing
only one, connection to the system must be accepted by
Internet - Two devices on the any host that wants to be
Internet can never have the same connected to the Internet.
address at the same time.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 11
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 addressing
• Address space : total number of addresses used by the protocol - If a protocol
uses N bits to define an address, the address space is 2N because each bit can
have two different values (0 or 1) and N bits can have 2N values

• IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than 4 billion)

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 12
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Notations: Two notations to show an IPv4 address: binary notation and dotted decimal
notation

Binary Notation
IPv4 address is displayed as 32 bits - Each octet is often referred to as a byte – so, its a 32-
bit address or a 4-byte address- Eg. 01110101 10010101 00011101 00000010

Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read - Internet addresses are usually
written in decimal form with a decimal point (dot) separating the bytes – Eg.117.149.29.2

Fig. Dotted-decimal notation and binary notation for an IPv4 address


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 13
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Q. Change the following IPv4 addresses from binary notation to dotted-decimal


notation.

Solution
We replace each group of 8 bits with its equivalent decimal number and add dots
for separation.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 14
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Q. Change the following IPv4 addresses from dotted-decimal


notation to binary notation.
Solution
We replace each decimal number with its binary equivalent

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 15
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Classful Addressing :
Address space is divided into 5 classes : A,B,C,D,E

Fig. IP address formats


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 16
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. IP address formats

Table. Number of blocks and block size in classful IPv4 addressing


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 17
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 18
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Each class is divided into a fixed number of blocks with each block having a fixed
size
Class A addresses – designed for large organizations with a large number of
attached hosts or routers
Class B addresses – designed for midsize organizations with tens of thousands of
attached hosts or routers.
Class C addresses – designed for small organizations with a small number of
attached hosts or routers
Class D addresses – designed for multicasting – each address is used to define one
group of hosts on the internet
Class E addresses – reserved for future use

A large part of the available addresses were wasted

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 19
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IP addresses are hierarchical – each Each 32-bit address is comprised of a variable-


length network portion in the top bits and a host portion in the bottom bits. The
network portion has the same value for all hosts on a single network, such as an
Ethernet LAN – called as prefix

The length of the prefix corresponds to a binary mask of 1s in the network portion
- called a subnet mask - It can be ANDed with the IP address to extract only the
network portion

IP address in class A,B and C is divided into NetID and HostID – these parts are of
varying lengths, depending on the class of the address
In class A, one byte defines the netID and three bytes define the hostID
In class B, two bytes define the neID and two bytes define the hostID
In class C, three bytes define the netID and one byte defines the hostID
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 20
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 21
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Find the class of each address


a. 4.23.145.90
b. 227.34.78.7
c. 246.7.3.8
d. 129.6.8.4
e. 198.76.9.23

Answers:
a. Class A
b. Class D
c. Class E
d. Class B
e. Class C

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 22
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Mask :a 32-bit number made of contiguous 1s followed by contiguous 0s – mask


can help to find the netID and hostID
The default masks for classes A, B, and C are shown in Table

/n defines the mask – called


slash notation or classless
interdomain routing
(CIDR) notation

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 23
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• For example , the mask for class A address has eight 1s, which means the first 8 bits
out of 32 total bits define the netID and the next 24 bits define the hostID
• Advantage of prefix: routers can forward packets based on only the network portion
of the address, as long as each of the networks has a unique address block - host
portion does not matter to the routers because all hosts on the same network will be
sent in the same direction
• Disadvantages : IP address of a host depends on where it is located in the network
Hierarchy is wasteful of addresses unless it is carefully managed

• Address Depletion: The flaws in classful addressing scheme combined with fast
growth of the Internet led to depletion of the available addresses
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 24
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Classless addressing :
• Was designed and implemented to overcome address depletion and give more
organizations access to the Internet
• There are no classes , but the addresses are still granted in blocks

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 25
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Restrictions on classless address blocks :


 The addresses in a block must be continuous, one after another. 2
 The number of addresses in a block must be a power of 2 (I, 2, 4, 8, ... ). 3
 The first address must be evenly divisible by the number of addresses
• Mask : In 1Pv4 addressing, a block of addresses can be defined as x.y.z.t/n in
which x.y.z.t defines one of the addresses and the /n defines the mask

First address :The first address in the block can be found by setting the rightmost
(32 – n) bits to 0s

Last address :The last address in the block can be found by setting the rightmost
(32 – n) bits to 1s

The number of addresses in the block can be found by using the formula 2^(32-n)
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 26
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Example :A block of addresses is granted to a small organization. We know that


one of the addresses is 205.16.37.39/28. Find the first address and the last address
in the block. Also find number of addresses in block
The binary representation of the given address and mask is
11001101 00010000 00100101 00100111 (Address)
11111111 11111111 11111111 11110000 (Mask)

Now to get the first address in the block we set 32-28=4 rightmost bits to 0
11001101 000100000100101 0010000 i.e. 205.16.37.32
Now to get the last address in the block we set 32-28=4 rightmost bits to 1
11001101 00010000 001001010010 1111 or 205.16.37.47
So, the number of addresses = 2^(32-n) = 2^(32-28) = 16

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 27
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

SUBNETTING
• For class A , the total number of hosts available are 167,77,216 hosts and Class
B provides for 65,534 hosts

• So creating a network with total number of hosts allowed for class A or B


addresses will be complex and complicated

• Each class C address has 254 host addresses available – If you wanted 2
networks with 100 addresses and used 2 class C networks, 308 addresses would
be wasted

• To overcome this problem with class based /classful addressing , subnetting


was introduced

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 28
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

SUBNETTING
• Subnetting allows you to borrow some host bits and use them to create new
networks

• These networks are commonly called subnets and are smaller in size

• Benefits of subnetting : Reduced broadcast


Increased network performance
Easier management
Scalability

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 29
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 30
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. A network configuration for a block without subnet


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 31
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Configuration and address in a subnetted network


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 32
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 33
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

 An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536


addresses). The ISP needs to distribute these addresses to three groups of
customers as follows:
a. The first group has 64 customers; each needs 256 addresses.
b. The second group has 128 customers; each needs 128 addresses.
c. The third group has 128 customers; each needs 64 addresses.
Design the subblocks and find out how many addresses are still available after
these allocations.
Group 1
For this group, each customer needs 256 addresses. This means that 8 (256=2𝑥𝑥 ,
x=8)bits are needed to define each host. The prefix length is then 32 − 8 = 24. The
addresses are

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 34
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Group 2
For this group, each customer needs 128 addresses. This means that 7 (log2 128)
bits are needed to define each host. The prefix length is then 32 − 7 = 25. The
addresses are

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 35
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Group 3
For this group, each customer needs 64 addresses. This means that 6 (log264) bits
are needed to each host. The prefix length is then 32 − 6 = 26. The addresses are

Number of granted addresses to the ISP: 65,536


Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576(=65,536-40,960)

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 36
Classless Vs Classful Addressing
Parameter Classful Addressing Classless Addressing
Classless addressing came to
replace the classful
In Classful addressing IP addresses are
Basics addressing and to handle the
allocated according to the classes- A to E.
issue of rapid exhaustion of
IP addresses.
Practical It is less practical. It is more practical.
Network ID and The changes in the Network ID and Host There is no such restriction of
Host ID ID depend on the class. class in classless addressing.
It supports the Variable
It does not support the Variable Length
VLSM Length Subnet Mask
Subnet Mask (VLSM).
(VLSM).

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 37
Parameter Classful Addressing Classless Addressing
Classful addressing requires more It requires less bandwidth.
bandwidth. As a result, it becomes slower Thus, fast and less expensive
Bandwidth
and more expensive as compared to as compared to classful
classless addressing. addressing.
It does not support Classless Inter-Domain It supports Classless Inter-
CIDR
Routing (CIDR). Domain Routing (CIDR).
Updates Regular or periodic updates Triggered Updates
Troubleshooting and problem detection
Troubleshooting
are easy than classless addressing because It is not as easy compared to
and Problem
of the division of network, host and classful addressing.
detection
subnet parts in the address.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 38
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 39
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL
• An IPv4 datagram consists of a header part and a body or payload part

• header has a 20-byte fixed part and a variable-length optional part

• The bits are transmitted from left to right and top to bottom, with the high-order
bit of the Version field going first

• Version field - keeps track of which version of the protocol the datagram
belongs to. By including the version at the start of each datagram, it becomes
possible to have a transition between versions over a long period of time

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 40
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL
• Since the header length is not constant, a field in the header, IHL, is provided to
tell how long the header is, in 32-bit words - minimum value is 5 - maximum
value of this 4-bit field is 15, which limits the header to 60 bytes, and thus the
Options field to 40 bytes

• Differentiated services field - Originally, it was called the Type of service field
- distinguish between different classes of service - Type of service field
provided 3 bits to signal priority and 3 bits to signal whether a host cared more
about delay, throughput, or reliability- the top 6 bits are used to mark the packet
with its service class - bottom 2 bits are used to carry explicit congestion
notification information, such as whether the packet has experienced
congestion

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 41
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL
• Total length includes everything in the datagram—both header and data. The
maximum length is 65,535 bytes

• Identification field is needed to allow the destination host to determine which


packet, a newly arrived fragment belongs to. All the fragments of a packet
contain the same Identification field value

• Next comes as an unused bit

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 42
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL (Fragmentation)


• Two 1-bit fields related to fragmentation.
 DF stands for Don’t Fragment. It is an order to the routers not to fragment
the packet - By marking the datagram with the DF bit, the sender knows it
will either arrive in one piece, or an error message will be returned to the
sender
 MF stands for More Fragments - All fragments except the last one have
this bit set. It is needed to know when all fragments of a datagram have
arrived

• The Fragment offset tells where in the current packet this fragment belongs -
Since 13 bits are provided, there is a maximum of 8192 fragments per
datagram, supporting a maximum packet length up to the limit of the Total
length field

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 43
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL
• The TTL (Time to live) field is a counter used to limit packet lifetimes - It must
be decremented on each hop and is supposed to be decremented multiple times
when a packet is queued for a long time in a router. In practice, it just counts
hops. When it hits zero, the packet is discarded and a warning packet is sent
back to the source host. This feature prevents packets from wandering around
forever

• Protocol field tells it which transport process to give the packet to. TCP is one
possibility, but so are UDP and some others

• Since the header carries vital information such as addresses, it rates its own
checksum for protection, the Header checksum - the Header checksum is
assumed to be zero upon arrival. Such a checksum is useful for detecting errors
while the packet travels through the network
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 44
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL
• The Source address and Destination address indicate the IP address of the
source and destination network interfaces

• The Options field was designed to provide an escape to allow subsequent


versions of the protocol to include information not present in the original
design, to permit experimenters to try out new ideas, and to avoid allocating
header bits to information that is rarely needed
• Security option tells how secret the information is
• Strict source routing option gives the complete path from source to
destination as a sequence of IP addresses - datagram is required to
follow that exact route
• Loose source routing option requires the packet to traverse the list of
routers specified, in the order specified, but it is allowed to pass
through other routers on the way
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 45
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 PROTOCOL
• Record route option tells each router along the path to append its IP
address to the Options field – helps to track down bugs in the routing
algorithms
• Timestamp option is like the Record route option, except that in
addition to recording its 32-bit IP address - each router also records a
32-bit time-stamp - mostly useful for network measurement

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 46
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

NETWORK ADDRESS TRANSLATION (NAT)


• enables a user to have a large set of addresses internally and one address, or a
small set of addresses, externally
• The traffic inside can use the large set; the traffic outside, the small set.
• To separate the addresses used inside the home or business and the ones used for
the Internet, the Internet authorities have reserved three sets of addresses as
private addresses

Table. Addresses for private network

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 47
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. A NAT implementation

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 48
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Addresses in a NAT

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 49
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. NAT address translation


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 50
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. An ISP and NAT


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 51
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv4 has some deficiencies that make it unsuitable for the fast-growing Internet
o Despite all short-term solutions, such as subnetting, classless addressing,
and NAT, address depletion is still a long-term problem in the Internet

o The Internet must accommodate real-time audio and video transmission.


This type of transmission requires minimum delay strategies and
reservation of resources not provided in the IPv4 design

o The Internet must accommodate encryption and authentication of data for


some applications. No encryption or authentication is provided by IPv4.

To overcome these deficiencies, IPv6 (Internetworking Protocol, version 6), also


known as IPng (Internetworking Protocol, next generation), was proposed and is
now a standard.
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 52
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv6
• IPv6 was extensively modified to support growth of Internet

• The next-generation IP, or IPv6, has some advantages over IPv4 :


 Larger address space : An IPv6 address is 128 bits long - compared with
the 32-bit address of IPv4, this is a huge increase in the address space

 Better header format : IPv6 uses a new header format in which options
are separated from the base header and inserted, when needed, between the
base header and the upper-layer data. This simplifies and speeds up the
routing process because most of the options do not need to be checked by
routers

 New options : IPv6 has new options to allow for additional functionalities

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 53
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv6
 Allowance for extension : IPv6 is designed to allow the extension of the
protocol if required by new technologies or applications

 Support for resource allocation : In IPv6, the type-of-service field has


been removed, but a mechanism has been added to enable the source to
request special handling of the packet. This mechanism can be used to
support traffic such as real-time audio and video

 Support for more security : The encryption and authentication options in


IPv6 provide confidentiality and integrity of the packet

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 54
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Routing protocols are also changed to support IPv6.

• Adoption of IPv6 is slow, as it needs infrastructural, device and protocol


changes in networks.

• However services like mobile IP, IP telephony, IoT, will require total
replacement on IPv4 with IPv6

• Packet format : Each packet is composed of a mandatory base header


followed by the payload. The payload consists of two parts: optional extension
headers and data from an upper layer. The base header occupies 40 bytes,
whereas the extension headers and data from the upper layer contain up to
65,535 bytes of information

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 55
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Packet format : Each packet is composed of a mandatory base header


followed by the payload. The payload consists of two parts: optional extension
headers and data from an upper layer. The base header occupies 40 bytes,
whereas the extension headers and data from the upper layer contain up to
65,535 bytes of information

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 56
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv6 datagram format

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 57
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Basehead : has 8 fields


 Version : this 4-bit field defines the version number of the IP. For IPv6, the value
is 6

 Priority : 4-bit priority field defines the priority of the packet with respect to
traffic congestion

 Flow label : The flow label is a 3-byte (24-bit) field that is designed to provide
special handling for a particular flow of data

 Payload length : The 2-byte payload length field defines the length of the IP
datagram excluding the base header

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 58
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

 Next header : The next header is an 8-bit field defining the header that follows
the base header in the datagram - The next header is either one of the optional
extension headers used by IP or the header of an encapsulated packet such as
UDP or TCP.

 Hop limit : This 8-bit hop limit field serves the same purpose as the TIL field in
IPv4

 Source address : The source address field is a 16-byte (128-bit) Internet address
that identifies the original source of the datagram

 Destination address : is a 16-byte (128-bit) Internet address that usually


identifies the final destination of the datagram. However, if source routing is
used, this field contains the address of the next router.
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 59
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

IPv6 address
• consists of 16 bytes (octets) i.e. 128 bits long
• Representation :
 Binary : uses 128 bits
 Hexadecimal : colon divides address into 8 sections – each section contain
octets made of 4 hexadecimal digits separated by colon – i.e. the address
consists of 32 hexadecimal digits, with every 4 digits separated by a colon

Even in hexadecimal format , IP address is very long – in order to


abbreviate the address , the leading zeroes of a section can be omitted - .
Only the leading zeroes can be dropped, not the trailing zeroes
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 60
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Abbreviated IPv6 address

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 61
• Address Space : IPv6 contains 2128 address – its huge and
296 times more than IPv4

• Address types:
 Unicast address :
 defines single interface and packet will be routed to intended recipient

 When a computer that is the source wants to communicate with another


computer which is the destination, it uses the unicast address as a
destination. Therefore, the unicast address refers to a single/individual
host.

 The unicast is used to send data to a single destination. It


communicates one to one.
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 62
 Anycast address :
 defines a group of computers which will share a single address – anycast
address is delivered to only one which is most reachable member of the
group

 it sends the same IP address to different devices/servers.

 Anycast address is mostly used in websites such as Google, where it hits


the nearest server based on a location. For example, if you live in India,
the router sends your request to the Indian servers of Google.

 Therefore, assigning a unicast address to more than one interface makes


a unicast address an anycast address. Anycast address delivers packets to
its nearest interface.
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 63
 Multicast address :
 defines a group of computers – each member of the group receives a
copy of address packet

 is used to deliver a package to a group of destinations. Therefore, a single


source is able to communicate with many other destination hosts.

 The multicast has a one-to-many relationship.

 The range for the multicast address is FF00::/8.

 There is no need to make a different range for broadcasting a message.


The multicast can broadcast the message.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 64
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 65
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Comparison of IPv4 and IPv 6 packet headers

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 66
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 67
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

ROUTING ALGORITHMS
Main function of the network layer is routing packets from the source machine to the
destination machine

Routing algorithm : -Major area of network design - choses the routes and the
data structures that they use
-that part of the network layer software responsible for
deciding which output line an incoming packet should be
transmitted on

If the network uses datagrams internally, this decision must be made anew for every
arriving data packet since the best route may have changed since last time

If the network uses virtual circuits internally, routing decisions are made only when a
new virtual circuit is being set up - data packets just follow the already established
route - called session routing because a route remains in force for an entire session
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 68
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

2 processes inside a Router : - look up outgoing lines in a table and figure out on
which line each packet that arrives has to be sent
– forwarding
- fills in and updates the routing tables –
responsibility of routing algorithms

Desirable properties of routing algorithm :


1. Correctness : The routing algorithm should be correct enough to deliver the
right packet to the right destination
2. Simplicity : It should be simple enough to implement and also to manipulate
3. Optimality : To achieve efficient routing one or more of the metrics should be
optimized - The metric may be the number of hops, delay bandwidth etc. - The
routing algorithms should be optimal in terms of throughput and minimizing
mean packet delays
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 69
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

3. Robustness : It should be robust enough to adapt to the situation in which the


desired path is congested or a router in the path is under maintenance or they
may be topological changes in the network - should be able to handle new
routers coming online, as well as, handle other routers going off or
malfunctioning.
4. Stability : The routing algorithm should come to equilibrium after running a
certain amount of time and after accommodating the changes in the network -
under constant conditions should converge to some equilibrium.
5. Fairness : The routing algorithm should be fair to all the hosts in delivering the
data sent by them - Every node connected to the network should get a fair
chance of transmitting their packets. This is generally done on a first come
first serve basis.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 70
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Design Parameters of Routing Algorithms :


i. Performance Criteria : Number of hops, Cost - Send packet with high
bandwidth path as the cost is less, Delay - Size of Queue, Throughput time -
Number of packets delivered/time
ii. Decision Time : When to decide to route a packet? Per-Packet(Datagram) or
Per session(Virtual-Circuit).
iii. Decision Place : Who will decide about routing? Each Node(distributed),
Central Node (centralized),Originated Node (source) .
iv. Network Information Source : None, Local, Adjacent node, Nodes along the
route, All nodes.
v. Network Information Update Time : Continuous, Periodic, Major Load
Change, Topology Change

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 71
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Routing algorithms – can be grouped as


 Non adaptive (static) and adaptive(dynamic)
 Inter-domain and intra domain

Non-adaptive algorithms :
• choice of the route is computed in advance , offline and downloaded to the
routers when the network is booted – static routing – does not respond to
failure
• here, table mappings are established by the network administrator before the
beginning of routing - These mappings do not change unless the network
administrator alters them
• Algorithms that use static routes are simple to design and work well in
environments where network traffic is relatively predictable and where network
design is relatively simple
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 72
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Routing decisions in these algorithms are in no way based on current topology


or traffic.

Adaptive algorithms :
• change the routing decisions to reflect changes in the topology, and sometimes
changes in the traffic as well – dynamic routing
• adjust to changing network circumstances by analysing incoming routing
update messages
• If the message indicates that a network change has occurred, the routing
software recalculates routes and sends out new routing update messages. These
messages permeate the network, stimulating routers to rerun their algorithms
and change their routing tables accordingly

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 73
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Inter-domain algorithms :
• Routing algorithm works within and between domains.
• It needs to know only about other routers within and between their domain.
• Protocols used in inter-domain routing are known as Exterior-gateway
protocols.
• In this Routing, routing takes place between the autonomous networks.
• Inter-domain routing protocol assumes that the internet contains the collection
of interconnected AS(autonomous systems).
• Popular Protocols of this routing is BGP(Border Gateway Protocol) used to
connect two or more AS(autonomous system).

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 74
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Intra-domain algorithms :
• Routing algorithm works only within domains.
• It need to know only about other routers within their domain.
• Protocols used in intra-domain routing are known as Interior-gateway
protocols.
• In this Routing, routing takes place within an autonomous network.
• Intra-domain routing protocols ignores the internet outside the AS(autonomous
system).
• Some Popular Protocols of this routing are RIP(resource information protocol)
and OSPF(open shortest path first).

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 75
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 76
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Routing table
A host or a router has a routing table with an entry for each destination, or a
combination of destinations, to route IP packets. The routing table can be either
static or dynamic

Static Routing Table :


• A static routing table contains information entered manually
• The administrator enters the route for each destination into the table.
• When a table is created, it cannot update automatically when there is a change
in the Internet - The table must be manually altered by the administrator.
• A static routing table can be used in a small internet that does not change very
often, or in an experimental internet for troubleshooting

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 77
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Routing table
Dynamic Routing Table :
• A dynamic routing table is updated periodically by using one of the dynamic
routing protocols.
• Whenever there is a change in the Internet, such as a shutdown of a router or
breaking of a link, the dynamic routing protocols update all the tables in the
routers (and eventually in the host) automatically.
• The routers in a big internet such as the Internet need to be updated
dynamically for efficient delivery of the IP packets

Fig. Common fields in a routing table

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 78
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Format of a routing table


• Mask : This field defines the mask applied for the entry

• Network address : This field defines the network address to which the packet is
finally delivered. In the case of host-specific routing, this field defines the
address of the destination host

• Next-hop address : This field defines the address of the next-hop router to
which the packet is delivered

• Interface : This field shows the name of the interface

• Flags : This field defines up to five flags. Flags are on/off switches that signify
either presence or absence. The five flags are U (up), G (gateway), H (host-
specific), D (added by redirection), and M (modified by redirection)
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 79
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Format of a routing table


 U (up) : indicates the router is up and running. If this flag is not present, it
means that the router is down. The packet cannot be forwarded and is discarded

 G (gateway) : indicates that the destination is in another network. The packet is


delivered to the next-hop router for delivery (indirect delivery). When this flag
is missing, it means the destination is in this network (direct delivery)

 H (host-specific) : indicates that the entry in the network address field is a host-
specific address. When it is missing, it means that the address is only the
network address of the destination

 D (added by redirection) : indicates that routing information for this destination


has been added to the host routing table by a redirection message

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 80
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Format of a routing table


 M (modified by redirection) : indicates that the routing information for this
destination has been modified by a redirection message

• Reference count : This field gives the number of users of this route at the
moment. For example, if five people at the same time are connecting to the
same host from this router, the value of this column is 5

• Use : This field shows the number of packets transmitted through this router for
the corresponding destination

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 81
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Distance Vector routing


• is a dynamic algorithm

• In distance vector routing, the least-cost route between any two nodes is the
route with minimum distance.

• Each node maintains a vector (table) of minimum distances to every node i.e.
each router maintain a table giving the best known distance to each destination
and which link to use to get there. These tables are updated by exchanging
information with the neighbours.

• The table at each node also guides the packets to the desired node by showing
the next stop in the route (next-hop routing).

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 82
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Distance Vector routing


• The distance might be measured as the number of hops or propagation delay
 If the metric is hops, the distance is just one hop.
 If the metric is propagation delay, the router can measure it directly
with special ECHO packets that the receiver just timestamps and sends
back as fast as it can.

• Sometimes also referred to as distributed Bellman-Ford routing algorithm

• Initialization : each node knows how to reach any other node and the cost -
Each node can know only the distance between itself and its immediate
neighbours, those directly connected to it -The distance for any entry that is not
a neighbour is marked as infinite (unreachable)

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 83
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Distance Vector routing


• Sharing of information : each node shares its routing table with its immediate
neighbours periodically and when there is a change

• Updating : Updating takes three steps:


1. The receiving node needs to add the cost between itself and the sending node
to each value in the second column. The logic is clear. If node C claims that its
distance to a destination is x , and the distance between A and C is y , then the
distance between A and that destination, via C, is x + y.

2. The receiving node needs to add the name of the sending node to each row as
the third column if the receiving node uses information from any row. The
sending node is the next node in the route.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 84
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Distance Vector routing


3. The receiving node needs to compare each row of its old table with the
corresponding row of the modified version of the received table.
a. If the next-node entry is different, the receiving node chooses the row
with the smaller cost. If there is a tie, the old one is kept.
b. If the next-node entry is the same, the receiving node chooses the new
row

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 85
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• When to Share
The question now is, When does a node send its partial routing table (only two
columns) to all its immediate neighbors? The table is sent both periodically and
when there is a change in the table.

 Periodic Update : A node sends its routing table, normally every 30 s,


in a periodic update.
 Triggered Update : A node sends its two-column routing table to its
neighbors anytime there is a change in its routing table. This is called
a triggered update. The change can result from the following.
i. A node receives a table from a neighbor, resulting in changes in
its own table after updating.
ii. A node detects some failure in the neighboring links which
results in a distance change to infinity.
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 86
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

BELLMAN FORD ALGORITHM


1. Initialize all distance value as infinity except source (0).
2. Repeat (v-1) times:
If d[u] + cost (uv) < d[v]
then update d[v]
Else skip
3. Relax all vertices once more.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 87
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

LINK STATE ROUTING


• Five parts of Link state routing: each router must -
1. Discover its neighbours and learn their network addresses.
2. Set the distance or cost metric to each of its neighbours
3. Construct a packet telling all it has just learned.
4. Send this packet to and receive packets from all other routers
5. Compute the shortest path to every other router.

• If each node in the domain has the entire topology of the domain i.e. the list of
nodes and links, how they are connected including the type, cost (metric), and
condition of the links (up or down) - the node can use Dijkstra's algorithm to build a
routing table.

• The topology must be dynamic, representing the latest state of each node and each
link - If there are changes in any point in the network (a link is down, for example),
the topology must be updated for each node
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 88
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

LINK STATE ROUTING


• Link state routing is based on the assumption that, although the global
knowledge about the topology is not clear, each node has partial knowledge: it
knows the state (type, condition, and cost) of its links - the whole topology can
be compiled from the partial knowledge of each node.

• Building Routing tables : In link state routing, four sets of actions are required
to ensure that each node has the routing table showing the least-cost node to
every other node
i. Creation of the states of the links by each node, called the link state
packet (LSP)
ii. Dissemination of LSPs to every other router, called flooding, in an
efficient and reliable way
iii. Formation of a shortest path tree for each node
iv. Calculation of a routing table based on the shortest path tree
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 89
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Creation of Link State Packet(LSP) : A link state packet can carry a large
amount of information – includes
 the node identity
 the list of links
 a sequence number - facilitates flooding and distinguishes new LSPs from
old ones
 age - prevents old LSPs from remaining in the domain for a long time

• LSPs are generated on two occasions:


 When there is a change in the topology of the domain - Triggering of
LSP distribution is the main way of quickly informing any node in the
domain to update its topology

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 90
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

 On a periodic basis - The period in this case is much longer compared


to distance vector routing - It is done to ensure that old information is
removed from the domain. The timer set for periodic distribution is
normally in the range of 60 min or 2 h based on the implementation -
A longer period ensures that flooding does not create too much traffic
on the network

• Flooding of LSPs : After a node has prepared an LSP, it must be distributed to


all other nodes, not only to its neighbours. The process is called flooding and is
based on the following:
1. The creating node sends a copy of the LSP out of each interface
2. A node that receives an LSP compares it with the copy it may already
have - If the newly arrived LSP is older than the one it has (found by
checking the sequence number), it discards the LSP
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 91
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

- If it is newer, the node does the following:


• It discards the old LSP and keeps the new one
• It sends a copy of it out of each interface except the one from
which the packet arrived This guarantees that flooding stops
somewhere in the domain

• Formation of Shortest Path Tree: Dijkstra Algorithm : After receiving all LSPs,
each node will have a copy of the whole topology - to find the shortest path to
every other node; a shortest path tree is needed - A tree is a graph of nodes and
links; one node is called the root - All other nodes can be reached from the root
through only one single route - A shortest path tree is a tree in which the path
between the root and every other node is the shortest

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 92
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

LINK STATE ROUTING


• The Dijkstra algorithm - creates a shortest path tree from a graph - The
algorithm divides the nodes into two sets: tentative and permanent - It finds the
neighbours of a current node, makes them tentative, examines them, and if they
pass the criteria, makes them permanent

• Calculation of Routing Table from Shortest Path Tree : Each node uses the
shortest path tree protocol to construct its routing table. The routing table
shows the cost of reaching each node from the root.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 93
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Flow chart of Dijkstra algorithm


Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 94
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Key Differences Between Distance Vector Routing & Link State Routing
1. Bellman-Ford algorithm is used for performing distance vector routing
whereas Dijsktra is used for performing the link state routing.

2. In distance vector routing the routers receive the topological information from
the neighbour point of view. On the contrary, in link state routing the router
receive complete information on the network topology.

3. Distance vector routing calculates the best route based on the distance (fewest
number of hops). As against, Link state routing calculates the best route on the
basis of least cost.

4. Link state routing updates only the link state while Distance vector routing
updates full routing table.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 95
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

5. The frequency of update in both routing technique is different distance vector


update periodically whereas link state update frequency employs triggered
updates.

6. The utilization of CPU and memory in distance vector routing is lower than
the link state routing.

7. The distance vector routing is simple to implement and manage. In contrast,


the link state routing is complex and requires trained network administrator.

8. The convergence time in distance vector routing is slow, and it usually suffers
from count to infinity problem. Conversely, the convergence time in link state
routing is fast, and it is more reliable.

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 96
The material in this presentation belongs to SIES GST and is solely for educational purposes. Distribution and modifications of the content is prohibited.

9. Distance vector doesn’t have hierarchical structure while in link state routing
the nodes can have a hierarchical structure

Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 97

You might also like