0% found this document useful (0 votes)
23 views

Week12.1 Final

Uploaded by

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

Week12.1 Final

Uploaded by

Enis Mert Kuzu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

CS 408

Computer Networks

Week 12-1 Routing

Kürşat Çağıltay, kursat.cagiltay@sabanciuniv.edu

1
Please Complete Course evaluations

• https://sucourse.sabanciuniv.edu/mynotif-
tool/goToEvaluationDashboard.jsp

• https://tinyurl.com/SUCS408

2
Introduction
• Routers forward IP datagrams from one router to another on the
path from source towards destination
• Routing protocols
—To decide on routes to be taken
• Routers must have idea of topology of internet in order to pick best
route to take
—It is an optimization problem. Decisions are based on some least cost
criteria
—May depend on the current conditions
Routing
• End systems and routers maintain routing tables
—Indicate next router to which datagram should be sent
• Static
—Tables do not change but may contain alternative routes
• Dynamic
—If needed, the tables are dynamically updated
—Flexible response to congestion and errors
—status reports issued by neighbours about down routers
Router Packet Forwarding Decision
What happens when the router receives the frame from the host device?
IP Router Routing Table

There three types of routes in a router’s routing table:


• Directly Connected – These routes are automatically added
by the router, provided the interface is active and has
addressing.
• Remote – These are the routes the router does not have a
direct connection and may be learned:
• Manually – with a static route
• Dynamically – by using a routing protocol to have the routers share
their information with each other
• Default Route – this forwards all traffic to a specific
direction when there is not a match in the routing table
Static Routing

Static Route Characteristics:


• Must be configured manually
• Good for small non-
redundant networks
• Often used in conjunction
with a dynamic routing
protocol for configuring a
default route
• Try it with Cisco Packet
Tracer
Dynamic Routing

Dynamic Routes Automatically:


• Discover remote networks
• Maintain up-to-date information
• Choose the best path to the
destination
• Find new best paths when there
is a topology change
Dynamic routing can also share
static default routes with the other
routers.
Routing protocols mobile network
national or global ISP
Routing protocol goal: determine
“good” paths (routes), from sending application
transport
hosts to receiving host, through network
link

network of routers
physical
network network
link link
physical physical

• path: sequence of routers packets network

traverse from given initial source host link


physical
network
link
physical network

to final destination host


link datacenter
physical network

• “good”: least “cost”, “fastest”, “least application


transport

congested” enterprise
network
network
link
physical
Link Costs
• Cost of each hop in each direction is called routing metric
• Normal
— Default metric assigned by administrators
— Typically 1 for minimum hop routing
• Monetary cost
• Reliability
— E.g. based on recent history of outages
• Throughput
• Delay
— Based on propagation and queueing delays for each interface of the routers
• Administrative preference of the route
Sample Configuration of Routers and Networks
(Fixed routing)

• Link costs are at the output of the


links
• Two principles:
• There is cost of putting data to
the network
• There is NO cost of getting data
from the network
• For example, the cost of the path
• X A  F  Y is 1+1+4=6
Routing Table
• One routing table is needed for each router
• One entry for each destination network (not each device!)
• Each entry shows next node (router) on the route to destination
—Not whole route
• If the attached network has single router, then routing table is not
needed
• All traffic must go through that router (called the default gateway)
Example Routing Tables
(Fixed routing)
Fixed Routing
• Single permanent route configured for each source-
destination pair
—Routes are fixed
—May change when topology changes (not so often)
• Mostly manual
• No dynamic updates

Normally we don’t use it


Adaptive Routing
• As conditions on internetwork change, routes may change
—Failure
• of routers or networks
—Congestion
• If a particular section of the network is heavily congested, it is better
not to use that part and change the route
mobile network
national or global ISP

Adaptive Routing - Challenges


• Complex routing decisions
—Router processing increases
• Depends on information collected in one place but datacenter
network

used in another
—More information exchange improves the quality of routing enterprise
network
decisions, but also increases overhead
• May react too fast (like in highway)
—causing congestion through oscillation (fluttering)
• May react too slow
—By the time routing decision changes, the network
conditions may be much more different
Adaptive Routing - Challenges
• Looping
—Packet forwarded by a router eventually returns to the same router
—May occur when changes in connectivity are not propagated fast enough
to all other routers
—An important pathology that must be prevented in routing algorithms

• Despite all challenges, adaptive routing prevails due to its


flexibility
Classification of Adaptive Routing
Strategies
• Based on information sources
—Adjacent nodes
• Delay and outage info from adjacent-neighbour nodes
• Distance vector algorithms
– Dijkstra's algorithm
—All nodes
• Link-state algorithms
– RIP- Routing Information Protocol - Bellman-Ford algorithm
Exterior and Interior Routing Protocols
Autonomous Systems (AS)
• An important concept for TCP/IP routing in IP layer

