Lecture 6: Intra-Domain RoutingOverview• Internet structure, ASes• Forwarding vs. Routing• Distance vector and link state• Example distance vector: RIP• Example link state: OSPFThe Internet, 1990NSFNET backboneStanfordBARRNETregionalBerkeleyPARCNCARUAUNMWestnetregionalUNLKUISUMidNetregional…• Hierarchical structure w. single backboneAddress allocation, 1990Network number Host numberClass B addressSubnet mask (255.255.255.0)Subnetted address111111111111111111111111 00000000Network number Host IDSubnet ID• Hierarchical IP addresses- Class A (8-bit prefix), B (16-bit), C (24-bit)• Subnetting adds another level within organizations- Subnet masks define variable partition of host part- Subnets visible only within siteExampleSubnet mask: 255.255.255.128Subnet number: 128.96.34.0128.96.34.15128.96.34.1H1R1128.96.34.130Subnet mask: 255.255.255.128Subnet number: 128.96.34.128128.96.34.129128.96.34.139R2H2128.96.33.1128.96.33.14Subnet mask: 255.255.255.0Subnet number: 128.96.33.0H3The Internet, todayBackbone service providerPeeringpointPeeringpointLarge corporationLarge corporationSmallcorporation“Consumer” ISP“Consumer” ISP“Consumer” ISP• Multiple “backbones”Address allocation, today• Class system makes inefficient use of addresses- class C with 2 hosts (2/255 = 0.78% efficient)- class B with 256 hosts (256/65535 = 0.39% efficient)- Causes shortage of IP addresses (esp. class B)- Makes address authorities reluctant to give out class Bs• Still Too Many Networks- routing tables do not scale- route propagation protocols do not scaleSupernetting• Assign block of contiguous network numbers tonearby networks• Called CIDR: Classless Inter-Domain Routing• Represent blocks with a single pair(first network address, count)• Restrict block sizes to powers of 2- Represent length of network in bits w. slash- E.g.: 128.96.34.0/25 means netmask has 25 1 bits, followedby 7 0 bits, or 0xffffff80 = 255.255.255.128- E.g.: 128.96.33.0/24 means netmask 255.255.255.0• All routers must understand CIDR addressingIP Connectivity• For each destination address, must either:1. Have prefix mapped to next hop in forwarding table, or2. know “smarter router”—default for unknown prefixes• Route using longest prefix match, default is prefix0.0.0.0/0• Core routers know everything—no default• Manage using notion of Autonomous System (AS)• Two-level route propagation hierarchy- interior gateway protocol (each AS selects its own)- exterior gateway protocol (Internet-wide standard)Autonomous systems• Correspond to an administrative domain- Internet is not a single network- ASes reflect organization of the Internet- E.g., Stanford, large company, etc.• Goals:- ASes want to choose their own local routing algorithm- ASes want to set policies about non-local routing• Each AS assigned unique 16-bit numberTypes of traffic & AS• Local traffic – packets with src or dst in local AS• Transit traffic – passes through an AS• Stub AS- Connects to only a single other AS• Multihomed AS- Connects to multiple ASes- Carries no transit traffic• Transit AS- Connects to multiple ASes and carries transit trafficIntra-domain routing• Intra-domain routing: within an AS• Single administrative control: optimality isimportant- Contrast with inter-AS routing, where policy dominates- Next lecture will cover inter-domain routing (BGP)What is routing?• forwarding – moving packetsbetween ports- Look up destination address inforwarding table- Find out-port or hout-port, MACaddri pair• Routing is process of populat-ing forwarding table- Routers exchange messages aboutnets they can reach- Goal: Find optimal route for ev-ery destination- . . . or maybe good route, or justany route (depending on scale)Stability• Stable routes are often preferred over rapidlychanging ones• Reason 1: management- Hard to debug a problem if it’s transient• Reason 2: higher layer optimizations- E.g., TCP RTT estimation- Imagine alternating over 500ms and 50ms routes• Tension between optimality and stabilityRouting algorithm properties• Global vs. decentralized- Global: All routers have complete topology- Decentralized: Only know neighbors & what they tell you• Intra-domain vs. Inter-domain routing- Intra-: All routers under same administrative control- Intra-: Scale to ∼100 networks (e.g., campus like Stanford)- Inter-: Decentralized, scale to Internet• Today’s lecture covers basic algorithms forintra-domain routing and two protocols: RIP andOSPFOptimality43621911DAFEBC• View network as a graph• Assign cost to each edge- Can be based on latency, b/w, utilization, queue length, . . .• Problem: Find lowest cost path between two nodes- Each node individually computes the cost (some recentresearch argues against doing this, more on this later)Scaling issues• Every router must be able to forward based on anydestination IP address- Given address, it needs to know ”next hop” (table)- Na¨ıve: Have an entry for each address- There would be 108entries!• Solution: Entry covers range of addresses- Can’t do this if addresses are assigned randomly! (e.g.,Ethernet addresses)- This is why address aggregation is important- Addresses allocation should be based on network structure• What is structure of the Internet?Basic Algorithms• Two classes of intra-domain routing algorithms• Link state- Have a global view of the network- Simpler to debug- Require global state• Distance vector- Require only local state (less overhead, smaller footprint)- Harder to debug- Can suffer from loopsLink State• Strategy- Send to all nodes (not just neighbors)- Send only information about directly connected links (notentire routing table)• Link State Packet (LSP)- ID of the node that created the LSP- Cost of link to each directly connected neighbor- Sequence number (SEQNO)- Time-to-live (TTL) for this packetReliable flooding• Store most recent LSP from each node• Forward LSP to all nodes but one that sent it• Generate new LSP periodically- Increment SEQNO• Start SEQNO at 0 when reboot- If you hear your own packet w. SEQNO= n, set your nextSEQNO to n + 1• Decrement TTL of each stored LSP- discard when TTL= 0Calculating best path• Dijkstra’s shortest path algorithm• Let:- N denote set of nodes in the graph- l(i, j) denotes non-negative cost (weight) for edge (i, j)- s denotes yourself (node computing paths)• Initialize variables- M ← {s} (set of nodes
View Full Document