Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Networks Network Layer

Similar presentations


Presentation on theme: "Computer Networks Network Layer"— Presentation transcript:

1 Computer Networks Network Layer
Shahrood University of Technology Department of Computer Engineering & IT Computer Networks Network Layer

2 Chapter 4: Network Layer
Chapter goals: understanding principles behind network layer services: routing (path selection) dealing with scale how a router works advanced topics: IPv6, mobility instantiation and implementation in the Internet Overview: network layer services routing principles: path selection hierarchical routing IP Internet routing protocols reliable transfer intra-domain inter-domain what’s inside a router? IPv6 mobility

3 Chapter 4 Outline 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

4 Network Layer Functions
transport packet from sending to receiving hosts network layer protocols in every host, router three important functions: path determination: route taken by packets from source to dest. (Routing Algorithms) forwarding: move packets from router’s input to appropriate router output call setup: some network architectures require router call setup along path before data flows application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical

5 Network Service Model The most important virtual circuit or datagram?
Q: What service model for “channel” transporting packets from sender to receiver? Services guaranteed bandwidth? preservation of inter-packet timing (no jitter)? loss-free delivery? in-order delivery? congestion feedback to sender? The most important abstraction provided by network layer: virtual circuit or datagram?

6 “source-to-destination path behaves much like telephone circuit”
Virtual circuits “source-to-destination path behaves much like telephone circuit” performance-wise network actions along source-to-destination path call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host ID) every router on source-destination path maintains “state” for each passing connection transport-layer connection only involved two end systems Link and router resources (bandwidth, buffers) may be allocated to VC to get circuit-like performance.

7 Virtual Circuits: Signaling Protocols
used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet application transport network data link physical 6. Receive data 3. Accept call 2. Incoming call application transport network data link physical 5. Data flow begins 4. Call connected 1. Initiate call

8 Datagram networks: the Internet model
no call setup at network layer routers: no state about end-to-end connections no network-level concept of “connection” packets forwarded using destination host address packets between same source-destination pair may take different paths application transport network data link physical 2. Receive Data application transport network data link physical 1. Send Data

9 Network Layer Service Models:
Guarantees ? Network Architecture Internet ATM Service Model best effort CBR VBR ABR UBR Congestion feedback no (inferred via loss) no congestion yes Bandwidth none constant rate guaranteed minimum Loss no yes Order no yes Timing no yes UBR: Unspecified bit rate CBR: Constant bit rate ABR: Available bit rate VBR: Variable bit rate Internet model being extended: Integrated services, Differentiated Services Chapter 6

10 QoS Factors Timing Connection Establishment Delay End-To-End Delay
Connection Establishment Failure Probability Throughput or Bandwidth Guarantee Ordering Preservation Congestion Indication (Control) Bit-Error rate or Packet-Loss Rate Control Protection Priority Resilience (Return Back to Normal Operation).

11 Service Clases Guaranteed Quality of Service
Predictive Quality of Service Best Effort Quality of Service

12 Guaranteed QoS Specified through QoS parameter values
deterministic statistical Single value - average (threshold, target) Pair of values - interval Triple of values – max., mean, min.

13 Predictable Service Parameter bounds based on history, that is, past network behavior. Parameter values are measured, and certain statistical analyses may be carried out

14 Best Effort Services No guarantees of quality, no QoS parameter values
UDP/IP Partial guarantees, some QoS parameter values are given. TCP/IP

15 Datagram or VC Network: why?
Internet data exchange among computers “elastic” service, no strict timing req. “smart” end systems (computers) can adapt, perform control, error recovery simple inside “network”, complexity at “edge” many link types different characteristics uniform service is difficult ATM evolved from telephony human conversation: strict timing, reliability requirements need for guaranteed service “dumb” end systems telephones complexity inside network

16 Active Queue Management (AQM)
Performance Degradation in current TCP Congestion Control Multiple packet loss Low link utilization Congestion collapse The role of the router (i.e., network) Control congestion effectively with a network Allocate bandwidth fairly

17 Buffering in IP routers
Internet Router Network Interface FIFO queues provide buffers to accommodate bursts Drop-tail on full semantics Internet still works High link utilization Buffer size Space for bursts of packets Latency Dropping packets When? What?

18 FIFO Queueing in the Router (Drop Tail)
Network Interface Traditional Internet Routers FIFO Queues Drop-tail on full semantics Single queue maintained

19 FIFO Queueing in the Router (Drop Tail)
Network Interface Single queue maintained Dequeue from head

20 FIFO Queueing in the Router (Drop Tail)
Network Interface Single queue maintained Dequeue from head Enqueue at tail

21 FIFO Queueing in the Router (Drop Tail)
Network Interface Single queue maintained Dequeue from head Enqueue at tail When full

22 FIFO Queueing in the Router (Drop Tail)
Network Interface Simple to implement Efficient hardware implementations available. Single queue maintained Dequeue from head Enqueue at tail When full drop arriving packet (drop-tail)

23 Active Queue Management
Goals: Better congestion notification for responsive flows (i.e. TCP) Maintain shorter queues Fairness in drops (proportional)

24 RED Operation

25 Active Queue Management Random Early Detection (RED)
Drop probability Time Max Queue Size Average queue length Max Threshold Min Threshold Forced drop Probabilistic drops No drops Probabilistic drops: If the average is above the minimum threshold the probability the incoming packet will be dropped increases as it approaches the max threshold. If a random value is above the prob. The incoming packet is dropped. Forced drops: If the average is above the max threshold a random packet from somewhere in the queue is dropped for each incoming packet. Does result in shorter queues on average Implemented in many CISCO routers Focus is on responsive flows Problem still unaddressed: unresponsive flows can still dominate Also, all flows will see equal drop %. - this is the way most folks “expect” FIFO to work, evenly distributed.

26 Chapter 4 Outline 4.1 Introduction and Network Service Models
4.2 Routing Principles Link state routing Distance vector routing 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

27 Routing Routing protocol Graph abstraction for routing algorithms:
D C E B 1 2 5 3 Goal: determine “good” path (sequence of routers) thru network from source to dest. Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links link cost: delay, $ cost, or congestion level Abstract model of a network “good” path: typically means minimum cost path other definitions possible

28 Routing Algorithm Classifications
1. Global: all routers have complete topology, link cost info “link state” algorithms 2. Decentralized: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms 1. Static: routes update slowly over time 2. Dynamic: routes update more quickly periodic update in response to link cost changes

29 A Link-State Routing Algorithm
Dijkstra’s algorithm (global) net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same information computes least cost paths from one node (‘source”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k destinations.

30 Notation: N: set of nodes whose least cost path definitively known
B 1 2 5 3 N: set of nodes whose least cost path definitively known c(i,j): link cost from node i to j. cost infinite if not direct neighbors p(v): nodes along path from source to v D(v): current value of cost of path from source to destination v. Example: N: A, B, C, D, E, F C(A,C)=5; C(C,A)=5 C(B,D)=2; C(D,B)=3 Source=A p(F): A-D-E-F D(F)=4

31 Dijsktra’s Algorithm v 1 Initialization: 2 N = {A} c(w,v)
D(v) c(w,v) D(w) A 1 Initialization: 2 N = {A} 3 for all nodes v if v adjacent to A then D(v) = c(A,v) else D(v) = infinity 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 n = number of nodes (except the source) n(n+1)/2) times

