chapter 7 packet-switching networks - sfu.ca · 2014-12-15 · chapter 7 packet-switching networks...

83
Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation Packet Network Topology Datagrams and Virtual Circuits Routing in Packet Networks Shortest Path Routing ATM Networks Traffic Management

Upload: others

Post on 29-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks Network Services and Internal Network

Operation Packet Network Topology

Datagrams and Virtual Circuits Routing in Packet Networks

Shortest Path Routing ATM Networks

Traffic Management

Page 2: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Network Services and Internal Network Operation

Page 3: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Network Layer

l  Network Layer: the most complex layer l  Requires the coordinated actions of multiple,

geographically distributed network elements (switches & routers)

l  Must be able to deal with very large scales l  Billions of users (people & communicating devices)

l  Biggest Challenges l  Addressing: where should information be directed to? l  Routing: what path should be used to get information

there?

Page 4: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

End system β Physical

layer

Data link layer

Physical layer

Data link layer End

system α

Network layer

Network layer

Physical layer

Data link layer

Network layer

Physical layer

Data link layer

Network layer

Transport layer

Transport layer

Messages Messages

Segments

Network service

Network service

Network Service

l  Network layer can offer a variety of services to transport layer l  Connection-oriented service or connectionless service l  Best-effort or delay/loss guarantees

Page 5: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Network Layer Functions Essential l  Routing: mechanisms for determining the

set of best paths for routing packets requires the collaboration of network elements

l  Forwarding: transfer of packets from NE inputs to outputs

l  Priority & Scheduling: determining order of packet transmission in each NE

Optional: congestion control, segmentation & reassembly, security

Page 6: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Packet Network Topology

Page 7: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

End-to-End Packet Network l  Packet networks very different than telephone

networks l  Individual packet streams are highly bursty

l  Statistical multiplexing is used to concentrate streams

l  User demand can undergo dramatic change l  Peer-to-peer applications stimulated huge growth in traffic

volumes

l  Internet structure highly decentralized l  Paths traversed by packets can go through many networks

controlled by different organizations l  No single entity responsible for end-to-end service

Page 8: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Home LANs

l  Home Router l  LAN Access using Ethernet or WiFi (IEEE 802.11) l  Private IP addresses in Home (192.168.0.x) using Network

Address Translation (NAT) l  Single global IP address from ISP issued using Dynamic

Host Configuration Protocol (DHCP)

Home Router

To packet

network

WiFi

Ethernet

Page 9: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

LAN Concentration

l  LAN Hubs and switches in the access network also aggregate packet streams that flows into switches and routers

l l l l l l l l l l l l

Switch / Router

Page 10: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

R R

R R S

S S

s

s s

s

s s

s

s s

s

R

s

R

Backbone

To Internet or wide area

network

Organization Servers

Departmental Server

Gateway

Campus Network

Only outgoing packets leave LAN through router

High-speed campus backbone net connects dept routers

Servers have redundant connectivity to backbone

Page 11: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Interdomain level

Intradomain level

Autonomous system or domain

Border routers

Border routers

Internet service provider

s

s s LAN

Connecting to Internet Service Provider

Campus Network

network administered by single organization

Page 12: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

National Service Provider A

National Service Provider B

National Service Provider C

NAP NAP

Private peering

Internet Backbone

l  Network Access Points: set up during original commercialization of Internet to facilitate exchange of traffic

l  Private Peering Points: two-party inter-ISP agreements to exchange traffic

Page 13: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Key Role of Routing How to get packet from here to there? l  Decentralized nature of Internet makes

routing a major challenge l  Interior gateway protocols (IGPs) are used to

determine routes within a domain l  Exterior gateway protocols (EGPs) are used to

determine routes across domains l  Routes must be consistent & produce stable flows

l  Scalability required to accommodate growth l  Hierarchical structure of IP addresses essential to

keeping size of routing tables manageable

Page 14: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Datagrams and Virtual Circuits

Page 15: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Long Messages vs. Packets

l  Approach 1: send 1 Mbit message

