section 5 error, flow and routing control

47
ARQ Error Control, Flow Control and Routing Prof. Izhak Rubin Electrical Engineering Department UCLA [email protected] © 2014-2015 by Professor Izhak Rubin

Upload: dylan-ler

Post on 21-Dec-2015

32 views

Category:

Documents


0 download

DESCRIPTION

hw

TRANSCRIPT

Page 1: Section 5 Error, Flow and Routing Control

ARQ Error Control, Flow

Control and Routing

Prof. Izhak Rubin

Electrical Engineering Department

UCLA

[email protected]

© 2014-2015 by Professor Izhak Rubin

Page 2: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 2

The Half Duplex Data Link

Half Duplex: Can only transmit or receive at the same time.

Turn around time = time to switch from receive to transmit mode or from

transmit to receive mode

Tx Rx

Communications Link

Rx Tx

Communications Link

Page 3: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 3

Error Control Methods: FEC

Forward Error Correction (FEC) Message = Information field + Error correction code field =

K(I) + K(FEC) = K

Code Rate = K(FEC) / K

Receiver is able to detect errors and to correct them (if within bounds)

Advantages: low delay (forward operation)

Disadvantages:

coding/decoding complexity / code / delay / cost

Bandwidth / throughput degradation in proportion to the code rate

Information field FEC field

Page 4: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 4

Error Control Methods: ARQ

Automatic Repeat reQuest (ARQ)

Error Detection and Retransmission

Message error control block = K(I) + K(EDC) = K =

information field + error detection code field

Example: 8 / 16 / 32 CRC (cyclic redundancy code) error

detection code used

Example: parity check code

Information field EDC field

Page 5: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 5

ARQ: ACK + Timeout

ARQ confirmations

Positive Acknowledgement (PACK)

PACK + Timeout operation

Using timeout timer at sender to resend if no ACK received

Negative ACK (NACK) used at times in conjunction with PACK or not at all

ARQ Not employed for typical realtime stream operations

Page 6: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 6

ARQ: Features

Advantages Lower cost

Positive confirmation to sender

Typically low throughput decrease implication

Fast EDC (line speed) operation

Disadvantages Delay – throughput performance; can result in higher

delays across communications links that induce high propagation and/or queueing delays (such as satellite links)

Page 7: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 7

ARQ: Throughput and Error Rates

TH = R(eff) = Throughput = Effective Rate of Message Transmission Across

the Link

TH (bps) = No. of bits accepted by the destination / total time to accept these

bits

Transmission Efficiency = Normalized TH = TH (bps) / R (bps)

Under statistically independent error events across the communications

link:

P = P (frame is received in error)

p = p(b) = bit error rate (BER) ; K = number of bits per ARQ Block (or frame)

