Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing.

Similar presentations


Presentation on theme: "Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing."— Presentation transcript:

1 Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing algorithms m Link state m Distance Vector r Routing in the Internet m RIP m OSPF m BGP r Multicast routing 4-1

2 Routing in the Internet The Internet uses hierarchical routing r The Internet is split into Autonomous Systems (AS’s)  Try: http://whois.arin.net/ui/ to query AS # r Within an AS, the administrator chooses an Interior Gateway Protocol (IGP)  Examples of IGPs: RIP (rfc 1058), OSPF (rfc 1247). r Between AS’s, the Internet uses an Exterior Gateway Protocol  AS’s today use the Border Gateway Protocol, BGP-4 (rfc 1771) 4-2

3 Routing in the Internet Stub AS Transit AS e.g. backbone service provider Stub AS AS ‘A’ AS ‘B’ AS ‘C’ Interior Gateway Protocol Interior Gateway Protocol Interior Gateway Protocol BGP 4-3

4 Hierarchical Routing scale: with 200 million destinations: r can’t store all dest’s in routing tables! r routing table exchange would swamp links! administrative autonomy r internet = network of networks r each network admin may want to control routing in its own network Our routing study thus far - idealization r all routers identical r network “flat” … not true in practice 4-4

5 Hierarchical Routing r aggregate routers into regions, “autonomous systems” (AS) r routers in same AS run same routing protocol m “intra-AS” routing protocol m routers in different AS can run different intra- AS routing protocol Gateway router r Direct link to router in another AS 4-5

6 Routing within a Stub AS r There is only one exit point, so routers within the AS can use default routing.  Each router knows all Network IDs within AS.  Packets destined to another AS are sent to the default router.  Default router is the border gateway to the next AS. r Routing tables in Stub AS’s tend to be small. 4-6

7 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b Intra-AS Routing algorithm Inter-AS Routing algorithm Forwarding table 3c Interconnected ASes r Forwarding table is configured by both intra- and inter-AS routing algorithm m Intra-AS sets entries for internal dests m Inter-AS & Intra-As sets entries for external dests 4-7

8 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c Inter-AS tasks r Suppose router in AS1 receives datagram for which dest is outside of AS1 m Router should forward packet towards one of the gateway routers, but which one? AS1 needs: 1. to learn which dests are reachable through AS2 and which through AS3 2. to propagate this reachability info to all routers in AS1 Job of inter-AS routing! 4-8

9 Example: Setting forwarding table in router 1d r Suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 (gateway 1c) but not from AS2. r Inter-AS protocol propagates reachability info to all internal routers. r Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c. r Puts in forwarding table entry (x,I). 4-9

10 Learn from inter-AS protocol that subnet x is reachable via multiple gateways Use routing info from intra-AS protocol to determine costs of least-cost paths to each of the gateways Hot potato routing: Choose the gateway that has the smallest least cost Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x,I) in forwarding table Example: Choosing among multiple ASes r Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. r To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. r This is also the job on inter-AS routing protocol! r Hot potato routing: send packet towards closest of two routers. 4-10

11 Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing algorithms m Link state m Distance Vector r Routing in the Internet m RIP m OSPF m BGP r Multicast routing 4-11

12 Intra-AS Routing r Also known as Interior Gateway Protocols (IGP) r Most common Intra-AS routing protocols: m RIP: Routing Information Protocol m OSPF: Open Shortest Path First 4-12

13 Interior Routing Protocols r RIP  Uses distance vector (distributed Bellman-Ford algorithm).  Updates sent every 30 seconds. Each update/advertisement list of up to 25 destination nets within AS  No authentication.  Originally in BSD UNIX.  Widely used for many years; not used much anymore. r OSPF  Link-state updates sent (using flooding) as and when required.  Every router runs Dijkstra’s algorithm.  Authenticated updates.  Autonomous system may be partitioned into “areas”.  Widely used. 4-13

14 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead m routes via neighbor invalidated m new advertisements sent to neighbors m neighbors in turn send out new advertisements (if tables changed) m link failure info quickly propagates to entire net m poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) 4-14

15 RIP Table processing r RIP routing tables managed by application-level process called route-d (daemon) r advertisements sent in UDP packets, periodically repeated physical link network forwarding (IP) table Transprt (UDP) routed physical link network (IP) Transprt (UDP) routed forwarding table 4-15

16 OSPF (Open Shortest Path First) r “open”: publicly available r Uses Link State algorithm m LS packet dissemination m Topology map at each node m Route computation using Dijkstra’s algorithm r OSPF advertisement carries one entry per neighbor router r Advertisements disseminated to entire AS (via flooding) m Carried in OSPF messages directly over IP (rather than TCP or UDP) 4-16

17 OSPF “advanced” features (not in RIP) r Security: all OSPF messages authenticated (to prevent malicious intrusion) r Multiple same-cost paths allowed (only one path in RIP) r For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) r Integrated uni- and multicast support: m Multicast OSPF (MOSPF) uses same topology data base as OSPF r Hierarchical OSPF in large domains. 4-17