l  Probability message arrives correctly

l  On average it takes about 3 transmissions/hop

l  Total # bits transmitted ≈ 6 Mbits

1 Mbit message source dest

BER=p=10-6 BER=10-6

How many bits need to be transmitted to deliver message?

l  Approach 2: send 10 100-kbit packets

l  Probability packet arrives correctly

l  On average it takes about 1.1 transmissions/hop

l  Total # bits transmitted ≈ 2.2 Mbits

3/1)101( 11010106 666

≈=≈−= −−− −

eePc 9.0)101( 1.01010106 655

≈=≈−=ʹ′ −−− −

eePc

Page 16: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Packet Switching - Datagram l  Messages broken into

smaller units (packets) l  Source & destination

addresses in packet header l  Connectionless, packets

routed independently (datagram)

l  Packet may arrive out of order

l  Pipelining of packets across network can reduce delay, increase throughput

l  Lower delay that message switching, suitable for interactive traffic

Packet 2

Packet 1

Packet 1

Packet 2

Packet 2

Page 17: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Destination address Output

port

1345 12

2458

7 0785

6

12

1566

Routing Tables in Datagram Networks

l  Route determined by table lookup

l  Routing decision involves finding next hop in route to given destination

l  Routing table has an entry for each destination specifying output port that leads to next hop

l  Size of table becomes impractical for very large number of destinations

Page 18: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Example: Internet Routing l  Internet protocol uses datagram packet

switching across networks l  Networks are treated as data links

l  Hosts have two-port IP address: l  Network address + Host address

l  Routers do table lookup on network address l  This reduces size of routing table

l  In addition, network addresses are assigned so that they can also be aggregated l  Discussed as CIDR in Chapter 8

Page 19: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Datagrams and Virtual Circuits Structure of a Packet Switch

Page 20: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Controller

1 2

3

N

Line card

Line card

Line card

Line card

Inte

rcon

nect

ion

fabr

ic

Line card

Line card

Line card

Line card

1 2

3

N

Input ports Output ports

Data path Control path (a)

Generic Packet Switch “Unfolded” View of Switch l  Ingress Line Cards

l  Header processing l  Demultiplexing l  Routing in large switches

l  Controller l  Routing in small switches l  Signalling & resource

allocation l  Interconnection Fabric

l  Transfer packets between line cards

l  Egress Line Cards l  Scheduling & priority l  Multiplexing

Page 21: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Routing in Packet Networks

Page 22: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

1

2

3

4

5

6

Node (switch or router)

Routing in Packet Networks

l  Three possible (loopfree) routes from 1 to 6: l  1-3-6, 1-4-5-6, 1-2-5-6

l  Which is “best”? l  Min delay? Min hop? Max bandwidth? Min cost?

Max reliability?

Page 23: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Creating the Routing Tables

l  Need information on state of links l  Link up/down; congested; delay or other metrics

l  Need to distribute link state information using a routing protocol l  What information is exchanged? How often? l  Exchange with neighbors; Broadcast or flood

l  Need to compute routes based on information l  Single metric; multiple metrics l  Single route; alternate routes

Page 24: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Routing Algorithm Requirements

l  Responsiveness to changes l  Topology or bandwidth changes, congestion l  Rapid convergence of routers to consistent set of routes l  Freedom from persistent loops

l  Optimality l  Resource utilization, path length

l  Robustness l  Continues working under high load, congestion, faults,

equipment failures, incorrect implementations l  Simplicity

l  Efficient software implementation, reasonable processing load

Page 25: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

0000 0111 1010 1101

0001 0100 1011 1110

0011 0101 1000 1111

0011 0110 1001 1100

R1

1

2 5

4

3

0000 1 0111 1 1010 1 … …

0001 4 0100 4 1011 4 … …

R2

Non-Hierarchical Addresses and Routing

l  No relationship between addresses & routing proximity

l  Routing tables require 16 entries each

Page 26: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

0000 0001 0010 0011

0100 0101 0110 0111

1100 1101 1110 1111

1000 1001 1010 1011

R1 R2

1

2 5

4

3

00 1 01 3 10 2 11 3

00 3 01 4 10 3 11 5

Hierarchical Addresses and Routing

l  Prefix indicates network where host is attached

l  Routing tables require 4 entries each

Page 27: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Specialized Routing

l  Flooding l  Useful in starting up network l  Useful in propagating information to all nodes

l  Deflection Routing l  Fixed, preset routing procedure l  No route synthesis

Page 28: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Flooding

Send a packet to all nodes in a network l  No routing tables available l  Need to broadcast packet to all nodes (e.g.

to propagate link state information)

Approach l  Send packet on all ports except one where it

arrived l  Exponential growth in packet transmissions

Page 29: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

1

2

3

4

5

6

Flooding is initiated from Node 1: Hop 1 transmissions

Page 30: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

1

2

3

4

5

6

Flooding is initiated from Node 1: Hop 2 transmissions

Page 31: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

1

2

3

4

5

6

Flooding is initiated from Node 1: Hop 3 transmissions

Page 32: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Shortest Path Routing

Page 33: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Shortest Paths & Routing

l  Many possible paths connect any given source and to any given destination

l  Routing involves the selection of the path to be used to accomplish a given transfer

l  Typically it is possible to attach a cost or distance to a link connecting two nodes

l  Routing can then be posed as a shortest path problem

Page 34: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Routing Metrics Means for measuring desirability of a path l  Path Length = sum of costs or distances l  Possible metrics

l  Hop count: rough measure of resources used l  Reliability: link availability; BER l  Delay: sum of delays along path; complex & dynamic l  Bandwidth: “available capacity” in a path l  Load: Link & router utilization along path l  Cost: $$$

Page 35: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Shortest Path Approaches

Distance Vector Protocols l  Neighbors exchange list of distances to destinations l  Best next-hop determined for each destination l  Ford-Fulkerson (distributed) shortest path algorithm Link State Protocols l  Link state information flooded to all routers l  Routers have complete topology information l  Shortest path (& hence next hop) calculated l  Dijkstra (centralized) shortest path algorithm

Page 36: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Shortest Path to SJ

i j

San Jose

Cij

Dj

Di If Di is the shortest distance to SJ from i and if j is a neighbor on the shortest path, then Di = Cij + Dj

Focus on how nodes find their shortest path to a given destination node, i.e. SJ

Page 37: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

i only has local info from neighbors

Dj"

Cij”

i

San Jose

j Cij

Dj

Di j"

Cij'

j' Dj'

Pick current shortest path

But we don’t know the shortest paths

Page 38: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Why Distance Vector Works

San Jose 1 Hop

From SJ 2 Hops From SJ 3 Hops

From SJ

Accurate info about SJ ripples across network,

Shortest Path Converges

SJ sends accurate info

Hop-1 nodes calculate current (next hop, dist), & send to neighbors

Page 39: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Bellman-Ford Algorithm l  Consider computations for one destination d l  Initialization

l  Each node table has 1 row for destination d l  Distance of node d to itself is zero: Dd=0 l  Distance of other node j to d is infinite: Dj=∝, for j≠ d l  Next hop node nj = -1 to indicate not yet defined for j ≠ d

l  Send Step l  Send new distance vector to immediate neighbors across local link

l  Receive Step l  At node j, find the next hop that gives the minimum distance to d,

l  Minj { Cij + Dj } l  Replace old (nj, Dj(d)) by new (nj*, Dj*(d)) if new next node or distance

l  Go to send step

Page 40: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Bellman-Ford Algorithm l  Now consider parallel computations for all destinations d l  Initialization

l  Each node has 1 row for each destination d l  Distance of node d to itself is zero: Dd(d)=0 l  Distance of other node j to d is infinite: Dj(d)= ∝ , for j ≠ d l  Next node nj = -1 since not yet defined

l  Send Step l  Send new distance vector to immediate neighbors across local link

l  Receive Step l  For each destination d, find the next hop that gives the minimum

distance to d, l  Minj { Cij+ Dj(d) } l  Replace old (nj, Di(d)) by new (nj*, Dj*(d)) if new next node or distance

found l  Go to send step

Page 41: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞)

