Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4: Network Layer

Similar presentations


Presentation on theme: "Chapter 4: Network Layer"— Presentation transcript:

1 Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing

2 Hierarchical OSPF Perhaps some routers don’t need to know about every link. two-level hierarchy: local area, backbone. Link-state advertisements only within the area each nodes has detailed knowledge of its area topology 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. E C H G A ABR C announces link C<->A to Area 1 ABR C announces link C<->E to Backbone ABR C announces a summary of Area 1 to the Backbone ABR C announces a summary of the Backbone and other areas to Area 1 C learns about other areas from the other ABR ……

3 Area Border Router Summaries
Should the summaries include reachbility information or path metrics? Routers in area 1 do not need to know about the paths used to reach destinations in other areas They only need to know that they can be reached. In this case, reachbility information is sufficient to compute optimal routes i.e., the ABR only announces which destinations it can reach. However, no one would make a topology as shown in the figure Why? If a single key links break or router crashes, the network would be partitioned (and the network designer would be fired) C H G

4 Area Border Router Summaries
e.g., if summaries only include reachbility information area border router E F C G A B D ABR C announces to Area 1 that it can reach Area 2 in 1 hops (and includes a list of destinations in Area 2) ABR F announces to Area 1 that it can reach Area 2 in 0 hops Router A determines the path to D as follows The path to Area 2 via F is 2 hops (2 to reach F and then 0 more to Area 2) The path to Area 2 via C is 2 hops (1 to C and then 1 more to Area 2) Either path is good to reach D However, the path via F is better. A does not have sufficient information to determine this.

5 Area Border Router Summaries
In this case, reachability information is not enough to compute optimal routes. Therefore, ABRs provide distance vector type information, i.e., which destinations can be reached and the cost to reach them area border router E F C G A B Notice the C does not announce the link CG to Area 1. Notice that C gets a summary from G, which is distances to destinations, like distance vector. C uses the distances from G to determine its distances. C announces these distances to Area 1 This is like a one hop distance vector protocol D ABR G tells all routers in the Backbone that it can reach D in 2 hop. ABR F tells all routers in the Backbone that it can reach D in 1 hops ABR C tells all routers in Area 1 that it can reach D in 3 hops ABR F tells all routers in Area 1 that it can reach D in 1 hop A decides B is the best next hop toward D

6 Area Border Router Summaries
The backbone is completely connected because each router essentially sends distance vector updates directly to its neighbor area border router E F F A in 1 hop B in 2 hops C 2 1 A in 4 hop B in 5 hops 3 G C 2 A A in 2 hop B in 3 hops Area 3 1 G Area 1 B Area 2 D This is like a one hop distance vector protocol Convergence time: 1 Loops are not possible

7 Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing

8 Recall: Subnets

9 Subnet part or CIDR-block
IP addressing: CIDR CIDR: Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address Subnet part or CIDR-block host part /23

10 IP addresses: how to get one?
Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block /20 Organization /23 Organization /23 Organization /23 … … …. Organization /23

11 Hierarchical addressing: route aggregation
Hierarchical addressing allows efficient advertisement of routing information: Organization 0 /23 Organization 1 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . ISP1 . Border Router Internet Organization 7 /23 “Send me anything with addresses beginning /16” ISP2 This way, the whole 32 bit address does not need to be examined

12 Hierarchical addressing: more specific routes
ISP2 has a more specific route to Organization 1 Organization 0 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . ISP1 . Border Router Internet Organization 7 /23 “Send me anything with addresses beginning /16 or /23” ISP2 Organization 1 /23

13 Longest prefix matching
Border Router Forwarding Table Prefix Match Link Interface / / / otherwise If a packet with destination address arrives at the boarder router, then is it forwarding to interface 0 or 1? Since interface 1 has a longer match, it goes to interface 1

14 A Problem with Longest Match and subnetting
In order to improve reliability, organization 7 has a backup link with ISP1. This way, if ISP1 has problems or ISP1’s provider has problems, then organization 7 is still reachable. Will this work? Organization 0 /23 Organization 1 /23 “Send me anything with addresses beginning ……” Organization 2 /23 . ISP1 . Border Router Internet Organization 7 /23 “Send me anything with addresses beginning ….. ISP2

15 Hierarchical Routing Our routing study thus far has been an idealization all routers identical network “flat” … not true in practice scale: with 200 million destinations: can’t store all dest’s in routing tables! Memory for address table must be very fast How fast? How long can an address lookup take on a 10GBit interface? E.g., 64B/1010=50nsec routing table exchange would swamp links! There are ~ 1 million links If link state was flooded every 30 minutes seconds and each link state is 20B, then each router receives and processes 100kbps in link announcements But, perhaps, only changes in link state could be distributed. administrative autonomy internet = network of networks each network admin wants to control routing in its own network ATT does not want Sprint to know what their topology is Trade secret Improves security ATT wants to select a routing protocol and parameters without getting Sprint’s permission

