Transcript Document
IP routing protocols
• Interior Routing Protocols
RIP, RIP2 (Routing Information Protocol)
HELLO (not used at the moment)
IS-IS (Intermediate System to Intermediate System)
IGRP (Interior Gateway Routing Protocol)
OSPF (Open Shortest Path First)
• Exterior Routing Protocols
EGP (Exterior Gateway Protocol)
BGP (Border Gateway Protocol)
Rev. 1.01 / 15.01.2007
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
IP routing and OSI RM
IP routing information
APPLICATION
IP routing
TCP
IP
Physical
PRESENTATION
SESSION
TRANSPORT
NETWORK
DATA LINK
PHYSICAL
TCP/IP
Petrozavodsk State University, Alex Moschevikin, 2003
Layer 7
Layer 6
Layer 5
Layer 4
Layer 3
Layer 2
Layer 1
OSI/RM
NET TECHNOLOGIES
First IP router at ARPANET
Interface Message Processor
Bolt, Beranek and Newman, Inc., United States
The Interface Message Processor (IMP) was
the first packet router for the ARPANET, the
predecessor of today’s Internet. Inside was a
Honeywell 516 minicomputer with only 6,000
words of software to monitor network status and
gather statistics. The first ARPANET transmission
occurred between the University of California in
Los Angeles and Stanford Research Institute in
Menlo Park, California, at 22:30 PST on October
29, 1969.
IMP development team
c. 1965
Speed:520,833 Add/s
Memory Size:12K
Cost:$82,200
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
IP routing Ethernet-based scheme
Source
default
gateway
194.0.1.1
IP datagram
194.0.1.100 ==> 194.0.32.4
194.0.1.100
Eth0
194.0.1.1
IP router 1
routing table
net
gateway
194.0.1.0
194.0.4.0
194.0.8.0 194.0.8.128
Default
Eth1
if
Eth0
Eth1
ppp0
ppp0
Source and destination IP
addresses remain the same from
hop to hop, but MAC addresses
are substituted by routers and
correspond to the certain source
and destination interfaces in each
LAN
194.0.8.1
ppp0
194.0.8.128
ppp0
Destination
194.0.32.4
194.0.32.1
Eth1
IP router 2
routing table
194.0.8.0 ppp0
194.0.32.0 Eth1
194.0.4.1
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Routing tables
• Routing Tables & static routing
• Dynamic routing (inter-domain and intra-domain)
$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask
Flags Metric Ref Use Iface
10.64.64.1
*
255.255.255.255 UH
0
0
0 ppp0
172.16.227.0 *
255.255.255.0
U
0
0
0 vmnet8
172.16.216.0 *
255.255.255.0
U
0
0
0 vmnet1
127.0.0.0
*
255.0.0.0
U
0
0
0 lo
default 10.64.64.1 0.0.0.0
UG
0
0
0 ppp0
vmnet* - виртуальные интерфейсы VmWare
Routing tables are used in IP forwarding ("netstat -rn")
Routing table may be altered by:
a) ‘route’ command
b) routing daemon (eg: ‘routed’)
c) ICMP redirect message.
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Routing tables
Fields: destination, gateway, flags, metric
Destination: can be a host address or a network address. Subnet
mask also present, but implicit for this discussion. If the ‘H’ flag
is set, it is the host address.
Gateway: router/next hop IP address. The ‘G’ flag says whether
the destination is directly connected (link address & IP address
refer to destination), or indirectly connected (link address refers to
router’s, IP address refers to destination)
U flag: Is route up ?
G: router (indirect vs direct)
H flag: host (dest field: host or n/w address?)
D & M flags: created/modified by ICMP redirect
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Routing tables
c:\>netstat -rn (dial-up access to Electrosvyaz')
Active routes:
Net address
Mask
Gateway
Interface
0.0.0.0
0.0.0.0 217.107.59.114 217.107.59.114
127.0.0.0
255.0.0.0
127.0.0.1
127.0.0.1
217.107.59.0
255.255.255.0 217.107.59.114 217.107.59.114
217.107.59.114 255.255.255.255
127.0.0.1
127.0.0.1
217.107.59.255 255.255.255.255 217.107.59.114 217.107.59.114
224.0.0.0
224.0.0.0 217.107.59.114 217.107.59.114
255.255.255.255 255.255.255.255 217.107.59.114 217.107.59.114
Metric
1
1
1
1
1
1
1
guess local IP address
Active connections: (after establishing few POP3 sessions)
Name
TCP
TCP
TCP
TCP
TCP
Local address
217.107.59.114:1037
217.107.59.114:1038
217.107.59.114:1040
217.107.59.114:1041
217.107.59.114:1042
External address
194.85.172.211:110
195.161.9.73:110
195.161.136.3:110
217.107.58.235:110
194.85.172.129:110
Petrozavodsk State University, Alex Moschevikin, 2003
Condition
ESTABLISHED
TIME_WAIT
ESTABLISHED
ESTABLISHED
ESTABLISHED
NET TECHNOLOGIES
Routing daemons
• irdd daemon implements the Internet Router Discovery
(IRD) protocol.
• routed daemon implements version I of the Routing
Information Protocol (RIP I) to exchange routing information.
• gated daemon now implements the SNMP Multiplexing
(SMUX) protocol, which provides support for the following
Simple Network Management Protocol (SNMP) Management
Information Bases (MIBs) and EGP, BGP, RIP 2, OSPF as
well.
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Distance vector vs Link State routing
DISTANCE VECTOR:
• Distance vector protocols count the number of devices data must
flow through to reach a destination. Each device is referred to as a
'hop'. Routes with lower hop counts are preferred.
• Very little overhead in terms of processor power and memory.
• Algorithm chooses the best route according to the hop count metric.
LINK STATE:
• Link State protocols track the status and connection type (and
therefore speed) of each link, and produce a calculated metric based on
these and other factors, including some set by the network
administrator.
• more processor power and memory, take longer to converge, and
therefore longer to recover from network outages.
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Distance vector vs Link State routing
128kb
ISDN
A
100Mb
Eth
128kb
ISDN
D
A
100Mb
Eth
B
C
10Mb
Eth
DISTANCE VECTOR
A ==> D
D
100Mb
Eth
100Mb
Eth
B
C
10Mb
Eth
LINK STATE
A==>B==>C==>D
A, B, C, D - routers
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
RIP
RIP: Routing Information Protocol
Active (routers advertise their route tables) and passive (hosts)
devices
Key fields of RIP packet: command, AFI, IP address, metric
• Command: request and response.
• Address Family Identifier (AFI): 2 for IP.
• IP address: subnet masks are not passed => variable length
subnet masks (VSLMs) cannot be supported. The routers
have to know apriori what subnet masks are being used.
Convention: 255.255.255.0
• Metric: hop count. Max = 16 (“infinity”)
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
RIP cont'd
RIP supports both point-to-point & broadcast links, uses port
520 in UDP. Normal mode = broadcast packets => overhead of
each station processing it.
Each RIP packet can contain upto 25 addresses. Usually a table
can fit inside one packet.
Router advertises its tables to neighbors every 30 s. Route is
reinitialized (as 16 or infinity) if no refresh for 180 s, and may be
removed later.
Triggered updates: inform neighbors when table changes.
Delay updates to avoid “update storms”.
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
RIP problems
Counting-to-infinity problem
Simple configuration A->B->C. If C fails, B needs to update and
thinks there is a route through A. A needs to update and thinks
there is a route through B.
No clear solution, except to set infinity to be small (eg 16 in
RIP)
A
B
C
Slow convergence after topology change
• Due to count to infinity problem
• Also information cannot propogate through node until it
recalculates routing info
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
RIP problems
Black-holes
If one node goes broke and advertises route of zero to several
key networks, all nodes immediately point to it.
General problem in distance-vector methods
How to install a fix in a distributed manner?
Require protocol to be “self-stabilizing” I.e even if some nodes
are faulty, once they are isolated, the system should quickly
return to normal operation
Broadcasts => resources from all nodes
Does not support VLSMs
No authentication
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
RIPv2 (RIP II)
Provides:
VLSM support (subnet mask in reserved field of RIP packet)
authentication
multicasting (224.0.0.0)
“wire-sharing” by multiple routing domains (reduce the volume of
tranferred data of the Internet routing tables due to CIDR)
Internet
A
B
info on routing to
net with 24-bit mask
10.0.1.0/24
(10.0.1.010.0.1.255)
10.0.1.0/26 10.0.1.64/26
(10.0.1.0(10.0.1.6410.0.1.63) 10.0.1.127)
Petrozavodsk State University, Alex Moschevikin, 2003
10.0.1.128/25
(10.0.1.12810.0.1.255)
different IP nets,
maybe different physical nets
NET TECHNOLOGIES
Interior Gateway Routing Protocol
As RIP:
• distance vector protocol
• routing update messages
Not as RIP:
• implemented only in Cisco routers
• composite metric, factoring weighted, that is calculated by
mathematical values for internetwork delay, bandwidth, reliability,
and load. These constants are expressed as certain metric and
administrator can vary it.
• IGRP permits multipath routing (round-robin algorithm of
choosing the way of available routes even if they are of not equal
metric)
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Stability features of IGRP
Holddown: after the break of router other routers
begin to exchange information on the changed
scheme (triggered). But if at this moment regular
routing update will take place (somebody don't know
about breakdown) tables will be not correct.
Holddowns tell routers to hold down any changes
that might affect routes for some period of time. The
holddown period usually is calculated to be just
greater than the period of time necessary to update
the entire network with a routing change.
C
D
triggered
B
A
regular
E
Split-horizon (solving counting to infinity): If A’s
route to C is through B, then A advertises C’s route
(only to B) as infinity.
B
C
A
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Stability features of IGRP (cont'd)
Split horizons should prevent routing loops between adjacent routers,
but
poison-reverse updates are necessary to defeat larger routing loops.
Increases in routing metrics generally indicate routing loops. Poisonreverse updates then are sent to remove the route and place it in
holddown. In Cisco's implementation of IGRP, poison-reverse updates
are sent if a route metric has increased by a factor of 1.1 or greater.
IGRP timers:
update timer frequency of routing update messages (90 seconds)
invalid timer route is invalid after … (3 times of update period)
hold-time variable specifies the holddown period (invalid+10s)
flush timer flushed the route from the routing table (7 times of update)
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Open Shortest Path First
Open + SPF (Dijkstra’s algorithm)
OSPF runs directly on top of IP (not over UDP)
Unlike RIP, OSPF can operate with hierarchy. (Autonomous
System - common administration and common routing strategy,
OSPF - IGP, but is capable of receiving routes from and sending
routes to other ASs).
Link State protocol:
calls for the sending of link-state advertisements (LSAs) to
all other routers within the same hierarchical area
LSA: attached interfaces, metrics, and other variables
routers accumulate link-state information and use the SPF
algorithm to calculate the shortest path to each node
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Open Shortest Path First
area 2
C
AS
H1
area 1
A
B
E
virtual backbone link
F
G
area 3
D
H2
H
AS can be divided into a number of areas (the same topological
database for routers in the same area)
E, F, G - Area Border Routers
E, F, G, H - backbone
Router A knows only about routers B and E
Two different types of OSPF routing: intra-area and interarea
routing
The backbone topology is invisible to all intra-area routers, as are
individual area topologies to the backbone
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
OSPF algorithm
Each participating router distributes its local state (i.e., the
router's usable interfaces and reachable neighbors) to others
inside area or backbone
From the topology database, each router constructs a tree of
the shortest paths with itself as the root (the route to each
destination in the AS)
OSPF chooses the least cost path as the best path
Table of shortest paths = routing table
Key fields of OSPF packet (24 bytes):
o Type (hello, database description, link-state request and
response, link-state acknowledgement)
o Router ID (source)
o Source area ID (0.0.0.0 for backbone)
o upper-level data
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Additional OSPF features
LSA are sent every 30 minutes
authentication (MD5 algorithm)
equal-cost, multipath routing (round-robin algorithm)
load balancing: distributing traffic equally among routes
routing based on upper-layer type-of-service (TOS) requests
(delay, low throughput, and high reliability bits in IP headers)
VLSMs support
Advantages of link state over distance vector:
Faster convergence than distance vector
Easier to discover network topology, troubleshoot network
Can do better source-routing with link-state Type & Qualityof-service routing (multiple route tables) possible
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES
Border Gateway Protocol
BGP is replacing EGP
routing between ASs
BGP provides a mechanism that allows non-core routers to learn
routes from core routers so that they can choose optimal backbone routes
distance vector protocol
keep-alive messages every 30 seconds
BGP uses TCP - reliable delivery
A
AS1RIP
BGP
AS2
B
BGP
AS3
BGP
RIP
RIP
Petrozavodsk State University, Alex Moschevikin, 2003
C
AS5
OSPF, RIP
BGP
AS4
IGRP
NET TECHNOLOGIES
BGP-4 features
Three types of routing:
1. interautonomous system routing
2. intra-autonomous system routing (between two or more
BGP routers located within the same autonomous system, ex.
in university building)
3. pass-through autonomous system routing (virtual channels)
BGP
B
IGP
AS
BGP
Petrozavodsk State University, Alex Moschevikin, 2003
C
NET TECHNOLOGIES
BGP-4 features (cont'd)
AS has the responsibility of advertising reachability info to other
ASs.
Received routing info is retained and not inserted into routing table
until incremental update.
Routers send only the portion of their routing table that has changed,
not the whole table every session.
The best route is chosen on path attributes, for example,
administrative preferences based on political, organizational, or security
considerations in the routing decisionas well as number of autonomous
systems through which the path passes, stability, speed, delay, or cost.
Petrozavodsk State University, Alex Moschevikin, 2003
NET TECHNOLOGIES