Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Module 4 Routing Algorithms CN

The document discusses the concept of routing in the network layer, focusing on the role of routers and routing tables in forwarding packets across interconnected networks. It differentiates between static and dynamic routing, outlines various routing protocols such as RIP, OSPF, and BGP, and explains the algorithms used for routing decisions. Additionally, it highlights the challenges of managing routing tables and the importance of routing architecture in the Internet, including the division of networks into Autonomous Systems.

Uploaded by

adarshhalse45
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Module 4 Routing Algorithms CN

The document discusses the concept of routing in the network layer, focusing on the role of routers and routing tables in forwarding packets across interconnected networks. It differentiates between static and dynamic routing, outlines various routing protocols such as RIP, OSPF, and BGP, and explains the algorithms used for routing decisions. Additionally, it highlights the challenges of managing routing tables and the importance of routing architecture in the Internet, including the division of networks into Autonomous Systems.

Uploaded by

adarshhalse45
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Concept of Routing

in Network Layer

1
Routing/routers
a) An internet is a combination of networks connected by routers.
b) When a packet goes from a source to a destination, it will pass
through many routers until it reaches the router attached to
destination network.
c) A router consults a routing table when a packet is ready to be
forwarded. The routing table specifies the optimum path for the
packet and can be either static of dynamic. Dynamic routing is more
popular.
d) Static table does not change frequently. Dynamic table is updated
automatically when there is a change somewhere in the network; i.e
when a route is down or a better route has been created.

2
Routing
➢ Routing requires a host or a router to have a routing table.
➢ Usually when a host has a packet to send or when a router has
received a packet to be forwarded, it looks at this table to find the
route to the final destination.

Network Layer:
Delivery,Forwarding,Routing
General Routing Table

Flags
U (Up) The router is up and running.
G (Gateway) The destination is in another network.
H Host-specific address.
D Added by redirection.
M Modified by redirection.

4
General Routing Table
• Static routing table: created manually
• Dynamic routing table: updated periodically by using one of the
dynamic routing protocols such as RIP, OSPF, or BGP
• Common fields in a routing table
– Flag:
– Reference count: number of users of this route at the moment
– Use: the number of packets transmitted through this router for the
corresponding destination

Network Layer:
Delivery,Forwarding,Routing
Network Layer II (routing)
➢Routing Styles:
▪Static vs. Dynamic Routing
➢Routing Protocols/Algorithms
▪ Routing Table
▪ Routing Information Protocol (RIP) & Distance Vector Routing
(DVR)
▪ Open Shortest Path First (OSPF) & Link State Routing (LSR)
▪ Border Gateway Protocol (BGP) and Path Vector Routing (PVR)

7
Routing Protocol & Routing Algorithm
➢A Routing Protocol is a combination of rules and
procedures that lets routers in an internet inform
each other of changes. It allows routers to share
whatever they know about the internet or their
neighbourhood.

➢A Routing Algorithm is that part of network layer


software responsible for deciding which output
line and incoming packet should be transmitted
on.
8
Routing
a) However, this simple solution is impossible in today’s Internet
world because the number of entries in the routing table makes the
table lookups inefficient.
b) Need to make the size of table manageable and handles issues such
security at the same time. The key question is how to design the
routing table.
c) Next-hop routing, Network-specific routing, host specific routing
d) Static versus Dynamic Routing
e) Routing Protocols: RIP, OSPF, BGP
f) Routing Algorithms: DVR, LSR, PVR

9
Routing Protocol:
Interior Vs Exterior

11
Routing Architecture in the Internet
Fact:
Nobody owns the whole Internet.
However, parts of the Internet are owned and administered by
commercial and public organisations (such as ISPs, universities,
governmental offices, research institutes, companies etc.).

Idea:
Divide the Internet in Autonomous Systems (AS) that are
independently administered by individual organisations. Let each
administrative authority use its own routing protocol within the
AS. Let’s use one routing protocol to exchange routing
information among AS.

12
Routing Architecture in the Internet
An AS is a group of networks and routers under the authority
of a single administrator.

13
Static versus Dynamic Routing

A static routing table


contains information entered manually
Usually remains unchanged.

A dynamic routing table is updated


periodically or whenever necessarily
using one of the dynamic routing protocols
such as RIP, OSPF, or BGP.
14
Routing Protocols: Interior vs Exterior

• Routing inside an AS is referred to as interior routing whereas routing between ASs