16 Hierarchical Routing aggregate routers into regions, “autonomous systems” (AS) Single administrative domain Routers in the same AS run same routing protocol “intra-AS” routing protocol routers in different AS can run different intra-AS routing protocol An ISP may be made of 1 or more ASs ATT-USA = 1 AS and ATT-Europe is another Some stub networks are an AS UD is an AS Some companies have routers but are not ASs ASs have their own number, assigned by ICANN There are ~50K ASs Gateway router Direct link to router in another AS Gateway routers run a common inter-networking routing protocol

17 Simple example Connections to other ASs and the rest of the Internet AS2 Service provider of AS1 (e.g., AS1=UD and AS2=cogent) E (Recall that ASs (ISPs) sometimes meet at NAPs. E.g., google: MAE-East) An AS could also meet its provider at a POP. The rest of the internet Stub network (at the edge of the network) These tables are made with RIP, OSPF, ISIS, etc 1 B Forwarding table Forwarding table 3 Prefix /24 3 Prefix Interface 2 /24 4 /24 3 /22 2 /24 3 /22 2 AS1 1 4 C 2 3 /24 1 Forwarding table Prefix Interface 3 /24 3 A /24 2 /24 3 /22 2 /22

18 Q: How can routers in AS1 know where to send pkts with destination not in AS1?
A: Easy, if a pkt is for an “unknown” address, then send it to B. Specifically, B advertises a link to prefix /0 This is called a default route, and it can be statically set (no need for any routing protocol beside OSPF) AS2 Service provider of AS1 (e.g., AS1=UD and AS2=cogent) E The rest of the internet Stub network (at the edge of the network) These tables are made with RIP, OSPF, ISIS, etc 1 B Forwarding table Forwarding table 3 Prefix Prefix Interface /24 3 2 /24 4 /24 3 /24 3 /22 2 /22 2 /0 1 /0 1 AS1 1 4 C 2 3 /24 1 Forwarding table Prefix Interface 3 /24 3 A /24 2 /24 3 /22 2 /22 /0 1

19 to the rest of the Internet
We need to put prefixes /16, /16, /16 in the forwarding tables How to get there? B must learn from E that /16 and /16 are reachable through E A must learn that /16 is reachable through D B and A must distribute this information throughout AS1 Steps 1 and 2 need a exterior inter-networking routing protocol Step 3 needs an interior inter-networking routing protocol EBGP and IBGP – border gateway routing protocol can accomplish this to the rest of the Internet /16 AS2 /16 E These tables are made with RIP, OSPF, ISIS, etc 1 B Forwarding table Prefix Forwarding table 3 2 /24 3 Prefix Interface /24 3 /24 4 3 /22 2 /24 /22 2 AS1 4 1 C 2 /24 3 1 Forwarding table 3 Prefix Interface A /24 3 /24 /24 3 2 4 /22 2 /22 D AS3 /16

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

21 Example: Setting forwarding table in router 1d
suppose AS1 learns (via inter-AS protocol) that subnet x is reachable via AS3 (gateway 1c) but not via 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. installs forwarding table entry (x,I) Alternatively, 1d has two table entries One entry says x is reachable via 1c (determined by IBGP) A second entry says which is the next hop to reach 1c (determined by intra-routing protocol) x 3c 3a 2c 3b 2a AS3 2b 1c AS2 1a 1b AS1 1d

22 Example: Choosing among multiple ASes
now suppose AS1 learns from 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 job of inter-AS routing protocol! If both gateways are equivalent, then the intra-AS routing protocol will route packets to the best gateway This is called hot potato routing: send packet towards closest of two routers. 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c x

23 Hot Potato Routing AS1 A B AS2
/16 AS1 A B AS2 Pkt arrives with dest in /16 AS2 could give send the pkt to gateway B – hot potato routing. But AS1 would prefer AS2 to carry its own traffic. So AS1 might require that AS2 gives higher priority to gateway A. But how can AS1 enforce AS2 to do this?

24 Example: Choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol that subnet x is reachable from AS3 and from AS2. to configure forwarding table, router 1d must determine which gateway it should forward packets for dest x. this is also job of inter-AS routing protocol! hot potato routing: send packet towards closest of two routers. 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 least cost Determine from forwarding table the Interface that leads to least-cost gateway. Enter (x,I) in forwarding table Cpeg 419 strats

