part iv network layer protocols routing ip protocol router architectures

46
Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Upload: carmella-griffith

Post on 28-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Part IVNetwork Layer Protocols

Routing

IP Protocol

Router Architectures

Page 2: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Network Layer Functions• Determine the routes to be taken by datagrams using routing

algorithms such as Link State, Distance Vector, Hierarchical Routing, multicast routing

• Switch packets arriving on an input port to the output port specified by the routing algorithms

• In case of connection oriented services (ATM), implement Call Setup and Virtual Circuit mechanisms and maintain information related to set-up VCs

Page 3: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Network Layer Functions

Page 4: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Virtual Circuit (VC) Service

common route followed by all packets of a connection, thus providing in-order packet delivery to a destination

VC phases:

VC Set-up: source to destination route is selected, tables entries are inserted indicating the VC numbers and incoming/outgoing ports; resources may be reserved for this connection (eg buffer space)

Data Transfer: data packets flow over the selected route, headers indicate the VC numbers

VC tear-down: either side can request tear-down, other side is informed, and resources are released

Signaling Messages and Signaling Protocol: used to set-up and tear-down VCs

Page 5: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Datagram Service

• No connection set-up and tear-down, thus routers do not have to maintain any connection state information

• Packets carry source and destination addresses and are switched in a router based on the destination address

• packets may follow different end-to-end routes, and thus may arrive out of order

Page 6: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Virtual Circuit Vs. Datagram

Page 7: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Internet Service Model

• Internet uses datagram, while ATM uses VC service

• Internet provides only one type of datagram service, sometimes called best effort; ie no guarantees regarding in-order delivery, throughput, end to end average delay, jitter, or just plain delivery!

• Researchers are currently working to add differentiated services

Page 8: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

ATM Service Models

• 4 service classes for a user connection:

– Constant Bit Rate (CBR): connection looks like a dedicated wire; guarantees bdw and upper bounds on loss rate, delay, jitter; suitable for real-time applications (digitized voice)

– Unspecified Bit Rate (UBR): guarantees only in-order delivery; suited for interactive traffic (email, newsgroups)

– Available Bit Rate (ABR): guarantees a minimum transmission rate, but if bandwidth is available, user may exceed that rate up to some peak cell rate (suitable for Web browsing)

– Variable Bit Rate (VBR): provides guarantees as in CBR, but user can vary cell rate; suitable for compressed video applications

Page 9: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Routing Principles

• Routing: delivering a packet to its destination on the best possible path

• Routing steps:

(a) determine node network address

(b) compute/construct the path

(c) forward the packet to destination

Here, we will focus on (b) - routing alg. for

path computation

Page 10: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Routing Alg Requirements

• Find path with min delay, cost or other metric

• dynamic reconfiguration after failures/changes

• adaptive load balancing

Page 11: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Routing Alg Classification

• Global routing (eg, Link State): each node knows complete topology (connectivity, link costs etc); it individually computes all routes (“centralized” computation)

• Distributed (decentralized) routing (eg, Distance Vector): no node has global topology knowledge. Totally distributed route computation. Gradual computation of routes via exchange of route tables among neighbors

• Also static routing (manually edited routing tables) vs dynamic routing (automatically updated tables)

Page 12: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Link State Routing

• Each router measures the “costs” (eg, delay, bdw, pkt loss etc.) of its attached links

• Periodically (or upon link change/failure) it packs the link costs in a Link State (LS) pkt, and broadcasts the LS pkt to its neighbors

• The neighbors will in turn broadcast the LS pkt to their neighbors and so on until all nodes have heard the pkt (propagation via flooding)

• Duplicate pkts are detected and dropped based on source ID and unique sequence number

Page 13: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Link State Routing (cont)

• At steady state, each router has received the LS updates from all other routers

• It can build a complete network topology and link cost map (identical for all routers)

• Next, it computes routes from itself to all other nodes in the network (using, for example, Dijkstra’s Alg). It creates a routing table with such routes

• Routing tables at different nodes are all consistent since they are based on the same topology/cost data base

• LS routing protocol used in OSPF intradomain routing

Page 14: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Dijkstra Shortest Path Alg

Notation:

• c(i,j) be cost of link (i,j);

• D(v) cost of path from source A to v;

• p(v) previous node on shortest path from A to v