1 2 3

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5 San Jose

Table entry @ node 1 for dest SJ

Table entry @ node 3 for dest SJ

Page 42: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞)

1 (-1, ∞) (-1, ∞) (6,1) (-1, ∞) (6,2)

2 3

San Jose

D6=0

D3=D6+1 n3=6

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5

D6=0 D5=D6+2 n5=6

0

2

1

Page 43: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞)

1 (-1, ∞) (-1, ∞) (6, 1) (-1, ∞) (6,2)

2 (3,3) (5,6) (6, 1) (3,3) (6,2)

3

San Jose

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5 0

1

2

3

3

6

Page 44: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞) (-1, ∞)

1 (-1, ∞) (-1, ∞) (6, 1) (-1, ∞) (6,2)

2 (3,3) (5,6) (6, 1) (3,3) (6,2)

3 (3,3) (4,4) (6, 1) (3,3) (6,2)

San Jose

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5 0

1

2 6

3

3

4

Page 45: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (3,3) (4,4) (6, 1) (3,3) (6,2)

1 (3,3) (4,4) (4, 5) (3,3) (6,2)

2 3

San Jose

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5 0

1

2

3

3

4

Network disconnected; Loop created between nodes 3 and 4

5

Page 46: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (3,3) (4,4) (6, 1) (3,3) (6,2)