25 Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto standard BGP provides each AS a means to: Obtain subnet reachability information from neighboring ASs. Propagate reachability information to all AS-internal routers. Determine “good” routes to subnets based on reachability information and policy. allows subnet to advertise its existence to rest of Internet: “I am here”

26 BGP basics pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessions BGP sessions need not correspond to physical links. when AS2 advertises a prefix to AS1: AS2 promises it will forward datagrams towards that prefix. AS2 can aggregate prefixes in its advertisement But this can cause problems when some prefixes have backup links eBGP session 3c iBGP session 2c 3a 3b 2a AS3 2b 1c AS2 1a 1b AS1 1d

27 Distributing reachability info
using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. 1c can then use iBGP do distribute new prefix info to all routers in AS1 1b can then re-advertise new reachability info to AS2 over 1b-to-2a eBGP session when router learns of new prefix, it creates entry for prefix in its forwarding table. eBGP session 3c iBGP session 2c 3a 3b 2a AS3 2b 1c AS2 1a 1b AS1 1d

28 Aggregation Problem ISP ISP ISP ISP
/24 /22 /24 /22 ISP ISP Y /24 ISP W /24 /24 /24 ISP ISP X ISP ISP From ISP W, the next hop to /24 is X, it should be Y

29 Path attributes & BGP routes
advertised prefix includes BGP attributes. prefix + attributes = “route” two important attributes: AS-PATH: contains ASs through which prefix advertisement has passed: e.g, AS 67, AS 17, … NEXT-HOP: indicates specific internal-AS router to next-hop AS. (there may be multiple routers with links from current AS to next-hop-AS. Each router can advertise the path) when gateway router receives route advertisement, uses import policy to accept/decline.

30 BGP route selection router may learn about more than 1 route to some prefix. Router must select route. elimination rules: local preference value attribute: policy decision shortest AS-PATH closest NEXT-HOP router: hot potato routing additional criteria

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

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

33 BGP routing policy (2) A advertises path AW to B
X Y legend: customer network: provider network A advertises path AW to B B advertises path BAW to X Should B advertise path BAW to C? No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers B wants to force C to route to w via A B wants to route only to/from its customers!

34 BGP route processing configuration configuration routing decision
BGP advertises and withdraws paths with the UPDATE message UPDATE has three fields Router to withdraw Attributes of routes to prefixes in NLRI NLRI The NLRI is a list of prefixes that the list of attributes applies to. If two prefixes have different attributes, then these two prefixes need to be announced with different UPDATE messages. In OSPF each path is a list of routes and a total cost (two attributes). In BGP, routes have many attributes, the cost (in AS hops) is only one of the attributes configuration configuration routing decision routing table input policy engine output policy engine from peers to peers

35 RIBs Adj-rib-in Adj-rib-out Input Policy engine
Routing information base (RIB) – a list of routes (including attributes) Adj-RIB-In: RIB learned from neighbor (many of these) Adj-RIB-Out: RIB to be sent to neighbor (many of these) Loc-RIB: RIB for local use (only one of these) Adj-rib-in peer Input Policy engine BGP decision Loc-RIB Adj-rib-out

36 Sample routing environment
AS3 deny 0/0 from AS1 Give /24 from AS1 better preference Accept other routes AS1 Do not propagate 0/0 Do not send /24 to AS4 Give /24 with metric = 10 to AS3 /24 path=(AS5, AS2) /24 path=(AS5, AS1) metric=10 /24 path=(AS5) /24 0/0 input policy engine decision process routes output policy engine /24 path=(AS5) /24 path=(AS5 AS1) Use 0/0 from AS2 Use /24 from AS1 Use /24 from AS2 Use /24 from AS5 (this AS) AS4 AS2 /24 /24 0/0

37

38 Fun with BGP Routeviews.org collects and archives BGP announcements
One way to use routeviews is with dig At the linux prompt dig txt aspath.routeviews.org Outputs various stuff and Answer section: 4.128.aspath.routeviews.org 600 IN TXT “ ” “ ” “16” Syntax = ASPath “Prefix” “prefix length” Now use whois -h whois.arin.net "a ASXX" to learn about ASs where XX is an AS number. E.g., whois -h whois.arin.net "a AS34" gives information about AS34 Try with some other AS

39 Check out a collection of path announcements
Open bgp030408p39.Partial An old (2003) partial list of BGP announcements received by several routers Check which ASs peer with UD (ASN 34)

40 Why 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 needed Scale: hierarchical routing saves table size, reduced update traffic Performance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance


Download ppt "Chapter 4: Network Layer"

Similar presentations


Ads by Google