0% found this document useful (0 votes)
2 views46 pages

Unit II Lecture Notes

The document covers the Network Layer and IPv4 Addressing, detailing responsibilities such as packet delivery, logical addressing, and routing. It explains IPv4 as a 32-bit address system, its hierarchical structure, and various addressing classes (A, B, C, D, E), including their characteristics and limitations. Additionally, it discusses classful and classless addressing, subnetting, special addresses, and the Internet Protocol's role in network communication.

Uploaded by

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

Unit II Lecture Notes

The document covers the Network Layer and IPv4 Addressing, detailing responsibilities such as packet delivery, logical addressing, and routing. It explains IPv4 as a 32-bit address system, its hierarchical structure, and various addressing classes (A, B, C, D, E), including their characteristics and limitations. Additionally, it discusses classful and classless addressing, subnetting, special addresses, and the Internet Protocol's role in network communication.

Uploaded by

jerlin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

EC3401 – NETWORKS AND SECURITY

UNIT II – LECTURE NOTES

Lecture Topic CO PO
No

10 Network Layer C211.2 1

NETWORK LAYER:
This layer is responsible for the delivery of packets from source to destination. It determines
the best path to move data from source to the destination based on the network conditions, the
priority of service, and other factors.
The other responsibilities of this layer are
⮚ Logical addressing - If a packet passes the network boundary, we need another
addressing system for source and destination called logical address. This addressing is
used to identify the device on the internet.
⮚ Routing – Routing is the major component of the network layer, and it determines the
best optimal path out of the multiple paths from source to the destination.

Lecture Topic CO PO
No

11 IPV4 Addressing C211.2 1,2,3

IPV4 ADDRESSING:

• The identifier used in the IP layer of the TCP/IP protocol suite to identify the
connection of each device to the Internet is called the Internet address or IP address.
• Internet Protocol version 4 (IPv4) is the fourth version in the development of the
Internet Protocol (IP) and the first version of the protocol to be widely deployed.
• IPv4 is described in IETF publication in September 1981.
• The IP address is the address of the connection, not the host or the router. An IPv4
address is a 32-bit address that uniquely and universally defines the connection .
• If the device is moved to another network, the IP address may be changed.
• IPv4 addresses are unique in the sense that each address defines one, and only one,
connection to the Internet.
• If a device has two connections to the Internet, via two networks, it has two IPv4
addresses.
• Pv4 addresses are universal in the sense that the addressing system must be accepted
by any host that wants to be connected to the Internet.
IPV4 ADDRESS SPACE:
• IPv4 defines addresses has an address space.
• An address space is the total number of addresses used by the protocol.
• If a protocol uses b bits to define an address, the address space is 2 b because each bit
can have two different values (0 or 1).
• IPv4 uses 32-bit addresses, which means that the address space is 2 32 or 4,294,967,296
(more than four billion). 4 billion devices could be connected to the Internet

IPV4 ADDRESS NOTATION:

There are three common notations to show an IPv4 address:


(i)binary notation (base 2)
(ii)dotted-decimal notation (base 256)
(ii)hexadecimal notation (base 16)

 In binary notation, an IPv4 address is displayed as 32 bits. To make the address more
readable, one or more spaces are usually inserted between bytes (8 bits).
 In dotted-decimal notation,IPv4 addresses are usually written in decimal form with a
decimal point (dot) separating the bytes. Each number in the dotted-decimal notation
is between 0 and 255.
 In hexadecimal notation, each hexadecimal digit is equivalent to four bits. This means
that a 32-bit address has 8 hexadecimal digits. This notation is often used in network
programming.

HIERARCHY IN IPV4 ADDRESSING:

In any communication network that involves delivery, the addressing system is


hierarchical. A 32-bit IPv4 address is also hierarchical, but divided only into two parts.
The first part of the address, called the prefix, defines the network(Net ID); the second part of
the address, called the suffix, defines the node (Host ID).The prefix length is n bits and the
suffix length is (32-n) bits
• A prefix can be fixed length or variable length.
• The network identifier in the IPv4 was first designed as a fixed-length prefix.
• This scheme is referred to as classful addressing.
• The new scheme, which is referred to as classless addressing, uses a variable length
network prefix.

CATEGORIES OF IPV4 ADDRESSING

• There are two broad categories of IPv4 Addressing techniques.

• They are

⮚ Classful Addressing

⮚ Classless Addressing

CLASSFUL ADDRESSING
An IPv4 address is 32-bit long(4 bytes).

Classfull Network Architecture

Class A
• In Class A, an IP address is assigned to those networks that contain a large number of
hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
• In Class A, the first bit in higher order bits of the first octet is always set to 0 and the
remaining 7 bits determine the network ID.
• The 24 bits determine the host ID in any network.
• The total number of networks in Class A = 27 = 128 network address
• The total number of hosts in Class A = 224 - 2 = 16,777,214 host address
Class B
• In Class B, an IP address is assigned to those networks that range from smallsized to
large-sized networks.
• The Network ID is 16 bits long.
• The Host ID is 16 bits long.
• In Class B, the higher order bits of the first octet is always set to 10, and the
remaining14 bits determine the network ID.
• The other 16 bits determine the Host ID.
• The total number of networks in Class B = 2 14 = 16384 network address  The total
number of hosts in Class B = 216 - 2 = 65534 host address

Class C
• In Class C, an IP address is assigned to only small-sized networks.
• The Network ID is 24 bits long.
• The host ID is 8 bits long.
• In Class C, the higher order bits of the first octet is always set to 110, and the
remaining 21 bits determine the network ID.
The 8 bits of the host ID determine the host in a network
• The total number of networks = 221 = 2097152 network address  The total number of
hosts = 28 - 2 = 254 host address

Class D
• In Class D, an IP address is reserved for multicast addresses.
• It does not possess subnetting.
The higher order bits of the first octet is always set to 1110, and the remaining bits
determines the host ID in any network.
Class E
• In Class E, an IP address is used for the future use or for the research and
development purposes.
• It does not possess any subnetting.
• The higher order bits of the first octet is always set to 1111, and the remaining bits
determines the host ID in any network.

Address Depletion in Classful Addressing:


• The reason that classful addressing has become obsolete is address depletion.
• Since the addresses were not distributed properly, the Internet was faced with the
problem of the addresses being rapidly used up.
• This results in no more addresses available for organizations and individuals that
needed to be connected to the Internet.
• To understand the problem, let us think about class A.
• This class can be assigned to only 128 organizations in the world, but each
organization needs to have a single network with 16,777,216 nodes .
• Since there may be only a few organizations that are this large, most of the addresses
in this class were wasted (unused).
• Class B addresses were designed for midsize organizations, but many of the addresses
in this class also remained unused.
• Class C addresses have a completely different flaw in design. The number of
addresses that can be used in each network (256) was so small that most companies
were not comfortable using a block in this address class.  Class E addresses were
almost never used, wasting the whole class.

Advantage of Classful Addressing:


• Although classful addressing had several problems and became obsolete, it had one
advantage.
• Given an address, we can easily find the class of the address and, since the prefix
length for each class is fixed, we can find the prefix length immediately.
• In other words, the prefix length in classful addressing is inherent in the address; no
extra information is needed to extract the prefix and the suffix.

Subnetting and Supernetting:


• To alleviate address depletion, two strategies were proposed and implemented:
(i) Subnetting (ii) Supernetting.

Subnetting:
• In subnetting, a class A or class B block is divided into several subnets.
• Each subnet has a larger prefix length than the original network.
• For example, if a network in class A is divided into four subnets, each subnet has a
prefix of nsub = 10.
• At the same time, if all of the addresses in a network are not used, subnetting allows
the addresses to be divided among several organizations.

