Dynamic Routing Protocols I RIP: Relates To Lab 4
Dynamic Routing Protocols I RIP: Relates To Lab 4
RIP
Relates to Lab 4.
The first module on dynamic routing protocols. This module provides an
overview of routing, introduces terminology (interdomain, intradomain,
autonomous system),
Routing
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
There are two approaches for calculating the routing tables:
Static Routing
Dynamic Routing: Routes are calculated by a routing protocol
IP Routing
routing
daemon
route
comman d
netstat
comman d
UDP
TCP
YES
For me ?
ICMP
Process IP
Options
routing
table
IP Output: Calculate
Next Hop Router
IP Input
Queue
Network Interfaces
IP Layer
Autonomous Systems
An autonomous system is a region of the Internet that is
administered by a single entity.
Examples of autonomous regions are:
UVAs campus network
MCIs backbone network
Regional Internet Service Provider
Routing is done differently within an autonomous system
(intradomain routing) and between autonomous system
(interdomain routing).
Autonomous
System 1
Ethernet
Router
Ethernet
Router
Router
Router
Ethernet
Router
Autonomous
System 2
Ethernet
RouterEthernet
Interdomain Routing
Routing within an AS
Ignores the Internet outside the
AS
Protocols for Intradomain routing
are also called Interior Gateway
Protocols or IGPs.
Popular protocols are
RIP (simple, old)
OSPF (better)
Each node knows the distance (=cost) to its directly connected neighbors
A node sends periodically a list of routing updates to its neighbors.
If all nodes update their distances, the routing tables eventually converge
New nodes advertise themselves to their neighbors
Link State
Gateway-to-Gateway Protocol
(GGP)
Daemon
Hello
rrouted
Gated
(Version 3)
RIP
interdomain
OSPF
EGP
BGP
V2
Yes
V2, V3
V1
Yes
V1
V2
10
A network as a graph
In the following, networks are represented as a network
graph:
nodes are connected by networks
network can be a link or a LAN
c(v,n)
Net
Net(v,n)
n
11
Net(v,w)
c(v,w)
Net(v,n)
c(v,n)
via
(next hop)
cost
Net
Net
D (v,Net)
12
Net
via
(next hop)
cost
D (v,Net)
[Net , D(v,Net)]
nn
Dest
(next hop)
cost
Net
D (v,Net
Net
D (v,Net
Net
D (v,Net
[Net
,D(v,Net
[Net
,D(v,Net
)]
N
[Net
)]
[Net
1
N
,D(v,Net
,D(v,Net
)]
)]
w
[Net
,D(v,Net
)]
[Net
,D(v,Net
)]
14
RoutingTable
c (v,w)
Net(v,w)
v
via
(next hop)
cost
w
c(v,n)
Net(v,n)
Dest
Net(v,m)
Net(v,w)
Net(v,n)
15
via
cost
(next hop)
Net(v,m)
Net(v,w)
Net(v,n)
New node v sends the routing table entry to all its neighbors:
[Net(v,n),0]
[ n,0 ]
[Net(v,w),0]
[w,0]
m
m
[Net(v,n),0]
[ n,0 ]
[Net(v,m),0]
[m,0]
v
v
w
w
[m,0]
[Net(v,m),0]
[w,0][Net(v,w),0]
n
n
16
[Net
[Net
,D(m,Net
,D(m,Net
)]
N
[Net
)]
[Net
1
N
,D(w,Net
,D(w,Net
)]
)]
w
[Net
,D(n,Net
)]
[Net
,D(n,Net
)]
17
Net
c(v,m)
Net(v,m)
18
RoutingTable
[Net,D(m,Net)]
Net
c(v,m)
Net(v,m)
Dest
v
via
cost
(next hop)
Net
??
D(v,Net)
Net
c(v,m)
Net(v,m)
new
Dest
(v,Net)]
w
[Net,D
RoutingTable
new
Net
via
cost
(next hop)
new
(v,Net)
(v,Net)]
19
10.0.3.0/24
10.0.4.0/24
.1
.1
.1
.2
Net
via
t=0:
10.0.1.0 10.0.2.0 t=1:
10.0.1.0 10.0.2.0 10.0.3.0 10.0.2.2
t=2:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.2.2
10.0.2.2
cost
Router A
0
0
.2
Router B
Net
via
t=0:
10.0.2.0 10.0.3.0 -
Router C
Net
via
0
0
10.0.3.1
10.0.4.2
1
0
0
1
10.0.3.1
10.0.3.1
10.0.4.2
2
1
0
0
1
0
0
1
10.0.2.1
10.0.3.2
1
0
0
1
t=1:
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
0
0
1
2
t=2:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
10.0.2.1
10.0.3.2
10.0.3.2
1
0
0
1
2
t=2:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
.1
Router D
t=0:
10.0.3.0 10.0.4.0 -
t=1:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0/24
.2
cost
.2
10.0.2.0/24
cost
10.0.1.0/24
0
0
Net
via
cost
Example
t=0:
10.0.4.0 10.0.5.0 -
0
0
t=1:
10.0.3.0 10.0.4.1
10.0.4.0 10.0.5.0 -
1
0
0
t=2:
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
2
1
0
0
10.0.4.1
10.0.4.1
-
20
Example
10.0.3.0/24
10.0.4.0/24
.1
.1
.1
.2
via
t=2:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.2.2
10.0.2.2
0
0
1
2
t=3:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
10.0.2.2
10.0.2.2
10.0.2.2
0
0
1
2
3
Net
via
.2
Router C
cost
Net
Router B
cost
Router A
.2
t=2:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
10.0.2.1
10.0.3.2
10.0.3.2
1
0
0
1
2
t=3:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
10.0.2.1
10.0.3.2
10.0.3.2
1
0
0
1
2
Net
t=2:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
t=3:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
via
10.0.3.1
10.0.3.1
10.0.4.2
10.0.3.1
10.0.3.1
10.0.4.2
10.0.5.0/24
.1
Router D
2
1
0
0
1
2
1
0
0
1
Net
via
cost
.2
10.0.2.0/24
cost
10.0.1.0/24
t=2:
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
10.0.4.1
10.0.4.1
-
2
1
0
0
t=3:
10.0.1.0
10.0.2.0
10.0.3.0
10.0.4.0
10.0.5.0
10.0.4.1
10.0.4.1
10.0.4.1
-
3
2
1
0
0
21
22
AA
A's Routing Table
cost
(next hop)
CC
via
to
BB
via
to
(next hop)
cost
oo
oo
2
C
2
oo
C
C
C
oo
4
C
oo
3
C
oo
23
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?
24
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 (Path vectors)
If routing tables are large, the routing messages
require substantial bandwidth
BGP uses this solution
25
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 As current route to C
Split Horizon does not solve count-to-infinity in all cases!
26
27
RIP - History
Late 1960s : Distance Vector protocols were used in the
ARPANET
Mid-1970s: XNS (Xerox Network system) routing protocol is
the precursor of RIP in IP (and Novells IPX RIP
and Apples 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)
28
UDP header
1: request
2: response
2: for IP
00: request full routing table
Command
Version
Set to 00...0
address family
Set to 00.00
32-bit address
Unused (Set to 00...0)
Address of destination
Cost (measured in hops)
One RIP message can
have up to 25 route entries
1: RIPv1
IP header
32 bits
29
RIPv2
RIPv2 is an extends RIPv1:
Subnet masks are carried in the route information
Authentication of routing messages
Route information carries next-hop address
Exploites IP multicasting
Extensions of RIPv2 are carried in unused fields of RIPv1
messages
30
UDP header
1: request
2: response
2: for IP
00: request full routing table
Command
Version
Set to 00...0
address family
Set to 00.00
32-bit address
Unused (Set to 00...0)
Address of destination
Cost (measured in hops)
One RIP message can
have up to 25 route entries
2: RIPv2
IP header
32 bits
31
UDP header
Command
Version
Set to 00.00
address family
route tag
IP address
Subnet Mask
Next-Hop IP address
2: RIPv2
metric (1-16)
IP header
32 bits
32
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
33
34
RIP Security
Issue: Sending bogus routing updates to a router
RIPv1: No protection
RIPv2: Simple authentication scheme
RIPv2 Message
UDP header
Command
Version
2: plaintext
password
Set to 00.00
0xffff
Authentication Type
Password (Bytes 0 - 3)
Password (Bytes 4 - 7)
Password (Bytes 8- 11)
Password (Bytes 12 - 15)
Authetication
IP header
32 bits
35
RIP Problems
36