18 Hierarchical OSPF 4-18

19 Hierarchical OSPF r Two-level hierarchy: local area, backbone. m Link-state advertisements only in local area m each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. r Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. r Backbone routers: run OSPF routing limited to backbone. r Boundary routers: connect to other AS’s. 4-19

20 Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing algorithms m Link state m Distance Vector r Routing in the Internet m RIP m OSPF m BGP r Multicast routing 4-20

21 Exterior Routing Protocols Problems:  Topology: The Internet is a complex mesh of different AS’s with very little structure.  Autonomy of AS’s: Each AS defines link costs in different ways, so not possible to find lowest cost paths.  Trust: Some AS’s can’t trust others to advertise good routes (e.g. two competing backbone providers), or to protect the privacy of their traffic (e.g. two warring nations).  Policies: Different AS’s have different objectives (e.g. route over fewest hops; use one provider rather than another). 4-21

22 Border Gateway Protocol (BGP-4) r BGP is not a link-state or distance-vector routing protocol. m Instead, BGP uses “Path vector” r BGP advertises complete paths (a list of AS’s). m Also called AS_PATH (this is the path vector) m Example of path advertisement: “The network 171.64/16 can be reached via the path {AS1, AS5, AS13}”. r Paths with loops are detected locally and ignored. r Local policies pick the preferred path among options. r When a link/router fails, the path is “withdrawn”. 4-22

23 BGP-4 r BGP provides each AS a means to: 1. Obtain subnet reachability information from neighboring ASs. 2. Propagate the reachability information to all routers internal to the AS. 3. Determine “good” routes to subnets based on reachability information and policy. r Allows a subnet to advertise its existence to rest of the Internet: “I am here” 4-23

24 BGP basics r Pairs of routers (BGP peers) exchange routing info over semi- permanent TCP conctns: BGP sessions r Note that BGP sessions do not correspond to physical links. r When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix. m AS2 can aggregate prefixes in its advertisement 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session 4-24

25 Customers and Providers Customer pays provider for access to the Internet Customer may not always need BGP provider customer IP traffic provider customer 4-25

26 Customer-Provider Hierarchy IP traffic provider customer 4-26

27 The Peering Relationship peer customerprovider Peers provide transit between their respective customers Peers do not provide transit between peers Peers (often) do not exchange $$$ traffic allowed traffic NOT allowed 4-27

28 Distributing reachability info r With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. r 1c can then use iBGP do distribute this new prefix reach info to all routers in AS1 r 1b can then re-advertise the new reach info to AS2 over the 1b-to-2a eBGP session r When router learns about a new prefix, it creates an entry for the prefix in its forwarding table. 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c eBGP session iBGP session 4-28

29 Path attributes & BGP routes r When advertising a prefix, advert includes BGP attributes. m prefix + attributes = “route”  BGP announcement r Attributes include: Next hop, AS Path, local preference, Multi-exit discriminator, … m Used to select among multiple options for paths r Two important attributes: m AS-PATH: contains the ASs through which the advert for the prefix passed: AS 67 AS 17 m NEXT-HOP: Indicates the specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop-AS.) E.g., 3a in the example r When gateway router receives route advert, uses import policy to accept/decline. 4-29

30 BGP route selection r Router may learn about more than 1 route to some prefix. Router must select route. r Elimination rules: 1. Local preference value attribute: policy decision 2. Shortest AS-PATH 3. Closest NEXT-HOP router: hot potato routing 4. Additional criteria 4-30

31 BGP Route Selection Summary Highest Local Preference Shortest ASPATH Lowest MED i-BGP < e-BGP Lowest IGP cost to BGP egress Lowest router ID traffic engineering Enforce relationships E.g. prefer customer routes over peer routes Throw up hands and break ties 4-31

32 ASPATH Attribute AS 7018 135.207.0.0/16 AS Path = 6341 AS 1239 Sprint AS 1755 Ebone AT&T AS 3549 Global Crossing 135.207.0.0/16 AS Path = 7018 6341 135.207.0.0/16 AS Path = 3549 7018 6341 AS 6341 135.207.0.0/16 AT&T Research Prefix Originated AS 12654 RIPE NCC RIS project AS 1129 Global Access 135.207.0.0/16 AS Path = 7018 6341 135.207.0.0/16 AS Path = 1239 7018 6341 135.207.0.0/16 AS Path = 1755 1239 7018 6341 135.207.0.0/16 AS Path = 1129 1755 1239 7018 6341 Pick shorter AS path 4-32

33 AS 1 AS 2 AS 4 AS 3 13.13.0.0/16 local pref = 80 local pref = 100 local pref = 90 Set appropriate “local pref” to reflect preferences: Higher Local preference values are preferred Frank’s Choices… peer customerprovider Route learned from customer preferred over route learned from peer, preferred over route learned from provider 4-33