KpP )1(1 KpP )1(1

Page 8: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 8

Example

K = 1000 bits/ frame

BER = p = 0.0001

P = 1-(1-p)k = 0.0951671

For p <<<1, P ≈ Kp

Note: For burst errors,

p(burst) = (1/3 -1/10)p

Page 9: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 9

ARQ: Retransmissions

N(T) = No. of transmissions of a frame for correct reception

N(R) = No. of Retransmission of a frame for correct reception

P = P (frame is received in error)

Under statistically independent error events

P (N(T)=j) = P j-1

(1-P); j ≥ 1; Geometric Distribution.

Page 10: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 10

Numbers of Transmissions and

Retransmissions

1

1

1

1)1()}({

j

j

PPjPtNE

)1())(( PPjRNP j

0 1)1())((

j

j

P

PPjPRNE

0<P<1

j≥0; Geometric Distribution

0<P<1

N(T) = 1+N(R) E(N(T)) = 1 +E(N(R)) Example: P=0.5; E(N(T)) = 2, E(N(R)) = 1.

Page 11: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 11

Stop and Wait ARQ

Stop and Wait ARQ has been frequently used across half duplex links

Protocol: 1. When the frame is transmitted, an ACK Timer of timeout duration t(T0)

is initiated

2. No subsequent frames are transmitted until the frame is PACKed

3. If no PACK is received by the expiration of the timer, the frame is retransmitted

4. Upon receipt of a PACK the next frame can be transmitted

Page 12: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 12

Stop and Wait ARQ:

Illustrative Example

T(T0)

Space

F(i-1)

A(i-1)

F (i)

F(i)

A(i)

Time

Space

F(i-1)

A(i-1)

F (i)

F(i)

A(i)

Time

T(T0)

A(i)

Page 13: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 13

Stop and Wait ARQ: Cycle Period

t(T0) = n(a)/R +2t(p)+t(ta)

Often, we include (due to variability) an extra t(ta) term, yielding:

t’(T0) = T(TO) = t(TO)+t(a)= n(a)/R +2[t(p)+t(ta)]

t(IM) = K/R +T(T0) = [K +n(a)]/R + 2 [t(p) +t(ta)]

t(ta) K/R

Message

Tx turns around

Rx turns around

t(p) t(ta)

ACK

n(a)/R t(p)

Next Frame Tx initiated

t(ta)

Message

Time

t(IM)

t(T0)

T(T0)

Page 14: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 14

Stop and Wait ARQ: Throughput

E {t(c)} = E{N(T)}t(IM); E{N(T)} = 1/(1-P)

)1/()(

)(

)}({

)(

PIMt

hnK

ctE

hnKTH

M1 M1 M1 M2

T(T0) T(T0) T(T0)

t(C): Cycle Time

)]()([2)(

)1)](([

tatptRanK

RPhnKTH

E{D(HOL)} = K/R +[E(N(T))-1]t(IM)+t(p) = mean HOL message delay to correct receipt at the destination

t(IM)

Page 15: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 15

Stop and Wait ARQ: Throughput Performance

Example

Given: n(h) = n(a) = 48 bits; t(p)= 10 ms, t(ta) = 100 ms, R = 4800 bps

t’(T0) = [N(a)/R] + 2 [t(p)+t(ta)]=230ms

TH = (K-48) / (E(N(T) [(K/R)+0.23]

Assume K = 4800 bits

BER = p = 0.0001; P = 1-(1-p)K = 0.381

E (N(T)) = 1/(1-P) = 1.616

TH = 2390 bps

Assume now that BER = 0.00001

Using the same equations as above, we get

TH = 3682 bps

Page 16: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 16

Stop and Wait Throughput Behavior

Max Throughput at K (opt)

K<K(opt): OH inefficiency

K>K(opt): High level of P and N(R)

Page 17: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 17

Go Back N ARQ

Protocol

When frame is transmitted an ACK Timer of timeout duration t(T0) is initiated

Up to N subsequent frames can be transmitted until outstanding frame is PACKed

If no PACK is received by the expiration of the timer, the frame is retransmitted. In addition, all subsequently transmitted frames are also retransmitted

Upon receipt of a PACK, the sliding window quota is refreshed

Tx Rx

Communications Link

FDX

Page 18: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 18

GO BACK N ARQ:

ILLUSTRATIVE EXAMPLE

Space

F1

A1

F 2

F3

F2

Time

Error

F3

t(T0)

Page 19: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 19

GBN ARQ: CHANNEL PROCESS

Under no transmission errors (when ACK is returned prior

to exhaustion of the ARQ transmission window quota):

TH = [K-n(h)]/(K/R) (Throughput rate)

NTH = [K-n(h)]/K

Note: NTH = Normalized Throughput = Throughput / Max TH;

whereby across the link under consideration, we assume that

Max_TH = Tx Rate.

K/R K/R K/R

Page 20: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 20

GBN ARQ: CHANNEL PROCESS

Under transmission errors:

In this example (assuming ACK to be received after N frame transmissions), 3N extra frames were transmitted prior to the correct reception of frame 1:

t(c)= 3NK/R +K/R with probability P3(1-P)

TH = [K-N(h)]/E[t(c)]

We set the ACK timeout timer to: t(T0) = (N-1)K/R or to: (N-2)K/R.

1 2 1 2 N 1 2 N N 1

NK/R NK/R NK/R

Page 21: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 21

GBN ARQ THROUGHPUT

N(FT) =Number of frame transmissions until correct reception

E{N(FT)} = 1+ NE{N(R)}

Where N(R) = Average number of retransmissions per frame = P/(1-P)

)/)}(1/(])1(1{[

)(

/)}({

)(

RKPPN

hnK

RKFTNE

hnKTH

])1(1[

)1)](([

PNK

RPhnKTH

Page 22: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 22

GBN Selection of N

t(rr) = receiver reaction time

t(rt) = transmitter reaction time

t(a) = ACK transmission time = n(a)/R

t(T0) = 2t(p) +t(rr) +t(rt) +n(a)/R = T

Select N so that T = (N-2)K/R

The optimal N (under full duplex operation) is then given by (setting, to leave processing / variability margin) the time to receipt of a PACK equal to about the time it takes to transmit (N-2) frames) :

2/

RK

TN

Page 23: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 23

Example (Satellite Link)

n(a) = 48 bits, t(rr) = t(rt) = 2ms, R= 4800 bps, t(p) = 270ms

T = 2t(p) +t(rr) +t(rt) +n(a)/R =554ms

For K = 56 to 66 bytes, we have

N = int (5.94) +2 = 8

For K = 67 to 83 bytes, N=7

In case of a terrestrial link where t(p) = 10ms

T=54 ms and N=3 for K>270 bits

As R is increased, higher ARQ window (N) values are selected.

Page 24: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 24

Selective Repeat ARQ

Protocol:

When a frame is transmitted an ACK timer of transmitter duration t(T0) is initiated

Subsequent frames are continuously transmitted

If no PACK is received by the expiration of the timer, the unACKED frame is retransmitted

Tx Rx

Communications Link

Page 25: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 25

Selective-Repeat ARQ:

Illustrative Example

Space F1

A1 F 2

F3

F2

Time

Error

A3

F4

t(T0)

Page 26: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 26

Selective Repeat ARQ THROUGHPUT

E {N(T)} = 1/(1-P)

)1/()/(

)(

/)]([

)(

PRK

hnK

RKTNE

hnKTH

M1 M1 M1

T(T0) T(T0)

E E C

K

RPhnKTH

)1)](([

Page 27: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 27

Frame Length and HOL Delay

Note: We can calculate the frame length K which

yields Max TH for a given BER.

K (opt) increases as BER decreases.

The head of line delay to successful receipt of the

message by the destination Rx is:

E {D(HOL)} = {K/R} +[E(N(T)-1] t(IM)+t(p)

t(T0)=2 t(p) +t(rr) +t(rt) +n(a)/R = T

Page 28: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 28

FLOW CONTROL

Flow control is the regulation of flow at the edges (I/O) of the network

It achieves:

Protection of Network Resources

Protection of User Resources

Fairness Control

Congestion Control

Key Methods:

End to end sliding window closed loop flow control

Open Loop input rate flow control

Sink

Network

Source

Flow Control

Flow Control

Page 29: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 29

End to end sliding window (Pacing)

Flow Control

Protocol:

A window size of W segments is negotiated between a source and a sink

The source is permitted to have no more than W outstanding elements

Upon receipt of an authorization from the sink, the source refreshes its window quota

Network

Source

Flow Control

Sink

Feedback Data (authorization)

Page 30: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 30

Feedback Based Flow Control:

Performance Parameters

Parameters: Window Size

Latency across the network

Feedback timeliness

Throughput Efficiency is determined by the

timeliness of the feedback in relation to the

source TX rate

Window window

time

T(active) T(pause)

Normalized Throughput = T(active) / [T(active) + T(pause)]

Window refresh

Fast window refresh Delayed window refresh

Page 31: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 31

Input Rate Flow Control

Open Loop flow control, no feedback used

UNI = User-to-Network Interface

Sink

Network

Source

Flow Control

Flow Control

UNI

Page 32: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 32

Credit Manager Algorithm

Each T time units, a credit of K segments is provided to the User-to-Network Interface (UNI)

A maximum of C(max) segments credit to be accumulated by UNI

To transmit a segment, the source must use a single segment-credit that it has accumulated; when out of its credit quota, the source cannot continue to transmit its segments across the UNI to the network until it gains more credits.

Average sustained source flow rate = K/T

Maximum Burt Size (MBS) is determined by C(max) Peak source flow rate at the UNI is determined by the speed of

the access line

The average and peak flow rates are negotiated at the call/connection time

Page 33: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 33

Basic Leaky Bucket Algorithm

A counter is used to count the total number of bytes arriving

At the end of each time interval T the counter is decremented by K Bytes

Average rate sustained at UNI per connection/flow = K/T Upon packet arrival, the count is incremented by the number of packet

bytes and it is compared with a threshold; or the count is first compared with a threshold

The threshold represent the level of burstiness allowed

Short term burstiness

Longer term burstiness (burst duration) If the count exceeds the threshold the packet is nonconforming and the

count is not incremented (or if already incremented, the increment is removed)

ATM systems use dual leaky buckets policing mechanisms at the UNI

Page 34: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 34

Routing

Static/Fixed Routing; specified routes per source destination pairs

Statically specified sets of routes per source-destination pairs; flow distributed across a number of routes

Dynamic/Adaptive Routing; route is determined based on the current congestion in the network.

Connectionless/Datagram routing ; decision made dynamically at each node as to the best route possible to destination from this node.

Example of criteria: minimum delay, minimum weighted delay, minimum number of hops

Page 35: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 35

Routing Approaches (Cont.)

Connection Oriented; Virtual Circuit dynamic routing; route is selected at the time of circuit setup; flow balancing at this time to reduce congestion occurrences in the network

Quasi-dynamic Assignment, where routes are fixed between updates (occurring at fixed periods or when dynamically required upon detection of congestion changes.

Key routing methods: Distance Vector routing

Link State routing

Page 36: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 36

Weights, Distances and Cost Measures

Link (i,j) weight/metric/distance/cost = w(i,j)

Delay; number of hops

Throughput

Reliability

$ cost

Path p(i,j) from node i to node j

Path distance / cost / weight = sum of path link weights

Page 37: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 37

Shortest Path Tree

The shortest paths from a node s to all other nodes in a domain are deduced from a shortest path tree with s as a root node

S E,7

A,2 C,5

B,3 D,4

• Example: The shortest path from s to

(D,4) is s to (A,2) to (B,3) to (D,4)

• A tree graph is a connected graph with

no cycles

• In a tree graph, there is a unique path

between any pair of nodes

Page 38: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 38

Distance Vector Routing

Distributed Implementation

Each node periodically notifies its neighbors about the shortest path estimates

Each node uses its local link states as well as the received estimates to calculate the shortest path from itself to other nodes

Bellman-Ford Algorithm

Complexity: N3 for highly connected graphs, lower for less

connected topologies

Issues: Stability and speed of adaptation to varying network conditions

Example: RIP, original ARPANET

Page 39: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 39

Distance Vector Routing Method:

Principle of Optimality

(Dynamic Programming): Iteration on subsequent nodes

w(Ps(i,j)) = min {w(i,v) + w(Ps(v,j))}

Minimum over all nodes v that are neighbors of

node i

Node i

Node V1

Node v2

Node j

Ps(v2,j) = length of shortest path from v2 to j

w(i,v1)

w(i,v2)

Ps(v1,j) = length of shortest path from v1 to j

Page 40: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 40

Distance Vector Routing Method:

Principle of Optimality

(Dynamic Programming): Iteration on preceding nodes

w(Ps(s,v)) = min {u: w(s,u) + w(Ps(s,u))}

Minimum over all nodes u that are neighbors of

node v

Node i= Node s

Node u1

Node u2

Node j= Node v

Ps(s,u2) = length of shortest path from s to u2

w(u1,v)

Dv = distance along shortest path from source node s to destination node v Iteration on all preceding nodes u and Du

Ps(s,u1) = length of shortest path from s to u1

w(u2,v)

Page 41: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 41

Bellman’s Equation

Dv = distance along shortest path from source node s to destination node v

Bellman’s Equation:

Dv = min [Du + w(u,v)], for each node v ≠ s

over all nodes u that are neighbors of v;

Ds = 0.

Bellman-Ford algorithm iterates on h = no. hops in a path.

Dv(h) = distance to node v using paths that are no longer than h hops

For successive values of h:

Dv(h+1) = min [Du(h) + w(u,v)], for each node v ≠ s

over all nodes u that are neighbors of v;

Ds(0) = 0.; Dv(0) = ∞, for each node v ≠ s

Page 42: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 42

Distributed Bellman-Ford

Algorithm

At step h, node v announces to its neighbors its shortest path estimates to each other node, based on information received from its neighbors and based on the states of its own links to its neighbors

Dv(h+1) = min over its neighbors u of

[w(v,u) + Du(h)]

At termination (will take at most n-1 steps), each node will find its shortest path to each other node, and the identity of the next hop along the shortest path.

Sequence numbers used to differentiate new updates from old ones.

Page 43: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 43

Distributed Asynchronous

Bellman-Ford Algorithm

At regular intervals each node notifies its neighbors of its shortest path estimates; each node uses this info and the latest status of its attached links to estimate its shortest paths to each other node in the domain.

At regular intervals, at each node v ≠ s, compute:

Dv(new) = min over u in Av of

[w(v,u) + Du (received from u)]

Page 44: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 44

Link State Routing

Each node periodically sends updates of its local link states to each other node in the network domain

Each node constructs the full network domain topological graph and calculates the shortest path tree specifying the shortest path to any other domain node

Dijkstra’s labeling algorithm, complexity of the order of N2

Examples: OSPF, later version of ARPANET/ INTERNET routing

Page 45: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 45

Dijkstra’s Algorithm

Algorithm Dijkstra:

begin

T = V

d(s) = 0 and pred(s) = 0

for do d(u) = and pred(u) = -1 od

while T is not empty do

Choose such that d(u) is minimal

Update T: T = T\{u}

Update temporary labels:

for all v do

if d(v) > d(u)+w(u,v) then

d(v) = d(u) + w(u,v)

pred(v) = u

fi

od

end

Tu

uAT

}{\ sTu While loop executes O(|V|) times

For loop executes O(|V|)times

• Dijkstra’s algorithm has complexity of O(|V|2)

• Closer look: Initialization = O(|V|) steps

For loop: each edge is treated once = O(|E|)

Which is better than O(|V|) for sparse graphs

• Can reduce the # comparisons in (choose min)

by using a priority queue (‘heap’), in which

we insert and order elements = O(log n)

• Algorithm = O(|E| log |V|).

Notations: Av = list of nodes adjacent to

(i.e., neighbors of) node v; s = source node

G = (V,E); pred(v) = predecessor to node v

Page 46: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 46

Example

S 0,S 0,S 0,S 0,S 0,S 0,S

A inf,nil 2,S 2,S 2,S 2,S 2,S

B inf,nil 5,S 3,A 3,A 3,A 3,A

C inf,nil inf,nil 5,A 5,A 5,A 5,A

D inf,nil inf,nil inf,nil 4,B 4,B 4,B

E inf,nil inf,nil inf,nil inf,nil 7,D 7,D

{current min distance, predecessor}

3

S E

A C

B D

2

5

1 2

1

2

4

3

S E,7

A,2 C,5

B,3 D,4

Page 47: Section 5 Error, Flow and Routing Control

(c) Prof. Izhak Rubin 47

QoS Routing

The bandwidth / capacity required to meet the QoS requirement for a connection is calculated

Route is selected so that it meets the required BW as well as an effective routing criteria, such as the shortest path

Methods based on distance vector routing (and Bellman Ford routing algorithm) For each class of <=h routes, identify the available BW levels

Methods based on link state routing Prune the graph to eliminate links which at present do not meet the BW

requirement

Integrated flow admission control (developed by Prof. Izhak Rubin) for ad hoc wireless networks involving Mobile Backbone Network (MBN) oriented architectures based on capacity and stability metrics