CLASSLESS ADDRESSING:

• In 1996, the Internet authorities announced a new architecture called classless


addressing.
• In classless addressing, variable-length blocks are used that belong to no classes.
We can have a block of 1 address, 2 addresses, 4 addresses, 128 addresses, and so on.
• In classless addressing, the whole address space is divided into variable length blocks.
• The prefix in an address defines the block (network); the suffix defines the node
(device).
• Theoretically, we can have a block of 20, 21, 22, ………..232 addresses.
• The number of addresses in a block needs to be a power of 2. An organization can be
granted one block of addresses.

• The prefix length in classless addressing is variable.


• We can have a prefix length that ranges from 0 to 32.
• The size of the network is inversely proportional to the length of the prefix.
• A small prefix means a larger network; a large prefix means a smaller network.
• The idea of classless addressing can be easily applied to classful addressing.
• An address in class A can be thought of as a classless address in which the prefix
length is 8.
• An address in class B can be thought of as a classless address in which the prefix is
16, and so on. In other words, classful addressing is a special case of classless
addressing.

Notation used in Classless Addressing:

The notation used in classless addressing is informally referred to as slash notation


and formally as classless interdomain routing or CIDR.
• For example , [Link] /24 represents the IP address [Link] and, its
subnet mask [Link], which has 24 leading 1-bits.

Address Aggregation:

• One of the advantages of the CIDR strategy is address aggregation (sometimes called
address summarization or route summarization).
• When blocks of addresses are combined to create a larger block, routing can be done
based on the prefix of the larger block.
• ICANN assigns a large block of addresses to an ISP.
• Each ISP in turn divides its assigned block into smaller subblocks and grants the
subblocks to its customers.

Special Addresses in IPv4This-host Address:

 The only address in the block [Link]/32 is called the this-host address.
 It is used whenever a host needs to send an IP datagram but it does not know its own
address to use as the source address.
 Limited-broadcast Address. The only address in the block [Link]/32 is
called the limited broadcast address.
 It is used whenever a router or a host needs to send a datagram to all devices in a
network.
 The routers in the network, however, block the packet having this address as the
destination; the packet cannot travel outside the network.

Loopback Address:

 The block [Link]/8 is called the loopback address.


 A packet with one of the addresses in this block as the destination address never
leaves the host; it will remain in the host.

Private Addresses:

 Four blocks are assigned as private addresses: [Link]/8, [Link]/12,


[Link]/16, and [Link]/16.

Multicast Addresses:

 The block [Link]/4 is reserved for multicast addresses

There are five special addresses that are used for special purposes: this-host address,
limited-broadcast address, loopback address, private addresses, and multicast addresses.

[Link] QUESTION PARTA/B/C YEAR CO PO BT

1 An IPv4 datagram has B April/May


arrived with the 2024 C211.2 1,2,3 3
following information in
the header(in
hexadecimal):
O*45 00 00 54 00 03 58
50 20 0600 00 7C 4E 03
02 B4 OE OF 02
(i) Is the packet
corrupted?
(ii) Is the packet
fragmented?
(iii) What is the
size of the
data?
(iv) How many
more routers
can the
packet travel
to?
(v) What is the
identification
number of
the packet?
(vi) What is the
type of
service?

Lecture Topic CO PO
No

12 Network Layer Protocols(IP) C211.2 1,2

⮚ The main protocol Internet Protocol is responsible for packetizing, forwarding, and
delivery of a packet at the network layer.
⮚ The Internet Control Message Protocol version 4 (ICMPv4) helps IPv4 to handle some
errors that may occur in the network-layer delivery.

IP - INTERNET PROTOCOL:

⮚ The Internet Protocol is the key tool used today to build scalable, heterogeneous
internetworks.
⮚ IP runs on all the nodes (both hosts and routers) in a collection of networks
IP defines the infrastructure that allows these nodes and networks to function as a
single logical internetwork.
IP SERVICE MODEL:

⮚ Service Model defines the host-to-host services that we want to provide


⮚ The main concern in defining a service model for an internetwork is that we can
provide a host-to-host service only if this service can somehow be provided over each
of the underlying physical networks.
⮚ The Internet Protocol is the key tool used today to build scalable, heterogeneous
internetworks.
⮚ The IP service model can be thought of as having two parts:
• A GLOBAL ADDRESSING SCHEME - which provides a way to identify all
hosts in the internetwork
• A DATAGRAM DELIVERY MODEL – A connectionless model of data
delivery.

IP PACKET FORMAT / IP DATAGRAM FORMAT:

A key part of the IP service model is the type of packets that can be carried. The IP
datagram consists of a header followed by a number of bytes of data

FIELD DESCRIPTION

Version Specifies the version of IP. Two versions exists – IPv4 and IPv6.
HLen Specifies the length of the header
TOS An indication of the parameters of the quality of service desired such as
(Type of Service) Precedence, Delay, Throughput and Reliability.
Length Length of the entire datagram, including the header. The maximum size
of an IP datagram is 65,535(210 )bytes
Ident Uniquely identifies the packet sequence number. Used
(Identification) for fragmentation and re-assembly.
Flags Used to control whether routers are allowed to fragment a packet. If a
packet is fragmented , this flag value is [Link] not, flag value is 0.

Offset Indicates where in the datagram, this fragment belongs.


(Fragmentation The fragment offset is measured in units of 8 octets (64
offset) bits). The first fragment has offset zero.
TTL Indicates the maximum time the datagram is allowed to remain in
(Time to Live) the network. If this field contains the value zero, then the datagram
must be destroyed.
Protocol Indicates the next level protocol used in the data portion of the datagram

Checksum Used to detect the processing errors introduced into the packet

Source Address The IP address of the original sender of the packet.

Destination The IP address of the final destination of the packet.


Address
Options This is optional field. These options may contain values for options
such as Security, Record Route, Time Stamp, etc
Pad Used to ensure that the internet header ends on a 32 bit boundary. The
padding is zero.

IP DATAGRAM - FRAGMENTATION AND REASSEMBLY


Fragmentation:

Every network type has a maximum transmission unit (MTU), which is the largest IP
datagram that it can carry in a frame.

Fragmentation of a datagram will only be necessary if the path to the destination includes a
network with a smaller MTU.
⮚ When a host sends an IP datagram,it can choose any size that it wants.
⮚ Fragmentation typically occurs in a router when it receives a datagram that it wants to
forward over a network that has an MTU that is smaller than the received datagram.
⮚ Each fragment is itself a self-contained IP datagram that is transmitted over a
sequence of physical networks, independent of the other fragments.
⮚ Each IP datagram is re-encapsulated for each physical network over which it travels.
For example , if we consider an Ethernet network to accept packets up to 1500 bytes
long.
⮚ This leaves two choices for the IP service model:

• Make sure that all IP datagrams are small enough to fit inside one packet on
any network technology
• Provide a means by which packets can be fragmented and reassembled when
they are too big to go over a given network technology.

Fragmentation produces smaller, valid IP datagrams that can be readily reassembled into the
original datagram upon receipt, independent of the order of their arrival

Example:

⮚ The original packet starts at the client; the fragments are reassembled at the server.
The value of the identification field is the same in all fragments, as is the value of the
flags field with the more bit set for all fragments except the last.
⮚ Also, the value of the offset field for each fragment is shown.
⮚ Although the fragments arrived out of order at the destination, they can be correctly
reassembled.
⮚ The value of the offset field is always relative to the original datagram.
⮚ Even if each fragment follows a different path and arrives out of order, the final
destination host can reassemble the original datagram from the fragments received (if
none of them is lost) using the following strategy:
1) The first fragment has an offset field value of zero.
2) Divide the length of the first fragment by 8. The second fragment has an offset
value equal to that result.
3) Divide the total length of the first and second fragment by 8. The third
fragment has an offset value equal to that result.
4) Continue the process. The last fragment has its M bit set to 0.
5) Continue the process. The last fragment has a more bit value of 0.

