Presentation is loading. Please wait.

Presentation is loading. Please wait.

Homework 4 r Out: Fri 2/27/2015 r In: Fri 3/13/2015.

Similar presentations


Presentation on theme: "Homework 4 r Out: Fri 2/27/2015 r In: Fri 3/13/2015."— Presentation transcript:

1 Homework 4 r Out: Fri 2/27/2015 r In: Fri 3/13/2015

2 2 NAT: Network Address Translation r 16-bit port-number field: m 60,000 simultaneous connections with a single LAN-side address! r NAT is controversial: m routers should only process up to layer 3 m violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications m address shortage should instead be solved by IPv6

3 3 NAT traversal problem r client wants to connect to server with address 10.0.0.1 m server address 10.0.0.1 local to LAN (client can’t use it as destination addr) m only one externally visible NATed address: 138.76.29.7 r solution 1: statically configure NAT to forward incoming connection requests at given port to server m e.g., (123.76.29.7, port 2500) always forwarded to 10.0.0.1 port 25000 10.0.0.1 10.0.0.4 NAT router 138.76.29.7 Client ?

4 4 NAT traversal problem r solution 2: Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to:  learn public IP address (138.76.29.7)  add/remove port mappings (with lease times) i.e., automate static NAT port map configuration 10.0.0.1 10.0.0.4 NAT router 138.76.29.7 IGD

5 5 NAT traversal problem r solution 3: relaying (used in Skype) m NATed client establishes connection to relay m External client connects to relay m relay bridges packets between two connections 138.76.29.7 Client 10.0.0.1 NAT router 1. connection to relay initiated by NATed host 2. connection to relay initiated by client 3. relaying established

6 6 Chapter 4: Network Layer r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Hierarchical routing

7 7 ICMP: Internet Control Message Protocol r used by hosts & routers to communicate network-level information m error reporting: unreachable host, network, port, protocol m echo request/reply (used by ping) r network-layer “above” IP: m ICMP msgs carried in IP datagrams r ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

8 8 Traceroute and ICMP r Source sends series of UDP segments to dest m First has TTL =1 m Second has TTL=2, etc. m Unlikely port number r When nth datagram arrives to nth router: m Router discards datagram m And sends to source an ICMP message (type 11, code 0) m Message includes name of router& IP address r When ICMP message arrives, source calculates RTT r Traceroute does this 3 times Stopping criterion r UDP segment eventually arrives at destination host r Destination returns ICMP “port unreachable” packet (type 3, code 3) r When source gets this ICMP, stops.

9 9 Chapter 4: Network Layer r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Hierarchical routing

10 10 IPv6 r Initial motivation: 32-bit address space soon to be completely allocated. r Additional motivation: m header format helps speed processing/forwarding m header changes to facilitate QoS IPv6 datagram format: m fixed-length 40 byte header m no fragmentation allowed

11 11 IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data

12 12 Other Changes from IPv4 r Checksum: removed entirely to reduce processing time at each hop r Options: allowed, but outside of header, indicated by “Next Header” field r ICMPv6: new version of ICMP m additional message types, e.g. “Packet Too Big” m multicast group management functions

13 13 Transition From IPv4 To IPv6 r Not all routers can be upgraded simultaneously m no “flag days” m How will the network operate with mixed IPv4 and IPv6 routers? r Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

14 14 Tunneling A B E F IPv6 tunnel Logical view: Physical view: A B E F IPv6 C D IPv4 Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F data Src:B Dest: E A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4

15 15 Chapter 4: Network Layer r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Hierarchical routing

16 16 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  all routers identical  network “flat” … not true in practice

17 17 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 at “edge” of its own AS r has link to router in another AS

18 18 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 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

19 19 Inter-AS tasks r suppose router in AS1 receives datagram destined outside of AS1: m router should forward packet to gateway router, but which one? AS1 must: 1. learn which dests are reachable through AS2, which through AS3 2. propagate this reachability info to all routers in AS1 job of inter-AS routing! AS3 AS2 3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b other networks other networks

20 20 Example: Setting forwarding table in router 1d r suppose AS1 learns (via inter-AS protocol) that subnet x reachable via AS3 (gateway 1c) but not via AS2. m 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. m installs forwarding table entry (x,I) AS3 AS2 3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b other networks other networks x …

21 21 Example: Choosing among multiple ASes r now suppose AS1 learns from inter-AS protocol that subnet x is reachable from AS3 and from AS2. r to configure forwarding table, router 1d must determine which gateway it should forward packets towards for dest x m this is also job of inter-AS routing protocol! AS3 AS2 3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b other networks other networks x …… … ?

22 22 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 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. m this is also job of inter-AS routing protocol! r hot potato routing: send packet towards closest of two routers.

23 23 Chapter 4: Network Layer 4.6 Routing in the Internet m RIP m OSPF m BGP

24 24 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 m IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

25 25 RIP ( Routing Information Protocol) r Distance vector algorithm r Included in BSD-UNIX Distribution in 1982 r Distance metric: # of hops (max = 15 hops) D C BA u v w x y z destination hops u 1 v 2 w 2 x 3 y 3 z 2

26 26 RIP advertisements r Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) r Each advertisement: list of up to 25 destination nets within AS

27 27 RIP: Example Destination Network Next Router Num. of hops to dest. wA2 yB2 zB7 x--1 ….…..... w xy z A C D B Routing table in D

28 28 RIP: Example Destination Network Next Router Num. of hops to dest. wA2 yB2 zB A7 5 x--1 ….…..... Routing table in D w xy z A C D B Dest Next hops w - - x - - z C 4 …. …... Advertisement from A to D

29 29 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)

30 30 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

31 31 Chapter 4: Network Layer 4.6 Routing in the Internet m RIP m OSPF m BGP

32 32 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

33 33 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 ToS; high for real time ToS) r integrated uni- and multicast support: m Multicast OSPF (MOSPF) uses same topology data base as OSPF r hierarchical OSPF in large domains.

34 34 Hierarchical OSPF boundary router backbone router Area 1 Area 2 Area 3 backbone area border routers internal routers

35 35 Hierarchical OSPF r two-level hierarchy: local area, backbone. m link-state advertisements only in area m each node 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.

36 36 Chapter 4: Network Layer 4.6 Routing in the Internet m RIP m OSPF m BGP

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

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

39 39 BGP basics: distributing path information AS3 AS2 3b 3a AS1 1c 1a 1d 1b 2a 2c 2b other networks other networks r using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. m 1c can then use iBGP do distribute new prefix info to all routers in AS1 m 1b can then re-advertise new reachability info to AS2 over 1b-to-2a eBGP session r when router learns of new prefix, it creates entry for prefix in its forwarding table. eBGP session iBGP session

40 40 Path attributes & BGP routes r advertised prefix includes BGP attributes m prefix + attributes = “route” r two important attributes: m AS-PATH: contains ASs through which prefix advertisement has passed: e.g., AS 67, AS 17 m NEXT-HOP: indicates specific internal-AS router to next- hop AS. (may be multiple links from current AS to next-hop- AS) r gateway router receiving route advertisement uses import policy to accept/decline m e.g., never route through AS x m policy-based routing

41 41 BGP route selection r router may learn about more than 1 route to destination AS, selects route based on: 1. local preference value attribute: policy decision 2. shortest AS-PATH 3. closest NEXT-HOP router: hot potato routing 4. additional criteria


Download ppt "Homework 4 r Out: Fri 2/27/2015 r In: Fri 3/13/2015."

Similar presentations


Ads by Google