1 (3,3) (4,4) (4, 5) (3,3) (6,2)

2 (3,7) (4,4) (4, 5) (5,5) (6,2)

3

San Jose

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5 0

2

5

3

3

4

7

5

Node 4 could have chosen 2 as next node because of tie

Page 47: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

Initial (3,3) (4,4) (6, 1) (3,3) (6,2)

1 (3,3) (4,4) (4, 5) (3,3) (6,2)

2 (3,7) (4,4) (4, 5) (5,5) (6,2)

3 (3,7) (4,6) (4, 7) (5,5) (6,2)

San Jose

3 1

5

4 6

2

2

3

4

2

1

1

2

3

5 0

2

5

5 7

4

7

6 Node 2 could have chosen 5 as next node because of tie

Page 48: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

3

5

4 6

2

2

3

4

2

1

1

2

3

5 1

Iteration Node 1 Node 2 Node 3 Node 4 Node 5

1 (3,3) (4,4) (4, 5) (3,3) (6,2)

2 (3,7) (4,4) (4, 5) (2,5) (6,2)

3 (3,7) (4,6) (4, 7) (5,5) (6,2)

4 (2,9) (4,6) (4, 7) (5,5) (6,2)

San Jose

0

7 7

5

6

9

2

Node 1 could have chose 3 as next node because of tie

Page 49: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

3 1 2 4 1 1 1

3 1 2 4 1 1

X

(a)

(b)

Update Node 1 Node 2 Node 3

Before break (2,3) (3,2) (4, 1)

After break (2,3) (3,2) (2,3)

1 (2,3) (3,4) (2,3)

2 (2,5) (3,4) (2,5)

3 (2,5) (3,6) (2,5)

4 (2,7) (3,6) (2,7)

5 (2,7) (3,8) (2,7)

… … … …

Counting to Infinity Problem Nodes believe best path is through each other (Destination is node 4)

Page 50: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Problem: Bad News Travels Slowly Remedies l  Split Horizon

l  Do not report route to a destination to the neighbor from which route was learned

l  Poisoned Reverse l  Report route to a destination to the neighbor

from which route was learned, but with infinite distance

l  Breaks erroneous direct loops immediately l  Does not work on some indirect loops

Page 51: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

3 1 2 4 1 1 1

3 1 2 4 1 1

X

(a)

(b)

Split Horizon with Poison Reverse

Nodes believe best path is through each other

Update Node 1 Node 2 Node 3 Before break (2, 3) (3, 2) (4, 1) After break (2, 3) (3, 2) (-1, ∞) Node 2 advertizes its route to 4 to

