Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMPE 252A : Computer Networks

Similar presentations


Presentation on theme: "CMPE 252A : Computer Networks"— Presentation transcript:

1 CMPE 252A : Computer Networks
Chen Qian Computer Engineering UCSC Baskin Engineering Network layer

2 Network-layer functions
forwarding: move packets from router’s input to appropriate router output routing: determine route taken by packets from source to dest. routing algorithms analogy: routing: process of planning trip from source to dest forwarding: process of getting through single interchange Network Layer

3 Interplay between routing and forwarding
1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 1001 Control plane: routing algorithm determines end-end-path through network Data plane: forwarding table determines local forwarding at this router Network Layer

4 Datagram forwarding table
4 billion IP addresses, so rather than list individual destination address list range of addresses (aggregate table entries) routing algorithm local forwarding table dest address output link address-range 1 address-range 2 address-range 3 address-range 4 3 2 1 IP destination address in arriving packet’s header 1 2 3 Network Layer

5 Datagram forwarding table
Destination Address Range through otherwise Link Interface 1 2 3 Q: but what happens if ranges don’t divide up so nicely? Network Layer

6 Longest prefix matching
when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address. Destination Address Range *** ********* ********* *** ********* otherwise Link interface 1 2 3 examples: DA: which interface? DA: which interface? Network Layer

7 IP addressing: introduction
IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host typically has one or two interfaces (e.g., wired Ethernet, wireless ) IP addresses associated with each interface = 223 1 1 1 Network Layer

8 Subnets IP address: what’s a subnet ? subnet part - high order bits
host part - low order bits what’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router subnet network consisting of 3 subnets Network Layer

9 Subnets /24 /24 /24 subnet recipe to determine the subnets, detach each interface from its host or router, creating islands of isolated networks each isolated network is called a subnet subnet mask: /24 Network Layer

10 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 host part /23 Network Layer

11 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 Network Layer

12 Hierarchical addressing: route aggregation
hierarchical addressing allows efficient advertisement of routing information: Organization 0 /23 Organization 1 “Send me anything with addresses beginning /20” /23 Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16” ISPs-R-Us Network Layer

13 Hierarchical addressing: more specific routes
ISPs-R-Us has a more specific route to Organization 1 Organization 0 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16 or /23” ISPs-R-Us Organization 1 /23 Network Layer

14 A Link-State Routing Algorithm
Dijkstra’s algorithm net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (‘source”) to all other nodes gives forwarding table for that node iterative: after k iterations, know least cost path to k dest.’s notation: c(x,y): link cost from node x to y; = ∞ if not direct neighbors D(v): current value of cost of path from source to dest. v p(v): predecessor node along path from source to v N': set of nodes whose least cost path definitively known Network Layer

15 Dijsktra’s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v
if v adjacent to u then D(v) = c(u,v) else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known shortest path cost to w plus cost from w to v */ 15 until all nodes in N' Network Layer

16 Dijkstra’s algorithm: example
D(v) p(v) D(w) p(w) D(x) p(x) D(y) p(y) D(z) p(z) Step N' u 7,u 3,u 5,u 1 uw 11,w 6,w 5,u 2 uwx 14,x 11,w 6,w 3 uwxv 14,x 10,v 4 uwxvy 12,y 5 uwxvyz w 3 4 v x u 5 7 y 8 z 2 9 notes: construct shortest path tree by tracing predecessor nodes ties can exist (can be broken arbitrarily) Network Layer

17 Dijkstra’s algorithm: another example
Step 1 2 3 4 5 N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u D(w),p(w) 5,u 4,x 3,y D(x),p(x) 1,u D(y),p(y) 2,x D(z),p(z) 4,y u y x w v z 2 1 3 5 Network Layer

18 Dijkstra’s algorithm: example (2)
resulting shortest-path tree from u: u y x w v z resulting forwarding table in u: v x y w z (u,v) (u,x) destination link Network Layer

19 Dijkstra’s algorithm, discussion
algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n2) more efficient implementations possible: O(nlogn) Network Layer

20 Intra-AS Routing also known as interior gateway protocols (IGP)
most common intra-AS routing protocols: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco proprietary) Network Layer

21 OSPF (Open Shortest Path First)
“open”: publicly available uses link state algorithm LS packet dissemination topology map at each node route computation using Dijkstra’s algorithm OSPF advertisement carries one entry per neighbor advertisements flooded to entire AS carried in OSPF messages directly over IP (rather than TCP or UDP IS-IS routing protocol: nearly identical to OSPF Network Layer

22 Hierarchical OSPF backbone boundary router backbone router area border
routers area 3 internal routers area 1 area 2 Network Layer

23 Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto inter-domain routing protocol “glue that holds the Internet together” BGP provides each AS a means to: eBGP: obtain subnet reachability information from neighboring ASs. iBGP: propagate reachability information to all AS-internal routers. determine “good” routes to other networks based on reachability information and policy. allows subnet to advertise its existence to rest of Internet: “I am here” Network Layer

24 BGP basics BGP session: two BGP routers (“peers”) exchange BGP messages: advertising paths to different destination network prefixes (“path vector” protocol) exchanged over semi-permanent TCP connections when AS3 advertises a prefix to AS1: AS3 promises it will forward datagrams towards that prefix AS3 can aggregate prefixes in its advertisement 3c 3a BGP message 3b 2c AS3 other networks AS1 1c 1a 1d 1b 2a 2b other networks AS2 Network Layer

25 BGP basics: distributing path information
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 3a 3b iBGP session 2c AS3 other networks 1c 2a 2b other networks 1a 1b AS2 1d AS1 Network Layer

26 BGP route selection router may learn about more than 1 route to destination AS, selects route based on: local preference value attribute: policy decision shortest AS-PATH closest NEXT-HOP router: hot potato routing additional criteria Network Layer

27 Next class Please read Chapter 6 of the textbook BEFORE Class 27


Download ppt "CMPE 252A : Computer Networks"

Similar presentations


Ads by Google