34 BGP messages r BGP messages exchanged using TCP. r BGP messages: m OPEN: opens TCP connection to peer and authenticates sender m UPDATE: advertises new path (or withdraws old) m KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request m NOTIFICATION: reports errors in previous msg; also used to close connection 4-34

35 BGP routing policy r A,B,C are provider networks r X,W,Y are customer (of provider networks) r X is dual-homed: attached to two networks m X does not want to route from B via X to C m.. so X will not advertise to B a route to C 4-35

36 BGP routing policy (2) r A advertises to B the path AW r B advertises to X the path BAW r Should B advertise to C the path BAW? m No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers m B wants to force C to route to w via A m B wants to route only to/from its customers! 4-36

37 Why different Intra- and Inter-AS routing ? Policy: r Inter-AS: admin wants control over how its traffic routed, who routes through its net. r Intra-AS: single admin, so no policy decisions needed Scale: r hierarchical routing saves table size, reduced update traffic Performance: r Intra-AS: can focus on performance r Inter-AS: policy may dominate over performance 4-37

38 Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing algorithms m Link state m Distance Vector r Routing in the Internet m RIP m OSPF m BGP r Multicast routing 4-38

39 A B G D E c F A B G D E c F (a) Broadcast initiated at A (b) Broadcast initiated at D Spanning Tree r First construct a spanning tree r Nodes forward copies only along spanning tree 4-39

40 Multicast Trees The basic idea Server G G G G G G G G G G Multiple unicasts Single multicast 4-40

41 Applications that need multicast r One way, single sender: “one-to-many” m TV m Non-interactive learning m Database update m Information dispersal (e.g. Pointcast) m Software updates/patches r Two way, interactive, multiple sender: “many-to-many” m Teleconference m Interactive learning 4-41

42 Multicast Routing r A multicast tree is a spanning tree with the sender at the root, spanning all the members of the group. 4-42

43 Multicast Trees e.g. a teleconference Sender/Speaker Multicast Group (S 1,G) S1S1 Class D S1S1 R 4-43

44 Multicast Trees and Addressing r All members of the group share the same “Class D” Group Address. r An end station may be the member of multiple groups. r An end-station “joins” a multicast group by (periodically) telling its nearest router that it wishes to join (uses IGMP – Internet Group Management Protocol). r Routers maintain “soft-state” indicating which end-stations have subscribed to which groups. 4-44

45 Multicast Trees Multiple source trees Sender/Speaker Multicast Group (S 2,G) S2S2 Class D S2S2 R 4-45

46 Multicast Forwarding is Sender-specific R GS1S1 S2S2 2,3 1,3 1 2 Group Address Src Address Src Interface Dst Interface S2S2 G S1S1 G 1 2 3 2 1 3 4-46

47 Distance-vector Multicast RPB: Reverse-Path Broadcast r Uses existing unicast shortest path routing table. m Computed using Distance vector r If packet arrived through interface that is the shortest path to the packet’s SA, then forward packet to all interfaces. r Else drop packet. 4-47

48 Distance-vector Multicast RPB: Reverse-Path Broadcast Sender/Speaker Multicast Group (S 1,G) S1S1 LAN S1S1 1 AddressPort Unicast DV Routing Table 1 2 3 Shortest Path to Source Q: Is it shortest path from source? 4-48

49 Distance-vector Multicast RPB: Reverse-Path Broadcast Sender/Speaker Multicast Group (S 1,G) S1S1 LAN Designated Parent Router: One parent router picked per LAN (one “closest” to source). 4-49

50 Internet Multicasting Routing: DVMRP r DVMRP: distance vector multicast routing protocol, RFC1075 r flood and prune: reverse path broadcast, source-based tree m RPB tree based on DVMRP’s own routing tables constructed by communicating DVMRP routers m no assumptions about underlying unicast m initial datagram to mcast group flooded everywhere via RPB m routers not wanting group: send upstream prune msgs 4-50

51 DVMRP: continued… r soft state: DVMRP router periodically (1 min.) “forgets” branches are pruned: m mcast data again flows down unpruned branch m downstream router: reprune or else continue to receive data r routers can quickly regraft to tree m following IGMP join at leaf r odds and ends m commonly implemented in commercial routers m Mbone routing done using DVMRP 4-51

52 Tunneling Q: How to connect “islands” of multicast routers in a “sea” of unicast routers?  mcast datagram encapsulated inside “normal” (non-multicast- addressed) datagram  normal IP datagram sent thru “tunnel” via regular IP unicast to receiving mcast router  receiving mcast router unencapsulates to get mcast datagram physical topology logical topology 4-52

53 Multicast: Interesting Questions r How to make multicast reliable? r How to implement flow-control? r How to support/provide different rates for different end users? r How to secure a multicast conversation? r Will multicast become widespread? m Several protocols for multicast routing in IP But IP multicast is not enabled in routers! No one uses IP multicast, really End-system based, overlay-based approaches more popular 4-53


Download ppt "Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing."

Similar presentations


Ads by Google