Reassembly:
⮚ Reassembly is done at the receiving host and not at each router.
⮚ To enable these fragments to be reassembled at the receiving host, they all carry the
same identifier in the Ident field.
⮚ This identifier is chosen by the sending host and is intended to be unique among all
the datagrams that might arrive at the destination from this source over some
reasonable time period.
⮚ Since all fragments of the original datagram contain this identifier, the reassembling
host will be able to recognize those fragments that go together.
⮚ For example, if a single fragment is lost, the receiver will still attempt to reassemble
the datagram, and it will eventually give up and have to garbage collect the resources
that were used to perform the failed reassembly.

⮚ Hosts are now strongly encouraged to perform “path MTU discovery,” a process by
which fragmentation is avoided by sending packets that are small enough to traverse
the link with the smallest MTU in the path from sender to receiver.

IP SECURITY:
There are three security issues that are particularly applicable to the IP protocol:
(1) Packet Sniffing (2) Packet Modification and (3) IP Spoofing.

Packet Sniffing:
⮚ An intruder may intercept an IP packet and make a copy of it.
⮚ Packet sniffing is a passive attack, in which the attacker does not change the contents
of the packet.
⮚ This type of attack is very difficult to detect because the sender and the receiver may
never know that the packet has been copied.
⮚ Although packet sniffing cannot be stopped, encryption of the packet can make the
attacker’s effort useless.
⮚ The attacker may still sniff the packet, but the content is not detectable.

Packet Modification:
⮚ The second type of attack is to modify the packet.
⮚ The attacker intercepts the packet, changes its contents, and sends the new packet to
the receiver.
⮚ The receiver believes that the packet is coming from the original sender.

This type of attack can be detected using a data integrity mechanism.


⮚ The receiver, before opening and using the contents of the message, can use this
mechanism to make sure that the packet has not been changed during the
transmission.

IP Spoofing:
⮚ An attacker can masquerade as somebody else and create an IP packet that carries the
source address of another computer.
⮚ An attacker can send an IP packet to a bank pretending that it is coming from one of
the customers.
⮚ This type of attack can be prevented using an origin authentication mechanism
IP Sec:
⮚ The IP packets today can be protected from the previously mentioned attacks using a
protocol called IPSec (IP Security).
⮚ This protocol is used in conjunction with the IP protocol.
⮚ IPSec protocol creates a connection-oriented service between two entities in which
they can exchange IP packets without worrying about the three attacks such as Packet
Sniffing, Packet Modification and IP Spoofing.

IP Packet Encryption :

The packets exchanged between two parties can be encrypted for privacy using one of
the encryption algorithms and a shared key agreed upon in the first step. This makes the
packet sniffing attack useless.
1) Data Integrity : Data integrity guarantees that the packet is not modified
during the transmission. If the received packet does not pass the data integrity
test, it is discarded. This prevents the second attack, packet modification.
2) Origin Authentication : IPSec can authenticate the origin of the packet to be
sure that the packet is not created by an imposter. This can prevent IP spoofing
attacks.

[Link] QUESTION PARTA/B/C YEAR CO PO BT

1 Summarize the basic April/


principles of network B May 2023 C211.2 1 2
protocols.
2 Find the error, if any, in Nov/Dec
the following IPv4 A 2023 C211.2 1,2 3
addresses.
(a) [Link]
(b) [Link]

Lecture Topic CO PO
No

13 ICMP and Mobile IP C211.2 1,2,3

ICMP (INTERNET CONTROL MESSAGE PROTOCOL)

⮚ ICMP is a network-layer protocol.


⮚ It is a companion to the IP protocol.
⮚ Internet Control Message Protocol (ICMP) defines a collection of error messages that
are sent back to the source host whenever a router or host is unable to process an IP
datagram successfully.

ICMP MESSAGE TYPES:

⮚ ICMP messages are divided into two broad categories: error-reporting messages and
query messages.
⮚ The error-reporting messages report problems that a router or a host (destination) may
encounter when it processes an IP packet.
⮚ The query messages help a host or a network manager get specific information from a
router or another host.
ICMP Error – Reporting Messages:

⮚ Destination Unreachable―When a router cannot route a datagram, the datagram is


discarded and sends a destination unreachable message to source host.
⮚ Source Quench―When a router or host discards a datagram due to congestion, it sends a
source-quench message to the source host. This message acts as flow control.
⮚ Time Exceeded―Router discards a datagram when TTL field becomes 0 and a time
exceeded message is sent to the source host.
⮚ Parameter Problem―If a router discovers ambiguous or missing value in any field of
the datagram, it discards the datagram and sends parameter problem message to source.
⮚ Redirection―Redirect messages are sent by the default router to inform the source host
to update its forwarding table when the packet is routed on a wrong path.

ICMP Query Messages:


⮚ Echo Request & Reply―Combination of echo request and reply messages
determines whether two systems communicate or not.
⮚ Timestamp Request & Reply―Two machines can use the timestamp request and
reply messages to determine the round-trip time (RTT).
⮚ Address Mask Request & Reply―A host to obtain its subnet mask, sends an
address mask request message to the router, which responds with an address mask
reply message.
⮚ Router Solicitation/Advertisement -A host broadcasts a router solicitation message
to know about the router. Router broadcasts its routing information with router
advertisement message.

ICMP MESSAGE FORMAT:

An ICMP message has an 8-byte header and a variable-size data section.

Type Defines the type of the message


Code Specifies the reason for the particular message type
Checksum Used for error detection
Rest of the header Specific for each message type
Data Used to carry information
Identifier Used to match the request with the reply
Sequence Number Sequence Number of the ICMP packet

ICMP DEBUGGING TOOLS:


Two tools are used for debugging purpose. They are (1) Ping (2) Traceroute

Ping:

⮚ The ping program is used to find if a host is alive and responding.


⮚ The source host sends ICMP echo-request messages; the destination, if alive, responds
with ICMP echo-reply messages.
⮚ The ping program sets the identifier field in the echo-request and echo-reply message
and starts the sequence number from 0; this number is incremented by 1 each time a
new message is sent.
⮚ The ping program can calculate the round-trip time.
⮚ It inserts the sending time in the data section of the message.
⮚ When the packet arrives, it subtracts the arrival time from the departure time to get the
round-trip time (RTT).
$ ping [Link]

Traceroute or Tracert:
⮚ The traceroute program in UNIX or tracert in Windows can be used to trace the path
of a packet from a source to the destination.
⮚ It can find the IP addresses of all the routers that are visited along the path.
⮚ The program is usually set to check for the maximum of 30 hops (routers) to be
visited.
⮚ The number of hops in the Internet is normally less than this.
$ traceroute [Link]

[Link] QUESTION PARTA/B/C YEAR CO PO BT

1 Exemplify in detail about B Nov/Dec 1,2 2


Internet Control Message 2023 C211.2
Protocol(ICMP) error
reporting messages.(6)

Lecture Topic CO PO
No
14 Unicast and Multicast Routing C211.2 1,2

UNICAST ROUTING :
Routing is the process of selecting best paths in a network. In unicast routing, a packet
is routed, hop by hop, from its source to its destination by the help of forwarding tables.
Routing a packet from its source to its destination means routing the packet from a source
router (the default router of the source host) to a destination router (the router connected to
the destination network).
• The source host needs no forwarding table because it delivers its packet to the default
router in its local network.
• The destination host needs no forwarding table either because it receives the packet
from its default router in its local network.
• Only the intermediate routers in the networks need forwarding tables.