node 3 as having distance infinity; node 3 finds there is no route to 4

1 (2, 3) (-1, ∞) (-1, ∞) Node 1 advertizes its route to 4 to node 2 as having distance infinity; node 2 finds there is no route to 4

2 (-1, ∞) (-1, ∞) (-1, ∞) Node 1 finds there is no route to 4

Page 52: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Link-State Algorithm l  Basic idea: two step procedure

l  Each source node gets a map of all nodes and link metrics (link state) of the entire network

l  Find the shortest path on the map from the source node to all destination nodes

l  Broadcast of link-state information l  Every node i in the network broadcasts to every other node

in the network:

l  ID’s of its neighbors: Ni=set of neighbors of i l  Distances to its neighbors: {Cij | j ∈Ni}

l  Flooding is a popular method of broadcasting packets

Page 53: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Dijkstra Algorithm: Finding shortest paths in order

s

w

w"

w'

Closest node to s is 1 hop away

w"

x

x'

2nd closest node to s is 1 hop away from s or w”

x z

z'

3rd closest node to s is 1 hop away from s, w”, or x w'

Find shortest paths from source s to all other destinations

Page 54: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Dijkstra’s algorithm l  N: set of nodes for which shortest path already found l  Initialization: (Start with source node s)

l  N = {s}, Ds = 0, “s is distance zero from itself” l  Dj=Csj for all j ≠ s, distances of directly-connected neighbors

l  Step A: (Find next closest node i) l  Find i ∉ N such that l  Di = min Dj for j ∉ N l  Add i to N l  If N contains all the nodes, stop

l  Step B: (update minimum costs) l  For each node j ∉ N l  Dj = min (Dj, Di+Cij) l  Go to Step A

Minimum distance from s to j through node i in N

Page 55: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Execution of Dijkstra’s algorithm

Iteration N D2 D3 D4 D5 D6 Initial {1} 3 2 5 ∝ ∝

1 {1,3} 3 2 4 ∝ 3 2 {1,2,3} 3 2 4 7 3 3 {1,2,3,6} 3 2 4 5 3 4 {1,2,3,4,6} 3 2 4 5 3 5 {1,2,3,4,5,6} 3 2 4 5 3

1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3

ü

ü

ü

ü

ü ü

ü

ü

ü

Page 56: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Shortest Paths in Dijkstra’s Algorithm

1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3

1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3

1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3 1

2

4

5

6

1

1

2

3 2 3

5

2

4

3 3

Page 57: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Reaction to Failure l  If a link fails,

l  Router sets link distance to infinity & floods the network with an update packet

l  All routers immediately update their link database & recalculate their shortest paths

l  Recovery very quick l  But watch out for old update messages

l  Add time stamp or sequence # to each update message

l  Check whether each received update message is new l  If new, add it to database and broadcast l  If older, send update message on arriving link

Page 58: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Why is Link State Better?

l  Fast, loopless convergence l  Support for precise metrics, and multiple

metrics if necessary (throughput, delay, cost, reliability)

l  Support for multiple paths to a destination l  algorithm can be modified to find best two paths

Page 59: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Source Routing l  Source host selects path that is to be followed by a

packet l  Strict: sequence of nodes in path inserted into header l  Loose: subsequence of nodes in path specified

l  Intermediate switches read next-hop address and remove address

l  Source host needs link state information or access to a route server

l  Source routing allows the host to control the paths that its information traverses in the network

l  Potentially the means for customers to select what service providers they use

Page 60: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Traffic Management Packet Level

Flow Level Flow-Aggregate Level

Page 61: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Traffic Management Vehicular traffic management l  Traffic lights & signals

control flow of traffic in city street system

l  Objective is to maximize flow with tolerable delays

l  Priority Services l  Police sirens l  Cavalcade for dignitaries l  Bus & High-usage lanes l  Trucks allowed only at night

Packet traffic management l  Multiplexing & access

mechanisms to control flow of packet traffic

l  Objective is make efficient use of network resources & deliver QoS

