You are on page 1of 31

Network Layer

Unit 5
Routing algorithm
• The main function of the network layer is routing packets from the source machine to the
destination machine.

• The routing algorithm is that part of the network layer software responsible for deciding
which output line an incoming packet should be transmitted on.

• If the subnet uses virtual circuits internally, routing decisions are made only when a new
virtual circuit is being set up. Thereafter, data packets just follow the previously-
established route. The latter case is sometimes called session routing because a route
remains in force for an entire user session

• It is sometimes useful to make a distinction between routing, which is making the decision
which routes to use, and forwarding, which is what happens when a packet arrives. One
can think of a router as having two processes inside it. One of them handles each packet
as it arrives, looking up the outgoing line to use for it in the routing tables. This process is
forwarding.
Shortest path
• Bellman-Ford Algorithm [Distance Vector]
• Dijkstra’s Algorithm [Link State]

1. What does it mean to be the shortest (or optimal) route?


Choices:
– Minimize the number of hops along the path.
– Minimize mean packet delay.
– Maximize the network throughput.
Flooding
• Every incoming packet is sent out on every outgoing line except the one it
arrived on. Flooding obviously generates vast numbers of duplicate packets, in
fact, an infinite number unless some measures are taken to damp the process.
One such measure is to have a hop counter contained in the header of each
packet, which is decremented at each hop, with the packet being discarded
when the counter reaches zero.
• An alternative technique for damming the flood is to keep track of which
packets have been flooded, to avoid sending them out a second time. achieve
this goal is to have the source router put a sequence number in each packet it
receives from its hosts. Each router then needs a list per source router telling
which sequence numbers originating at that source have already been seen. If
an incoming packet is on the list, it is not flooded.
• A variation of flooding that is slightly more practical is selective flooding. In this
algorithm the routers do not send every incoming packet out on every line, only
on those lines that are going approximately in the right direction. There is
usually little point in sending a westbound packet on an eastbound line unless
the topology is extremely peculiar and the router is sure of this fact.
Distance vector
• A distance-vector routing (DVR) protocol requires that a router
inform its neighbors of topology changes periodically. Historically
known as the old ARPANET routing algorithm (or known as
Bellman-Ford algorithm).
• Distance Vector Algorithm –
– A router transmits its distance vector to each of its neighbors in a routing
packet.
– Each router receives and saves the most recently received distance vector
from each of its neighbors.
– A router recalculates its distance vector when:
– It receives a distance vector from a neighbor containing different
information than before.
– It discovers that a link to a neighbor has gone down.
DV-EXAMPLE
• Consider 3-routers X, Y and Z as shown in figure.
Each router have their routing table. Every routing
table will contain distance to the destination
nodes.

• Consider router X , X will share it routing table to


