Sie sind auf Seite 1von 17

Addis Ababa University

Faculty of Informatics
Department of Computer Science

Chapter 4

What Is Routing?
Routing is the act of moving information across a network from a
source to a destination.
Occurs at layer 3 the network layer
The router is the device that performs routing, and it connects
different LAN segments so that larger networks can be created.
Routing involves two basic activities:
determining optimal routing paths and
transporting packets through a network.

making a decision and choosing one route whenever there are multiple routes
based on some criteria;
how do you choose a route when you drive?
may be the condition of your car and the road,
the shortest one,
the one that is not congested,
the one with less traffic lights, avoid forbidden paths,...
the job of the network layer routing protocol
a combination of rules and procedures that lets routers in the internet
inform one another of changes (to share whatever they know about
the internet or their neighborhood); e.g. a failure of a network can be

at the heart of such protocol is the routing algorithm that determines the path
for a packet

routing requires a host or a router to have a routing table which is

constructed by the routing algorithm

given big internetworks such as the Internet, the number of entries in

the routing table becomes large and table look ups become inefficient;
methods for reducing its size required

Routers rely on two types of network protocols to make the routing

routable protocols and
routing protocols.
Large networks need protocols that allow systems to be identified by the
address of the network to which they are attached and by an address that
uniquely identifies them on that network.
Network protocols that provide both of these features are said to be
Three routable LAN network protocols are used today:

Routing protocols are the means by which routers communicate with

each other.

This communication is necessary so that routers can learn the network

topology and changes that occur in it.

two kinds of routing algorithms (routing tables): nonadaptive (static)

and adaptive (dynamic)

nonadaptive (static)
routing decisions are not based on measurements or estimates of the
current topology or traffic
the choice of a root is computed in advance, off-line, and
downloaded to the routers when the network is booted
an administrator enters the route for each destination into the table;
not automatically updated when there is a change; may be used in a
small internet, but not for big internet like the Internet

Disadvantages of static routing

manually entering routes is time-consuming and susceptible to
human error.
if the topology of the network changes, the routers must be
manually reconfigured.

adaptive (dynamic)
routing decisions are made periodically (every sec) to reflect
changes in the topology, traffic, a shutdown of a router, a break in
the link, a better route has been created, ...

metrics used
a metric is a cost assigned for passing through a network
the cost could be the level of congestion of a link (mean queue
length, transmission delay, average traffic), bandwidth, the
geographic distance traversed by the link, number of hops, estimated
transit time, communication cost, ...
which cost to choose depends on the application
the total metric of a particular route is equal to the sum of the
metrics of networks that comprise the route
a router chooses the route with the shortest (smallest) metric

Two routing protocols

A router that uses distance-vector protocols need only maintain a small
database of the routes accessible by the routers to which it is directly
A router that uses link-state protocols must maintain a database of the
routers in the entire network.

i. RIP - Routing Information Protocol

uses distance vector routing algorithm (dynamic)

each router maintains a table (one entry per router) giving the best
known distance to each destination

the tables are updated by exchanging information with neighbors

in the general case, the metrics could be: number of hops, time delay
in milliseconds, total number of packets queued along the path, ...

it is the original ARPANET routing algorithm (using queue length as

a metric) and was used until 1979

the distance metric used in RIP is the number of hops

all networks are treated as equals, i.e., the cost of passing through each
network is the same, it is one hop count

ii. OSPF - Open Shortest Path First

became a standard in 1990 by the IETF (Internet Engineering Task


aim: to simplify the implementation at the boundaries between

Autonomous Systems by having a standard for the interior routing
IETF identified some requirements
Netwo Co

has to be published in the open

literature - proprietary solutions are
not good

Route Informati







N4 (physical
has to support a variety of distance metrics

delay, ...)



it has to be dynamic
has to do load balancing for better performance (the best route is
not always the best)

has to support routing based on type of service

support for hierarchical systems - routers are not expected to
know the entire topology

introduce security so that spoofing routers by sending false

routing information is avoided

uses link state routing algorithm (dynamic)

replaced distance vector routing in ARPANET
since distance vector routing does not consider bandwidth (no
need initially since all lines were 56 Kbps; later some lines were
upgraded) and other metrics

Another classification of routing protocols is interior and exterior


since an internet can be large, one routing protocol cannot

handle the task of updating the routing tables of all routers

hence, an internet is divided into autonomous systems

an autonomous system (AS) is a group of networks and routers
under the authority of a single administration

routing inside an autonomous system is referred to as interior

routing; each AS can choose its own routing protocol

routing between autonomous systems is referred to as exterior

routing; one protocol is usually chosen to handle routing
between autonomous systems; usually used for routing in the

R1, R2, R3, and R4 use both interior and exterior routing protocols
the rest use only interior routing protocols
solid lines - communication between routers
broken lines - communication between the routers that use an exterior
routing protocol

why an exterior routing protocol apart from size of an internet? politics

political - I hate country X hence I will not handle its traffic

security - my information is confidential and should not pass
through a hostile country

it should not pass through a competitors network
I am not paid for it and hence dont want to carry a transit packet
such policies are typically manually configured into each router and are
not part of the protocol itself

Interior and Exterior routing protocols are more commonly referred to

as Interior Gateway Protocols (IGP) and Exterior Gateway Protocols
For the most part, the network administrator is concerned with IGP
protocols. RIP and OSPF are the two most implemented IGPs.
BGP (Border Gateway Protocol) is distance vector exterior routing