NETWORK AS A GRAPH:

 The Figure below shows a graph representing a network.


 The nodes of the graph, labeled A through G, may be hosts, switches, routers, or
networks.
 The edges of the graph correspond to the network links.
 Each edge has an associated cost.
 The basic problem of routing is to find the lowest-cost path between any two nodes,
where the cost of a path equals the sum of the costs of all the edges that make up the
path.
 This static approach has several problems:
 It does not deal with node or link failures.
 It does not consider the addition of new nodes or links.
 It implies that edge costs cannot change.
 For these reasons, routing is achieved by running routing protocols among the nodes.
 These protocols provide a distributed, dynamic way to solve the problem of finding
the lowest-cost path in the presence of link and node failures and changing edge costs.

UNICAST ROUTING ALGORITHMS:


There are three main classes of routing protocols:
 Distance Vector Routing Algorithm – Routing Information Protocol
 Link State Routing Algorithm – Open Shortest Path First Protocol
 Path-Vector Routing Algorithm - Border Gateway Protocol
DISTANCE VECTOR ROUTING (DSR) ROUTING INFORMATION
PROTOCOL (RIP) BELLMAN - FORD ALGORITHM:
 Distance vector routing is distributed, i.e., algorithm is run on all nodes.
 Each node knows the distance (cost) to each of its directly connected neighbors.
 Nodes construct a vector (Destination, Cost, NextHop) and distributes to its
neighbors.
 Nodes compute routing table of minimum distance to every other node via NextHop
using information obtained from its neighbors.

Initial State:

⮚ In given network, cost of each link is 1 hop.


⮚ Each node sets a distance of 1 (hop) to its immediate neighbor and cost to itself as
0.
⮚ Distance for non-neighbors is marked as unreachable with value ∞ (infinity).
For node A, nodes B, C, E and F are reachable, whereas nodes D and G are unreachable.

Updation of Routing Tables:


There are two different circumstances under which a given node decides to send a
routing update to its neighbors.

Periodic Update :
⮚ In this case, each node automatically sends an update message every so often, even
if nothing has changed.
⮚ The frequency of these periodic updates varies from protocol to protocol, but it is
typically on the order of several seconds to several minutes.

Triggered Update
⮚ In this case, whenever a node notices a link failure or receives an update from one of
its neighbors that causes it to change one of the routes in its routing table.
⮚ Whenever a node’s routing table changes, it sends an update to its neighbors, which
may lead to a change in their tables, causing them to send an update to their
neighbors.

ROUTING INFORMATION PROTOCOL (RIP)

RIP is an intra-domain routing protocol based on distance-vector algorithm.

Example:
• Routers advertise the cost of reaching networks. Cost of reaching each link is 1 hop.
For example, router C advertises to A that it can reach network 2, 3 at cost 0 (directly
connected), networks 5, 6 at cost 1 and network 4 at cost 2.
• Each router updates cost and next hop for each network number.
• Infinity is defined as 16, i.e., any route cannot have more than 15 hops.
Therefore RIP can be implemented on small-sized networks only.

Advertisements are sent every 30 seconds or in case of triggered update

Command - It indicates the packet type.


Value 1 represents a request packet. Value 2 represents a response packet.

 Version - It indicates the RIP version number. For RIPv1, the value is 0x01.
 Address Family Identifier - When the value is 2, it represents the IP protocol.
 IP Address - It indicates the destination IP address of the route. It can be the addresses
of only the natural network segment.
 Metric - It indicates the hop count of a route to its destination.

Count-To-Infinity (or) Loop Instability Problem:


• Suppose link from node A to E goes down.
❖ Node A advertises a distance of ∞ to E to its neighbors
❖ Node B receives periodic update from C before A’s update reaches B
❖ Node B updated by C, concludes that E can be reached in 3 hops via C
❖ Node B advertises to A as 3 hops to reach E
❖ Node A in turn updates C with a distance of 4 hops to E and so on
• Thus nodes update each other until cost to E reaches infinity, i.e., no convergence.
• Routing table does not stabilize.
• This problem is called loop instability or count to infinity.
Solution to Count-To-Infinity (or) Loop Instability Problem :

 Infinity is redefined to a small number, say 16.


 Distance between any two nodes can be 15 hops maximum. Thus distance vector
routing cannot be used in large networks.
 When a node updates its neighbors, it does not send those routes it learned from each
neighbor back to that neighbor. This is known as split horizon.
 Split horizon with poison reverse allows nodes to advertise routes it learnt from a
node back to that node, but with a warning message.

LINK STATE ROUTING (LSR) OPEN SHORTEST PATH PROTOCOL (OSPF)


DIJKSTRA’S ALGORITHM:

 Each node knows state of link to its neighbors and cost.


 Nodes create an update packet called link-state packet (LSP) that contains:
 ID of the node
 List of neighbors for that node and associated cost
 64-bit Sequence number
 Time to live
 Link-State routing protocols rely on two mechanisms:
 Reliable flooding of link-state information to all other nodes.
 Route calculation from the accumulated link-state knowledge.

Reliable Flooding:
 Each node sends its LSP out on each of its directly connected links.
 When a node receives LSP of another node, checks if it has an LSP already for that
node.
 If not, it stores and forwards the LSP on all other links except the incoming one.
 Else if the received LSP has a bigger sequence number, then it is stored and
forwarded. Older LSP for that node is discarded.
 Otherwise discard the received LSP, since it is not latest for that node.
 Thus recent LSP of a node eventually reaches all nodes, i.e., reliable flooding.

(a) (b) (c) (d)


 Flooding of LSP in a small network is as follows:
 When node X receives Y’s LSP (fig a), it floods onto its neighbors A and C
(fig b)
 Nodes A and C forward it to B, but does not sends it back to X (fig c).
 Node B receives two copies of LSP with same sequence number.
 Accepts one LSP and forwards it to D (fig d). Flooding is complete.
 LSP is generated either periodically or when there is a change in the topology.
Route Calculation:
 Each node knows the entire topology, once it has LSP from every other node.
 Forward search algorithm is used to compute routing table from the received LSPs.
 Each node maintains two lists, namely Tentative and Confirmed with entries of the
form (Destination, Cost, NextHop).

DIJKSTRA’S SHORTEST PATH ALGORITHM (FORWARD SEARCH ALGORITHM) :


1. Each host maintains two lists, known as Tentative and Confirmed.
2. Initialize the Confirmed list with an entry for the Node (Cost = 0).
3. Node just added to Confirmed list is called Next. Its LSP is examined.
4. For each neighbor of Next, calculate cost to reach each neighbor as Cost (Node to
Next) + Cost (Next to Neighbor).
a. If Neighbor is neither in Confirmed nor in Tentative list, then add (Neighbor,
Cost, Next Hop) to Tentative list.
b. If Neighbor is in Tentative list, and Cost is less than existing cost, then replace
the entry with (Neighbor, Cost, Next Hop).
5. If Tentative list is empty then Stop, otherwise move least cost entry from Tentative
list to Confirmed list. Go to Step 2.

OPEN SHORTEST PATH FIRST PROTOCOL (OSPF):


 OSPF is a non-proprietary widely used link-state routing protocol.
 OSPF Features are:
⮚ Authentication―Malicious host can collapse a network by advertising to
reach every host with cost 0. Such disasters are averted by authenticating
routing updates.
⮚ Additional hierarchy―Domain is partitioned into areas, i.e., OSPF is more
scalable.
⮚ Load balancing―Multiple routes to the same place are assigned same cost.
Thus traffic is distributed evenly.

