COMSCSEE 4140 Networking Laboratory Lecture 05 Salman Abdul
COMS/CSEE 4140 Networking Laboratory Lecture 05 Salman Abdul Baset Spring 2008
Announcements Lab 4 (1 -4) due next week before your lab slot p Assignment 2 due next Monday p Class participation p n n p Help me update the router/linux commands Glossary Lab participation n TAs / myself will ask random questions Midterm (March 10 th, duration ~1. 5 hours) p Projects p 2
Previous Lecture CIDR multi-homing and IP forwarding p The Internet p n n n p Routing protocols n n p IETF, IRTF, IESG, IRB IANA, ICANN IETF (eight areas, 119 WGs) Distance vector vs. link state Intra-domain vs. inter-domain (IGP vs. EGP) Routing Information Protocol (RIP) 3
Previous Lecture: The Count-to. Infinity Problem A 1 B 1 C 4
Agenda Routing Information Protocol (RIPv 2) p Link state protocols p Open Shortest Path First (OSPF) p Autonomous Systems (AS) p 5
The Gang of Four Link State IGP EGP OSPF IS-IS Vectoring RIP BGP 6
RIP - History p p p p Late 1960 s : Distance Vector protocols were used in the ARPANET Mid-1970 s: XNS (Xerox Network system) routing protocol is the precursor of RIP in IP (and Novell’s IPX RIP and Apple’s routing protocol) 1982 Release of routed for BSD Unix 1988 RIPv 1 (RFC 1058) - classful routing 1993 RIPv 2 (RFC 1388) - adds subnet masks with each route entry - allows classless routing 1997 RIPng (IPv 6) 1998 Current version of RIPv 2 (RFC 2453) and Internet standard (STD 56) (IPv 4) 7
Routing Information Protocol p RIPv 2 n p Subnet masks, next hop addresses, authentication (plain text), multicast (instead of broad cast) Count-to-infinity solution n Split-horizon A 1 B 1 C A never advertises to B that its path to C goes through B n Hold-down timer A 1 B 1 C B ignores any updates for the link B-C for a hold-down time n Triggered updates A 1 B immediately advertises that its link is down. C 8
Routing Information Protocol p Looping solution (for RIP messages) n p Link costs n p n n UDP port 520 (msgs sent and rcvd on this port) Complete or partial routing table? n n p per table: update (30 s + /- 0 to 5) send complete routing table in unsolicited response to every neighbor router. per entry: each entry has a timeout timer (180 s) per entry: route-flush timer (120 s) Dedicated port n p Always one or 16 (link-down) RIP timers n p Maximum number of hops is 16. Complete (may spread over multiple fragments) No reliable delivery Multicast n 224. 0. 0. 9 9
RIPv 1 Packet Format 1: RIPv 1 1: request 2: response 2: for IP 0… 0: request full routing table Address of destination Cost (measured in hops) One RIP message can have up to 25 route entries 20 x 25=500 bytes + 8 (RIP hdr) + 8 (UDP) + 20 (IP)=536 bytes 10
RIPv 2 p RIPv 2 is an extends RIPv 1: n n p Subnet masks are carried in the route information Authentication of routing messages Route information carries next-hop address Exploits IP multicasting Extensions of RIPv 2 are carried in unused fields of RIPv 1 messages 11
RIPv 2 Packet Format 2: RIPv 2 1: request 2: response 2: for IP 0… 0: request full routing table Address of destination Cost (measured in hops) One RIP message can have up to 25 route entries 12
RIPv 2 Packet Format 2: RIPv 2 Used to carry information from other routing protocols (e. g. , autonomous system number) Subnet mask for IP address Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0…. 0) Any problems? 13
RIP Messages p Dedicated port for RIP is UDP port 520. p Two types of messages: n Request messages p n used to ask neighboring nodes for an update Response messages p contains an update 14
Routing with RIP p Initialization: Send a request packet (command = 1, address family=0. . 0) on all interfaces: n n p p RIPv 1 uses broadcast if possible, RIPv 2 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 +/- 5 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. 15
Agenda Routing Information Protocol (RIPv 2) p Link state protocols p Open Shortest Path First (OSPF) p Autonomous Systems p 16
Link State Routing p Based on Dijkstra’ s Shortest-Path-First algorithm. p Each router starts by knowing: n n p Each router advertises to the entire network (flooding): n n p Prefixes of its attached networks. Links to its neighbors. Key idea: synchronize state with directly connected routers Key idea: ACK the flooded messages Prefixes of its directly connected networks Active links to its neighbors. Each router learns: n A complete topology of the network (routers, links). p Each router computes shortest path to each destination. p In a stable situation, all routers have the same graph, and compute the 17 same paths.
Dijkstra’s 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 = min{Dj ; 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 18
Link state routing: graphical illustration Global view: b 3 a a’s view: 3 a d b 6 b d’s view: c c 1 a c’s view: 2 c 6 a b’s view: 3 1 2 d c b 1 c 2 d 6 19 Collecting all views yield a global & complete view of the network!
Operation of a Link State Routing Protocol Received LSAs Link State Database Dijkstra’s Algorithm IP Routing Table LSAs are flooded to other interfaces LSA: link-state advertisement 20
Link State Routing: Properties p Each node requires complete topology information p Link state information must be flooded to all nodes p Guaranteed to converge 21
Distance Vector vs. Link State Routing p With distance vector routing, each node has information only about the next hop: n n p p 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 makes poor routing decisions if directions are not completely correct (e. g. , because a node is down). A B C D E F If parts of the directions incorrect, the routing may be incorrect until the routing algorithms has re-converged. 22
Distance Vector vs. Link State Routing p In link state routing, each node has a complete map of the topology A p p If a node fails, each node can calculate the new route B C D E A F A Difficulty: All nodes need to have a consistent view of the network A B C D E A F B C D E F F A F B C D E 23 F
Distance Vector vs. Link State Routing Link State • • • Topology information is flooded within the routing domain Best end-to-end paths are computed locally at each router. Best end-to-end paths determine next-hops. Based on minimizing some notion of distance Works only if policy is shared and uniform Examples: OSPF, IS-IS Vectoring • • • Each router knows little about network topology Only best next-hops are chosen by each router for each destination network. Best end-to-end paths result from composition of all next-hop choices Does not require any notion of distance Does not require uniform policies at all routers Examples: RIP, BGP 24
Agenda Routing Information Protocol (RIPv 2) p Link state protocols p Open Shortest Path First (OSPF) p Autonomous Systems p 25
OSPF p p p OSPF = Open Shortest Path First (Why Open? ) 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 n n p RIP (RFC 2453 ~ 40 pages) OSPF (RFC 2328 ~ 250 pages) History: n n n 1989: RFC 1131 OSPF Version 1 1991: RFC 1247 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) 26
Features of OSPF p Provides authentication of routing messages p Enables load balancing by allowing traffic to be split evenly across routes with equal cost (problem: reordering) p Type-of-Service routing allows to setup different routes dependent on the TOS field p Supports subnetting p Supports multicasting p Allows hierarchical routing 27
Hierarchical OSPF 28
Hierarchical OSPF p Two-level hierarchy: local area, backbone. n Link-state advertisements only in area n each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. p Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. p Backbone routers: run OSPF routing limited to backbone. 29
Example Network 2. 0 /2 4. 3 . 4 1 . 5 5 . 5. 5 10. 1. 5. 0/24 10. 1. 2. 3 . 6 4 3 . 6 10. 1. 7. 0 / 24 10. 1. 4. 0 / 24 . 3 1 . 4 /2 . 1. 2 . 4 8. 0 10 3 . 2 2 . 1. . 2 10. 1. 1. 0 / 24 . 1 Router IDs can be selected independent of interface addresses, but usually chosen to be the smallest interface address . 2 10. 1. 3. 0 / 24 4 . 1 10. 1. 7. 6 10. 1. 4. 4 10 10. 1. 1. 2 10. 1. 6. 0 / 24 10. 1. 1. 1 10. 1. 5. 5 • Link costs are called Metric • Metric is in the range [0 , 216] • Metric can be asymmetric 30
Link State Advertisement (LSA). 4 2. 0 4 /2 . 5 . 6 4 . 3. 3 . 6 10. 1. 7. 0 / 24 10. 1. 4. 0 / 24 . 3 . 5. 5 10. 1. 5. 0/24 10. 1. 2. 3 p . 4 /2 2 . 1. 10 3 . 2 . 4 10. 1. 6. 0 / 24 10. 1. 1. 0 / 24 . 1 . 2 8. 0 . 2 10. 1. 3. 0 / 24 4 . 1 10. 1. 7. 6 10. 1. 4. 4 . 1. 10. 1. 1. 2 10 10. 1. 1. 1 10. 1. 5. 5 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: Description of Link 2: Description of Link 3: Link ID = 10. 1. 1. 2, Metric = 4 Link ID = 10. 1. 2. 2, Metric = 3 Link ID = 10. 1. 1. 1, Metric = 0 31
Network and Link State Database . 1. 10. 1. 7. 0 / 24. 4 2. 0 4 /2 . 3 . 5. 3 . 6 4 10. 1. 4. 0 / 24 . 4 /2 10 Each router has a database which contains the LSAs from all other routers . 2 . 4 8. 0 10. 1. 1. 0 / 24 . 2 10. 1. 6. 0 / 24 . 1 . 2 10. 1. 3. 0 / 24 . 1 10. 1. 7. 6 10. 1. 4. 4 . 1. 10. 1. 1. 2 10 10. 1. 1. 1 . 5. 5 10. 1. 5. 0/24 10. 1. 5. 5 10. 1. 2. 3 LS Type Link State. ID Adv. Router Checksum LS Seq. No LS Age Router-LSA 10. 1. 1. 1 0 x 9 b 47 0 x 80000006 0 Router-LSA 10. 1. 1. 2 0 x 219 e 0 x 80000007 1618 Router-LSA 10. 1. 2. 3 0 x 6 b 53 0 x 80000003 1712 Router-LSA 10. 1. 4. 4 0 xe 39 a 0 x 8000003 a 20 Router-LSA 10. 1. 5. 5 0 xd 2 a 6 0 x 80000038 18 Router-LSA 10. 1. 7. 6 0 x 05 c 3 0 x 80000005 1680 32
Link State Database p The collection of all LSAs is called the link-state database p Each router has an identical link-state database n Useful for debugging: Each router has a complete description of the network p If neighboring routers discover each other for the first time, they will exchange their link-state databases p The link-state databases are synchronized using reliable flooding (flooded packets are acknowledged using ‘Link State Acknowledgement’ packet) 33
OSPF 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: neighbor’s IP address or 224. 0. 0. 5 (ALLSPFRouters) or 224. 0. 0. 6 (All. DRouters) 34
OSPF Packet Format 2: current version is OSPF V 2 Message types: 1: Hello (tests reachability) 2: Database description 3: Link state request 4: Link state update 5: Link state acknowledgement Standard IP checksum taken over entire packet Authentication passwd = 1: Authentication passwd = 2: 64 cleartext password 0 x 0000 (16 bits) Key. ID (8 bits) Length of MD 5 checksum (8 bits) Nondecreasing sequence number (32 bits) ID of the Area from which the packet originated 0: no authentication 1: Cleartext password 2: MD 5 checksum (added to end packet) Prevents replay 35 attacks
OSPF LSA Format LSA Header Link 1 Link 2 36
Discovery of Neighbors p p Routers multicasts OSPF Hello packets on all OSPF-enabled interfaces. If two routers share a link, they can become neighbors, and establish an adjacency Scenario: Router 10. 1. 10. 2 restarts p After becoming a neighbor, routers exchange their link state databases 37
Neighbor discovery and database synchronization Scenario: Router 10. 1. 10. 2 restarts Discovery of adjacency After neighbors are discovered the nodes exchange their databases Sends database description. (description only contains LSA headers) Acknowledges receipt of description Sends empty database description Database description of 10. 1. 10. 2 38
Regular LSA exchanges 10. 1 Link State Request packets, LSAs = Router-LSA, 10. 1, Router-LSA, 10. 1. 10. 2, Router-LSA, 10. 1. 10. 3, Router-LSA, 10. 1. 10. 4, Router-LSA, 10. 1. 10. 5, Router-LSA, 10. 1. 10. 6, 10. 1 sends requested LSAs 10. 1. 10. 2 explicitly requests each LSA from 10. 1 Link State Update Packet, LSAs = Router-LSA, 10. 1, 0 x 80000006 Router-LSA, 10. 1. 10. 2, 0 x 80000007 Router-LSA, 10. 1. 10. 3, 0 x 80000003 Router-LSA, 10. 1. 10. 4, 0 x 8000003 a Router-LSA, 10. 1. 10. 5, 0 x 80000038 Router-LSA, 10. 1. 10. 6, 0 x 80000005 39
Dissemination of LSA-Update p p p 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: n n p 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? 40
Agenda Routing Information Protocol (RIPv 2) p Link state protocols p Open Shortest Path First (OSPF) p Autonomous Systems p 41
Autonomous Systems p An autonomous system (AS) is a region of the Internet that is administered by a single entity and that has a unified routing policy p Each autonomous system is assigned an Autonomous System Number (ASN). p p p Columbia campus network (AS 14) Rogers Cable Inc. (AS 812) Sprint (AS 1239, AS 1240, AS 6211, …) Interdomain routing is concerned with determining paths between autonomous systems (interdomain routing) Routing protocols for interdomain routing are called exterior gateway protocols (EGP) 42
Autonomous Systems (AS) 43
Interdomain and Intradomain Routing protocols for intradomain routing are called interior gateway protocols (IGP) n p Objective: shortest path Routing protocols for interdomain routing are called exterior gateway protocols (EGP) 44 n Objective: satisfy policy of the AS
Interdomain vs. Intradomain p Intradomain routing n n p Routing is done based on metrics Routing domain is one autonomous system Interdomain routing n n Routing is done based on policies Routing domain is the entire Internet 45
Interdomain Routing p p Interdomain routing is based on connectivity between autonomous systems Interdomain routing can ignore many details of router interconnection 46
AS Graphs AT&T North America From: T. Griffin, BGP Tutorial, ICNP 2002 47
Multiple Routing Protocols p p Multiple routing protocols can run on the same router Each routing protocol updates the routing table 48
Autonomous Systems Terminology local traffic = traffic with source or destination in AS p transit traffic = traffic that passes through the AS p Stub AS = has connection to only one AS, only carry local traffic p Multihomed AS = has connection to >1 AS, but does not carry transit traffic p Transit AS = has connection to >1 AS and carries transit traffic p 49
Stub and Transit Networks p p p AS 1, AS 2, and AS 5 are stub networks AS 2 is a multihomed stub network AS 3 and AS 4 are transit networks 50
Selective Transit Example: p Transit AS 3 carries traffic between AS 1 and AS 4 and between AS 2 and AS 4 p But AS 3 does not carry traffic between AS 1 and AS 2 p The example shows a routing policy. 51
Customer/Provider p p p A stub network typically obtains access to the Internet through a transit network. Transit network that is a provider may be a customer for another network Customer pays provider for service 52
Customer/Provider and Peers p p Transit networks can have a peer relationship Peers provide transit between their respective customers Peers do not provide transit between peers Peers normally do not pay each other for service 53
Shortcuts through peering p p p Note that peering reduces upstream traffic Delays can be reduced through peering But: Peering may not generate revenue 54
This week’s lab /etc/quagga/ripd. conf p eth 1 does not work on some machines (PC 1 and PC 2 of rack 3) p Set eth 1 to a completely different IP address e. g. , 202. 11. 12. 15 and use eth 2 p Enable debugging – and observe /etc/quagga/ripd. log p Count-to-infinity p n disable split-horizon, triggered updates and set holddown timer to zero. 55
- Slides: 55