32 Dijkstra’s Algorithm: example
computes least cost paths from node A to all other nodes Step 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A-B D(C),p(C) 5,A-C 4,A-D-C 3,A-D-E-C D(D),p(D) 1,A-D D(E),p(E) infinity 2,A-D-E D(F),p(F) infinity 4,A-D-E-F A F D C E B 1 2 5 3 D(v): Distance (cost) of A to v. P(v): nodes along path fromA to v.

33 Dijkstra’s Algorithm: discussion1
Algorithm complexity: Suppose there are n nodes, except source First iteration: Search through all n nodes to determine the node, w, not in N that has the minimum cost. Second iteration: Check n - 1 nodes to determine minimum cost. Third iteration: n - 2 nodes, and so on. Total number of nodes searched: n(n + 1)/2 The implementation of the link state algorithm has worst-case complexity of order n squared: O(n2). A more sophisticated implementation of this algorithm, using a data structure known as a heap, can find the minimum in line 9 in logarithmic rather than linear time, thus reducing the complexity: O( nlog(n) )

34 Dijkstra’s Algorithm: discussion2
Oscillations possibility: Suppose link costs are equal to the load carried on the link, or the delay that experienced. Link costs are not symmetric, c(A,B) equals c(B,A) only if the load on both directions on the AB link is the same. Nodes B and D originates a unit of traffic destined for A. Node C originates e unit for A. D C B A 1 1+e e Fig. a- Initial routing

35 Discussion2 (cont.) … oscillations possible:
1 1+e e Fig. a- Initial routing … oscillations possible: Algorithm is run: C determines (Fig. a) the clockwise path to A has a cost of 1, while the counterclockwise path to A has a cost of 1 + e. Hence C ’s least-cost path to A is now clockwise. Similarly, B determines that its new least-cost path to A is also clockwise, resulting in costs shown in Fig. b. D C B A 1+e 1 2+e Fig. b- B, C find better path to A is clockwise e

36 path to A is counterclockwise
Discussion2 (cont.) Fig. c- B, C, D find better path to A is counterclockwise D C B A 1+e 1 2+e e … oscillations possible: When algorithm is run next, nodes B, C, and D all detect a zero-cost path to A in the counterclockwise direction, and all route their traffic to the counterclockwise routes. The next time the LS algorithm is run, B, C, and D all then route their traffic to the clockwise routes. D C B A 1+e 1 2+e e Fig. d- B, C, D find better path to A is clockwise

37 Dijkstra’s Algorithm: discussion2
  To prevent such oscillations: Solution1 :link costs not depend on the amount of traffic carried ,an unacceptable solution since one goal of routing is to avoid highly congested (for example, high-delay) links. Solution2 :all routers do not run the LS algorithm at the same time (a reasonable solution). Routers run the LS algorithm with the same periodicity, the execution instance of the algorithm would not be the same at each node. Researchers have noted: Routers in the Internet can self-synchronize among themselves. That is, even though they initially execute the algorithm with the same period but at different instants of time, the algorithm execution instance can eventually become, and remain, synchronized at the routers. Avoid such self-synchronization: Introduce randomization into the period between execution instants of the algorithm at each node.

38 Distance Vector Routing Algorithm (Decentralized)
Iterative: continues until no nodes exchange info. self-terminating: no “signal” to stop Asynchronous: nodes need not exchange info/iterate in lock step! distributed: each node communicates only with directly-attached neighbors Distance Table data structure each node has its own: row for each possible destination column for each directly-attached neighbor to node example: in node X, for dest. Y via neighbor Z: DX(Y,Z) D (Y,Z) X c(X,Z) + min {D (Y,w)} Z w = distance from X to Y, via Z as next hop

39 Distance Table: example
neighbor: j 2 D C B A E 1 7 8 A B C D A 1 7 6 4 B 14 8 9 11 D 5 4 2 destination: i source A E B D (A,C) D C c(E,B) E’s neighbor B’s neighbor D(i, j) E Distance table: c(E,B) + min {D (A,w)} = = 14 E D (A,B)= B w =

40 Distance table gives routing table
cost to destination via E Outgoing link to use, cost D () A B C D A 1 7 6 4 B 14 8 9 11 D 5 4 2 A B C D E A,1 D,5 D,4 D () destination destination Distance table Routing table of node E

41 Distance Vector Routing: overview
Iterative, asynchronous: each local iteration caused by: local link cost change message from neighbor: its least cost path change from neighbor Distributed: each node notifies neighbors only when its least cost path to any destination changes neighbors then notify their neighbors if necessary Each node: wait for (change in local link cost or message from neighbor) recompute distance table if least cost path to any destination has changed, notify neighbors

42 Distance Vector Algorithm:
X v c(X,v) * DX (*,v) X’s adjacents destinations w Y DX (y,w) At node: X Initialization: for all adjacent nodes v: DX (*,v) = ∞ /* the * means "for all desstinations" */ DX (v,v) = c(X,v) for all destinations, y send minW DX (y,w) to each neighbor /* w over all X's neighbors */

43 Distance Vector Algorithm (cont.):
8 loop 9 wait ( until I see a link cost change to neighbor v or until I receive update from neighbor v ) 11 12 if ( c(X,v) changes by d ) /* change cost to all dest's via neighbor v by d */ /* note: d could be positive or negative */ for all destinations y: DX (y,v) = DX (y,v) + d 16 17 else if (update received from v for destination Y) /* shortest path from V to some Y has changed */ /* V has sent a new value for its minW DV (Y,w) */ /* call this received new value is "newval" */ for the single destination y: DX (Y,v) = c(X,v) + newval 22 23 if we have a new minW DX(Y,w) for any destination Y send new value of minW DX(Y,w) to all neighbors 25 26 forever

44 Distance Vector Algorithm: example
Node X’s table 2 Y X Z 1 7 Node Y’s table Node Z’s table new minimum time

45 Distance Vector Algorithm: example
4 1 X dose not sends DX(Y,Y) to Y and Z. 3 2 Y X Z 1 7 4 X sends new DX(Y,Z) to Y and Z 2 2 X learns this term from Y D (Z,Y) X c(X,Y) + min {D (Z,w)} w = 2+1 = 3 Y 1 X learns this term from Z D (Y,Z) X c(X,Z) + min {D (Y,w)} w = 7+1 = 8 Z 1