is referred to as exterior routing.
• Each AS can choose one or more interior routing protocols inside an AS.
• Only one exterior routing protocol is usually chosen to handle routing between ASs.
• To know the next ’path’ (or router) a packet should be pass-on, the decision is based
on some optimisation rule/protocol, e.g. using different assignment of the cost
(metric) for each passing through a network for different routing Protocol above. 15
16
Distance Vector Routing (DVR)
a) 3 keys to understand how this algorithm works:
• Sharing knowledge about the entire AS. Each router
shares its knowledge about the entire AS with
neighbours. It sends whatever it has.
• Sharing only with immediate neighbours. Each router
sends whatever knowledge it has thru all its interface.
• Sharing at regular intervals. sends at fixed intervals,
e.g. every 30 sec.

b) Problems: Tedious comparing/updating process, slow


response to infinite loop problem, huge list to be
maintained!!

17
Distance Vector Routing (DVR)

➢ This method sees an AS, with all routers and networks, as


a graph, a set of nodes and lines (edges) connecting the
nodes.
➢ The graph theory used an algorithm called Bellman-Ford
(also called Ford-Fulkerson) for a while to find the shortest
path between nodes in a graph given the distance
between nodes.

18
Distance Vector Routing (DVR)

1.In distance vector routing, the cost is normally hop counts (how
many networks are passed before reaching the destination).
2. Each router needs to update its routing table asynchronously,
whenever it has received some information from its neighbors. In
other words, each router executes part of the whole algorithm in the
Bellman-Ford algorithm. Processing is distributive.
3. After a router has updated its routing table, it should send the result
to its neighbors so that they can also update their routing table.
4. Each router should keep at least three pieces of information for each
route: destination network, the cost, and the next hop.
5. We refer to information about each route received from a neighbor
as R (record), which has only two pieces of information: R.dest and
R.cost. The next hop is not included in the received record
19
Distance Vector Routing (DVR)

The algorithm is based on the fact that if all neighbors of


node i know the shortest distance to node j, then the
shortest distance between node i and j can be found by
adding the distance between node i and each neighbor to
the neighbor’s shortest distance to node j and then select
the minimum

20
Count to Infinity(Infinite loop problem

➢ A problem with distance vector routing is that any


decrease in cost (good news) propagates quickly, but
any increase in cost (bad news) propagates slowly.
➢ For a routing protocol to work properly, if a link is
broken (cost becomes infinity), every other router
should be aware of it immediately, but in distance
vector routing, this takes some time.
➢ The problem is referred to as count to infinity. It takes
several updates before the cost for a broken link is
recorded as infinity by all routers.

22
Count to Infinity(Infinite loop problem)

23
Interior Routing Protocol 2:
Open Shortest Path First
Protocol (OSPF)

34
Open Shortest Path First (OSPF)
a) OSPF uses link state routing to update the routing table in an area;
OSPF divides an AS into different areas (depending on their
type).
b) Unlike RIP, OSPF treats the entire network within differently with
different philosophy; depending on the types, cost (metric) and
condition of each link: to define the ‘state’ of a link.
c) OSPF allows the administrator to (only) assign a cost for passing
through a network based on the type of service required. e.g.
minimum delay, maximum throughput. (but not stating exact path)
d) Each router should have the exact topology of the AS network(a
picture of entire AS network) at every moment. The topology is a
graph consisting of nodes and edges.
e) Each router needs to advertise to the neighbourhood of every
other routers involved in an Area. (flood)
35
Open Shortest Path First (OSPF)
Areas in an Autonomous System

(AS>Areas)

OSPF divides an AS into areas. An area is a collection of network, hosts and routers
all contained within an AS. Routers inside an area flood the area with routing info. At
the border of an Area, special routers called Area Border routers summarize the info.
about the area and send it to other area. Among the areas inside an AS is a special area
called the Backbone connecting all areas through Backbone routers and serves as a
primary area to the outside (other ASs) via the AS Boundary router. 36
Link State Routing (LSR)
a) Like RIP, in link state routing, each router also shares its knowledge
about its neighbourhood with every routers in the area.
b) However, in LSR, the link-state packet (LSP) defines the best known
network topology (of an area) is sent to every routers (of other area)
after it is constructed locally. Whereas RIP slowly converge to final
routing list based information received from immediate neighbours.
c) 3 keys to understand how this algorithm works:
• Sharing knowledge about the neighbourhood. Each router sends the state of
its neighbourhood to every other router in the area.
• Sharing with every other routers. Thru process of flooding. each router sends
the state of its neighbourhood thr all its output ports and each neighbour sends
to every other neighbours and so on until all routers received same full
information eventually.
• Sharing when there is a change. Each router share its state of its neighbour
only when there is a change; contrasting DVR results in lower traffic.
d) From the received LSPs and knowledge of entire topology, a router
can then calculate the shortest path between itself and each network.
37
In OSPF, all routers have
the same Link State database.
• Every router in an area receives the router link and network link
LSAs and form a link state database.
• Every router in the same area has the same link state database.
• A link state database is a tabular representation of the topology of
the internet inside an area. It shows the relationship between each
router and its neighbors including the metrics used.
• To calculate its next-route in the routing table, each router applies
the Dijkstra algorithm to its state database, to find the shortest path
between 2 points on a network, using a graph (nodes and edges).
• The algorithm divides the nodes into two sets: tentative and
permanent. It chooses nodes, makes them tentative, examines them,
and if they pass the criteria, makes permanent. 47
Shortest Path Search
Dijkstra’s Algorithm
1. Start with the local node (router): the root of the tree.
2. Assign a cost of 0 to this node and make it the first permanent node.
3. Examine each neighbour node of the node that was the last
permanent node.
4. Assign a cumulative cost to each node and make it tentative.
5. Among the list of tentative nodes
a. Find the node with the smallest cumulative cost and make it permanent.
b. If a node can be reached from more than one direction
i. Select the direction with the shortest cumulative cost.
6. Repeat steps 3 to 5 until every node becomes permanent.