neighbors and neighbors will share it routing table
to it to X and distance from node X to destination
will be calculated using bellmen- ford equation.
DV-EXAMPLE
• As we can see that distance will be less going
from X to Z when Y is intermediate node(hop)
so it will be update in routing table X.
DV-EXAMPLE
• Routing table of x:
DV-EXAMPLE
• Updated routing table of X,Y,Z:
Link state
• Link state routing is the second family of routing protocols. While
distance-vector routers use a distributed algorithm to compute
their routing tables, link-state routing uses link-state routers to
exchange messages that allow each router to learn the entire
network topology.
• Based on this learned topology, each router is then able to
compute its routing table by using the shortest path computation.
• Features:
– Link state packet – A small packet that contains routing information.
– Link state database – A collection of information gathered from the link-
state packet.
– Shortest path first algorithm (Dijkstra algorithm) – A calculation
performed on the database results in the shortest path
– Routing table – A list of known paths and interfaces.
Hierarchical
• In hierarchical routing, the routers are divided into regions. Each router has
complete details about how to route packets to destinations within its own
region.
• But it does not have any idea about the internal structure of other regions.
• In both Link State and Distance Vector algorithms, every router needs to
save some information about other routers. When network size is growing,
the number of routers in the network will increase.
• Therefore, the size of routing table increases, then routers cannot handle
network traffic as efficiently. To overcome this problem we are using
hierarchical routing.
• In hierarchical routing, routers are classified in groups called regions. Each
router has information about the routers in its own region and it has no
information about routers in other regions. So, routers save one record in
their table for every other region.
• For huge networks, a two-level hierarchy may be insufficient hence, it may
be necessary to group the regions into clusters, the clusters into zones, the
zones into groups and so on.
Broadcast
• In general, to broadcast information is to transmit it to many
receivers. For example, a radio station broadcasts a signal to
many listeners, and digital TV subscribers receive a signal that is
broadcast by their TV provider.
• In computer networking, broadcasting is sending data packets to
multiple recipients all at once.
• For instance, a local area network can be configured so that any
device on the network can broadcast a message to all the
others.
• When a networked device wants to broadcast, it transmits a
data packet to the network's broadcast address.
• The network hardware, such as routers or switches, does the
work of sending the packet to every other device in the group.
• The group of eligible devices is called a broadcast domain.
Multicast routing
• Multicast is a method of group communication where the sender sends
data to multiple receivers or nodes present in the network
simultaneously.
• Multicasting is a type of one-to-many and many-to-many
communication as it allows sender or senders to send data packets to
multiple receivers at once across LANs or WANs. This process helps in
minimizing the data frame of the network.
• Multicasting works in similar to Broadcasting, but in Multicasting, the
information is sent to the targeted or specific members of the network.
• This task can be accomplished by transmitting individual copies to each
user or node present in the network, but sending individual copies to
each user is inefficient and might increase the network latency.
• To overcome these shortcomings, multicasting allows a single
transmission that can be split up among the multiple users,
consequently, this reduces the bandwidth of the signal.
The IP protocol
• An IP datagram consists of a header part and a
text part. The header has a 20-byte fixed part
and a variable length optional part. The header
format is shown in Figure.
The IP protocol
• The Version field keeps track of which version of the protocol the
datagram belongs to.
• 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.
• The Type of service field is one of the few fields that has changed
its meaning (slightly) over the years.
• The Total length includes everything in the datagram—both header
and data. The maximum length is 65,535 bytes.
• The Identification field is needed to allow the destination host to
determine which datagram a newly arrived fragment belongs to.
• The Fragment offset tells where in the current datagram this
fragment belongs.
IP address
• IP, Short for Internet Protocol, is an address of a computer or other
network device on a network using IP or TCP/IP ( Transmission Control
Protocol / Internet Protocol ). For Example, the number "166.70.10.23"
is an example of such an address. These addresses are similar to
addresses used on houses and help data reach its appropriate destination
on a network.
• There are five classes of available IP ranges: Class A, Class B, Class C,
Class D and Class E, while only A, B and C are commonly used. Each
class allows for a range of valid IP addresses. Below is a listing of these
addresses.
Subnets
• A subnet, or subnetwork, is a segmented piece of a larger
network. More specifically, subnets are a logical partition of an
IP network into multiple, smaller network segments.
• The Internet Protocol (IP) is the method for sending data from
one computer to another over the internet. Each computer, or
host, on the internet has at least one IP address as a unique
identifier.
• Organizations will use a subnet to subdivide large networks
into smaller, more efficient subnetworks.
• One goal of a subnet is to split a large network into a grouping
of smaller, interconnected networks to help minimize traffic.
• This way, traffic doesn't have to flow through unnecessary
routs, increasing network speeds.
How do subnets work?
• Each subnet allows its connected devices to communicate with
each other, while routers are used to communicate between
subnets.
• The size of a subnet depends on the connectivity requirements
and the network technology employed.
• A point-to-point subnet allows two devices to connect, while a
data center subnet might be designed to connect many more
devices.
• Each organization is responsible for determining the number
and size of the subnets it creates, within the limits of the
address space available for its use.
• Additionally, the details of subnet segmentation within an
organization remain local to that organization.
How do subnets work?
• An IP address is divided into two fields: a Network
Prefix (also called the Network ID) and a Host ID.
What separates the Network Prefix and the Host ID
depends on whether the address is a Class A, B or C
address. Figure shows an IPv4 Class B address,
172.16.37.5. Its Network Prefix is 172.16.0.0, and
the Host ID is 37.5.
Internet control protocol
• Internet Control Message Protocol (ICMP) works in the network
layer of the OSI model and the internet layer of the TCP/IP
model. It is used to send control messages to network devices
and hosts.
• Routers and other network devices monitor the operation of the
network. When an error occurs, these devices send a message
using ICMP. Messages that can be sent include "destination
unreachable", "time exceeded", and "echo requests".
– ICMP is a network layer protocol.
– ICMP messages are not passed directly to the data link layer. The
message is first encapsulated inside the IP datagram before going to
the lower layer.
IGRP
• In a host network, the Interior Gateway Routing Protocol (IGRP) is
a proprietary distance vector routing protocol that is used to
exchange routing information.
• Cisco was the one who came up with the idea.
• The Internet Geolocation Routing Protocol (IGRP) regulates the
transfer of routing information among linked routers in the host
network or autonomous system.
• The protocol guarantees that every router’s routing table is kept
up to date with the most direct route available.
• IGRP also helps to minimize routing loops by updating itself in
response to changes that occur on the network and by
implementing error management.
Characteristics
• The following are the characteristics of the IGRP (Interior Gateway Routing Protocol):
• The Internet Group Routing Technology (IGRP) is a distance-vector routing protocol
created by Cisco.
• In addition to bandwidth, delay (by default), reliability, load, and MTU are all
measured in the IGRP protocol.
• It transmits updates every 90 seconds, with a hold-down time of 280 seconds between
each broadcasting session.
• When network changes occur, triggered updates are utilized to expedite the
convergence process.
• The IGRP router command needs the inclusion of an AS number.
• For routers to communicate routing information, they must be in the same Associated
System Number (AS).
• The maximum number of hops allowed by IGRP is 255. It has a default value of 100
and is often changed to 50 or less.
• The IGRP AD value is 100.
OSPF
• Provides for authentication of routing messages.
• 8-byte password designed to avoid
misconfiguration.
• Provides additional hierarchy
• Domains are partitioned into areas.
• This reduces the amount of information
transmitted in packet.
• Provides load-balancing via multiple routes.
Open Shortest Path First(OSPF)
• Open shortest path first (OSPF) is a link-state routing
protocol that is used to find the best path between the
source and the destination router using its own shortest
path first (SPF) algorithm.
• A link-state routing protocol is a protocol that uses the
concept of triggered updates, i.e., if there is a change
observed in the learned routing table then the updates are
triggered only, not like the distance-vector routing
protocol where the routing table is exchanged at a period
of time.
EIGRP
• Dynamic routing Protocol performs the same function as
static routing Protocol does. In dynamic routing Protocol, if
the destination is unreachable then another entry, in the
routing table, to the same destination can be used. One of
the routing protocols is EIGRP.
• EIGRP:
– Enhanced Interior Gateway Routing Protocol (EIGRP) is a
dynamic routing protocol that is used to find the best path
between any two-layer 3 devices to deliver the packet. EIGRP
works on network layer Protocol of OSI model and uses protocol
number 88. It uses metrics to find out the best path between
two layer 3 devices (router or layer 3 switches) operating EIGRP.
Border Gateway Protocol (BGP)
• Border Gateway Protocol (BGP) is used to Exchange routing
information for the internet and is the protocol used
between ISP which are different AS’s(Autonomous System).
• The protocol can connect together any internetwork of
autonomous system using an arbitrary topology.
• The only requirement is that each AS have at least one
router that is able to run BGP and that is router connect to
at least one other AS’s BGP router.
• BGP’s main function is to exchange network reach-ability
information with other BGP systems. Border Gateway
Protocol constructs an autonomous systems’ graph based
on the information exchanged between BGP routers.
CIDR
• CIDR stands for Classless Inter-Domain Routing. It
is an IP address assigning method that improves
the efficiency of address distribution. It is also
known as supernetting that replaces the older
system based on classes A, B, and C networks.
• By using a single CIDR IP address many unique IP
addresses can be designated. CIDR IP address is
the same as the normal IP address except that it
ends with a slash followed by a number.
Characteristics of CIDR
• It dynamically allocates the IP addresses by using CIDR blocks
on the requirement of the user based on certain rules.
• The assignment of the CIDR block is handled by the Internet
Assigned Number Authority (IANA). CIDR block consists of IP
addresses and it consists of some rules:
• All IP addresses which are allocated to host must be
continuous.
• The block size must be of power 2 and equal to the total
number of IP addresses.
• The size of the block must be divisible by the first IP address
of the block.
IPV6
• IP v6 was developed by Internet Engineering
Task Force (IETF) to deal with the problem of IP
v4 exhaustion.
• IP v6 is a 128-bits address having an address
space of 2^128, which is way bigger than IPv4.
• In IPv6 we use Colon-Hexa representation. There
are 8 groups and each group represents 2 Bytes.

IPV6
• In IPv6 representation, we have three addressing methods :
– Unicast
– Multicast
– Anycast
1. Unicast Address –
– Unicast Address identifies a single network interface. A packet sent to a
unicast address is delivered to the interface identified by that address.
2. Multicast Address –
– Multicast Address is used by multiple hosts, called as Group, acquires a
multicast destination address. These hosts need not be geographically
together. If any packet is sent to this multicast address, it will be distributed to
all interfaces corresponding to that multicast address.
3. Anycast Address –
– Anycast Address is assigned to a group of interfaces. Any packet sent to an
anycast address will be delivered to only one member interface (mostly
nearest host possible).
Thank You

You might also like