Page 15: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Dijkstra’s Alg (cont)1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 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: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

Page 16: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

step N D(B),p(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),p(F)

0 A 2,A 5,A 1,A infty infty

1 AD 2,A 4,D 2,D infty

2 ADE 2,A 3,E 4,E

3 ADEB 3E 4E

4 ADEBC 4E

5 ADEBCF

Page 17: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Dijkstra’s Alg Complexity

• Assume the set of nodes is stored as a linear array

• To find the node not in N, with min distance from A, it requires O(n) operations

• The above step is repeated n times, thus total complexity

is O(n)

• Using sorted heap instead of linear array, the complexity is reduced to O(n lgn)

Page 18: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Link State oscillatory behavior

• Route oscillations may occur if link cost depends on flow and thus on routes.

Page 19: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Distance Vector routing alg

• Distance Vector (DV): vector of distances to all destinations

• Periodically, each nodes receives from neighbors their respective DVs

• It adds to each DV entry the link cost to neighbor

• It updates own DV using the min distance (via any of the neighbors) to each destination

• It creates Routing Vector: vector of next hops to each destination following min distance path.

Page 20: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

DV code

Initialization: 2 for all adjacent nodes v: 3 DX(*,v) = infty /* the * operator means "for all rows" */ 4 DX(v,v) = c(X,v) 5 for all destinations, y 6 send minwD(y,w) to each neighbor /* w over all X's neighbors */7 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */

Page 21: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

DV code (cont’d)