49
Link State Routing (LSR)
Idea Behind LSR: Each router must do the following:
1. Discover its neighbors, learn their network address. (Send HELLO packet)
2. Measure the delay or cost to each of its neighbors. (Send ECHO packet)
3. Building Link State packet telling all it has just learned. (ACK flag)
4. Distribute/Send this packet to all other routers (Flooding – SEND flag).
5. Compute the shortest path to every other router. (Dijkstra’s algorithm)

In effect the complete topology and all the delays are experimentally
measured and distributed to every router, then Dijkstra’s algorithm can
be run to find the shortest path to every other router.

HELLO packet can be acknowledged by a reply to signal its present.


ECHO packet requires instant response to know the round-trip-time.

58
OSPF Packets

• Based on Link State Routing


• OSPF messages are transported directly
in IP packets
• OSPF standard supports novel concepts
such as type of service routing, load
balancing and authentication

59
Exterior Routing Protocol:
Border Gateway Protocol
(BGP)

64
BGP & Path Vector Routing (PVR)
a) Border Gateway Protocol (BGP) is an inter-domain or inter-
autonomous system routing protocol: routing between different ASs.
b) BGP uses path vector routing to update the routing table in an area.
c) DVR and LSR are not suitable candidates for inter-AS routing :
• DVR: there are occasions in which the route with the smallest hop count is not
the preferred route; non-secure path although the shortest route taken.
• LSR: internet is too big for this routing method to require each router to have a
huge link state database. Taking very long time to calculate the routing table.
d) PVR defines the exact paths as an ordered list of ASs that a packet
should travel thru to reach the destination (besides having the
destination network and next router info.) in its routing table.
e) Security and Political issues involved: more desired to avoid ‘unsaved’
paths/routes/ASs than to take a shorter route.
f) The AS boundary router that participate in PVR advertise the routes of
the networks in their own AS to neighbour AS boundary routers.
g) Solve the count-to-infinity problem 65
Path vector packets

•Each AS has its ‘speaker’ router/node that acts on behalves of the AS. Only
speaker router can communicate with other speaker routers.
•R1 send a path vector message advertising its reachability of N1. R2 receives
the message, updates its routing table and after adding its AS to the path and
inserting itself as next router, send message to R3. R3 receives the message,
updates its routing table, make changes and sends the message to R4.
66
Path Vector Routing Policy
a) Policy routing can be easily implemented through path vector routing.
b) When a router receives a message from its neighbour, the speaker
node or AS boundary router can check the path with its approved list
of ASs.
c) If one of the ASs listed in the path is against its policy, the router can
ignore that path entirely and that destination.
d) For any unapproved paths, the router does not update its routing table
with this path, and it does not send the PV message to its neighbours.
e) This means that the routing table in path vector routing are not based
on the smallest hop count (as in distance vector routing) or the
minimum delay metric (as in open shortest path first routing); they are
based on the policy imposed on the router by the administrator.
f) The path was presented as a list of ASs, but is in fact, a list of
attributes. Each attributes gives some information about the path. The
list of attributes helps the receiving router make a better decision
when applying its policy. (Well-known & Optional) 68
Types of BGP messages

a) Open: To create a relationship, a router running BGP opens a


connection with a neighbouring AS and sends an open message. If the
neighbour accepted, it responds with a Keep-alive message to
establish relationship between the two routers.
b) Update: The heart of BGP protocol used by router to withdraw
destination that have been advertised previously, announce a route to a
new destination or do both. (Withdraw several but advertise only one).
c) Notification: sent by a router whenever an error condition is detected
or router wants to close the connection (down). 69
Comparison of Distance Vector and Link State Routing

70

You might also like