46 Distance Vector: link cost changes
t0:Y detects local link cost change. updates distance table (line 15). least cost path DY (X,X) changes, notify neighbors (lines 23,24). t1: Z receives Y’s update and then updates its table. t2: Y receives Z’s update and then updates its table, DY (X,X) not changed, terminate. algorithm terminates 4 Y X Z 1 50

47 Distance Vector: link cost changes
Routing loop: in order to get to X, Y routes through Z, and Z routes through Y. “count to infinity” problem! 4 Y X Z 1 50 60 algorithm continues on! Y

48 Poisoned reverse solution: “count to infinity” problem!
If Z routes through Y to get to X : Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) will this completely solve count to infinity problem? 4 Y X Z 1 50 60 algorithm terminates

49 Comparison of LS and DV algorithms
Message complexity LS: with n nodes, E links, O(nE) msgs sent each DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n2) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: Node (router) can advertise incorrect link cost each node computes only its own table: robustness DV: DV node can advertise incorrect least-cost paths each node’s table used by others error propagate thru network

50 Chapter 4 Outline 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

51 Hierarchical Routing administrative autonomy:
The routing study thus far was idealized all routers identical network “flat” … not true in practice scale: with 200 million destinations (hosts): can’t store all dest’s in routing tables (memory limitation)! routing table exchange would leave no bandwidth left for sending data packets! DV algorithm that iterated among large number of routers never converge! administrative autonomy: internet = network of networks each network admin may want to control routing in its own network

52 Hierarchical Routing gateway routers
aggregate routers into regions, “autonomous systems” (AS) routers in same AS run same routing protocol “intra-AS” routing protocol routers in different AS can run different intra-AS routing protocol special routers in AS run intra-AS routing protocol with all other routers in AS also responsible for routing to destinations outside AS run inter-AS routing protocol with other gateway routers

53 Intra-AS and Inter-AS routing
C.b B.a Gateways: perform inter-AS routing amongst themselves perform intra-AS routers with other routers in their AS A.a b A.c c a a b C a B d c A b ▪Routers in an AS have information about routing paths within that AS. Intra-AS Routing Algorithm Inter-AS Routing Table DL PHL To/from B.a and A.a To/from A.b Inter/intra-AS routing in gateway A.c To/from A.d

54 Intra-AS and Inter-AS routing
C.b Inter-AS routing between A and B B.a A.a Host2 b A.c c a a b B C a d Intra-AS routing within AS B c A b Intra-AS routing within AS A Host1

55 Chapter 4 outline 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

56 The Internet Network layer
Host, Router network-layer-functions: forwarding table Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer ICMP: Internet Control Message Protocol, RFC792

57 Internet Routing Protocol
Intra-AS: administrator responsible for choice of routing algorithm within network Also known as Interior Gateway Protocols (IGP) Most common Intra-AS routing protocols: RIP: Routing Information Protocol (RFCs1058,2453) It is a distance vector protocol. Routing updates are exchanged between neighbors app. Every 30sec. OSPF: Open Shortest Path First (RFC2328) (Open Spec.) IGRP: Interior Gateway Routing Protocol (Cisco proprietary) These are link-state protocol that uses flooding of link information and a Dijkstra least-cost path algorithm. Inter-AS: unique standard for inter-AS routing: BGP (RFC1771)

58 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 may have multiple interfaces IP addresses associated with each interface = 223 1 1 1

59 IP Addressing IP address:
network part (high order bits) host part (low order bits) What’s a network ? (from IP address perspective) device interfaces with same network part of IP address can physically reach each other without intervening router LAN network consisting of 3 IP networks

60 IP Addressing How to find the networks?
How to find the networks? Detach each interface from router, host create “islands of isolated networks Interconnected system consisting of six networks.

61 Getting a datagram from source to dest.
Dest. Net. Next Router Nhops forwarding table in A IP datagram: misc fields source IP addr dest data A E B datagram remains unchanged, as it travels source to destination addr fields of interest here

62 Getting a datagram from source to dest.
forwarding table in A misc fields data Dest. Net. Next Router Nhops Starting at A, send IP datagram addressed to B: look up net. address of B in forwarding table find B is on same net. as A link layer will send datagram directly to B inside link-layer frame B and A are directly connected E A B

63 Getting a datagram from source to dest.
forwarding table in A misc fields data Dest. Net. Next Router Nhops Starting at A, dest. E: look up network address of E in forwarding table E on different network A, E not directly attached routing table: next hop router to E is link layer sends datagram to router inside link-layer frame datagram arrives at continued….. A B E

64 Getting a datagram from source to dest.
Dest. Net Router Nhops Interface forwarding table in router misc fields data Arriving at , destined for look up network address of E in router’s forwarding table E on same network as router’s interface router, E directly attached link layer sends datagram to inside link-layer frame via interface datagram arrives at A E B

65 Private or Non-Routable addresses
Some addresses are reserved for use on local networks that are not connected to the Internet Routers do not consider these addresses to be valid Internet addresses, and will not route a packet to any of them These addresses may be used on private internets not directly connected to the Internet. / to / to / to

66 IP Addresses: Class-full
given notion of “network”, let’s re-examine IP addresses: “class-full” addressing: network host 110 A 10 B C D class to to to to 32 bits 1110 multicast address E to 1111 reserved format range

67 Class-full Summary

68 Address depletion In 1991 IAB identified 3 dangers
Running out of class B addresses Increase in nets has resulted in routing table explosion Increase in net/hosts exhausting 32 bit address space Four strategies to address Creative address space allocation {RFC 2050} Private addresses {RFC 1918}, Network Address Translation (NAT) {RFC 1631} Classless InterDomain Routing (CIDR) {RFC 1519} IP version 6 (IPv6) {RFC 1883}

69 Creative IP address allocation
Class A addresses 64 – 127 reserved Handle on individual basis Class B only assigned given a demonstrated need Class C divided up into 8 blocks allocated to regional authorities remains unassigned and unallocated Three main registries handle assignments APNIC – Asia & Pacific ARIN – N. & S. America, Caribbean & sub-Saharan Africa RIPE – Europe and surrounding areas Class B addresses require demonstrated need: subnetting plan for > 32 subnets, > 4096 hosts Multiregional Europe Others N. America Central/South America Pacific Rim Reserved APNIC=Asia pacific Network Information Center ARIN = American Registry for Internet Numbers RIPE NCC = Reseau IP Europeens

70 Private IP Addresses IP addresses that are not globally unique, but used exclusively in an organization Three ranges: a single class A net contiguous class Bs – contiguous class Cs Connectivity provided by Network Address Translator (NAT) translates outgoing private IP address to Internet IP address, and a return Internet IP address to a private address Only for TCP/UDP packets Must adhere to: Cannot be referenced by hosts in another organization Cannot be defined to any external router Cannot be advertised addresses, and connot forward IP datagrams containing those address to external routers External routers will quietly discard all routing information regarding these addresses