Link State Packet format

Version ― represents the current version, i.e., 2.


 Type ― represents the type (1–5) of OSPF [Link] 1 - “hello” message,
Type 2 - request, Type 3 – send ,Type 4 - acknowledge the receipt of link
state messages , Type 5 – reserved
 SourceAddr ― identifies the sender
 AreaId ― 32-bit identifier of the area in which the node is located
 Checksum ― 16-bit internet checksum
 Authentication type ― 1 (simple password), 2 (cryptographic authentication).
 Authentication ― contains password or cryptographic checksum
Difference Between Distance-Vector And Link-State Algorithms
Distance vector Routing Link state Routing
Each node talks only to its directly connected Each node talks to all other nodes, but it tells
neighbors, but it tells them them only what it knows for sure (i.e., only
everything it has learned the state of its directly connected links).
(i.e., distance to all nodes).

PATH-VECTOR ROUTING
Path-vector routing is an asynchronous and distributed routing algorithm.
• The Path-vector routing is not based on least-cost routing.
• The best route is determined by the source using the policy it imposes on the route.
• In other words, the source can control the path.
• Path-vector routing is not actually used in an internet, and is mostly designed to route
a packet between ISPs.

Spanning Trees
 In path-vector routing, the path from a source to all destinations is determined by the
best spanning tree.
 The best spanning tree is not the least-cost tree.
 It is the tree determined by the source when it imposes its own policy.
 If there is more than one route to a destination, the source can choose the route that
meets its policy best.
 A source may apply several policies at the same time.
 One of the common policies uses the minimum number of nodes to be visited.
Another common policy is to avoid some nodes as the middle node in a route.
 The spanning trees are made, gradually and asynchronously, by each node. When a
node is booted, it creates a path vector based on the information it can obtain about its
immediate neighbor.
A node sends greeting messages to its immediate neighbors to collect these pieces of
information
 Each node, after the creation of the initial path vector, sends it to all its immediate
neighbors.
 Each node, when it receives a path vector from a neighbor, updates its path vector
using the formula

 The policy is defined by selecting the best of multiple paths.


 Path-vector routing also imposes one more condition on this equation.
 If Path (v, y) includes x, that path is discarded to avoid a loop in the path.
 In other words, x does not want to visit itself when it selects a path to y.

Example:
 The Figure below shows a small internet with only five nodes.
 Each source has created its own spanning tree that meets its policy.
 The policy imposed by all sources is to use the minimum number of nodes to reach a
destination.
 The spanning tree selected by A and E is such that the communication does not pass
through D as a middle node.

Path Vectors made at booting time:


 The Figure below shows all of these path vectors for the example.
 Not all of these tables are created simultaneously.
They are created when each node is booted
The figure also shows how these path vectors are sent to immediate neighbors after
they have been created

 A protocol is more than an algorithm.


 A protocol needs to define its domain of operation, the messages exchanged,
communication between routers, and interaction with protocols in other domains.
 A routing protocol specifies how routers communicate with each other, distributing
information that enables them to select routes between any two nodes on a computer
network
 Routers perform the "traffic directing" functions on the Internet; data packets are
forwarded through the networks of the internet from router to router until they reach
their destination computer.
 Routing algorithms determine the specific choice of route.
 Each router has a prior knowledge only of networks attached to it directly.
 A routing protocol shares this information first among immediate neighbors, and then
throughout the network. This way, routers gain knowledge of the topology of the
network.
 The ability of routing protocols to dynamically adjust to changing conditions such as
disabled data lines and computers and route data around obstructions is what gives the
Internet its survivability and reliability.
 The specific characteristics of routing protocols include the manner in which they
avoid routing loops, the manner in which they select preferred routes, using
information about hop costs, the time they require to reach routing convergence, their
scalability, and other factors.

INTERNET STRUCTURE:

 Internet has a million networks. Routing table entries per router should be minimized.
 Link state routing protocol is used to partition domain into areas.
 An routing area is a set of routers configured to exchange link-state information.
 Area introduces an additional level of hierarchy.
 Thus domains can grow without burdening routing protocols.

• There is one special area—the backbone area, also known as area 0.


• Routers R1, R2 and R3 are part of backbone area.
Routers in backbone area are also part of non-backbone areas. Such routers are known as
Area Border Routers (ABR)
• Link-state advertisement is exchanged amongst routers in a non-backbone area.
• They do not see LSAs of other areas. For example, area 1 routers are not aware of
area 3 routers.
• ABR advertises routing information in their area to other ABRs.
• For example,R2 advertises area 2 routing information to R1 and R3, which in turn
pass onto their areas.
• All routers learn how to reach all networks in the domain.
• When a packet is to be sent to a network in another area, it goes through backbone
area via ABR and reaches the destination area.
Routing Areas improve scalability but packets may not travel on the shortest
path.

[Link] QUESTION PARTA/B/C YEAR CO PO BT


1 Compare and contrast B April/May C211.2 1,2 4
between unicast and 2024
multicast routing.(6)

Lecture Topic CO PO
No

Intradomain and Interdomain


15 Routing Protocols C211.2 1,2

INTER DOMAIN ROUTING


• Internet is organized as autonomous systems (AS) each of which is under the control
of a single administrative entity.
• A corporation’s complex internal network might be a single AS, as may the network
of a single Internet Service Provider (ISP).
• Interdomain routing shares reachability information between autonomous systems.

• The basic idea behind autonomous systems is to provide an additional way to


hierarchically aggregate routing information in a large internet, thus improving
scalability.
Internet has backbone networks and sites. Providers connect at a peering point
Traffic on the internet is of two types:
⮚ Local Traffic - Traffic within an autonomous system is called local.
⮚ Transit Traffic - Traffic that passes through an autonomous system is called transit.

Autonomous Systems (AS) are classified as:


⮚ Stub AS - is connected to only one another autonomous system and carries local
traffic only (e.g. Small corporation).
⮚ Multihomed AS - has connections to multiple autonomous systems but refuses to
carry transit traffic (e.g. Large corporation).
⮚ Transit AS - has connections to multiple autonomous systems and is designed to
carry transit traffic (e.g. Backbone service provider).

Policies Used By Autonomous Systems :


⮚ Provider-Customer―Provider advertises the routes it knows, to the customer and
advertises the routes learnt from customer to everyone.

⮚ Customer-Provider―Customers want the routes to be diverted to them. So they


advertise their own prefixes and routes learned from customers to provider and
advertise routes learned from provider to customers.
 Peer―Two providers access to each other’s customers without having to pay

CHALLENGES IN INTER-DOMAIN ROUTING PROTOCOL


Each autonomous system has an intra-domain routing protocol, its own policy and
metric. Internet backbone must be able to route packets to the destination that complies with
policies of autonomous system along a loopless path Service providers have trust deficit and
may not trust advertisements by other AS, or may refuse to carry traffic from other AS
TYPES OF ROUTING PROTOCOLS

Two types of Routing Protocols are used in the Internet:


1) INTRADOMAIN ROUTING :
Routing within a single autonomous system

Multicasting:
 In multicasting, there is one source and a group of destinations.
 Multicast supports efficient delivery to multiple destinations.
 The relationship is one to many or many-to-many.
 One-to-Many (Source Specific Multicast) o Radio station broadcast o Transmitting
news, stock-price o Software updates to multiple hosts
 Many-to-Many (Any Source Multicast) o Multimedia teleconferencing o Online
multi-player games o Distributed simulations
 In this type of communication, the source address is a unicast address, but the
