Download presentation
Presentation is loading. Please wait.
Published byRosamund Jefferson Modified over 6 years ago
1
Interior Routing Protocols Chapter 11&12: Routing in IP
CS 408 Computer Networks Chapter 11&12: Routing in IP Chapter 15
2
Introduction Routers forward IP datagrams from one router to another on path from source to destination Router must have idea of topology of internet and the best route to take May depend the current conditions Decisions based on some least cost criterion Routing protocols To decide on routes to be taken
3
Fixed Routing Single permanent route configured for each source-destination pair Routes fixed May change when topology changes (not so often) No dynamic updates
4
A Configuration of Routers and Networks
5
Routing Table One required for each router Entry for each network
Not for each destination Routing only needs network portion in this example Once datagram reaches router attached to destination network, that router can deliver to host Each entry shows next node on route Not whole route Routing tables may also exist in hosts If attached to single network with single router then not needed All traffic must go through that router (called the gateway) If multiple routers attached to network, host needs table saying which to use
6
Example Routing Tables
7
Adaptive Routing As conditions on internet changes, 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
8
Adaptive Routing - Challenges
More complex routing decisions Router processing increases Depends on information collected in one place but used in another More information exchanged improves routing decisions but increases overhead May react too fast causing congestion through oscillation May react too slow By the time routing decision changes, the network conditions may be much more different
9
Adaptive Routing - Challenges
Looping Packet forwarded by router eventually returns to that router May occur when changes in connectivity not propagated fast enough to all other routers An important pathology that must be prevented Algorithms designed to prevent looping
10
Classification of Adaptive Routing Strategies
Based on information sources Local E.g. route each datagram to network with shortest queue Balance loads on networks May not be heading in correct direction Rarely used Adjacent nodes Delay and outage info from adjacent nodes Distance vector algorithms Discussed later All nodes Link-state algorithms
11
Flooding No network info required
Packet sent by node to every neighbor Incoming packets retransmitted on every link except incoming link Eventually a number of copies will arrive at destination Each packet is uniquely numbered so duplicates can be discarded at destination
12
Flooding Example
13
Flooding Precautions against unlimited grow in circulation
Nodes can remember packets already forwarded to keep network load in bounds Include a hop count in packets. Set to a maximum value (e.g. diameter of the network) Decrease one at each hop Discard when 0
14
Properties of Flooding
All possible routes are tried Very robust can be used for emergency messaging At least one packet will use minimum hop count route Can be used to set up virtual circuit All nodes are visited Useful to distribute information (e.g. routing info)
15
Random Routing Node selects one outgoing path for retransmission of incoming packet Selection is at random equally likely all outgoing links are utilized in long-run can select outgoing path based on a probability e.g. probability based on data rate good traffic distribution No network info needed Route is typically not least cost nor minimum hop
16
Autonomous Systems (AS)
Set of routers and networks managed by single organization (e.g. an ISP) Exchange information Common routing protocol A connected network There is at least one route between any pair of nodes
17
Interior Routing Protocol (IRP)
(not actually a protocol, for now just a concept) Passes routing information between routers within AS Need exchange of info among the routers only in AS Different ASs may have different IRP mechanisms ASs need to talk to each other Need minimum information from other connected AS A few routers in each AS must talk Use Exterior Routing Protocol (ERP) Again, a concept
18
Exterior Routing Protocol (ERP)
ERP passes less information than IRP Router in first system determines route to target AS Routers in target AS then co-operate to deliver datagram ERP does not deal with details within target AS
19
Application of Exterior and Interior Routing Protocols
20
Approaches to Routing – Distance-vector
Each node (router or host) exchange information with neighboring nodes Definition: Two nodes are said to be neighbors if both are directly connected to the same network Each node keeps a vector of link costs for each directly attached network, distance and next-hop vectors for each destination First generation routing algorithm for ARPANET Used by Routing Information Protocol (RIP) Requires transmission of lots of information by each router Distance vector to all neighbors that contains estimated path costs Changes take long time to propagate
21
Approaches to Routing – Link-state
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 Router constructs routing table, listing first hop to each destination Use any routing algorithm to determine shortest paths In practice, Dijkstra's algorithm Open shortest path first (OSPF) protocol uses link-state routing. Also second generation routing algorithm for ARPANET
22
Distance-vector and Link State
Both of them is suitable for IRP, not ERP Several reasons. Some of them: Both requires homogenous metrics that may be the case within an AS, but we cannot assume then same for several ASs Distance vector routing does not disseminate the ASs that will be visited along the route In ERP this info may be necessary to implement security and priority policies Flooding the link state information across multiple ASs is not scalable
23
Exterior Router Protocols – Path-vector
Provide information about which networks can be reached by a given router and ASs crossed to get there Does not include distance or cost estimate Each block of information lists all ASs visited on this route Enables router to perform policy routing E.g. minimizing number of transit ASs E.g. avoid path to avoid transiting particular AS due to link speed, capacity, tendency to become congested, and security reasons BGP (Border Gateway Protocol) is an example to path-vector routing protocol
24
Least Cost Algorithms Routing decision is based on some least-cost criterion (minimization problem) If minimize number of hops, link value 1 Link value may be inversely proportional to capacity, proportional to current load, or some combination May differ in different two directions (e.g. if cost is queue length) More formal problem definition Cost of path between two nodes is sum of costs of links traversed For each pair of nodes, find least cost path Dijkstra's algorithm Bellman-Ford algorithm
25
Dijkstra's Algorithm Find shortest paths from given node to all other nodes, by developing paths in order of increasing path length Proceeds in stages By kth stage, shortest paths up to k nodes closest to source have been determined The nodes for which shortest path determined are kept in a set called T At stage (k + 1), node not in T but has the shortest path from source added to T As each node added to T, path from source defined for other nodes not in T
26
Dijkstra's Algorithm – Formal (1)
N = set of nodes in the network s = source node T = set of nodes so far incorporated (shortest path found) w(i, j) = link cost from node i to node j w(i, i) = 0 w(i, j) = if nodes not directly connected w(i, j) 0 if nodes are directly connected L(n) = cost of current least-cost path from s to n At the end of algorithm (actually as soon as n is added to T), L(n) is the cost of least-cost path from s to n
27
Dijkstra's Algorithm – Formal (2)
[Initialization] T = {s} i.e. set of nodes so far incorporated consists of only source node L(n) = w(s, n) for all n ≠ s i.e. initial path costs to neighboring nodes are link costs
28
Dijkstra's Algorithm – Formal (3)
Repeat [Get Next Node] Find neighboring node not in T with least-cost path from s Find x Ï T such that Add x to T. L(x) is the shortest path from s to x. [Update Least-Cost Paths] L(n) = min[L(n), L(x) + w(x, n)] for all n Ï T If the latter term is the minimum, the path from s to n is now the path from s to x concatenated with the edge from x to n. Until all nodes are in T
29
Figure 11.5 Dijkstra’s Algorithm Applied to Figure 11.1
30
Bellman-Ford Algorithm
Iterative find the shortest paths from a source to all possible destinations using only link then using max. two links by adding appropriate links to the paths of step 1 then using max. 3 links on top of paths with two links so on .. until no improvement is gained by adding more links
31
Bellman-Ford Algorithm – Formal (1)
s = source node w(i, j) = link cost from node i to node j w(i, i) = 0 w(i, j) = if nodes are directly connected w(i, j) 0 if nodes directly connected h = maximum number of links in path at current stage Lh(n) =cost of least-cost path from s to n such that path contains no more than h links
32
Bellman-Ford Algorithm – Formal (2)
[Initialization] L0(n) = , for all n s h=0
33
Bellman-Ford Algorithm – Formal (3)
[Update] Loop until no more improvements For each n ≠ s, compute If s-to-n cost reduced, then path also changes to s -…- j - n h=h+1
34
Figure 11.6 Bellman-Ford Algorithm Applied to Figure 11.1
35
RIP (Routing Information Protocol)
Uses Distance Vector Routing approach Each node exchanges information with neighbors Directly connected by same network Each node maintains three vectors Link cost For each network it attaches Distance vector Current cost of route from the node to each network in the configuration Next hop vector The next router for each network in the configuration Every 30 seconds, exchange distance vector with neighbors Use this to update distance and next hop vector Similar to Bellman-Ford algorithm.
36
Distance Vector Algorithm Applied to Figure 11.1
37
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. RIP packets use UDP Actually RIP is designed to operate incrementally. Tables are updated after receipt of individual distance vector
38
RIP Details – Topology Change
If no updates received from a router within 180 seconds, mark route invalid Assumes router crash or network connection unstable Set distance value to infinity Actually 16. Why? See next.
39
Counting to Infinity Problem (1)
A problem of RIP is slow convergence to a change in topology Consider the example network below with all link costs 1 B has distance to network 5 as 2, next hop D A and C have distance 3 and next hop B
40
Counting to Infinity Problem (2)
Suppose router D fails: B determines network 5 no longer reachable via D Sets distance to 4 based on report from A or C At next update, B tells A and C this A and C receive this and increment their network 5 distance to 5 4 from B plus 1 to reach B B receives distance count 5 and assumes network 5 is 6 away Repeat until reach infinity (16) Update interval is 30 seconds, so reaching 16 takes several minutes. If infinity is larger, then convergence could take longer.
41
Split Horizon Rule Counting to infinity problem caused by misunderstanding between B and A, and B and C Each thinks it can reach network 5 via the other Split Horizon rule says do not send information about a route back in the direction it came from Router sending information is nearer to the destination than you are Erroneous route now eliminated within time out period (180 seconds)
42
Poisoned Reverse Send updates with hop count of 16 to neighbors for routes through these neighbors breaks loop immediately Example Before D crashes, Routers A and C inform B that it can reach network 5 through them with a cost of 16 So after D crashes, B never thinks that it can reach network 5 through A or C
43
Figure 11.9 RIP Packet Format
44
RIP Packet Format Notes
Command: 1=request 2=reply Updates are replies whether asked for or not Initializing node broadcasts request Requests are replied to immediately Version: 1 or 2 Address family: 2 for IP IP address: non-zero network portion, zero host portion Identifies particular network Metric Path distance from this router to network Typically 1, so metric is hop count
45
RIP Limitations Destinations with metric more than 15 are unreachable
If larger metric allowed, convergence becomes lengthy So RIP is not suitable for large networks Simple metric leads to sub-optimal routing tables Packets sent over slower links Accept RIP updates from any device Misconfigured device can disrupt entire configuration
46
Open Shortest Path First (OSPF)
RIP limited in large internets OSPF preferred interior routing protocol for TCP/IP based internets Link state routing used
47
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 occurs, 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
48
OSPF Overview Router maintains descriptions of state of local links
Transmits updated state information to all routers that it knows Router receiving update must acknowledge Each router maintains database that reflects the topology Directed graph And then generates a spanning tree and routing table
49
Router Database Graph Vertices (nodes) Edges Router Network
Connecting two routers Connecting router to network
50
Sample Autonomous System
51
Directed Graph of Sample Autonomous System
52
The Spanning Tree for Router R6
53
Link Costs Cost of each hop in each direction is called routing metric
OSPF provides flexible metric scheme based on type of service (ToS) Normal Default metric assigned by administrators Minimize monetary cost Maximize reliability Maximize throughput Minimize delay Each router generates 5 spanning trees (and 5 routing tables)
54
Areas Make large internets more manageable
Configured as a backbone and multiple areas Area – Collection of contiguous networks and hosts plus routers connected to any included network Not so different from AS, but smaller Backbone – networks and routers that connect multiple areas as a central hub
55
Operation of Areas Each area runs a separate copy of the link state algorithm Topological database and graph of just that area Link state information broadcast to other routers in area Reduces traffic Intra-area routing relies solely on local link state information
56
Inter-Area Routing Path consists of three legs Within source area
Intra-area Delivers to the backbone Through backbone Has properties of an area Uses link state routing algorithm for inter-area routing Delivers to the destination area Within destination area Delivers to recipient
57
OSPF Packet Format OSPF directly runs over IP 24-byte header
58
Header Fields Version number: 2 is current
Type: one of 5, see next slide Packet length: in octets including header Router id: this packet’s source, 32 bit Area id: Area to which source router belongs Authentication type: null, simple password or cryptographic Authentication data: used by authentication procedure
59
OSPF Packet Types Hello: used in neighbor discovery
Periodically sent out the discover new neighbors Database description: Defines set of link state information present in each router’s database Content is not conveyed, just the structure Routers synchronize their network topologies Link state request Link state update Link state acknowledgement
60
Border Gateway Protocol (BGP)
For use with TCP/IP internets Preferred EGP of the Internet Allows routers (gateways) in different ASs to exchange routing information Current version is BGP-4 RFC 1771 Messages sent over TCP Types of messages coming in a few slides later
61
BGP Procedures (details later) Neighbor acquisition
shall we exchange routing info? initial step Neighbor reachability are we still connected? periodic keepalive messages Network reachability key part of the protocol exchange routing information for the networks that can be reached
62
Neighbor Acquisition Definition: Two routers are neighbors if they attach to same subnetwork If in different ASs, routers may wish to exchange information But first they have to agree Neighbor acquisition occurs when two neighboring routers agree to exchange routing information regularly Needed because one router may not wish to participate due to several reasons E.g. overloaded One router sends request, the other accepts or refuses Knowledge of existence of other routers and decision of acquisition established at configuration time or by active intervention (manual configuration)
63
Neighbor Acquisition Neighbors attach to same subnetwork
If in different ASs routers may wish to exchange information Neighbor acquisitionis when two neighboring routers agree to exchange routing information regularly Needed because one router may not wish to take part One router sends request, the other acknowledges Knowledge of existence of other routers and need to exchange information established at configuration time or by active intervention
64
Neighbor Reachability
Needed to maintain the relationship Each party should make sure that other is still alive Periodic issue of keepalive messages between all routers that are neighbors
65
Network Reachability Each router keeps database of subnetworks it can reach and preferred route When change made, router broadcast update message All BGP routers build up and maintain routing information
66
BGP Messages Open Keepalive Update Notification
Start neighbor relationship with another router Keepalive Acknowledge open message Periodically confirm neighbor relationship Update Transmit information about single route List multiple routes to be withdrawn Notification Send when error condition detected
67
BGP Message Formats Marker Length Type
Reserved for authentication data Length Of the message in octets Type Of message Open, Update, Keepalive, Notification
68
Neighbor Acquisition Detail
Router opens TCP connection with neighbor Sends Open message Identifies sender’s AS Includes Hold Time proposed by sender If recipient prepared to open neighbor relationship Calculate hold time min [own hold time, received hold time] This is the max amount of time between sucessive keepalive/update messages Reply with keepalive
69
Keepalive Detail Header only
Sent often enough to prevent hold time expiring
70
Update Detail Two types of information
A possible route List of previously advertised one or more routes being withdrawn May contain both Information about single route through internet Information to be added to database of any recipient router Network layer reachability information (NLRI) List of IP addresses of subnets that can be reached by this route Total path attributes length field Path attributes field (next slide) List of attributes that apply to this particular route
71
Some Path Attributes Field
AS_Path List of ASs traversed for this route A router may implement routing policies based on this info Security related Performance related Next_Hop IP address of border router for next hop Multi_Exit_disc To choose among multiple border routers Atomic_Aggregate, Aggregator Uses subnet addresses in tree view of network to reduce information needed in NLRI
72
BGP Routing Information Exchange
Within AS, router builds topology picture using IGP Router issues Update message to other routers outside AS using BGP These routers exchange info with other routers in other AS Routers must then decide best routes
73
BGP Routing Information Exchange (example)
R1 constructs routing table for AS1 using OSPF R1 issues update message to R5 (in AS2) AS_Path: identity of AS1 Next_Hop: IP address of R1 NLRI: List of all subnets in AS1 Suppose R5 has neighbor relationship with R9 in AS3 R5 forwards information received from R1 to R9 in update message AS_Path: list of ids {AS2,AS1} Next_Hop: IP address of R5 NLRI: All subnets in AS1 R9 decides if this is preferred route and forwards to neighbors With AS_Path field {AS1, AS2, AS3}
74
Withdrawal of Route(s)
Oneror more routers could be removed in one Update message Route(s) is/are identified by IP address of destination subnetwork(s)
75
Notification Message (some)
Error notification Message header error Includes authentication and syntax errors Open message error Syntax errors and option not recognised Proposed hold time unacceptable Update message error Problems in Update Message Hold timer expired If a router does not get a message (Keepalive/Update/Notification) then it sends this error and connection is closed
76
Inter-Domain Routing Protocol (IDRP)
Exterior routing protocol designed for IPv6 ISO-OSI standard AS BGP, based on Path-vector routing concept Superset of BGP. Key differences are: Operates over any internet protocol (not just TCP) Own handshaking for guaranteed delivery Variable length AS identifiers (in BGP fixed 16-bit) Handles multiple internet protocols and address schemes In BGP, a path is sequence of ASs. IN IDRP a set of connected ASs may be grouped as routing domain confederations
77
Routing Domain Confederations
Set of connected ASs Appear to outside world as single AS Recursive, i.e. confederations can be grouped as well Scales effectively for large internets
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.