71 Special Purpose IP Addresses
Several Addresses within the classes are reserved for special use. :Source IP Addr. Just after Boot network part of dest. Addr.= 0 :Source and Destination are in same network. Dest. Addr.= :Broadcast in Sender’s network. host part of Dest.=111… : Broadcast in destination network. Dest. Addr. = 127.anything : Loop Back

72 Special Purpose Addresses-List
Address Block Present Use Reference /8 "This" Network [RFC1700, page 4] /8 Private-Use Networks [RFC1918] /8 Public-Data Networks [RFC1700, page 181] /8 Cable Television Networks /8 Reserved, subject to allocation [RFC1797] /8 Loop back [RFC1700, page 5] /16 Reserved but subject to allocation /16 Link Local – /12 Private-Use Networks [RFC1918] /16 Reserved but subject to allocation – / Reserved but subject to allocation – / Test-Net /24 6to4 Relay Anycast [RFC3068] /16 Private-Use Networks [RFC1918] /15 Network Interconnect Device Benchmark Testing [RFC2544] /24 Reserved but subject to allocation – / Multicast [RFC3171] /4 Reserved for Future Use [RFC1700]

73 Class Inter Domain Routing (CIDR)
Many organization have > 256 computers but few have more than several thousand Instead of giving class B (16384 nets) give sufficient contiguous class C addresses to satisfy needs < 256 addresses assign 1 class C < 8192 addresses assign 32 contiguous Class C nets

74 IP addressing: CIDR Classful addressing:
inefficient use of address space, address space exhaustion e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network CIDR: Classless Inter Domain Routing (RFC1519) network portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in network portion of address network part host /23

75 Bit Masks and Subnet Masks
In a production environment this prefix typically varies in length from 8 to 30 bits /8 = /9 = /10 = /11 = /12 = /13 = /14 = /15 = /16 = /17 = /18 = /19 = /20 = /21 = /22 = /23 = /24 = /25 = /26 = /27 = /28 = /29 = /30 = /31 = not usable /32 = not usable /30 yields two usable hosts and is used for WAN connections

76

77 Protocols Class-full Routing Protocols Classless Routing Protocol
RIP version1 RIP version2 IGPR EIGPR EGP OSPF BGP3 BGP4 IS-IS

78 Examples

79 IP addresses: how to get one?
Q: How does host get IP address? IP addr. is configures into host by admin. in a file Wintel: control-panel->network->configuration->tcp/ip->properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol (RFC2131): dynamically get address from as server “plug-and-play”

80 Subnetting (Extended Network Prefix)
Q: How an organization gets network part of IP addr? A: It gets allocated portion of its ISP’s address space. The ISP have been allocated the address block ISP's block /20 Organization /23 Organization /23 Organization /23 … … …. Organization /23 The ISP divides the block into 8 smaller addr. blocks (subnets) and gives them to 8 organization.

81 Hierarchical addressing: route aggregation
Hierarchical addressing allows efficient advertisement of routing information: Organization 0 route aggregation or route summarization. /23 Organization 1 “Send me anything with addresses beginning /20” /23 Organization 2 ISP1 /23 . /20 . Internet Organization 7 /23 ISP2 “Send me anything with addresses beginning /16” /16

82 Hierarchical addressing: more specific routes
ISP2 has a more specific route to Organization 1 The routers in Internet use a longest prefix matching rule, and route toward ISP2, as it advertises the longest (more specific) address prefix that matches the destination address.  Organization 0 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . ISP1 20 bits . Internet Organization 7 /23 “Send me anything with addresses beginning /16 or /23” ISP2 Organization 1 /23 23 bits

83 Subnet Mask-1 A subnet mask is applied to the host bits to determine how the network is subnetted, e.g. if the host is: , and the subnet mask is then the right hand 8 bits are for the host (255 is decimal for all bits set in an octet) Host addresses of all bits set or no bits set, indicate a broadcast, i.e. the packet is sent to all hosts.

84 Subnet Mask-2 ISP's block /20 ISP’s subnet mask Organization /23 Organization /23 Organization /23 … … …. Organization /23 Or’s subnet mask Network part of an IP address= subnet mask & IP address

85 IP addressing: ICANN Q: How does an ISP get block of addresses?
A: ICANN: Internet Corporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes

86 CIDR: Subneting Example
You are assigned the CIDR address /22 and you must support the network shown in the diagram. Create an addressing scheme that will meet the diagram requirements. 100 computers Objective: Create an addressing scheme using variable length subnet masking (VLSM). 100 computers 300 computers 100 computers

87 CIDR: Subneting Example (Questions)
Given the CIDR address /22 How many Class C networks do we have? 3 classes How many host addresses do we have? 4x254 addresses What is the largest LAN requirement? 300 addresses Host required - 300, 100, 100, 100, and 3 WAN links

88 255 255 255 255

89 255 /23 300 hosts

90 255 /23 300 hosts 127 128 /25 100 hosts /25

91 255 /23 300 hosts 127 128 /25 100 hosts /25 /25

92 255 /23 300 hosts 127 128 /25 100 hosts /25 /25 191 192 223 224 248 247 243 252 251 244 WAN links /30 240 239

93 CIDR: Subneting Example (Results)
Given the CIDR address /22 /25 1/2 Class C 100 computers /30 /30 /30 300 computers 100 computers /23 100 computers 2 Class C’s /25 /25 1/2 Class C 1/2 Class C

94 Supernetting Example-1
Company XYZ needs to address 400 hosts. Its ISP gives them two contiguous Class C addresses: /24 /24 Company XYZ can use a prefix of /23 to supernet these two contiguous networks. (Yielding 510 hosts) /23 23 bits in common

95 Supernetting Example-2
addressing authority of ISP,include XYZ, be advertized to Internet as a single supernt

96 CIDR and the Provider example of route aggregation
advertising address: a.b.c.d/x

97 32 bit destination IP address
IP datagram format IP protocol version Number[4bits] 32 bits total datagram length (bytes) head. len header length (bytes)[4bits] “type” of service ver length fragment offset fragmentation/ Reassembly/ DF, MF Flags 16-bit identifier flags “type” of data: Priority [3bits] Delay[1bit] Throughput[1bit] Reliability[1bit] time to live upper layer Checksum: 1’s add of 16bits words in header upper layer protocol to deliver payload to (rfc 1700) 32 bit source IP address max number remaining hops (decremented at each router) 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) 1 :ICMP 6 :TCP 17 :UDP how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead e.g. timestamp, record route taken, specify list of routers to visit. A packet is unique in Internet by: Id + S. IP Add + D. IP Add + Upper L.

98 IP Fragmentation & Reassembly
network links have MTU (max.transfer size) - largest possible link-level frame. different link types, different MTUs large IP datagram divided (“fragmented”) within net one datagram becomes several datagrams “reassembled” only at final destination IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly

99 IP Fragmentation and Reassembly
data 20 Byte 0……….3979 length =4000 ID =x fragflag =0 offset =0 Example 4000 byte datagram MTU = 1500 bytes 4000 Bytes 0……….1479 length =1500 ID =x fragflag =1 offset =0 1480…2959 One large datagram becomes 3 smaller datagrams. length =1500 ID =x fragflag =1 offset =1480 length =1040 ID =x fragflag =0 offset =2960

100 ICMP: Internet Control Message Protocol
Network managers or users identify network problems. One of the most frequently used debugging tools invokes the ICMP echo request and echo reply messages. A host or router sends an ICMP echo request message to a specified destination. The command users invoke to send ICMP echo requests is named ping. Sophisticated versions of ping send a series of ICMP echo requests, capture responses, and provide statistics about datagram loss. They allow the user to specify the length of the data being sent and the interval between requests. Less sophisticated versions merely send one ICMP echo request and await a reply.

101 ICMP (Cont.) Any machine that receives an echo request formulates an echo reply and returns it to the original sender. The request contains an optional data area; the reply contains a copy of the data sent in the request. The echo request and associated reply can be used to test whether a destination is reachable and responding. Because both the request and reply travel in IP datagrams, successful receipt of a reply verifies that major pieces of the transport system work. First, IP software on the source computer must route the datagram. Second, intermediate routers between the source and destination must be operating and must route the datagram correctly. Third, the destination machine must be running (at least it must respond to interrupts), and both ICMP and IP software must be working. Finally, all routers along the return path must have correct routes.

102 ICMP (Cont.) The Internet Control Message Protocol allows routers to send error or control messages to other routers or hosts; ICMP provides communication between the Internet Protocol software on one machine and the Internet Protocol software on another. When a datagram causes an error, ICMP can only report the error condition back to the original source of the datagram; the source must relate the error to an individual application program or take other action to correct the problem. Each ICMP message has its own format. They all begin with the same three fields: an 8-bit TYPE field that identifies the message, an 8-bit CODE field that provides further information about the message type, a 16-bit CHECKSUM field (ICMP uses the same additive checksum algorithm as IP, but the ICMP checksum only covers the ICMP message). In addition, ICMP messages that report errors always include the header and first 64 data bits of the datagram causing the problem.

103 ICMP: TYPE, CODE Type Code description 0 0 echo reply (ping)
dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header

104 ICMP’s Message Format: an example
ICMP echo request or reply message format. OPTIONAL DATA is a variable length field that contains data to be returned to the sender. An echo reply always returns exactly the same data as was received in the request. IDENTIFIER and SEQUENCE NUMBER are used by the sender to match replies to requests. The value of the TYPE field specifies whether the message is a request (8) or a reply (0). The ICMP message is encapsulated in an IP datagram, which is further encapsulated in a frame for transmission. To identify ICMP, the datagram protocol field contains the value 1.

105 DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on” Support for mobile users who want to join network (more shortly) DHCP overview: host broadcasts “DHCP discover” msg DHCP server responds with “DHCP offer” msg host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg

106 DHCP client-server scenario
DHCP server arriving DHCP client needs address in this network A B E

107 DHCP client-server scenario
arriving client DHCP server: DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs time

108 NAT: Network Address Translation
rest of Internet local network (e.g., home network) 10.0.0/24 All datagrams leaving local network have same single source NAT IP address: , different source port numbers Datagrams with source or destination in this network have /24 address for source, destination (as usual)

109 NAT: Network Address Translation
Motivation: local network uses just one IP address as far as outside word is concerned: no need to be allocated range of addresses from ISP: - just one IP address is used for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus).

110 NAT: Network Address Translation
Implementation: NAT router must: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

111 NAT: Network Address Translation
NAT translation table WAN side addr LAN side addr 1: host sends datagram to , 80 2: NAT router changes datagram source addr from , 3345 to , 5001, updates table , , 3345 …… …… S: , 3345 D: , 80 1 S: , 80 D: , 3345 4 S: , 5001 D: , 80 2 S: , 80 D: , 5001 3 4: NAT router changes datagram dest addr from , 5001 to , 3345 3: Reply arrives dest. address: , 5001

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

113 Chapter 4 Outline 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.5.1 Intra-AS routing: RIP and OSPF 4.5.2 Inter-AS routing: BGP 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

114 Routing in the Internet (RC1812) Requirements for IP Version 4 Routers
The Global Internet consists of Autonomous Systems (AS) interconnected with each other: Stub AS: small corporation: one connection to other AS’s Multihomed AS: large corporation (no transit): multiple connections to other AS’s Transit AS: provider, hooking many AS’s together Two-level routing: Intra-AS: administrator responsible for choice of routing algorithm within network Inter-AS: unique standard for inter-AS routing: BGP(RFC1771)

115 Internet AS Hierarchy Intra-AS border (exterior gateway) routers
C.b B.a A.a C b A.c c a a b a A B d c b Inter-AS (interior gateway) routers

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

117 RIP ( Routing Information Protocol)
Distance vector algorithm Included in BSD-UNIX Distribution in 1982 Distance metric: # of hops (max = 15 hops) Can you guess why? Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) Each advertisement: list of up to 25 destination nets within AS

118 RIP: Example z y x w A D B C y B 2 z B 7 x -- 1
Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x …. … Routing table in D

119 RIP: Example z y x w A D B y B 2 z B A 7 5 x -- 1 Advertisement
Dest Next hops w x z C 4 …. … Advertisement from A to D w x y z A D B Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B A 7 5 x …. … Routing table in D

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

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

122 RIP Table example (continued)
Router: giroflee.eurocom.fr Destination Gateway Flags Ref Use Interface UH lo0 U fa0 U le0 U qaa0 U le0 default UG Three attached class C networks (LANs) Router only knows routes to attached LANs Default router used to “go up” Route multicast address: Loopback interface (for debugging)

123 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 router Advertisements disseminated to entire AS (via flooding) Carried in OSPF messages directly over IP (rather than TCP or UDP

124 OSPF “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 metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) Integrated uni- and multicast support: Multicast OSPF (MOSPF) uses same topology data base as OSPF Hierarchical OSPF in large domains.

125 Hierarchical OSPF

126 Hierarchical OSPF Two-level hierarchy: local area, backbone.
Link-state advertisements only in area each 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.

127 Inter-AS routing in the Internet: BGP
( OSPF intra - AS AS1 AS2 routing) (RIP intra-AS routing) ( OSPF BGP intra - AS routing) R1 R2 Figure 4. 5.2 - new2 : BGP use for inter domain routing

128 Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto standard Path Vector protocol: similar to Distance Vector protocol each Border Gateway broadcast to neighbors (peers) entire path (i.e., sequence of AS’s) to destination BGP routes to networks (ASs), not individual hosts E.g., Gateway X may send its path to dest. Z: Path (X,Z) = X,Y1,Y2,Y3,…,Z

129 Internet inter-AS routing: BGP
Suppose: gateway X send its path to peer gateway W W may or may not select path offered by X cost, policy (don’t route via competitors AS), loop prevention reasons. If W selects path advertised by X, then: Path (W,Z) = w, Path (X,Z) Note: X can control incoming traffic by controlling it route advertisements to peers: e.g., don’t want to route traffic to Z -> don’t advertise any routes to Z

