Module 3 - CN - AIML
Module 3 - CN - AIML
Computer Networks(CN)
Subject code : CSC501
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.
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
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.
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.
• 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.
• 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.
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
Computer Networks
Artificial Intelligence and Machine Learning Department (AI ML) Ms. Gigi Joseph 8
Communication Primitives: Unicast, Multicast, Broadcast
Feature Unicast Broadcast Multicast
Computer Networks
Department of Electronics and Computer Science (ECS) Ms. Gigi Joseph 9
Feature Unicast Broadcast Multicast
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
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
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.
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
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
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.
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.
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.
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.
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.
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
• 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
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
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.
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.
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
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
• 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
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.
• 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
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.
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.
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.
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.
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
IPv6
• IPv6 was extensively modified to support growth of Internet
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
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.
• However services like mobile IP, IP telephony, IoT, will require total
replacement on IPv4 with IPv6
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.
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.
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.
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
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
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
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.
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
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.
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.
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.
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
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
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.
• 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
• 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.
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
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.
• 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.
• 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.
• 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.
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.
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.
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.
• 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.
• 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
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.
• 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.
• 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.
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.
6. The utilization of CPU and memory in distance vector routing is lower than
the link state routing.
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