• AS is defined as set of routers and networks managed by single


organization (e.g. an ISP – Internet Service Provider)
—Exchange routing information in itself
—Common routing protocol
• An AS must be connected in itself
—There is at least one route between any pair of nodes and networks
Check with https://asnlookup.com

21
Interior Routing Protocol (IRP)
Exterior Routing Protocol (ERP)

• (not actually protocols, just concepts)


• IRP passes routing information between routers within AS
—e.g. Carrefoursa
—Need exchange of info among the routers only in AS
—Different autonomous systems may have different IRP mechanisms
• Autonomous systems need to talk to each other
—e.g. Vodafone - Turkcell
—A few routers in each AS must talk with other AS
—Use Exterior Routing Protocol (ERP)
• Again, a concept
—ERP does not deal with details within source and target AS
Application of Exterior and Interior Routing
Protocols
Approaches to Routing –
Distance-vector/Bellman-Ford

• Each router exchange information with neighboring routers


— Definition: Two nodes/routers are said to be neighbors if both are directly
connected to each other or to the same network
• Each node keeps a Routing Table
— distance vector and next-hop vector
• One entry for each destination network
— a vector of link costs for each directly attached network
• Requires transmission of information by each router to all neighbors
— Distance vector that contains estimated path costs for all destination networks
— Changes may take long time to propagate
• First generation routing algorithm for ARPANET
• Used by Routing Information Protocol (RIP) – (now almost retired)
Approaches to Routing –
Link-state / Dijkstra's Algorithm ***
• Designed to overcome drawbacks of distance-vector
• When router initialized, it determines link cost on each interface
• Advertises set of link costs to all other routers in topology
— Not just neighboring routers
• After that, each router monitors its link costs
— If significant change, router advertises new set of link costs
• In this way, each router builds up a picture of the entire topology
— Can calculate shortest path to each destination
— Use an algorithm to determine shortest paths
• In practice, Dijkstra's algorithm
• Router constructs routing table, listing first hop to each destination
• Second generation routing algorithm for ARPANET
• Open shortest path first (OSPF) protocol uses link-state routing.
Distance-vector and Link State
• Both of them is suitable for IRP, not ERP
• Several reasons. Some of them:
—Both require homogenous metrics that may be the case within an AS, but
we cannot assume then same for different AS systems
—Flooding (Broadcasting) the link state information across multiple AS
systems is not scalable
Approaches to Routing –
Path-vector
• Suitable approach for Exterior Router Protocols
• Provide information about which networks can be
reached by a given router and Autonomous
Systems crossed to get there
—Does not include distance or cost estimate
• BGP (Border Gateway Protocol) is an example to
path-vector routing protocol
IRP and Least Cost Algorithms
• Routing decision is based on some least-cost criteria (minimization
problem)
— To minimize number of hops, link cost is simply assumed to be 1
— Link cost may be inversely proportional to capacity, proportional to current
load (queue length), or some combination
— May be different in two directions (e.g. if cost is queue length)
• More formal problem definition
— For each pair of nodes, find the least cost path
— Cost of path between two nodes
is sum of costs of links traversed
• Dijkstra's algorithm
• Bellman-Ford algorithm
Graph abstraction: link costs
5
ca,b: cost of direct link connecting a and b
v 3 w e.g., cw,z = 5, cu,z = ∞
2 5
u 2 1 z
3 cost defined by network operator: could
1 2
x y always be 1, or inversely related to
1
bandwidth, or inversely related to
congestion
graph: G = (N,E)

N: set of routers = { u, v, w, x, y, z }
E: set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Dijkstra's Algorithm ***
• Find shortest paths from a given node to all other nodes, by
developing paths in the order of increasing path length (and
increasing cost)
• Proceeds in stages
—At each stage shortest path from source to one node is determined
—The nodes for which shortest path determined are kept in a set called T
—At each iteration, node not in T but has the shortest path from source is
added to T
—As each node added to T, path from source to the nodes not in T are
checked to see whether there is a better path through this newly added
node
Dijkstra’s link-state routing algorithm
 centralized: network topology, link notation
costs known to all nodes  cx,y: direct link cost from
• accomplished via “link state broadcast” node x to y; = ∞ if not
• all nodes have same info direct neighbors
 computes least cost paths from one  D(v): current estimate of
node (“source”) to all other nodes cost of least-cost-path from
source to destination v
• gives forwarding table for that node
 p(v): predecessor node
 iterative: after k iterations, know along path from source to v
least cost path to k destinations  N': set of nodes whose
least-cost-path definitively
known
Node Shortest Previous
Distance Node

Example A
B
-

C ∞
D ∞
B 6 ∞
E 9 E
2
F ∞

Visited Nodes:
A 5 1
3 C Unvisited Nodes: A B C D E F
8
3

D 2 F