destination address is a group address.
 The group address defines the members of the group.

 In multicasting, a multicast router may have to send out copies of the same datagram
through more than one interface.
 A host can be in multiple groups
 A host can join and leave groups
 A host signals its desire to join or leave a multicast group by communicating with its
local router using a special protocol.
 In IPv4, the protocol is Internet Group Management Protocol (IGMP)  In IPv6, the
protocol is Multicast Listener Discovery (MLD)
IGMP OR MLD PROTOCOL
 Hosts communicate their desire to join / leave a multicast group to a router using
Internet Group Message Protocol (IGMP) in IPv4 or Multicast Listener Discovery
(MLD) in IPv6.
 Provides multicast routers with information about the membership status of hosts
connected to the network.
 Enables a multicast router to create and update list of loyal members for each group.
MULTICAST ADDRESSING
 Multicast address is associated with a group, whose members are dynamic.
 Each group has its own IP multicast address.
 IP addresses reserved for multicasting are Class D in IPv4 (Class D [Link] to
[Link]), 1111 1111 prefix in IPv6.
o
 Hosts that are members of a group receive copy of the packet sent when destination
contains group address.
MULTICASTING VERSUS MULTIPLE UNICASTING
• Multicasting starts with a single packet from the source that is duplicated by the
routers. The destination address in each packet is the same for all duplicates.
Only a single copy of the packet travels between any two routers.

• In multiple unicasting, several packets start from the source.


• If there are three destinations, for example, the source sends three packets, each with a
different unicast destination address.
• There may be multiple copies traveling between two routers
NEED FOR MULTICAST
Without support for multicast
• A source needs to send a separate packet with the identical data to each member of the
group
• Source needs to keep track of the IP address of each member in the group

Using IP multicast
• Sending host does not send multiple copies of the packet
• A host sends a single copy of the packet addressed to the group’s multicast address
• The sending host does not need to know the individual unicast IP address of each
member.

TYPES OF MULTICASTING
• Source-Specific Multicast - In source-specific multicast (one-to-many model),
receiver specifies multicast group and sender from which it is interested to receive
packets. Example: Internet radio broadcasts.

• Any Source Multicast - Supplements any source multicast (many-to-many


model).

MULTICAST APPLICATIONS
• Access to Distributed Databases
 Information Dissemination
 Teleconferencing.
• Distance Learning

MULTICAST ROUTING
• To support multicast, a router must additionally have multicast forwarding tables
that indicate, based on multicast address, which links to use to forward the
multicast packet.
• Unicast forwarding tables collectively specify a set of paths.
• Multicast forwarding tables collectively specify a set of trees -Multicast
distribution trees.
• Multicast routing is the process by which multicast distribution trees are
determined.
• To support multicasting, routers additionally build multicast forwarding tables.
• Multicast forwarding table is a tree structure, known as multicast distribution
trees.
• Internet multicast is implemented on physical networks that support broadcasting
by extending forwarding functions.

MULTICAST DISTRIBUTION TREES

There are two types of Multicast Distribution Trees used in multicast routing.
They are
⮚ Source-Based Tree: (DVMRP)
▪ For each combination of (source , group), there is a shortest
path spanning tree.
▪ Flood and prune
⮚ Send multicast traffic everywhere
⮚ Prune edges that are not actively subscribed to group
 Link-state
⮚ Routers flood groups they would like to receive
⮚ Compute shortest-path trees on demand
⮚ Shared Tree (PIM)
 Single distributed tree shared among all sources
 Does not include its own topology discovery mechanism, but instead uses
routing information supplied by other routing protocols
 Specify rendezvous point (RP) for group ▪ Senders send packets to RP, receivers join
at RP.
 RP multicasts to receivers; Fix-up tree for optimization
 Rendezvous-Point Tree: one router is the center of the group and
therefore the root of the tree.

MULTICAST ROUTING PROTOCOLS


• Internet multicast is implemented on physical networks that support broadcasting by
extending forwarding functions.
• Major multicast routing protocols are:
1. Distance-Vector Multicast Routing Protocol (DVMRP)
2. Protocol Independent Multicast (PIM)

1. Distance Vector Multicast Routing Protocol


• The DVMRP, is a routing protocol used to share information
between routers to facilitate the transportation of IP multicast packets among
networks.
• It formed the basis of the Internet's historic multicast backbone.
• Distance vector routing for unicast is extended to support multicast routing.
• Each router maintains a routing table for all destination through exchange of distance
vectors.
• DVMRP is also known as flood-and-prune protocol.
DVMRP consists of two major components
• A conventional distance-vector routing protocol, like RIP
• A protocol for determining how to forward multicast packets, based on the routing
table
• DVMRP router forwards a packet if
• The packet arrived from the link used to reach the source of the packet
• If downstream links have not pruned the tree
• DVMRP protocol uses the basic packet types as follows:

• Multicasting is added to distance-vector routing in four stages.


⮚ Flooding
⮚ Reverse Path Forwarding (RPF)
⮚ Reverse Path Broadcasting (RPB)
⮚ Reverse Path Multicast (RPM)
Flooding
 Router on receiving a multicast packet from source S to a Destination from Next Hop,
forwards the packet on all out-going links.
 Packet is flooded and looped back to S.
 The drawbacks are:
 It floods a network, even if it has no members for that group.
 Packets are forwarded by each router connected to a LAN, i.e., duplicate
flooding

Reverse Path Forwarding (RPF):


 RPF eliminates the looping problem in the flooding process.
 Only one copy is forwarded and the other copies are discarded.
 RPF forces the router to forward a multicast packet from one specific interface: the
one which has come through the shortest path from the source to the router.
Packet is flooded but not looped back to S.

Reverse-Path Broadcasting (RPB)


 RPB does not multicast the packet, it broadcasts it.
 RPB creates a shortest path broadcast tree from the source to each destination.
 It guarantees that each destination receives one and only one copy of the
packet.
 We need to prevent each network from receiving more than one copy of the
packet.
 If a network is connected to more than one router, it may receive a copy of the
packet from each router.
 One router identified as parent called designated Router (DR).
 Only parent router forwards multicast packets from source S to the attached network.
 When a router that is not the parent of the attached network receives a multicast
packet, it simply drops the packet.
Reverse-Path Multicasting (RPM)
 To increase efficiency, the multicast packet must reach only those networks that have
active members for that particular group.
 RPM adds pruning and grafting to RPB to create a multicast shortest path tree that
supports dynamic membership changes.
Pruning:
 Sent from routers receiving multicast traffic for which they have no active group
members“Prunes” the tree created by DVMRP Stops needless data from being sent

Grafting:
 Used after a branch has been pruned back
 Sent by a router that has a host that joins a multicast group
 Goes from router to router until a router active on the multicast group is reached
 Sent for the following cases
 A new host member joins a group
 A new dependent router joins a pruned branch
 A dependent router restarts on a pruned branch

2. Protocol Independent Multicast (PIM)


 PIM divides multicast routing problem into sparse and dense mode.
 PIM sparse mode (PIM-SM) is widely used.
 PIM does not rely on any type of unicast routing protocol, hence protocol
independent.
 Routers explicitly join and leave multicast group using Join and Prune
messages.
 One of the router is designated as rendezvous point (RP) for each group in a
domain to receive PIM messages.
 Multicast forwarding tree is built as a result of routers sending Join messages to
RP.
 Two types of trees to be constructed:
 Shared tree - used by all senders
 Source-specific tree - used only by a specific sending host
 The normal mode of operation creates the shared tree first, followed by one or more
source-specific trees

Shared Tree

 When a router sends Join message for group G to RP, it goes through a set of
routers.
 Join message is wildcarded (*), i.e., it is applicable to all senders
 Routers create an entry (*, G) in its forwarding table for the shared tree.
 Interface on which the Join arrived is marked to forward packets for that group.
Forwards Join towards rendezvous router RP. Eventually, the message arrives at
RP. Thus a shared tree with RP as root is formed.
Example
 Router R4 sends Join message for group G to rendezvous router RP.
 Join message is received by router R2. It makes an entry (*, G) in its table and
forwards the message to RP
 When R5 sends Join message for group G, R2 does not forwards the Join. It adds an
outgoing interface to the forwarding table created for that group.

 As routers send Join message for a group, branches are added to the tree, i.e., shared.
 Multicast packets sent from hosts are forwarded to designated router RP.
 Suppose router R1, receives a message to group G.
 R1 has no state for group G.
 Encapsulates the multicast packet in a Register message.
 Multicast packet is tunneled along the way to RP.
 RP decapsulates the packet and sends multicast packet onto the shared tree, towards
R2.
 R2 forwards the multicast packet to routers R4 and R5 that have members for group
G.
Source-Specific Tree
 RP can force routers to know about group G, by sending Join message to the sending
host, so that tunneling can be avoided.
 Intermediary routers create sender-specific entry (S, G) in their tables. Thus a source-
specific route from R1 to RP is formed.
 If there is high rate of packets sent from a sender to a group G, then shared tree is
replaced by source-specific tree with sender as root.

 Rendezvous router RP sends a Join message to the host router R1.


 Router R3 learns about group G through the message sent by RP.
 Router R4 send a source-specific Join due to high rate of packets from sender.
 Router R2 learns about group G through the message sent by R4.
 Eventually a source-specific tree is formed with R1 as root.

Analysis of PIM:

 Protocol independent because, tree is based on Join messages via shortest path.
 Shared trees are more scalable than source-specific trees.
 Source-specific trees enable efficient routing than shared trees.

INTRADOMAIN PROTOCOLS:
Routing Information Protocol (RIP):

The Routing Information Protocol (RIP) is one of the most widely used intradomain
routing protocols based on the distance-vector routing algorithm
 RIP was started as part of the Xerox Network System (XNS), but it was the Berkeley
Software Distribution (BSD) version of UNIX.
 A router in this protocol basically implements the distance-vector routing algorithm
 First, since a router in an AS needs to know how to forward a packet to different
networks (subnets) in an AS, RIP routers advertise the cost of reaching different
networks instead of reaching other nodes in a theoretical graph.
 Second, to make the implementation of the cost simpler, the cost is defined as the
number of hops, which means the number of networks (subnets) a packet needs to
travel through from the source router to the final destination host

Forwarding Tables

 A forwarding table in RIP is a three-column table in which the first column is the
address of the destination network, the second column is the address of the next
router to which the packet should be forwarded, and the third column is the cost (the
number of hops) to reach the destination network.

RIP Implementation:
 RIP is implemented as a process that uses the service of UDP on the well-known port
number 520.
RIP has gone through two versions: RIP-1 and RIP-2. The second version is backward
compatible with the first section; it allows the use of more information in the RIP
messages that were set to 0 in the first version.

RIP Messages:
 Two RIP processes, a client and a server, like any other processes, need to exchange
Messages

 RIP has two types of messages: request and response. A request message is sent by a
router that has just come up or by a router that has some time-out entries. A request
message can ask about specific entries or all entries.
 A response (or update) message can be either solicited or unsolicited. A solicited
response message is sent only in answer to a request message. It contains information
about the destination specified in the corresponding request message.

RIP Algorithm:
RIP implements the same algorithm as the distance-vector routing algorithm. There
are
some changes added in that algorithm
 Instead of sending only distance vectors, a router needs to send the whole contents of
its forwarding table in a response message.
 The receiver adds one hop to each cost and changes the next router field to the
address of the sending router. We call each route in the modified forwarding table the
received route and each route in the old forwarding table the old route. The received
router selects the old routes as the new ones except in the following three cases:
1. If the received route does not exist in the old forwarding table, it should be
added to the route.
2. If the cost of the received route is lower than the cost of the old one, the
received route should be selected as the new one.
3. If the cost of the received route is higher than the cost of the old one, but the
value of the next router is the same in both routes, the received route should be
selected as the new one.
4. The new forwarding table needs to be sorted according to the destination route

Open Shortest Path First (OSPF):


 OSPF is an open protocol, which means that the specification is a public document.
 Like RIP, the cost of reaching a destination from the host is calculated from the
source router to the destination network.
 However, each link (network) can be assigned a weight based on the throughput,
round-trip time, reliability, and so on. An administration can also decide to use the
hop count as the cost.

Forwarding Tables
 Each OSPF router can create a forwarding table after finding the shortest-path tree
between itself and the destination using Dijkstra’s algorithm
 Compared with RIP, which is normally used in small ASs, OSPF was designed to be
able to handle routing in a small or large autonomous system.
 However, the formation of shortest-path trees in OSPF requires that all routers flood
the whole.
 AS with their LSPs to create the global LSDB.
 Although this may not create a problem in a small AS, it may have created a huge
volume of traffic in a large AS.
 To prevent this, the AS needs to be divided into small sections called areas. Each area
acts as a small independent domain for flooding LSPs. OSPF uses two level of
hierarchy in routing: the first level is the autonomous system, the second is the area.
The routers in the backbone area are responsible for passing the information collected by
each area to all other areas

OSPF is based on the link-state routing algorithm, which requires that a router advertise
the state of each link to all neighbors for the formation of the LSDB.
 There are five types of link-state advertisements are there: router link, network link,
summary link to network, summary link to AS border router, and external link.

OSPF Messages:
OSPF is a very complex protocol; it uses five different types of messages.
 The hello message (type 1) is used by a router to introduce itself to the neighbors and
announce all neighbors that it already knows.
 The database description message (type 2) is normally sent in response to the hello
message to allow a newly joined router to acquire the full LSDB.
 The linkstate request message (type 3) is sent by a router that needs information about
a specific LS.
The link-state update message (type 4) is the main OSPF message used for building the
LSDB.
Border Gateway Protocol Version 4 (BGP4):
 The Border Gateway Protocol version 4 (BGP4) is the only interdomain routing
protocol used in the Internet today. BGP4 is based on the path-vector algorithm.
 BGP, and in particular BGP4, is a complex protocol. AS2, AS3, and AS4 are stub
autonomous systems; AS1 is a transient one.
 Each router in each AS knows how to reach a network that is in its own AS, but it
does not know how to reach a network in another AS.

Operation of External BGP (eBGP)


 When the software is installed on two routers, they try to create a TCP connection
using the well-known port 179.
 A pair of client and server processes continuously communicates with each other to
exchange messages.
 The two routers that run the BGP processes are called BGP peers or BGP speakers.

However, there is a need for a logical TCP connection to be created over the physical
connection to make the exchange of information possible.
 Each logical connection in BGP parlance is referred to as a session.
 The iBGP protocol is similar to the eBGP protocol in that it uses the service of TCP
on the well-known port 179, but it creates a session between any possible pair of
routers inside an autonomous system. However, some points should be made clear.
 First, if an AS has only one router, there cannot be an iBGP session. For example, we
cannot create an iBGP session inside AS2 or AS4 in our internet.
 Second, if there are n routers in an autonomous system, there should be *n × (n − 1) /
2+ iBGP sessions in that autonomous system to prevent loops in the system.
 Each router needs to advertise its own reachability to the peer in the session instead of
flooding what it receives from another peer in another session