l  Priority l  Fault-recovery packets l  Real-time traffic l  Enterprise (high-revenue)

traffic l  High bandwidth traffic

Page 62: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Time Scales & Granularities l  Packet Level

l  Queueing & scheduling at multiplexing points l  Determines relative performance offered to packets over a

short time scale (microseconds) l  Flow Level

l  Management of traffic flows & resource allocation to ensure delivery of QoS (milliseconds to seconds)

l  Matching traffic flows to resources available; congestion control

l  Flow-Aggregate Level l  Routing of aggregate traffic flows across the network for

efficient utilization of resources and meeting of service levels

l  “Traffic Engineering”, at scale of minutes to days

Page 63: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

1 2 N N – 1

Packet buffer

End-to-End QoS

l  A packet traversing network encounters delay and possible loss at various multiplexing points

l  End-to-end performance is accumulation of per-hop performances

Page 64: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

FIFO Queueing

l  All packet flows share the same buffer l  Transmission Discipline: First-In, First-Out l  Buffering Discipline: Discard arriving packets if

buffer is full (Alternative: random discard; pushout head-of-line, i.e. oldest, packet)

Packet buffer

Transmission link

Arriving packets

Packet discard when full

Page 65: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

FIFO Queueing l  Cannot provide differential QoS to different packet flows

l  Different packet flows interact strongly l  Statistical delay guarantees via load control

l  Restrict number of flows allowed (connection admission control) l  Difficult to determine performance delivered

l  Finite buffer determines a maximum possible delay l  Buffer size determines loss probability

l  But depends on arrival & packet length statistics l  Variation: packet enqueueing based on queue thresholds

l  some packet flows encounter blocking before others l  higher loss, lower delay

Page 66: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Earliest Due Date Scheduling

l  Queue in order of “due date” l  packets requiring low delay get earlier due date l  packets without delay get indefinite or very long due

dates

Sorted packet buffer

Transmission link

Arriving packets

Packet discard when full

Tagging unit

Page 67: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

l  Each flow has its own logical queue: prevents hogging; allows differential loss probabilities

l  C bits/sec allocated equally among non-empty queues l  transmission rate = C / n(t), where n(t)=# non-empty queues

l  Idealized system assumes fluid flow from queues l  Implementation requires approximation: simulate fluid system;

sort packets according to completion time in ideal system

Fair Queueing / Generalized Processor Sharing

C bits/second

Transmission link

Packet flow 1

Packet flow 2

Packet flow n

Approximated bit-level round robin service

Page 68: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Packetized GPS/WFQ

l  Compute packet completion time in ideal system l  add tag to packet l  sort packet in queue according to tag l  serve according to HOL

Sorted packet buffer

Transmission link

Arriving packets

Packet discard when full

Tagging unit

Page 69: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Bit-by-Bit Fair Queueing l  Assume n flows, n queues l  1 round = 1 cycle serving all n queues l  If each queue gets 1 bit per cycle, then 1 round = # active queues l  Round number = number of cycles of service that have been

completed

l  If packet arrives to idle queue: Finishing time = round number + packet size in bits

l  If packet arrives to active queue: Finishing time = finishing time of last packet in queue + packet size

rounds Current Round #

Page 70: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Random Early Detection (RED) l  Packets produced by TCP will reduce input rate in response

to network congestion l  Early drop: discard packets before buffers are full l  Random drop causes some sources to reduce rate before

others, causing gradual reduction in aggregate input rate

Algorithm: l  Maintain running average of queue length l  If Qavg < minthreshold, do nothing l  If Qavg > maxthreshold, drop packet l  If in between, drop packet according to probability l  Flows that send more packets are more likely to have

packets dropped

Page 71: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Average queue length

Pro

babi

lity

of p

acke

t dro

p

1

0 minth maxth full

Packet Drop Profile in RED

Page 72: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Chapter 7 Packet-Switching

Networks

Traffic Management at the Flow Level

Page 73: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

4 8

6 3

2

1

5 7

Congestion Congestion occurs when a surge of traffic overloads network resources

Approaches to Congestion Control: •  Preventive Approaches: Scheduling & Reservations •  Reactive Approaches: Detect & Throttle/Discard

Page 74: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Open-Loop Control

l  Network performance is guaranteed to all traffic flows that have been admitted into the network

l  Initially for connection-oriented networks l  Key Mechanisms

l  Admission Control l  Policing l  Traffic Shaping l  Traffic Scheduling

Page 75: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Time

Bits

/sec

ond

Peak rate

Average rate

Typical bit rate demanded by a variable bit rate information source

Admission Control l  Flows negotiate contract

with network l  Specify requirements:

l  Peak, Avg., Min Bit rate l  Maximum burst size l  Delay, Loss requirement

l  Network computes resources needed l  “Effective” bandwidth

l  If flow accepted, network allocates resources to ensure QoS delivered as long as source conforms to contract

Page 76: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Policing l  Network monitors traffic flows continuously to ensure

they meet their traffic contract l  When a packet violates the contract, network can

discard or tag the packet giving it lower priority l  If congestion occurs, tagged packets are discarded

first l  Leaky Bucket Algorithm is the most commonly used

policing mechanism l  Bucket has specified leak rate for average contracted rate l  Bucket has specified depth to accommodate variations in

arrival rate l  Arriving packet is conforming if it does not result in overflow

Page 77: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Leaky Bucket algorithm can be used to police arrival rate of a packet stream

water drains at a constant rate

leaky bucket

water poured irregularly Leak rate corresponds to

long-term rate Bucket depth corresponds to maximum allowable burst arrival 1 packet per unit time Assume constant-length packet as in ATM

Let X = bucket content at last conforming packet arrival Let ta – last conforming packet arrival time = depletion in bucket

Page 78: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Arrival of a packet at time ta

X’ = X - (ta - LCT)

X’ < 0?

X’ > L?

X = X’ + I LCT = ta

conforming packet

X’ = 0

Nonconforming packet

X = value of the leaky bucket counter X’ = auxiliary variable LCT = last conformance time

Yes

No

Yes

No

Depletion rate: 1 packet per unit time L+I = Bucket Depth I = increment per arrival, nominal interarrival time

Leaky Bucket Algorithm

Interarrival time Current bucket content

arriving packet would cause

overflow

empty

Non-empty

conforming packet

Page 79: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Network C Network A Network B

Traffic shaping Traffic shaping Policing Policing

1 2 3 4

Traffic Shaping

l  Networks police the incoming traffic flow l  Traffic shaping is used to ensure that a packet

stream conforms to specific parameters l  Networks can shape their traffic prior to passing it to

another network

Page 80: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Incoming traffic Shaped traffic Size N

Packet

Server

Leaky Bucket Traffic Shaper

l  Buffer incoming packets l  Play out periodically to conform to parameters l  Surges in arrivals are buffered & smoothed out l  Possible packet loss due to buffer overflow l  Too restrictive, since conforming traffic does not

need to be completely smooth

Page 81: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Incoming traffic Shaped traffic Size N

Size K

Tokens arrive periodically

Server

Packet

Token

Token Bucket Traffic Shaper

l  Token rate regulates transfer of packets l  If sufficient tokens available, packets enter network without delay l  K determines how much burstiness allowed into the network

An incoming packet must have sufficient tokens before admission into the network

Page 82: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Source Destination

Feedback information

Packet flow

Source Destination

(a)

(b)

End-to-End vs. Hop-by-Hop Congestion Control

Page 83: Chapter 7 Packet-Switching Networks - SFU.ca · 2014-12-15 · Chapter 7 Packet-Switching Networks Network Services and Internal Network Operation . Network Layer ! Network Layer:

Traffic Engineering l  Management exerted at flow aggregate level l  Distribution of flows in network to achieve efficient

utilization of resources (bandwidth) l  Shortest path algorithm to route a given flow not

enough l  Does not take into account requirements of a flow, e.g.

bandwidth requirement l  Does not take account interplay between different flows

l  Must take into account aggregate demand from all flows