130 BGP: controlling who routes to you
A B C W X Y legend: provider network customer Figure 4.5- BGPnew : a simple BGP scenario 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

131 BGP: controlling who routes to you
A B C W X Y legend: provider network customer A advertises to B the path AW B advertises to W the path BAW Should B advertise to C the path BAW? 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!

132 BGP operation Q: What does a BGP router do?
Receiving and filtering route advertisements from directly attached neighbor(s). Route selection. To route to destination X, which path )of several advertised) will be taken? Sending route advertisements to neighbors.

133 BGP messages BGP messages exchanged using TCP. BGP messages:
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

134 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

135 Chapter 4 Outline 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

136 Router Architecture Overview
Two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) switching datagrams from incoming to outgoing link

137 Input Port Functions Decentralized switching: Physical layer:
bit-level reception Decentralized switching: given datagram dest., lookup output port using routing table in input port memory goal: complete input port processing at ‘line speed’ queuing: if datagrams arrive faster than forwarding rate into switch fabric Data link layer: e.g., Ethernet see chapter 5

138 Input Port Queuing Fabric slower that input ports combined -> queueing may occur at input queues Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward queueing delay and loss due to input buffer overflow!

139 Three Types of Switching Fabrics

140 Switching Via Memory First generation routers:
packet copied by system’s (single) CPU speed limited by memory bandwidth (2 bus crossings per datagram) Input Port Output Memory System Bus Modern routers: input port processor performs lookup, copy into memory Cisco Catalyst 8500

141 Switching Via a Bus datagram from input port memory
to output port memory via a shared bus bus contention: switching speed limited by bus bandwidth 1 Gbps bus, Cisco 1900: sufficient speed for access and enterprise routers (not regional or backbone)

142 Switching Via An Interconnection Network
overcome bus bandwidth limitations Banyan networks, other interconnection nets initially developed to connect processors in multiprocessor Advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric. Cisco 12000: switches Gbps through the interconnection network

143 Output Ports Buffering required when datagrams arrive from fabric faster than the transmission rate Scheduling discipline chooses among queued datagrams for transmission

144 Output port queuing buffering when arrival rate via switch exceeds output line speed queueing (delay) and loss due to output port buffer overflow!

145 Chapter 4 Outline 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

146 IPv6 Initial motivation: 32-bit address space completely allocated by 2008. Additional motivation: header format helps speed processing/forwarding header changes to facilitate QoS new “anycast” address: route to “best” of several replicated servers IPv6 datagram format: fixed-length 40 byte header no fragmentation allowed

147 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

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

149 Transition From IPv4 To IPv6
Not all routers can be upgraded simultaneous no “flag days” How will the network operate with mixed IPv4 and IPv6 routers? Two proposed approaches: Dual Stack: some routers with dual stack (v6, v4) can “translate” between formats Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

150 Dual Stack Approach A B C D E F IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 A-to-B:
Flow: X Src: A Dest: F data Src:A Dest: F data Flow: ?? Src: A Dest: F data Src:A Dest: F data A-to-B: IPv6 B-to-C: IPv4 B-to-C: IPv4 B-to-C: IPv6

151 Tunneling-Analogy A B E F Logical view: Analogy: tunnel IPv6 IPv6 IPv6

152 Tunneling-Physical View
B E F Logical view: tunnel IPv6 IPv6 IPv6 IPv6 A B C D E F Physical view: IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 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 Flow: X Src: A Dest: F data A-to-B: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 E-to-F: IPv6

153 RFC2474: Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers
Differentiated services are intended to enable deployment of scalable service discrimination in the Internet. Architecture is separated into two major components, one of which is fairly well-understood and the other of which is just beginning to be understood. Decision is made to separate the forwarding and routing components (as in original design of Internet). Packet forwarding is the relatively simple task that needs to be performed on a per-packet basis as quickly as possible. Forwarding uses the packet header to find an entry in a routing table that determines the packet's output interface. Routing sets the entries in that table and may need to reflect a range of transit and other policies as well as to keep track of route failures.

154 RFC2474 (cont) Routing tables are maintained as a background process to the forwarding task. Further, routing is the more complex task and it has continued to evolve over the past 20 years. Analogously, the differentiated services architecture contains two main components. One is the fairly well-understood behavior in the forwarding path and the other is the more complex and still emerging background policy and allocation component that configures parameters used in the forwarding path. The forwarding path behaviors include the differential treatment an individual packet receives, as implemented by queue service disciplines and/or queue management disciplines. These per-hop behaviors are useful and required in network nodes to deliver differentiated treatment of packets no matter how we construct end-to-end or intra-domain services. Focus is on the general semantics of the behaviors rather than the specific mechanisms used to implement them since these behaviors will evolve less rapidly than the mechanisms.

155 Chapter 4 roadmap 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

156 Multicast: one sender to many receivers
Multicast: act of sending datagram to multiple receivers with single “transmit” operation analogy: one teacher to many students Question: how to achieve multicast Multicast via unicast source sends N unicast datagrams, one addressed to each of N receivers routers forward unicast datagrams multicast receiver (red) not a multicast receiver (red)

157 Multicast: one sender to many receivers
Multicast: act of sending datagram to multiple receivers with single “transmit” operation analogy: one teacher to many students Question: how to achieve multicast Network multicast Router actively participate in multicast, making copies of packets as needed and forwarding towards multicast receivers Multicast routers (red) duplicate and forward multicast datagrams

158 Multicast: one sender to many receivers
Multicast: act of sending datagram to multiple receivers with single “transmit” operation analogy: one teacher to many students Question: how to achieve multicast Application-layer multicast end systems involved in multicast copy and forward unicast datagrams among themselves

159 Internet Multicast Service Model
multicast group Notes: The Internet multicast service model and addressing/group management ideas have their foundation in the PhD thesis of S. Deering: “Multicast Routing in a Datagram Network,” Dept. of Computer Science, Stanford University, 1991. 3.1 Network Layer: Introduction multicast group concept: use of indirection hosts addresses IP datagram to multicast group routers forward multicast datagrams to hosts that have “joined” that multicast group

160 Multicast groups class D Internet addresses reserved for multicast:
host group semantics: anyone can “join” (receive) multicast group anyone can send to multicast group no network-layer identification to hosts of members needed: infrastructure to deliver mcast-addressed datagrams to all hosts that have joined that multicast group Notes: 3.1 Network Layer: Introduction

161 Joining a multicast group: two-step process
local: host informs local mcast router of desire to join group: IGMP (Internet Group Management Protocol) wide area: local router interacts with other routers to receive mcast datagram flow many protocols (e.g., DVMRP, MOSPF, PIM) Notes: 3.2 Network Layer: Multicast Addressing and Group Management IGMP IGMP wide-area multicast routing IGMP