14 /* note: d could be positive or negative */ 15 for all destinations y: DX(y,V) = DX(y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its minw DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: DX(Y,V) = c(X,V) + newval22 23 if we have a new minw DX(Y,w)for any destination Y 24 send new value of minw DX(Y,w) to all neighbors 25 26 forever

Page 22: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Bellman Ford Alg

• The algorithm used to compute DVs is the Bellman Ford (B-F) Algorithm

• For DV computation, we have used a “decentralized” version of the B-F algorithm

• The B-F based DV routing algorithm is used in many network routing protocols: BGP, ISO IDRP, RIP, Novell IPX, original ARPANET, Packet Radio net, etc.

Page 23: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

DV table example

Page 24: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

DV convergence example

Page 25: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Link cost change: good news

Page 26: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Count-to-infinity problem

Page 27: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Poison Reverse• If node Z uses next node Y to get to X, Z will advertises

D(X) = 00 to Y

Page 28: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Poison Reverse (cont)

• Note: loops with 3 or more nodes (instead of ping-pong) not detected by Poison Reverse

• Solution? Path Vector: advertise not only the distance to destination, but the entire path to destination

• Path vector used in internet BGP (interdomain routing)

Page 29: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Link State vs Distance Vector

• Message complexity:

For each cycle, O(nE) for both LS and DV, where

E = # of links

However, LS propagates change to ALL nodes; DV only to nodes affected by change

• Speed of Convergence:

LS updates propagate much faster than DV updates; this is one of the reasons why ARPANET dumped DV for LS in 1979

Page 30: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Link State vs Distance Vector (cont)

• Robustness:

both LS and DV tolerant of changes/failure; LS better protected against router mulfunctions (wrong path computation); the error remains local in LS; it affects the entire network in DV

• QoS support:

in LS, complete topology map allows router to compute paths with QoS constraints (Q-OSPF)

• Implementation cost:

LS requires more memory and more processing

Page 31: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Hierarchical Routing

• Routing hierarchy needed for:• Scaling: “flat” routing tables (DV) and topology maps

(LS) grow too large. Message and computation O/H excessive

• Local autonomy: different organizations (eg, Campus, company, ISP) wish to operate own network and to “hide” internal organization structure

Page 32: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Hierarchical Routing (cont)

• Solution: Autonomous Systems (AS) interconnected by gateway routers

• Intra-AS routing: varies from AS to AS• Inter-AS routing: same for the entire Internet; it is

run by Border Gateways

Page 33: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Intra and inter-AS routing

Page 34: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Gateway router

Page 35: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Intra and inter-AS path

Page 36: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Internet Protocol (IP)

• Connectionless datagram service (like US Post Service)• No performance guarantees, not even delivery guarantee• No guarantee of in-order delivery of datagrams• Components of network layer:

– IP Protocol– Routing Protocols

Page 37: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Addressing In IP• A host is typically connected via one link/interface to the network

• A router is typically connected by more than one link to the network

• Machines on the network will have as many addresses as there are links that connect them to the network, thus routers have more than one IP address, while hosts typically have one IP address

• IP Address is 32 bit long, expressed (for convenience to humans) in dot-decimal notation; eg 193.32.216.9

• Address space is managed by IANA (Internet Assigned Number Authority), and its regional registries: ARIN (American Registry for Internet Addresses: North and South America and Parts of Africa!), RIPE (Reseaux IP Europeans), APNIC (Asia Pacific Net Info Center)

• Address is either entered manually or by a protocol: BOOTP and more recently Dynamic Host Configuration Protocol (DHCP)

• Open issue: IP address for mobile host

Page 38: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Hosts And Router Addresses

• Router has three IP addresses

• Hosts/router interface on a network (LAN in the example above) share the first three bytes in the address; e.g. 223.1.3 for the rightmost LAN

223.1.1.4

223.1.2.9

223.1.3.27

Page 39: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Addresses In Interconnected Networks

This example has three LANs with IP addresses: 223.1.1, 223.1.2, 223.1.3; and three other networks (or subnets) with addresses: 223.1.7, 223.1.8, 223.1.9

Page 40: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Address Classes

Or Host/Router Interface

Page 41: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

IP Datagram Forwarding • Every IP datagram has an IP header including source and destination IP

addresses; Hosts/Routers have routing tables; for example:

223.1.1.4

223.1.2.9

223.1.3.27

Dest Net

NextRouter

#Hops

223.1.1223.1.2223.1.3

--223.1.1.4223.1.1.4

122

Routing Table In Host A Routing Table In RouterDest Net

NextRouter

#Hops Interface

223.1.1223.1.2223.1.3

----223.1.1.4

1 1 1

1 2 3

Page 42: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

IP Datagram Format• Version Number: allows coexistence of more than one version; router

forwards the arriving datagram for processing to the appropriate version of IP

• Header Length: to accommodate a variable number of Option fields• TOS: type of service, various interpretations• Length: header + data in bytes, 16 bits• Identifier, Flags, Fragmentation Offset: used in Fragmentation, TBD• Time-to-live: to avoid delayed datagrams; count decremented by one

after each hop, when reaches zero, datagram is dropped• Protocol: indicates the Transport Layer protocol to which the datagram

belongs, at the destination, the appropriate protocol software• Checksum: for header only, if error detected, the datagram is dropped,

recomputed at each router• Options: extend IP header when needed; increase processing time

variance

Page 43: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

IP Datagram Format (Cont.)

Page 44: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

IP Datagram Fragmentation• Links along a route may use different link layer protocols, possibly

with differing maximum frame size (called Maximum Transfer Unit, or MTU)

• A router which receives a datagram on one link, and has to forward on another link with smaller MTU ‘fragments’ the datagram

• Each fragment travel to the destination separately, and the original datagram is reassembled as the destination, and its payload passed to the transport layer

• Header fields used to support fragmentation:– Identification number: along with source and destination IP addresses,

uniquely identify a datagram– Fragmentation Offset: specify the position (in the original datagram) of

the first character in the fragment– Flag: 1 => not the last fragment

Page 45: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Fragmentation Example1st fragment

1480 bytes in the data field of the IP datagram.

identification = 777

offset = 0 (meaning the data should be inserted beginning at byte 0)

flag = 1 (meaning there is more)

2nd fragment

1480 byte information field

identification = 777

offset = 1,480 (meaning the data should be inserted beginning at byte 1,480

flag = 1 (meaning there is more)

3rd fragment

1020 byte (=3980-1480-1480) information field

identification = 777

offset = 2,960 (meaning the data should be inserted beginning at byte 2,960)

flag = 0 (meaning this is the last fragment)

Page 46: Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Internet Control Message Protocol (ICMP)

• Use by network nodes to exchange control information such as error messages, and for simple testing operations (eg, ping)

• ICMP messages are carried in IP datagrams

• Example messages:– echo request (ping)– echo reply (response to ping)– destination host unreachable– destination network unreachable– source quench (congestion control)– TTL expired (sent to source of datagram which was dropped due to TTL)– IP header bad

• Traceroute utility uses ICMP messages: send IP datagrams with specific TTL, thus forcing ICMP messages to be returned to sender host