32
Node Shortest Previous
Distance Node
Example A -
B 2 A
C 12 F
B 6 D 7 B
E 9
2 E 8 B
F 9 D
A 5 1
3 C
8
3

D 2 F

From A to C: A B D F C = 12

33
Dijkstra’s algorithm

Step N' N2,p(2) N3,p(3) N4,p(4) N5,p(5) N6,p(6)


0 1 2, 1-2 5, 1-3 1, 1-4 ∞ ∞
1 1,4 2,1-2 4,1-4-3 2,1-4-5 ∞
2 1,4,2 2,1-2 4,1-4-3 ∞
3 1,4,2,5 3,1-4-5-3 4,1-4-5-6
4 1,4,2,5,3 4,1-4-5-6
5 1,4,2,5,3,6
Dijkstra’s algorithm: result

resulting least-cost-path tree from N1:


resulting forwarding table in N1:
2 3 destination outgoing link
N2 (N1,N2) route from N1 to N4 directly
1 6 N4 (N1,N4)
4 5 N5 (N1,N4) route from N1 to all other
N3 (N1,N4) destinations via N4
N6 (N1,N4)
Dijkstra’s Algorithm – Example
See Table 11.1a for the Trace
Open Shortest Path First (OSPF)
• RIP has limitations in large internets
—RIP metrics are very simple and might cause suboptimal routes to be
formed
• OSPF is preferred interior routing protocol for TCP/IP based
internets
• Link state routing used
Link State Routing
• When initialized, router determines link cost on each interface
• Router advertises these costs to all other routers in topology
• Router monitors its costs
—When changes occur, costs are re-advertised
• Each router constructs topology and calculates shortest path to
each destination network
—Can use any algorithm, but in practice Dijkstra is used
OSPF Overview
• Router maintains the state (i.e. Cost) of local links
• Transmits updated state information to all routers in AS or in area
• Router receiving update must acknowledge

• Each router maintains a database that reflects the topology


—Directed graph
—And then generates a spanning tree and routing table
Router Database Graph
• Vertices (nodes)
—Routers
—Networks
• Edges
—Connecting two routers
—Connecting router to network
Sample Autonomous System
Directed Graph of Sample Autonomous System

Each router
applies
Dijkstra
algorithm on
this graph to
find out
minimum
path to each
destination
network
Example: The Spanning Tree for Router R6
Bellman-Ford Algorithm
• Iterative
1.find the shortest paths from a source to all possible destinations using only
one link
2.then using max. two links by adding appropriate links to the paths of step 1
3.then using max. 3 links on top of paths with two links
4.so on .. until no improvement is gained by adding more links

• Used for Distance Vector approach – RIP


—Not used anymore (almost)
Dijkstra vs Bellman-Ford
• Dijkstra's algorithm is typically employed in link-state routing protocols such as Open
Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS). These
protocols maintain a complete topology of the network and calculate the shortest path from
a source node to all other nodes based on the link costs.

• On the other hand, the Bellman-Ford algorithm is utilized in distance-vector routing


protocols like Routing Information Protocol (RIP). Distance-vector protocols exchange
routing information with their directly connected neighbors, and each router maintains a
routing table that contains the distance (cost) to reach each destination network. The
Bellman-Ford algorithm is used to iteratively update the routing tables and determine the
best paths.

• In summary, Dijkstra's algorithm is commonly used in link-state routing protocols, while the
Bellman-Ford algorithm is utilized in distance-vector routing protocols. Both algorithms
serve the purpose of finding the shortest paths in IP routing, mostly Dijkstra's algorithm is
used in routers.
RIP (Routing Information Protocol)
• Uses Distance Vector Routing approach
— Each node exchanges information with neighbors
— Neighbor = Directly connected via same network
• Each node maintains three vectors
— Link cost
• One entry for each network it attaches
Routing table

— Distance vector (metric column in the next slide)


• Current cost of route from the node to each destination network in the configuration
— Next hop vector (Next router column in the next slide)
• The next router for each destination network in the configuration
• Every 30 seconds, exchange distance vector with neighbors
• Use distance vectors received from neighbors to update distance and next
hop vector
— Similar to Bellman-Ford algorithm.
Distance Vector Algorithm Applied to Figure
11.1
RIP Details –
Incremental Update
• Previous algorithm implies that all distance vector updates arrive
within a small window of time
—Not correct, because (i) no synchronization, (ii) RIP uses UDP that means
no reliability.
• Actually RIP is designed to operate incrementally.
—Tables are updated after receipt of individual distance vector
Application of Exterior and Interior Routing
Protocols
Border Gateway Protocol (BGP)
• For use with TCP/IP internets
• Preferred ERP of the Internet
• Allows routers (gateways) in different Autonomous Systems to
exchange routing information
• Current version is BGP-4
—RFC 4271
• No time to cover
—See the book for details (in Chapter 12)
—Not responsible

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy