coms w4995-1 lecture 5
DESCRIPTION
COMS W4995-1 Lecture 5. Dynamic routing protocols I. Overview of router architecture Overview Dynamic Routing Protocols: Distance Vector Routing Intra-Domain Routing Protocols: RIP. Forwarding is selecting the next-hop machine for each outgoing packet. - PowerPoint PPT PresentationTRANSCRIPT
![Page 2: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/2.jpg)
Dynamic routing protocols I
1. Overview of router architecture2. Overview Dynamic Routing Protocols: Distance Vector Routing 3. Intra-Domain Routing Protocols: RIP
![Page 3: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/3.jpg)
Routing and Forwarding
Forwarding is selecting the next-hop machine for each outgoing packet. Forwarding table, FIB (Forwarding Information Base).
Routing is the process of deciding the path from a source to a destination. Routing table, RIB (Routing Information Base).
Why two tables and not just one?
![Page 4: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/4.jpg)
Routing and Forwarding
Control plane: run routing protocols: (RIP, OSPF, BGP)
Data plane: forwarding packets from incoming to outgoing link
![Page 5: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/5.jpg)
Routing and Forwarding
Select the next-hop router. Find the outgoing interface. Find the MAC address of the next-hop router. In Unix, you specify the IP address of the next-hop router.
Longest-prefix first.
Default routing (implied by longest-prefix rule: default has prefix of length 0).
![Page 6: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/6.jpg)
Routing and Forwarding
Routing functions include: route calculation maintenance of the routing table execution of routing protocols
On commercial routers handled by a single general purpose processor, called route processor
IP forwarding is per-packet processing On high-end commercial routers, IP forwarding is
distributed Most work is done on the interface cards
![Page 7: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/7.jpg)
Router Hardware Components
Hardware components of a router: Network interfaces Switching fabrics Processor with a memory
and CPU
Interface Card
Switching fabric
Interface Card Interface Card
Processor
CPUMemory
![Page 8: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/8.jpg)
PC Router versus commercial router
On a PC router: Switching fabric is the (PCI)
bus Interface cards are NICs (e.g.,
Ethernet cards) All forwarding and routing is
done on central processor
On Commercial routers: Switching fabrics and
interface cards can be sophisticated
Central processor is the route processor (only responsible for control functions)
Interface Card
Switching fabric
Interface Card Interface Card
Processor
CPUMemory
![Page 9: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/9.jpg)
Basic Architectural ComponentsPer-packet processing
I/O Ports I/O Ports
Switching Fabric
![Page 10: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/10.jpg)
Evolution of Router Architectures
Early routers were essentially general purpose computers Today, high-performance routers resemble
supercomputers Exploit parallelism Special hardware components
Until 1980s (1st generation): standard computer Early 1990s (2nd generation): delegate to interfaces Late 1990s (3rd generation): Distributed architecture
Today: Distributed over multiple racks
![Page 11: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/11.jpg)
1st Generation Routers (switching via memory)
This architecture is still used in low end routers
Arriving packets are copied to main memory via direct memory access (DMA)
Switching fabric is a backplane (shared bus)
All IP forwarding functions are performed in the central processor.
Routing cache at processor can accelerate the routing table lookup.
Memory
Shared Bus
DMA
MAC
DMA
MAC
Interface Card
DMA
MAC
Route Processor
Interface Card
Interface Card
CacheCPU
![Page 12: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/12.jpg)
Drawbacks of 1st Generation Routers
Forwarding Performance is limited by memory and CPU
Capacity of shared bus limits the number of interface cards that can be connected
InputPort
OutputPort
Memory
System Bus
![Page 13: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/13.jpg)
SharedBus
InterfaceCards
DMA
MAC
DMA
MAC
DMA
MAC
Route Cache
Memory
Route Cache
Memory
Route Cache
Memory
Route Processor
MemoryCacheCPU
2nd Generation Routers (switching via a shared bus)
Keeps shared bus architecture, but offloads most IP forwarding to interface cards
Interface cards have local route cache and processing elements
Fast path: If routing entry is found in local cache, forward packet directly to outgoing interface
Slow path: If routing table entry is not in cache, packet must be handled by central CPU
slow pathfast path
![Page 14: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/14.jpg)
CPU
Cache
Memory
MAC MAC
Memory
Forwarding Bus(IP headers only)
InterfaceCards
Data Bus
Control Bus
Memory
MAC
Memory
ForwardingEngine
CPU
Cache
Memory
ForwardingEngine Route Processor
CPU
Memory
Another 2nd Generation Architecture
IP forwarding is done by separate components (Forwarding Engines)
Forwarding operations:1. Packet received on interface:
Store the packet in local memory. Extracts IP header and sent to one forwarding engine
2. Forwarding engine does lookup, updates IP header, and sends it back to incoming interface
3. Packet is reconstructed and sent to outgoing interface.
![Page 15: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/15.jpg)
Drawbacks of 2nd Generation Routers
SharedBus
InterfaceCards
DMA
MAC
DMA
MAC
DMA
MAC
Route Cache
Memory
Route Cache
Memory
Route Cache
Memory
Route Processor
MemoryCacheCPU
Bus contentionlimits throughput
![Page 16: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/16.jpg)
3rd Generation Architecture
Switching fabric is an interconnection network (e.g., a crossbar switch)
Distributed architecture: Interface cards operate
independent of each other No centralized processing for IP
forwarding These routers can be scaled to
many hundred interface cards and to aggregate capacity of > 1 Terabit per second
CPU
Memory
RouteProcessor
Memory
RouteProcessing
MAC
SwitchFabric
Interface
SwitchFabric
Memory
RouteProcessing
MAC
SwitchFabric
Interface
![Page 17: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/17.jpg)
Cisco Express Forwarding (distributed mode)
![Page 18: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/18.jpg)
Cisco Express Forwarding Benefits
Scalability & Efficiency Adjacency Tables for local hosts (same network)
Layer 2 switching is faster. The line cards perform the express forwarding between port
adapters, relieving the RSP (Route Switch Processing) of involvement in the switching operation.
Resilience No route cache: several data structures for CEF switching Line Cards maintain an identical copy of the FIB and adjacency
tables.
More at Cisco on-line documentation
![Page 19: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/19.jpg)
Slotted Chassis
Large routers are built as a slotted chassis Interface cards are inserted in the slots Route processor is also inserted as a slot
This simplifies repairs and upgrades of components
![Page 20: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/20.jpg)
Dynamic Routing Protocols
Distance Vector Routing
![Page 21: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/21.jpg)
Routing Protocols
Recall: There are two parts to routing IP packets:1. How to pass a packet from an input interface to the output interface of a router (packet forwarding) ? 2. How to find and setup a route ?
We already discussed the packet forwarding part Longest prefix match
There are two approaches for calculating the routing tables: Static Routing (We modify manually the Routes) Dynamic Routing: Routes are calculated by a routing protocol
![Page 22: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/22.jpg)
Routing protocols vs routing algorithms
Routing protocols establish routing tables at routers.
A routing protocol specifies What messages are sent between routers Under what conditions the messages are sent How messages are processed to compute routing tables
At the heart of any routing protocol is a routing algorithm that determines the path from a source to a destination
![Page 23: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/23.jpg)
Overview Routing Protocols
Routing information protocol (RIP) Distance vectorInterior Gateway routing protocol (IGRP, Cisco proprietary)
Distance vector
Open shortest path first (OSPF) Link stateIntermediate System-to-Intermediate System (IS-IS
Link state
Border gateway protocol (BGP) Path vector
Routing protocol Routing Algorithm
![Page 24: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/24.jpg)
Intra-domain routing versus inter-domain routing
Recall Internet is a network of networks.
Administrative autonomy internet = network of networks each network admin may want to control routing in its own
network
Scale: with 200 million destinations: can’t store all destinations’s in routing tables! routing table exchange would swamp links
![Page 25: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/25.jpg)
Autonomous systems
aggregate routers into regions, “autonomous systems” (AS) or domain routers in the same AS run the same routing protocol
“intra-AS” or intra-domain routing protocol routers in different AS can run different intra-AS routing protocol
Ethernet
Router
Ethernet
Ethernet
RouterRouter
Ethernet
Ethernet
EthernetRouterRouter
Router
AutonomousSystem 2
AutonomousSystem 1
![Page 26: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/26.jpg)
Autonomous Systems An autonomous system is a region of the Internet that is
administered by a single entity.
Examples of autonomous regions are: UCI’s campus network MCI’s backbone network Regional Internet Service Provider
Routing is done differently within an autonomous system (intradomain routing) and between autonomous system (interdomain routing).
RIP, OSPF, IGRP, and IS-IS are intra-domain routing protocols.
BGP is the only inter-domain routing protocol.
![Page 27: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/27.jpg)
Distance Vector Routing Variations of Bellman-Ford algorithm.
Each router starts by knowing: Prefixes of its attached networks (“zero” distance). Its next hop routers (how to find them?)
Each router advertises only to its neighbors: All prefixes it knows about. Its distance from them.
Each router learns: All prefixes its neighbors know about. Their distance from them.
Each router figures out, for each destination prefix: The “distance” (how far away it is). The “vector” (the next hop router).
![Page 28: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/28.jpg)
Distance Vector Routing Properties DV Computes the Shortest Path
“Routing by rumor” Each router believes what its neighbors tell it.
In steady-state, each router has the “shortest” (smallest metric) path to the destination.
Convergence time is (on the average) proportional to the diameter of the network.
Any link change affects the entire network.
![Page 29: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/29.jpg)
Distance vector algorithm
A decentralized algorithm A router knows physically-connected neighbors and link costs to
neighbors A router does not have a global view of the network
Path computation is iterative and mutually dependent. A router sends its known distances to each destination (distance
vector) to its neighbors. A router updates the distance to a destination from all its
neighbors’ distance vectors A router sends its updated distance vector to its neighbors. The process repeats until all routers’ distance vectors do not
change (this condition is called convergence).
![Page 30: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/30.jpg)
Bellman-Ford Algorithm
Bellman-Ford EquationDefinedx(y) := cost of the least-cost path from x to y
Then dx(y) = minv{c(x,v) + dv(y) }, where min is taken over
all neighbors of node x
![Page 31: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/31.jpg)
Distance vector algorithm: initialization
Let Dx(y) be the estimate of least cost from x to y
Initialization: Each node x knows the cost to each neighbor: c(x,v). For each
neighbor v of x, Dx(v) = c(x,v) Dx(y) to other nodes are initialized as infinity.
Each node x maintains a distance vector (DV): Dx = [Dx(y): y 2 N ]
![Page 32: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/32.jpg)
Distance vector algorithm: updates
Each node x sends its distance vector to its neighbors, either periodically, or triggered by a change in its DV.
When a node x receives a new DV estimate from a neighbor v, it updates its own DV using B-F equation: If c(x,v) + Dv(y) < Dx(y) then
Dx(y) = c(x,v) + Dv(y) Sets the next hop to reach the destination y to the neighbor v Notify neighbors of the change
The estimate Dx(y) will converge to the actual least cost dx(y)
![Page 33: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/33.jpg)
Distance vector algorithm: an example
1 1
1
1 1
1
1
1
Time = 0
![Page 34: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/34.jpg)
Distance vector algorithm: an example
Time = 1
![Page 35: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/35.jpg)
Distance vector algorithm: an example
Time = 2 (End)
![Page 36: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/36.jpg)
How to map the abstract graph to the physical network
Nodes (e.g., v, w, n) are routers, identified by IP addresses, e.g. 10.0.0.1 Nodes are connected by either a directed link or a broadcast link (Ethernet) Destinations are IP networks, represented by the network prefixes, e.g.,
10.0.0.0/16 Net(v,n) is the network directly connected to router v and n.
Costs (e.g. c(v,n)) are associated with network interfaces. Router1(config)# router rip Router1(config-router)# offset-list 0 out 10 Ethernet0/0 Router1(config-router)# offset-list 0 out 10 Ethernet0/1
n
vw
Net
Net(v,w)
Net(v,n)
c(v,w)
c(v,n)
![Page 37: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/37.jpg)
Distance vector routing protocol: Routing Table
Dest
n
vw
D(v,Net)n
costvia(next hop)
Net
RoutingTable of node v
Net
Net(v,w)c(v,w)
Net(v,n)c(v,n)
Net(v,w): Network address of the network between v and w
c(v,w): cost to transmit on the interface to network Net(v,w)
D(v,net) is v’s cost to Net
![Page 38: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/38.jpg)
Distance vector routing protocol: Messages
Dest
D (v,Net)n
costvia(next hop)
Net
RoutingTable of node v
• Nodes send messages to their neighbors which contain distance vectors• A message has the format: [Net , D(v,Net)] means“My cost to go to Net is D (v,Net)”
v n[Net , D(v,Net)]
![Page 39: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/39.jpg)
Distance vector routing algorithm: Sending Updates
Dest
D (v,Net 2)n
costvia(next hop)
Net 2
RoutingTable of node v
D (v,Net 1)mNet 1
D(v,Net N)wNet N
Periodically, each node v sends the content of its routing table to its neighbors:
n
v wm
[Net N,D(v,Net N)]
[Net 1,D(v,Net 1)]
[Net N,D(v,Net N)]
[Net 1,D(v,Net 1)]
[Net N,D(v,Net N)]
[Net 1,D(v,Net 1)]
![Page 40: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/40.jpg)
Initiating Routing Table I
Destc (v,w)
Net(v,w)
0m
costvia(next hop)
Net(v,m)
RoutingTablec(v,m)
Net(v,m)
c(v,n)Net(v,n) 0wNet(v,w)
0nNet(v,n)n
v wm
Suppose a new node v becomes active. The cost to access directly connected networks is zero:
D (v, Net(v,m)) = 0 D (v, Net(v,w)) = 0 D (v, Net(v,n)) = 0
![Page 41: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/41.jpg)
Initiating Routing Table II
Dest
0m
costvia(next hop)
Net(v,m)
RoutingTable
0wNet(v,w)
0nNet(v,n)
Node v sends the routing table entry to all its neighbors:
n
v wm[w,0][n,0 ] [n,0 ]
[m,0]
[m,0][w,0]
n
v wm[Net(v,w),0][Net(v,n),0] [Net(v,n),0]
[Net(v,m),0]
[Net(v,w),0][Net(v,m),0]
n
v wm[Net(v,w),0][Net(v,n),0] [Net(v,n),0]
[Net(v,m),0]
[Net(v,w),0][Net(v,m),0]
![Page 42: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/42.jpg)
n
v wm
[Net N,D(n,Net N)]
[Net 1,D(n,Net 1)]
[Net N,D(m,Net N)]
[Net 1,D(m,Net 1)]
[Net N,D(w,Net N)]
[Net 1,D(w,Net 1)]
Initiating Routing Table III
Node v receives the routing tables from other nodes and builds up its routing table
![Page 43: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/43.jpg)
The Count-to-Infinity Problem
X
What happens on a link failure?
A: 1,AB:0C:1,C
A: 0B:1,BC:2,B
A: 2,BB:1,BC:0
A: 1,AB:0C:-
A: 1,AB:0C:3,A
A: 0B:1,BC:4,B
A: 1,AB:0C:5,A
A: 0B:1,BC:6,B
![Page 44: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/44.jpg)
Count-to-Infinity
The reason for the count-to-infinity problem is that each node only has a “next-hop-view”
For example, in the first step, A did not realize that its route (with cost 2) to C went through node B
How can the Count-to-Infinity problem be solved?
![Page 45: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/45.jpg)
Count-to-Infinity
The reason for the count-to-infinity problem is that each node only has a “next-hop-view”
For example, in the first step, A did not realize that its route (with cost 2) to C went through node B
How can the Count-to-Infinity problem be solved?
Solution 1: Always advertise the entire path in an update message to avoid loops (Path vectors) BGP uses this solution
![Page 46: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/46.jpg)
Count-to-Infinity
The reason for the count-to-infinity problem is that each node only has a “next-hop-view”
For example, in the first step, A did not realize that its route (with cost 2) to C went through node B
How can the Count-to-Infinity problem be solved?
Solution 2: Never advertise the cost to a neighbor if this neighbor is the next hop on the current path (Split Horizon)
Example: A would not send the first routing update to B, since B is the next hop on A’s current route to C
Split Horizon does not solve count-to-infinity in all cases! You can produce the count-to-infinity problem in Lab 4.
![Page 47: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/47.jpg)
Characteristics of D.V. Routing Protocols
Periodic Updates: Updates to the routing tables are sent at the end of a certain time period. A typical value is 30 seconds.
Triggered Updates: If a metric changes on a link, a router immediately sends out an update without waiting for the end of the update period.
Full Routing Table Update: Most distance vector routing protocol send their neighbors the entire routing table (not only entries which change).
Route invalidation timers: Routing table entries are invalid if they are not refreshed. A typical value is to invalidate an entry if no update is received after 3-6 update periods.
![Page 48: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/48.jpg)
Inter-domain Routing Protocols: RIP
![Page 49: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/49.jpg)
RIP - Routing Information Protocol
A simple intradomain protocol
Straightforward implementation of Distance Vector Routing
Each router advertises its distance vector every 30 seconds (or whenever its routing table changes) to all of its neighbors
RIP always uses 1 as link metric
Maximum hop count is 15, with “16” equal to “”
Routes are timeout (set to 16) after 3 minutes if they are not updated
![Page 50: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/50.jpg)
RIP - History
Late 1960s : Distance Vector protocols were used in the ARPANET
Mid-1970s: XNS (Xerox Network system) routing protocol is the ancestor of RIP in IP (and Novell’s IPX RIP and Apple’s routing protocol)
1982 Release of routed for BSD Unix 1988 RIPv1 (RFC 1058)
- classful routing 1993 RIPv2 (RFC 1388)
- adds subnet masks with each route entry - allows classless routing
1998 Current version of RIPv2 (RFC 2453)
![Page 51: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/51.jpg)
RIPv1 Packet Format
IP header UDP header RIP Message
Command Version Set to 00...0
32-bit address
Unused (Set to 00...0)
address family Set to 00.00
Unused (Set to 00...0)
metric (1-16)
one
rout
e en
try(2
0 by
tes)
Up to 24 more routes (each 20 bytes)
32 bits
One RIP message can have up to 25 route entries
1: request2: response
2: for IP
Address of destination
Cost (measured in hops)
1: RIPv1
![Page 52: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/52.jpg)
RIPv2
RIPv2 is an extends RIPv1: Subnet masks are carried in the route information Authentication of routing messages Route information carries next-hop address Uses IP multicasting
Extensions of RIPv2 are carried in unused fields of RIPv1 messages
![Page 53: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/53.jpg)
RIPv2 Packet Format
IP header UDP header RIP Message
Command Version Set to 00...0
32-bit address
Unused (Set to 00...0)
address family Set to 00.00
Unused (Set to 00...0)
metric (1-16) one
rout
e en
try(2
0 by
tes)
Up to 24 more routes (each 20 bytes)
32 bits
One RIP message can have up to 25 route entries
1: request2: response
2: for IP
Address of destination
Cost (measured in hops)
2: RIPv2
![Page 54: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/54.jpg)
RIPv2 Packet Format
IP header UDP header RIPv2 Message
Command Version Set to 00.00
IP address
Subnet Mask
address family route tag
Next-Hop IP address
metric (1-16) one
rout
e en
try(2
0 by
tes)
Up to 24 more routes (each 20 bytes)
32 bits
Used to provide a method of separating "internal" RIP routes (routes for networks within the RIP routing domain) from "external" RIP routes
Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0….0)
2: RIPv2
Subnet mask for IP address
![Page 55: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/55.jpg)
RIP Messages
This is the operation of RIP in routed. Dedicated port for RIP is UDP port 520.
Two types of messages: Request messages
used to ask neighboring nodes for an update Response messages
contains an update
![Page 56: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/56.jpg)
Routing with RIP
Initialization: Send a request packet (command = 1, address family=0..0) on all interfaces:
RIPv1 uses broadcast if possible, RIPv2 uses multicast address 224.0.0.9, if possible
requesting routing tables from neighboring routers
Request received: Routers that receive above request send their entire routing table
Response received: Update the routing table
Regular routing updates: Every 30 seconds, send all or part of the routing tables to every neighbor in an response message
Triggered Updates: Whenever the metric for a route change, send entire routing table.
![Page 57: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/57.jpg)
RIP Security
Issue: Sending bogus routing updates to a router RIPv1: No protection RIPv2: Simple authentication scheme
IP header UDP header RIPv2 Message
Command Version Set to 00.00
Password (Bytes 0 - 3)
Password (Bytes 4 - 7)
0xffff Authentication Type
Password (Bytes 8- 11)
Password (Bytes 12 - 15) Auth
etic
atio
nUp to 24 more routes (each 20 bytes)
32 bits
2: plaintext password
![Page 58: COMS W4995-1 Lecture 5](https://reader036.vdocuments.site/reader036/viewer/2022062520/56815a6c550346895dc7c863/html5/thumbnails/58.jpg)
RIP Problems
RIP takes a long time to stabilize Even for a small network, it takes several minutes until the
routing tables have settled after a change
RIP has all the problems of distance vector algorithms, e.g., count-to-Infinity RIP uses split horizon to avoid count-to-infinity
The maximum path in RIP is 15 hops