50
Part IV Network Layer Protocols Routing IP Protocol Router Architectures

Part IV Network Layer Protocols

  • Upload
    jason

  • View
    37

  • Download
    0

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Page 1: Part IV Network Layer Protocols

Part IVNetwork Layer Protocols

Routing

IP Protocol

Router Architectures

Page 2: Part IV Network Layer Protocols

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

Network Layer Functions

Page 4: Part IV Network Layer Protocols

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

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

Virtual Circuit Vs. Datagram

Page 7: Part IV Network Layer Protocols

Internet Service Model

• Internet uses datagram service, 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 QoS services (IntServ and DiffServ)

Page 8: Part IV Network Layer Protocols

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 Principles

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

• Routing steps:

(a) determine destination’s network address

(b) compute/construct the path

(c) forward the packet to destination

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

path computation

Page 10: Part IV Network Layer Protocols

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 Alg Classification

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

• Centralized routing: a single node computes all routes• 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

• Static routing (manually edited routing tables) vs dynamic routing (automatically updated tables)

Page 12: Part IV Network Layer Protocols

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

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

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

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

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

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^2)

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

Page 18: Part IV Network Layer Protocols

Link State oscillatory behavior

• Route oscillations may occur if link cost depends on flow and thus on routes (in example below, cost=flow)

Solutions: flow independent costs; or, multipath routing

Page 19: Part IV Network Layer Protocols

Distance Vector routing alg

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

• Periodic DV exchange between neighbors

• Each node updates own DV using the min distance (via “best” neighbor) to destination

Page 20: Part IV Network Layer Protocols

DV code

At each node X:

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

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

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

DV table example

Page 24: Part IV Network Layer Protocols

DV convergence example

Page 25: Part IV Network Layer Protocols

Link cost change: good news

Page 26: Part IV Network Layer Protocols

Count-to-infinity problem

Page 27: Part IV Network Layer Protocols

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

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

Link State vs Distance Vector

• Message transmission complexity:

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

E = # of links; n=#of nodes

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

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

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 “hide” internal organization structure

Page 32: Part IV Network Layer Protocols

Hierarchical Routing (cont)

• Internet hierarchical routing: Autonomous Systems (AS) interconnected by gateway routers

• Intra-AS routing scheme: varies from AS to AS• Inter-AS routing scheme: same for the entire

Internet; it is run by Border Gateways

Page 33: Part IV Network Layer Protocols

Intra and inter-AS routing

Page 34: Part IV Network Layer Protocols

Gateway router

Page 35: Part IV Network Layer Protocols

Intra and inter-AS path

Page 36: Part IV Network Layer Protocols

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

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

Page 38: Part IV Network Layer Protocols

Addressing In IP (cont)

• 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 39: Part IV Network Layer Protocols

Hosts And Router Addresses

• Three LANs, with different addresses

• Router has three IP addresses

• Hosts/router on same LAN share the first three bytes in the address

223.1.1.4

223.1.2.9

223.1.3.27

Page 40: Part IV Network Layer Protocols

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 41: Part IV Network Layer Protocols

Address Classes

Or Host/Router Interface

Page 42: Part IV Network Layer Protocols

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

----

--

1 1 1

1 2 3

Page 43: Part IV Network Layer Protocols

IP Datagram Format (Cont.)

Page 44: Part IV Network Layer Protocols

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

Page 45: Part IV Network Layer Protocols

IP Datagram Format (cont)

• Time-to-live: to avoid delayed datagrams; count decremented by one after each hop; when it 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 (eg, source routing); more processing time variance

Page 46: Part IV Network Layer Protocols

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 travels to the destination separately, • The original datagram is reassembled at the

destination, and its payload passed to the transport layer

Page 47: Part IV Network Layer Protocols

IP Datagram Fragmentation

• Header fields used to support fragmentation:– Identification number: along with source and

destination IP addresses, uniquely identifies a datagram

– Fragmentation Offset: specifies the position (in the original datagram) of the first character in the fragment

– Flag: 1 => not the last fragment

Page 48: Part IV Network Layer Protocols

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 49: Part IV Network Layer Protocols

Internet Control Message Protocol (ICMP)

• Used 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• Traceroute utility uses ICMP messages: send IP

datagrams with specific TTL, thus forcing ICMP messages to be returned to sender host

Page 50: Part IV Network Layer Protocols

ICMP: more examples

• Other ICMP 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