The first message (numbered 1) is sent by R1 announcing that networks N8 and N9


are
reachable through the path AS1-AS2, but the next router is R1.
 This message is sent, through separate sessions, to R2, R3, and R4. Routers R2, R4,
and R6 do the same thing but send different messages to different destinations.
 The interesting point is that, at this stage, R3, R7, and R8 create sessions with their
peers, but they actually have no message to send.
 After R1 receives the update message from R2, it combines the reachability
information about AS3 with the reachability information it already knows about AS1
and sends a new update message to R5.
 Now R5 knows how to reach networks in AS1 and AS3. The process continues when
R1 receives the update message from R4

[Link] QUESTION PARTA/B/C YEAR CO PO BT

1 Compare and contrast April/May


between interdomain and B 2024 C211.2 1 4
intradomain routing
protocols.(7)
Lecture Topic CO PO
No

16 IPv6 ADDRESSING C211.2 1,2

IPv6 ADDRESSING:
 The main reason for migration from IPv4 to IPv6 is the small size of the address
space in IPv4.
 An IPv6 address is 128 bits or 16 bytes (octets) long, four times the address length in
IPv4
 A computer normally stores the address in binary, but it is clear that 128 bits cannot
easily be handled by humans
 Binary notation is used when the addresses are stored in a computer.
 The colon hexadecimal notation (or colon hex for short) divides the address into eight
sections, each made of four hexadecimal digits separated by colons Abbreviation
 Although an IPv6 address, even in hexadecimal format, is very long, many of the
digits are zeros.
 The leading zeros of a section can be omitted. Using this form of abbreviation, 0074
can be written as 74, 000F as F, and 0000 as 0. Note that 3210 cannot be abbreviated.
 Further abbreviation, often called zero compression, can be applied to colon hex
notation if there are consecutive sections consisting of zeros only. We can remove all
the zeros and replace them with a double semicolon.
 IPv6 uses hierarchical addressing. The address space of IPv6 contains 2128 addresses.
 This address space is 296 times the IPv4 address—definitely no address depletion
Address Types In IPv6, a destination address can belong to one of three categories:
unicast, anycast, and multicast.

Unicast Address:
A unicast address defines a single interface (computer or router). The packet sent to a
unicast address will be routed to the intended recipient.
Anycast Address:
 An anycast address defines a group of computers that all share a single address.
 A packet with an anycast address is delivered to only one member of the group, the
most reachable one. An anycast communication is used, for example, when there are
several servers that can respond to an inquiry.
 The request is sent to the one that is most reachable. The hardware and software
generate only one copy of the request; the copy reaches only one of the servers.
 IPv6 does not designate a block for any casting; the addresses are assigned from the
unicast block.

Multicast Address:
 A multicast address also defines a group of computers. However, there is a difference
between any casting and multicasting.
 In any casting, only one copy of the packet is sent to one of the members of the group;
in multicasting each member of the group receives a copy.
Global Unicast Addresses:
 The block in the address space that is used for unicast (one-to-one) communication
between two hosts in the Internet is called the global unicast address block.
 CIDR for the block is 2000::/3, which means that the three leftmost bits are the same
for all addresses in this block (001). The size of this block is 2125 bits, which is more
than enough for Internet expansion for many years to come.
 An address in this block is divided into three parts: global routing prefix (n
bits),subnet identifier (m bits), and interface identifier (q bits)

Lecture Topic CO PO
No

17 IPv6 PROTOCOL C211.2 1,2

IPv6 PROTOCOL:
The change of the IPv6 address size requires the change in the IPv4 packet format.
 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
data.
 New options. IPv6 has new options to allow for additional functionalities.
 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 two new fields, traffic class and flow label, have 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.
Packet Format:
Each packet is composed of a base header followed by the payload. The base header
occupies 40 bytes, whereas payload can be up to 65,535 bytes of information.
Version. The 4-bit version field defines the version number of the IP. For IPv6, the
value is 6.
Traffic class. The 8-bit traffic class field is used to distinguish different payloads with
different delivery requirements. It replaces the type-of-service field in IPv4.
Flow label. The flow label is a 20-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 header.
Next header. The next header is an 8-bit field defining the type of the first
extension header or the type of the data that follows the base header in the
datagram.
Hop limit. The 8-bit hop limit field serves the same purpose as the TTL field in IPv4.
Source and destination addresses. The source address field is a 16-byte (128-bit)
Internet address that identifies the original source of the datagram. The destination
address field is a 16-byte (128-bit) Internet address that identifies the destination of
the datagram.
Payload. The payload field in IPv6 differ from IPv4

The payload in IPv6 means a combination of zero or more extension headers


(options) followed by the data from other protocols.
Extension Header:
 An IPv6 packet is made of a base header and some extension headers.
 The length of the base header is fixed at 40 bytes. However, to give more
functionality to the IP datagram, the base header can be followed by up to six
extension headers.
 These are hop-by-hop option, source routing, fragmentation, authentication,
encrypted security payload, and destination option.
Hop-by-Hop - The hop-by-hop option is used when the source needs to pass
information to all routers visited by the datagram
Destination Option The destination option is used when the source needs to pass
information to the destination only
Source Routing The source routing extension header combines the concepts of the strict
source route and the loose source route options of IPv4.
Authentication The authentication extension header has a dual purpose: it validates the
message sender and ensures the integrity of data
Encrypted Security Payload The encrypted security payload (ESP) is an extension that
provides confidentiality and guards against eavesdropping.

[Link] QUESTION PARTA/B/C YEAR CO PO BT

1 Illustrate IPv6 datagram April/May


packet format with neat A 2024 C211.2 1 4
diagram.

Lecture Topic CO PO
No

TRANSITION FROM IPv4 TO


18 IPv6 C211.2 1,2

TRANSITION FROM IPv4 TO IPv6:


There are three strategies have been devised for transition: dual stack, tunneling, and
header translation

Dual Stack:
 It is recommended that all hosts, before migrating completely to version 6, have a
dual stack of protocols during the transition. In other words, a station must run IPv4
and IPv6 simultaneously until all the Internet uses IPv6

 To determine which version to use when sending a packet to a destination, the source
host queries the DNS. If the DNS returns an IPv4 address, the source host sends an
IPv4 packet. If the DNS returns an IPv6 address, the source host sends an IPv6
packet.

Tunneling:
 Tunneling is a strategy used when two computers using IPv6 want to communicate
with each other and the packet must pass through a region that uses IPv4.
 To pass through this region, the packet must have an IPv4 address. So the IPv6 packet
is encapsulated in an IPv4 packet when it enters the region, and it leaves its capsule
when it exits the region. It seems as if the IPv6 packet enters a tunnel at one end and
emerges at the other end.

Header:
 Translation Header translation is necessary when the majority of the Internet has
moved to IPv6 but some systems still use IPv4.
 The sender wants to use IPv6, but the receiver does not understand IPv6. Tunneling
does not work in this situation because the packet must be in the IPv4 format to be
understood by the receiver.

[Link] QUESTION PARTA/B/C YEAR CO PO BT

1 Differentiate between April/May


IPv4 addresses and IPv6 A 2024 C211.2 1 4
addresses.
2 Discuss in detail about April/May
transition from IPv4 and B 2023 C211.2 1,2 2
IPv6.
3 Compare and contrast Nov/Dec
between IPv4 addresses B 2023 C211.2 1 4
and IPv6 addresses.(6)
4 Enumerate three Nov/Dec
transition strategies to B 2023 C211.2 1,2 2
move from IPv4 to IPv6.
Illustrate the difference
between tunneling and
dual stack strategies
during the transition
period. When is each
strategy used?(7)

You might also like