162 IGMP: Internet Group Management Protocol
host: sends IGMP report when application joins mcast group IP_ADD_MEMBERSHIP socket option host need not explicitly “unjoin” group when leaving router: sends IGMP query at regular intervals host belonging to a mcast group must reply to query Notes: 3.2 Network Layer: Multicast Addressing and Group Management query report

163 IGMP IGMP version 1 IGMP v2: additions include
router: Host Membership Query msg broadcast on LAN to all hosts host: Host Membership Report msg to indicate group membership randomized delay before responding implicit leave via no reply to Query RFC 1112 IGMP v2: additions include group-specific Query Leave Group msg last host replying to Query can send explicit Leave Group msg router performs group-specific query to see if any hosts left in group RFC 2236 IGMP v3: under development as Internet draft Notes: RFC-1112: S. Deering, “Host Extension for IP Multicasting,” August 1989 RFC 2236: R. Fenner, “Internet Group Management Protocol, Version 2”, November 1997. B. Cain, S. Deering, A. Thyagarajan, “Internet Group Management Protocol, Version 3,” work in progress, draft-ietf-idmr-igmp-v3-00.txt 3.2 Network Layer: Multicast Addressing and Group Management

164 Multicast Routing: Problem Statement
Goal: find a tree (or trees) connecting routers having local mcast group members tree: not all paths between routers used source-based: different tree from each sender to rcvrs shared-tree: same tree used by all group members Notes: 3.3 Network Layer: Multicast Routing Algorithms Source-based trees Shared tree

165 Approaches for building multicast trees
source-based tree: one tree per source shortest path trees reverse path forwarding group-shared tree: group uses one tree minimal spanning (Steiner) center-based trees Notes: 3.3 Network Layer: Multicast Routing Algorithms …we first look at basic approaches, then specific protocols adopting these approaches

166 Shortest Path Tree mcast forwarding tree: tree of shortest path routes from source to all receivers Dijkstra’s algorithm S: source LEGEND Notes: 3.3 Network Layer: Multicast Routing Algorithms R1 2 R4 router with attached group member 1 R2 5 router with no attached group member 3 4 R5 6 link used for forwarding, i indicates order link added by algorithm R3 i R6 R7

167 Reverse Path Forwarding
rely on router’s knowledge of unicast shortest path from it to sender each router has simple forwarding behavior: Notes: 3.3 Network Layer: Multicast Routing Algorithms if (mcast datagram received on incoming link on shortest path back to center) then flood datagram onto all outgoing links else ignore datagram

168 Reverse Path Forwarding: example
S: source LEGEND R1 R4 router with attached group member R2 router with no attached group member R5 Notes: 3.3 Network Layer: Multicast Routing Algorithms R3 datagram will be forwarded R6 R7 datagram will not be forwarded result is a source-specific reverse SPT may be a bad choice with asymmetric links

169 Reverse Path Forwarding: pruning
forwarding tree contains subtrees with no mcast group members no need to forward datagrams down subtree “prune” msgs sent upstream by router with no downstream group members LEGEND S: source Notes: 3.3 Network Layer: Multicast Routing Algorithms R1 router with attached group member R4 router with no attached group member R2 P P R5 prune message P links with multicast forwarding R3 R6 R7

170 Shared-Tree: Steiner Tree
Steiner Tree: minimum cost tree connecting all routers with attached group members problem is NP-complete excellent heuristics exists not used in practice: computational complexity information about entire network needed monolithic: rerun whenever a router needs to join/leave Notes: 1. See L. Wei and D. Estrin, “A Comparison of multicast trees and algorithms,” TR USC-CD , Dept. Computer Science, University of California, Sept 1993 for a comparison of heuristic approaches. 3.3 Network Layer: Multicast Routing Algorithms

171 Center-based trees single delivery tree shared by all
one router identified as “center” of tree to join: edge router sends unicast join-msg addressed to center router join-msg “processed” by intermediate routers and forwarded towards center join-msg either hits existing tree branch for this center, or arrives at center path taken by join-msg becomes new branch of tree for this router Notes: 1. It’s always nice to see a PhD dissertation with impact. The earliest discussion of center-based trees for multicast appears to be D. Wall, “Mechanisms for Broadcast and Selective Broadcast,” PhD dissertation, Stanford U., June 1980. 3.3 Network Layer: Multicast Routing Algorithms

172 Center-based trees: an example
Suppose R6 chosen as center: LEGEND R1 router with attached group member R4 3 Notes: 3.3 Network Layer: Multicast Routing Algorithms router with no attached group member R2 2 1 R5 path order in which join messages generated R3 1 R6 R7

173 Internet Multicasting Routing: DVMRP
DVMRP: distance vector multicast routing protocol, RFC1075 flood and prune: reverse path forwarding, source-based tree RPF tree based on DVMRP’s own routing tables constructed by communicating DVMRP routers no assumptions about underlying unicast initial datagram to mcast group flooded everywhere via RPF routers not wanting group: send upstream prune msgs Notes: D. Waitzman, S. Deering, C. Partridge, “Distance Vector Multicast Routing Protocol,” RFC 1075, Nov The version of DVMRP in use today is considerably enhanced over the RFC1075 spec. A more up-to-date “work-in-progress” defines a version 3 of DVMRP: T. Pusateri, “Distance Vector Multicast Routing Protocol,” work-in-progress, draft-ietf-idmr-v3-05.ps 3.4 Network Layer: Internet Multicast Routing Algorithms

174 DVMRP: continued… soft state: DVMRP router periodically (1 min.) “forgets” branches are pruned: mcast data again flows down unpruned branch downstream router: reprune or else continue to receive data routers can quickly regraft to tree following IGMP join at leaf odds and ends commonly implemented in commercial routers Mbone routing done using DVMRP Notes: 1. See for a (slightly outdatet) list of multicast capable routers (supporting DVMPR as well as other protocols) from various vendors. 2. ftp://parcftp.xerox.com/pub/net-research/ipmulti for circa 1996 public copy “mrouted” v3.8 of DVMRP routing software for various workstation routing platforms. 3.4 Network Layer: Internet Multicast Routing Algorithms

175 Tunneling Q: How to connect “islands” of multicast routers in a “sea” of unicast routers? Notes: For a general discussion of IP encapsulation, see C. Perkins, “IP Encapsulation within IP,” RFC 2003, Oct The book S. Bradner, A Mankin, “Ipng: Internet protocol next generation,” Addison Wesley, 1995 has a very nice discussion of tunneling Tunneling can also be used to connect islands of IPv6 capable routers in a sea IPv4 capable routers. The long term hope is that the sea evaporates leaving only lands of IPv6! 3.4 Network Layer: Internet Multicast Routing Algorithms physical topology logical topology 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

