2Layer reminder Bridges - emulate single link Everything broadcastSame collision domainSwitches - emulate single networkFlat addressingBroadcast supportedInternet - connect multiple networksHierarchical addressingNo broadcastHighly scalable
3IP service model Service provided to transport layer (TCP, UDP) Global name spaceHost-to-host connectivity (connectionless)Best-effort packet deliveryNot in IP service modelDelivery guarantees on bandwidth, delay or lossDelivery failure modesPacket delayed for a very long timePacket lossPacket delivered more than oncePackets delivered out of orderPacket may be delievered N times, for N in range of 0 to infinityWhy is this good?Lest you think routers are out to get you, this happens mostly due to accidents, rather than intentional malice
4IP addressing Ethernet address space IP address space Flat Assigned at manufacture timeIP address spaceHierarchicalAssigned at configuration time“has no structure” - “not related to network topology”“assigned at birth”
5IP Addressing: introduction IP address: 32-bit identifier for host, router interfaceinterface: connection between host/router and physical linkrouters typically have multiple interfaceshost typically has one interfaceIP addresses associated with each interface=223111
6IP networks Address has 2 components Network (high-order bits) Address has 2 componentsNetwork (high-order bits)Host (low-order bits)
7IPv4 Address Model Class Network ID Host ID # of Addresses # of NetworksA0 + 7 bit24 bit224-2126Bbit16 bit65,214Cbit8 bit221DMulticast AddressIP MulticastEFuture UseNetwork (7 bits)Network (14 bits)1Network (21 bits)Host (24 bits)Host (16 bits)Host (8 bits)Class A:Class B:Class C:
8IP networks Class A network: 18.104.22.168 (MIT) has addressClass B network: (UIUC)has addressClass C network: (Parkland)has address
9CIDR 3-class model too inflexible CIDR: Classless InterDomain Routing Arbitrary number of bits to specify networkAddress format: a.b.c.d/x, where x is # bits in network portionsubnetparthostpart/23
11IP forwarding Forwarding table has: Network numberInterfaceAvoid having to store 4 billion entriesBut there are still 2 million class C’s…and perhaps more CIDR networks
12Hierarchical Routing Our routing study thus far - idealization all routers identicalnetwork “flat”… not true in practicescale: with 200 million destinations:can’t store all dest’s in routing tables!routing table exchange would swamp links!administrative autonomyinternet = network of networkseach network admin may want to control routing in its own network
13Hierarchical Networks Organization 0/23Organization 1“Send me anythingwith addressesbeginning/20”/23Organization 2/23.Fly-By-Night-ISP.InternetOrganization 7/23ISPs-R-Us“Send me anythingwith addressesbeginning/16”
15Forwarding Tables Most specific rule is used Internet/21 if1/21 if2/16 if3/0 if4Most specific rule is usedMost hosts outside of the core have default rulesCRHCif1if4if2EWSif3UIUCForwarding tables are small, except at network coreStop here, go back to routing.
16Hierarchical Routing Gateway router aggregate routers into regions, “autonomous systems” (AS)routers in same AS run same routing protocol“intra-AS” routing protocolrouters in different AS can run different intra-AS routing protocolGateway routerDirect link to router in another AS
17Interconnected ASes 3c 3a 2c 3b 2a AS3 2b 1c 1a 1b AS1 1d Intra-ASRoutingalgorithmInter-ASForwardingtable3cForwarding table is configured by both intra- and inter-AS routing algorithmIntra-AS sets entries for internal destsInter-AS & Intra-As sets entries for external dests
18Inter-AS tasks AS1 needs: Suppose router in AS1 receives datagram for which dest is outside of AS1Router should forward packet towards on of the gateway routers, but which one?AS1 needs:to learn which dests are reachable through AS2 and which through AS3to propagate this reachability info to all routers in AS1Job of inter-AS routing!3b1d3a1c2aAS3AS1AS21a2c2b1b3c
19Example: Setting forwarding table in router 1d Suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 (gateway 1c) but not from AS2.Inter-AS protocol propagates reachability info to all internal routers.Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c.Puts in forwarding table entry (x,I).
20Example: Choosing among multiple ASes Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2.To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x.This is also the job on inter-AS routing protocol!Hot potato routing: send packet towards closest of two routers.Learn from inter-ASprotocol that subnetx is reachable viamultiple gatewaysUse routing infofrom intra-ASprotocol to determinecosts of least-costpaths to eachof the gatewaysHot potato routing:Choose the gatewaythat has thesmallest least costDetermine fromforwarding table theinterface I that leadsto least-cost gateway.Enter (x,I) inforwarding table
21Intra-AS Routing Also known as Interior Gateway Protocols (IGP) Most common Intra-AS routing protocols:RIP: Routing Information ProtocolOSPF: Open Shortest Path FirstIGRP: Interior Gateway Routing Protocol
22Internet inter-AS routing: BGP BGP (Border Gateway Protocol): the de facto standardBGP provides each AS a means to:Obtain subnet reachability information from neighboring ASs.Propagate the reachability information to all routers internal to the AS.Determine “good” routes to subnets based on reachability information and policy.Allows a subnet to advertise its existence to rest of the Internet: “I am here”
23BGP basicsPairs of routers (BGP peers) exchange routing info over semi-permanent TCP conctns: BGP sessionsNote that BGP sessions do not correspond to physical links.When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix.AS2 can aggregate prefixes in its advertisement3b1d3a1c2aAS3AS1AS21a2c2b1b3ceBGP sessioniBGP session
24Distributing reachability info With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1.1c can then use iBGP do distribute this new prefix reach info to all routers in AS11b can then re-advertise the new reach info to AS2 over the 1b-to-2a eBGP sessionWhen router learns about a new prefix, it creates an entry for the prefix in its forwarding table.3b1d3a1c2aAS3AS1AS21a2c2b1b3ceBGP sessioniBGP session
25Path attributes & BGP routes When advertising a prefix, advert includes BGP attributes.prefix + attributes = “route”Two important attributes:AS-PATH: contains the ASs through which the advert for the prefix passed: AS 67 AS 17NEXT-HOP: Indicates the specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop-AS.)When gateway router receives route advert, uses import policy to accept/decline.
26BGP route selectionRouter may learn about more than 1 route to some prefix. Router must select route.Elimination rules:Local preference value attribute: policy decisionShortest AS-PATHClosest NEXT-HOP router: hot potato routingAdditional criteria
27BGP messages BGP messages exchanged using TCP. BGP messages: OPEN: opens TCP connection to peer and authenticates senderUPDATE: advertises new path (or withdraws old)KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN requestNOTIFICATION: reports errors in previous msg; also used to close connection
28BGP routing policy A,B,C are provider networks X,W,Y are customer (of provider networks)X is dual-homed: attached to two networksX does not want to route from B via X to C.. so X will not advertise to B a route to C
29BGP routing policy (2) A advertises to B the path AW B advertises to X the path BAWShould B advertise to C the path BAW?No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customersB wants to force C to route to w via AB wants to route only to/from its customers!
30Why different Intra- and Inter-AS routing ? Policy:Inter-AS: admin wants control over how its traffic routed, who routes through its net.Intra-AS: single admin, so no policy decisions neededScale:hierarchical routing saves table size, reduced update trafficPerformance:Intra-AS: can focus on performanceInter-AS: policy may dominate over performance
31Intra-AS Routing Also known as Interior Gateway Protocols (IGP) Most common Intra-AS routing protocols:RIP: Routing Information ProtocolOSPF: Open Shortest Path FirstIGRP: Interior Gateway Routing Protocol (Cisco proprietary)UIUC used to use RIP until 2002
32RIP ( Routing Information Protocol) Distance vector algorithmIncluded in BSD-UNIX Distribution in 1982Distance metric: # of hops (max = 15 hops)From router A to subsets:DCBAuvwxyzdestination hopsuvwxyz
33RIP advertisementsDistance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement)Each advertisement: list of up to 25 destination nets within ASwhy 25?
34RIP: Example z w x y A D B C X X 5 Dest NW Next Router Hops 2 Dest w A Routing table in DCDest NWNextRouterHops 2DestwA2yBz7x--1...Dest Next hopswxz C 4…. …Distance Vector from A to DXAX5
35RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared deadroutes via neighbor invalidatednew advertisements sent to neighborsneighbors in turn send out new advertisements (if tables changed)link failure info quickly (?) propagates to entire netpoison reverse used to prevent ping-pong loopsinfinite distance = 16 hopsWhy did I put a question mark by “quickly”?Why is it 180 seconds - 3 minutes - when a messages is supposed to be sent every 30s?With 10% link loss, the chance of a link declared dead due to lost messages is 1 in a million
36RIP Table processingRIP routing tables managed by application-level process called route-d (daemon)advertisements sent in UDP packets, periodically repeatedroutedroutedTransprt(UDP)Transprt(UDP)network forwarding(IP) tablenetwork(IP)forwardingtablelinklinkphysicalphysical
37OSPF (Open Shortest Path First) “open”: publicly availableUses Link State algorithmLS packet disseminationTopology map at each nodeRoute computation using Dijkstra’s algorithmOSPF advertisement carries one entry per neighbor routerAdvertisements disseminated to entire AS (via flooding)Carried in OSPF messages directly over IP (rather than TCP or UDP
38OSPF “advanced” features (not in RIP) Security: all OSPF messages authenticated (to prevent malicious intrusion)Multiple same-cost paths allowed (only one path in RIP)For each link, multiple cost metricsIntegrated uni- and multicast support:Multicast OSPF (MOSPF) uses same topology data base as OSPFHierarchical OSPF in large domains.Multiple paths let you make routing decisions differently.For example, you could load balance packets across same-cost pathsOr you could use different metrics for picking a path, e.g. bandwidth for file transfers, latency for interactive traffic, etc.
40Hierarchical OSPF Two-level hierarchy: local area, backbone. Link-state advertisements only in areaeach 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.Boundary routers: connect to other AS’s.Why is this better than normal OSPF?How is it worse?
41IPv4 Address Translation support IP addresses to LAN physical addressesProblemAn IP route can pass through many physical networksData must be delivered to destination’s physical networkHosts only listen for packets marked with physical interface namesEach hop along routeDestination host
42IP to Physical Address Translation Hard-codedEncode physical address in IP addressEx: Map Ethernet addresses to IP addressesMakes it impossible to associate address with topologyFixed tableMaintain a central repository and distribute to hostsBottleneck for queries and updatesAutomatically generated tableUse ARP to build table at each hostUse timeouts to clean up tableWhen we get back to IPv6, we will return to this “hard coded” example
43Address Resolution Protocol (ARP) Check table for physical addressIf address not presentBroadcast a query, include host’s translationWait for a responseUpon receipt of ARP queryTargeted host responds with address translationTimeout and discard entries after O(10) minutes
44ARP snoopingDue to broadcast nature, other hosts overhear ARP exchangeIf address already presentRefresh entry and reset timeoutIf address not presentAdd entry for requesting hostIgnore for other hosts
45ARP example eth7->broadcast who-has 10.0.0.3 tell 10.0.0.1 A B C IP:Eth: 7AIP:Eth: 13BIP:Eth: 25Ceth25->eth is-at eth25What will happen to C’s ARP table?What will happen to B’s ARP table? Why will it only update existing entries?C’s tableA’s tableeth 7eth 25
47Host Configuration Plug new host into network Some answers How much information must be known?What new information must be assigned?How can process be automated?Some answersHost needs an IP address (must know it)Host must alsoSend packets out of physical (direct) networkThus needs physical address of router
48Host Configuration Reverse Address Resolution Protocol (RARP) Translate physical address to IP addressUsed to boot diskless hostsHost broadcasts request to bootRARP server tells host the host’s own IP addressBoot protocol (BOOTP)Use UDP packets for same purpose as RARPAllows boot requests to traverse routersIP address of BOOTP server must be knownAlso returns file server IP, subnet mask, and default router for host
49Dynamic Host Configuration Protocol (DHCP) A simple way to automate configuration informationNetwork administrator does not need to enter host IP address by handGood for large and/or dynamic networks
50Dynamic Host Configuration Protocol (DHCP) New machine sends request to DHCP server for assignment and informationServer receivesDirectly if new machine given server’s IP addressThrough broadcast if on same physical networkVia DHCP relay nodes that forward requests onto the server’s physical networkServer assigns IP address and provides other infoCan be made secure (present signed request or just a “valid” physical address)
51DHCP DHCP Server DHCP Relay Host A Host BHost ADHCP RelayHost A broadcasts DHCPDISCOVER messageOther NetworksHost A broadcasts DHCP requestRelay unicasts DHCP request to serverServer responds with host’s IP addressStop here for break, go into putting it all together discussionDHCP Server