Title: W4140 Network Laboratory Lecture 6 Oct 16 - Fall 2006 Shlomo Hershkop Columbia University
1W4140 Network LaboratoryLecture 6Oct 16 - Fall
2006Shlomo HershkopColumbia University
2Announcements
- midterm evaluations will be going up soon
- please fill them out, you will be getting credit
for class participation for this - Project proposals are due this week
- groups of 2 or 3 students
- need to designate project lead
- PL meet with me this week Wednesday
- who will be part of the group
- what you will be doing for each phase
- who will do what
- what background references are you using (if
appropriate) - due in three weeks
- will provide any software/hardware required for
this - have fun, if you will be working with PHD, can
get a paper publication out of this most probably
3Dynamic routing protocols II
- Dynamic Routing Protocols Link State Routing
- Intra-Domain Routing Protocols OSPF BGP
4Dynamic Routing Protocols Link State Routing
5The Gang of Four
6Link State Routing
- Based on Dijkstra s Shortest-Path-First
algorithm. - Each router starts by knowing
- Prefixes of its attached networks.
- Links to its neighbors.
- Each router advertises to the entire network
(flooding) - Prefixes of its directly connected networks.
- Active links to its neighbors.
- Each router learns
- A complete topology of the network (routers,
links). - Each router computes shortest path to each
destination. - In a stable situation, all routers have the same
graph, and compute the same paths.
7Dijkstras Shortest Path Algorithm for a Graph
Input Graph (N,E) with N the set of nodes
and E the set of edges cvw link cost (cvw 1
if (v,w) ? E, cvv 0) s source node. Output
Dn cost of the least-cost path from node s to
node n M s for each n ? M Dn
csn while (M ? all nodes) do Find w ? M
for which Dw minDj j ? M Add w to
M for each neighbor n of w and n ? M Dn
min Dn, Dw cwn Update route end for
end while end for
8Link state routing graphical illustration
Global view
b
3
1
2
a
c
d
6
Collecting all views yield a global complete
view of the network!
9Operation of a Link State Routing protocol
IP Routing Table
Dijkstras Algorithm
Link StateDatabase
ReceivedLSAs
LSAs are flooded to other interfaces
10Link State Routing Properties
- Each node requires complete topology information
- Link state information must be flooded to all
nodes - Guaranteed to converge
11Distance Vector vs. Link State Routing
- With distance vector routing, each node has
information only about the next hop - Node A to reach F go to B
- Node B to reach F go to D
- Node D to reach F go to E
- Node E go directly to F
- Distance vector routing makespoor routing
decisions if directions are not
completelycorrect (e.g., because a node is
down). -
- If parts of the directions incorrect, the routing
may be incorrect until the routing algorithms has
re-converged.
A
B
C
F
D
E
12Distance Vector vs. Link State Routing
- In link state routing, each node has a complete
map of the topology - If a node fails, each node can calculate the
new route - Difficulty All nodes need to have a consistent
view of the network
A
B
C
F
D
E
13Distance Vector vs. Link State Routing
Link State
Vectoring
14Dynamic Routing ProtocolsOpen Shortest Path
First
15OSPF
- OSPF Open Shortest Path First
- The OSPF routing protocol is the most important
link state routing protocol on the Internet
(another link state routing protocol is IS-IS
(intermediate system to intermediate system) - The complexity of OSPF is significant
- RIP (RFC 2453 40 pages)
- OSPF (RFC 2328 250 pages)
- History
- 1989 RFC 1131 OSPF Version 1
- 1991 RFC1247 OSPF Version 2
- 1994 RFC 1583 OSPF Version 2 (revised)
- 1997 RFC 2178 OSPF Version 2 (revised)
- 1998 RFC 2328 OSPF Version 2 (current version)
16Features of OSPF
- Provides authentication of routing messages
- Enables load balancing by allowing traffic to be
split evenly across routes with equal cost - Type-of-Service routing allows to setup different
routes dependent on the TOS field - Supports subnetting
- Supports multicasting
- Allows hierarchical routing
17Hierarchical OSPF
18Hierarchical OSPF
- Two-level hierarchy local area, backbone.
- Link-state advertisements only in area
- each nodes has detailed area topology only know
direction (shortest path) to nets in other
areas. - Area border routers summarize distances to
nets in own area, advertise to other Area Border
routers. - Backbone routers run OSPF routing limited to
backbone.
19Example Network
10.1.7.6
10.1.1.1
10.1.1.2
10.1.4.4
.1
.2
.2
.4
.4
.6
10.1.7.0 / 24
10.1.4.0 / 24
10.1.1.0 / 24
.1
.2
.4
.6
Router IDs can be selected independent of
interface addresses, but usually chosen to be the
smallest interface address
10.1.6.0 / 24
10.1.3.0 / 24
10.1.8.0 / 24
10.1.2.0 / 24
.3
.5
.3
.5
.5
.3
10.1.5.0/24
10.1.2.3
10.1.5.5
- Link costs are called Metric
- Metric is in the range 0 , 216
- Metric can be asymmetric
20Link State Advertisement (LSA)
4
3
2
- The LSA of router 10.1.1.1 is as follows
- Link State ID 10.1.1.1 Router ID
- Advertising Router 10.1.1.1 Router ID
- Number of links 3 2 links plus router
itself - Description of Link 1 Link ID 10.1.1.2,
Metric 4 - Description of Link 2 Link ID 10.1.2.2,
Metric 3 - Description of Link 3 Link ID 10.1.1.1,
Metric 0
21Network and Link State Database
Each router has a database which contains the
LSAs from all other routers
LS Type
Link
StateID
Adv. Router
Checksum
LS
SeqNo
LS Age
Router-LSA
10.1.1.1
10.1.1.1
0x9b47
0x80000006
0
Router-LSA
10.1.1.2
10.1.1.2
0x219e
0x80000007
1618
Router-LSA
10.1.2.3
10.1.2.3
0x6b53
0x80000003
1712
Router-LSA
10.1.4.4
10.1.4.4
0xe39a
0x8000003a
20
Router-LSA
10.1.5.5
10.1.5.5
0xd2a6
0x80000038
18
Router-LSA
10.1.7.6
10.1.7.6
0x05c3
0x80000005
1680
22Link State Database
- The collection of all LSAs is called the
link-state database - Each router has an identical link-state database
- Useful for debugging Each router has a complete
description of the network - If neighboring routers discover each other for
the first time, they will exchange their
link-state databases - The link-state databases are synchronized using
reliable flooding
23OSPF Packet Format
OSPF packets are not carried as UDP payload! OSPF
has its own IP protocol number 89
TTL set to 1 (in most cases)
Destination IP neighbors IP address or
224.0.0.5 (ALLSPFRouters) or 224.0.0.6
(AllDRouters)
24OSPF Packet Format
2 current version is OSPF V2
ID of the Area from which the packet originated
Message types 1 Hello (tests reachability) 2
Database description 3 Link Status request 4
Link state update 5 Link state acknowledgement
0 no authentication 1 Cleartext password 2 MD5
checksum (added to end packet)
Standard IP checksum taken over entire packet
Authentication passwd 1 64 cleartext
password Authentication passwd 2 0x0000
(16 bits) KeyID (8 bits)
Length of MD5 checksum (8 bits)
Nondecreasing sequence number (32 bits)
Prevents replay attacks
25OSPF LSA Format
LSA Header
Link 1
Link 2
26Discovery of Neighbors
- Routers multicasts OSPF Hello packets on all
OSPF-enabled interfaces. - If two routers share a link, they can become
neighbors, and establish an adjacency - After becoming a neighbor, routers exchange their
link state databases
ScenarioRouter 10.1.10.2 restarts
27Neighbor discovery and database synchronization
ScenarioRouter 10.1.10.2 restarts
After neighbors are discovered the nodes exchange
their databases
Sends database description. (description only
contains LSA headers)
Sends empty database description
Acknowledges receipt of description
Database description of 10.1.10.2
28Regular LSA exchanges
10.1.10.2 explicitly requests each LSA from
10.1.10.1
10.1.10.1 sends requested LSAs
29Dissemination of LSA-Update
- A router sends and refloods LSA-Updates, whenever
the topology or link cost changes. (If a received
LSA does not contain new information, the router
will not flood the packet) - Exception Infrequently (every 30 minutes), a
router will flood LSAs even if there are not new
changes. - Acknowledgements of LSA-updates
- explicit ACK, or
- implicit via reception of an LSA-Update
- Question If a new node comes up, it could build
the database from regular LSA-Updates (rather
than exchange of database description). What role
do the database description packets play?
30Dynamic Routing Protocols (Inter-domain) Border
Gateway Protocol
31BGP Quick View
- BGP Border Gateway Protocol . Currently in
version 4, specified in RFC 1771. ( 60 pages) - Note In the context of BGP, a gateway is nothing
else but an IP router that connects autonomous
systems. - Interdomain routing protocol for routing between
autonomous systems - Uses TCP to establish a BGP session and to send
routing messages over the BGP session - BGP is a path vector protocol. Routing messages
in BGP contain complete routes. - Network administrators can specify routing
policies
32BGP Policy-based Routing
- Each node is assigned an AS number (ASN)
- BGPs goal is to find any AS-path (not an optimal
one). Since the internals of the AS are never
revealed, finding an optimal path is not
feasible. - Network administrator sets BGPs policies to
determine the best path to reach a destination
network.
33How Many ASNs are there today?
20,570
Thanks to Geoff Huston. http//bgp.potaroo.net on
October 9, 2005
34today's data
35Autonomous Routing Domains Dont Always Need BGP
or an ASN
ARDs versus ASes
Qwest
Nail up routes 130.132.0.0/16 pointing to Yale
Nail up default routes 0.0.0.0/0 pointing to Qwest
Yale University
130.132.0.0/16
Static routing is the most common way of
connecting an autonomous routing domain to the
Internet. This helps explain why BGP is a
mystery to many
36ASNs Can Be Shared (RFC 2270)
AS 701 UUNet
AS 7046 Crestar Bank
AS 7046 NJIT
AS 7046 Hood College
128.235.0.0/16
ASN 7046 is assigned to UUNet. It is used
by Customers single homed to UUNet, but needing
BGP for some reason (load balancing, etc..) RFC
2270
37ARDs and ASes Summary
- Most ARDs have no ASN (statically routed at
Internet edge) - Some unrelated ARDs share the same ASN (RFC
2270) - Some ARDs are implemented with multiple ASNs
(example Worldcom)
ASes are just an implementation detail of
Inter-domain routing
38How many prefixes today?
IPv4 Address space covered
Thanks to Geoff Huston. http//bgp.potaroo.net on
October 9, 2005
39Policy-Based vs. Distance-Based Routing?
Host 1
Cust1
Minimizing hop count can violate commercial
relationships that constrain inter- domain
routing.
ISP1
ISP3
Host 2
ISP2
Cust3
Cust2
Thanks to Tim Griffin http//www.cl.cam.ac.uk/user
s/tgg22
40Customer versus Provider
provider
customer
Customer pays provider for access to the Internet
41Why not minimize AS hop Count?
Shortest path routing is not compatible with
commercial relations
42The Peering Relationship
43Peering Provides Shortcuts
44Peering Wars
Peer
Dont Peer
- You would rather have customers
- Peers are usually your competition
- Peering relationships may require periodic
renegotiation
- Reduces upstream transit costs
- Can increase end-to-end performance
- May be the only way to connect your customers to
some part of the Internet (Tier 1)
Peering struggles are by far the most
contentious issues in the ISP world! Peering
agreements are often confidential.
45The Border Gateway Protocol (BGP)
BGP
RFC 1771
optional extensions RFC 1997 (communities) RFC
2439 (damping) RFC 2796 (reflection) RFC3065
(confederation)
routing policy configuration languages
(vendor-specific)
Current Best Practices in management of
Interdomain Routing
BGP was not DESIGNED. It EVOLVED.
46BGP Route Processing
Open ended programming. Constrain
ed only by vendor configuration language
Apply Policy filter routes tweak attributes
Apply Policy filter routes tweak attributes
Receive BGP Updates
Best Routes
Transmit BGP Updates
Based on Attribute Values
Best Route Selection
Apply Import Policies
Best Route Table
Apply Export Policies
Install forwarding Entries for best Routes.
IP Forwarding Table
47BGP Attributes
Value Code
Reference ----- -----------------------------
---- --------- 1 ORIGIN
RFC1771 2 AS_PATH
RFC1771 3 NEXT_HOP
RFC1771 4
MULTI_EXIT_DISC RFC1771 5
LOCAL_PREF RFC1771
6 ATOMIC_AGGREGATE
RFC1771 7 AGGREGATOR
RFC1771 8 COMMUNITY
RFC1997 9 ORIGINATOR_ID
RFC2796 10 CLUSTER_LIST
RFC2796 11 DPA
Chen 12
ADVERTISER RFC1863 13
RCID_PATH / CLUSTER_ID RFC1863
14 MP_REACH_NLRI
RFC2283 15 MP_UNREACH_NLRI
RFC2283 16 EXTENDED
COMMUNITIES Rosen ... 255
reserved for development
Most important attributes
Not all attributes need to be present in every
announcement
From IANA http//www.iana.org/assignments/bgp-par
ameters
48ASPATH Attribute
49Next up
- if you missed the intro on projects, please take
a look online - need to form groups of 2 or 3 students
- need to have an idea of what you are doing and
get approval by wed/Thursday - due in 3 weeks Nov 17
- make sure to let me know if you need more time
am flexible for short extensions ONLY if you
start early