176 PIM: Protocol Independent Multicast
not dependent on any specific underlying unicast routing algorithm (works with all) two different multicast distribution scenarios : Dense: group members densely packed, in “close” proximity. bandwidth more plentiful Sparse: # networks with group members small wrt # interconnected networks group members “widely dispersed” bandwidth not plentiful Notes: a very readable discussion of the PIM architecture is S. Deering, D. Estrin, D. Faranacci, V. Jacobson, C. Liu, L. Wei, “The PIM Architecture for Wide Area Multicasting,” IEEE/ACM Transactions on Networking, Vol. 4, No. 2, April 1996. D. Estrin et al, PIM-SM: Protocol Specification, RFC 2117, June 1997 S. Deering et al, PIM Version 2, Dense Mode Specification, work in progress, draft-ietf-idmr-pim-dm-05.txt PIM is implemented in Cisco routers and has been deployed in UUnet as part of their streaming multimedia delivery effort. See S. LaPolla, “IP Multicast makes headway among ISPs,” PC Week On-Line, 3.4 Network Layer: Internet Multicast Routing Algorithms

177 Consequences of Sparse-Dense Dichotomy:
group membership by routers assumed until routers explicitly prune data-driven construction on mcast tree (e.g., RPF) bandwidth and non-group-router processing profligate Sparse: no membership until routers explicitly join receiver- driven construction of mcast tree (e.g., center-based) bandwidth and non-group-router processing conservative Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms

178 PIM- Dense Mode flood-and-prune RPF, similar to DVMRP but
underlying unicast protocol provides RPF info for incoming datagram less complicated (less efficient) downstream flood than DVMRP reduces reliance on underlying routing algorithm has protocol mechanism for router to detect it is a leaf-node router Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms

179 PIM - Sparse Mode center-based approach
router sends join msg to rendezvous point (RP) intermediate routers update state and forward join after joining via RP, router can switch to source-specific tree increased performance: less concentration, shorter paths R1 R4 join R2 join Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms R5 join R3 R7 R6 all data multicast from rendezvous point rendezvous point

180 PIM - Sparse Mode sender(s):
unicast data to RP, which distributes down RP-rooted tree RP can extend mcast tree upstream to source RP can send stop msg if no attached receivers “no one is listening!” R1 R4 join R2 join Notes: 3.4 Network Layer: Internet Multicast Routing Algorithms R5 join R3 R7 R6 all data multicast from rendezvous point rendezvous point

181 Chapter 4 roadmap 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

182 What is mobility? spectrum of mobility, from the network perspective:
no mobility high mobility mobile user, using same access point mobile user, connecting/ disconnecting from network using DHCP. mobile user, passing through multiple access point while maintaining ongoing connections (like cell phone)

183 Mobility: Vocabulary home network: permanent “home” of mobile
(e.g., /24) home agent: entity that will perform mobility functions on behalf of mobile, when mobile is remote wide area network Permanent address: address in home network, can always be used to reach mobile e.g., correspondent

184 Mobility: more vocabulary
visited network: network in which mobile currently resides (e.g., /24) Permanent address: remains constant (e.g., ) Care-of-address: address in visited network. (e.g., 79, ) wide area network home agent: entity in visited network that performs mobility functions on behalf of mobile. correspondent: wants to communicate with mobile

185 How do you contact a mobile friend:
I wonder where Ali moved to? Consider friend frequently changing addresses, how do you find her? search all phone books? call her parents? expect her to let you know where he/she is?

186 Mobility: approaches Let routing handle it: routers advertise permanent address of mobile-nodes-in-residence via usual routing table exchange. routing tables indicate where each mobile located no changes to end-systems Let end-systems handle it: indirect routing: communication from correspondent to mobile goes through home agent, then forwarded to remote direct routing: correspondent gets foreign address of mobile, sends directly to mobile

187 Mobility: approaches Let routing handle it: routers advertise permanent address of mobile-nodes-in-residence via usual routing table exchange. routing tables indicate where each mobile located no changes to end-systems let end-systems handle it: indirect routing: communication from correspondent to mobile goes through home agent, then forwarded to remote direct routing: correspondent gets foreign address of mobile, sends directly to mobile not scalable to millions of mobiles

188 Mobility: registration
visited network home network 1 mobile contacts foreign agent on entering visited network 2 foreign agent contacts home agent home: “this mobile is resident in my network” wide area network End result: Foreign agent knows about mobile Home agent knows location of mobile

189 Mobility via Indirect Routing
foreign agent receives packets, forwards to mobile home agent intercepts packets, forwards to foreign agent visited network home network 3 4 wide area network 1 2 correspondent addresses packets using home address of mobile mobile replies directly to correspondent

190 Indirect Routing: comments
Mobile uses two addresses: permanent address: used by correspondent (hence mobile location is transparent to correspondent) care-of-address: used by home agent to forward datagrams to mobile foreign agent functions may be done by mobile itself triangle routing: correspondent-home-network-mobile inefficient when correspondent, mobile are in same network

191 Forwarding datagrams to remote mobile
dest: foreign-agent-to-mobile packet dest: dest: packet sent by home agent to foreign agent: a packet within a packet Permanent address: Care-of address: dest: packet sent by correspondent

192 Indirect Routing: moving between networks
suppose mobile user moves to another network registers with new foreign agent new foreign agent registers with home agent home agent update care-of-address for mobile packets continue to be forwarded to mobile (but with new care-of-address) Mobility, changing foreign networks transparent: on going connections can be maintained!

193 Mobility via Direct Routing
foreign agent receives packets, forwards to mobile correspondent forwards to foreign agent visited network home network 4 wide area network 2 3 1 4 correspondent requests, receives foreign address of mobile mobile replies directly to correspondent

194 Mobility via Direct Routing: comments
overcome triangle routing problem non-transparent to correspondent: correspondent must get care-of-address from home agent What happens if mobile changes networks?

195 Mobile IP RFC 3220 has many features we’ve seen:
home agents, foreign agents, foreign-agent registration, care-of-addresses, encapsulation (packet-within-a-packet) three components to standard: agent discovery registration with home agent indirect routing of datagrams

196 Mobile IP: agent discovery
agent advertisement: foreign/home agents advertise service by broadcasting ICMP messages (typefield = 9) H,F bits: home and/or foreign agent R bit: registration required

197 Mobile IP: registration example
visited network: /24 home agent foreign agent ICMP agent adv. HA: COA: Mobile agent COA: 3.2 MA: …. registration req. registration req. COA: HA: COA: MA: HA: Lifetime: 9999 MA: identification:714 Lifetime: 9999 identification: 714 …. encapsulation format …. registration reply time registration reply HA: MA: HA: Lifetime: 4999 Identification: 714 MA: 6 encapsulation format Lifetime: 4999 …. Identification: 714 ….

198 Network Layer: summary
What we’ve covered: network layer services routing principles: link state and distance vector hierarchical routing IP Internet routing protocols RIP, OSPF, BGP what’s inside a router? IPv6 mobility


Download ppt "Computer Networks Network Layer"

Similar presentations


Ads by Google