Sie sind auf Seite 1von 47

ARQ Error Control, Flow

Control and Routing


Prof. Izhak Rubin
Electrical Engineering Department
UCLA
rubin@ee.ucla.edu

2015 by Professor Izhak Rubin

The Half Duplex Data Link


Communications Link
Rx

Tx

Communications Link
Tx

Rx

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
(c) Prof. Izhak Rubin

Error Control Methods: FEC

Forward Error Correction (FEC)

Message = Information field + Error correction code field =


K(I) + K(FEC) = K
Code Rate (= Information Rate) = K(I) / 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
(c) Prof. Izhak RubinFEC field

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
(c) Prof. Izhak Rubin

EDC field

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

(c) Prof. Izhak Rubin

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)

(c) Prof. Izhak Rubin

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)

1 P (1 p)

P 1 (1 p) K

(c) Prof. Izhak Rubin

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

(c) Prof. Izhak Rubin

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.

(c) Prof. Izhak Rubin

Numbers of Transmissions and


Retransmissions

E{N (t )} jP j 1 (1 P)
j 1

P( N ( R) j ) P (1 P)
j

E ( N ( R))
j 0

0<P<1

1
1 P

j0; Geometric Distribution

P
jP (1 P)
1 P
j

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.
(c) Prof. Izhak Rubin

10

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
No subsequent frames are transmitted until the frame is PACKed
If no PACK is received by the expiration of the timer, the frame is
retransmitted
Upon receipt of a PACK the next frame can be transmitted

2.
3.
4.

(c) Prof. Izhak Rubin

11

Stop and Wait ARQ:


Illustrative Example
Space

Space

F(i-1)

F(i-1)

A(i-1)

A(i-1)

F (i)

F (i)
T(T0)
T(T0)

A(i)
F(i)

F(i)
A(i)

A(i)
Time

Time
(c) Prof. Izhak Rubin

12

Stop and Wait ARQ: Cycle Period


t(ta)

K/R

t(p)

t(ta)

Message
Tx turns
around

n(a)/R

t(p)

t(ta)
Message

ACK
Rx turns
around

t(T0)

t(IM)

Next Frame
Tx initiated

Time

t(TO)= T(T0)

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

Inter-message transmission time= t(IM) = K/R +T(T0) = [K +n(a)]/R + 2 [t(p) +t(ta)]


(c) Prof. Izhak Rubin

13

Stop and Wait ARQ: Throughput


t(IM)
T(T0)

T(T0)
M1

M1

T(T0)
M1

M2

t(C): Cycle Time

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


TH

K n( h)
K n( h)

E{t (c)}
t ( IM ) /(1 P)

[ K n(h)](1 P) R
TH
K n(a) 2 R[t ( p) t (ta )]

Head of the Line (HOL)


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

(c) Prof. Izhak Rubin

14

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

(c) Prof. Izhak Rubin

15

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)
(c) Prof. Izhak Rubin

16

Go Back N ARQ
FDX
Communications Link
Rx

Tx

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
(c) Prof. Izhak Rubin

17

GO BACK N ARQ:
ILLUSTRATIVE EXAMPLE
Space
F1
F2
A1

Error
F3

t(T0)
F2
F3

Time
(c) Prof. Izhak Rubin

18

GBN ARQ: CHANNEL PROCESS


K/R

K/R

K/R

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.

(c) Prof. Izhak Rubin

19

GBN ARQ: CHANNEL PROCESS


NK/R

NK/R
1

NK/R
N

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.

Accounting for statistical variations in message transport across


the network.
(c) Prof. Izhak Rubin
20

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)

K n( h )
K n( h)
TH

E{N ( FT )}K / R {[1 ( N 1) P] /(1 P)}(K / R)

TH

[ K n(h)](1 P) R
K [1 ( N 1) P]
(c) Prof. Izhak Rubin

21

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

T
N
2

K / R
(c) Prof. Izhak Rubin

22

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.
(c) Prof. Izhak Rubin

23

Selective Repeat ARQ


Communications Link
Rx

Tx

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

(c) Prof. Izhak Rubin

24

Selective-Repeat ARQ:
Illustrative Example
Space

F1
A1

F2
F3

Error

t(T0)
F2

A3

F4

Time
(c) Prof. Izhak Rubin

25

Selective Repeat ARQ THROUGHPUT


T(T0)

T(T0)
M1
E

M1

M1
C

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

K n( h)
K n ( h)
TH

E[ N (T )]K / R ( K / R) /(1 P)
[ K n(h)](1 P) R
TH
K
(c) Prof. Izhak Rubin

26

Frame Length and HOL Delay

Note: We can calculate the frame length K which


yields Max TH for a given BER.

The head of line delay to successful receipt of the


message by the destination Rx is:

K (opt) increases as BER decreases.

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

(c) Prof. Izhak Rubin

27

FLOW CONTROL
Sink

Source
Flow
Control

Network

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

(c) Prof. Izhak Rubin

28

End to end sliding window (Pacing)


Flow Control
Sink

Source
Flow
Control

Network
Feedback Data (authorization)

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

(c) Prof. Izhak Rubin

29

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
Delayed window refresh
T(active)
T(pause)
Window

Fast window refresh


window

Window refresh

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


(c) Prof. Izhak Rubin

time
30

Input Rate Flow Control


Source

Sink
UNI
Flow
Control

Network

Flow
Control

Open Loop flow control, no feedback used


UNI = User-to-Network Interface

(c) Prof. Izhak Rubin

31

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

(c) Prof. Izhak Rubin

32

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

(c) Prof. Izhak Rubin

33

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

(c) Prof. Izhak Rubin

34

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

(c) Prof. Izhak Rubin

35

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

(c) Prof. Izhak Rubin

36

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

A,2

Example: The shortest path from s to

C,5

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


A tree graph is a connected graph with
no cycles

E,7

In a tree graph, there is a unique path


between any pair of nodes

B,3

D,4

(c) Prof. Izhak Rubin

37

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
3
Complexity: N for highly connected graphs, lower for less
connected topologies
Issues: Stability and speed of adaptation to varying network
conditions
Example: RIP, original ARPANET

(c) Prof. Izhak Rubin

38

Distance Vector Routing Method:


Principle of Optimality
(Dynamic Programming): Iteration on subsequent nodes
Node V1

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

w(i,v1)
Node i

Node j
w(i,v2)
Node v2

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

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

Minimum over all nodes v that are neighbors of


node i
(c) Prof. Izhak Rubin

39

Distance Vector Routing Method:


Principle of Optimality
(Dynamic Programming): Iteration on preceding nodes
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

Node u1
w(u1,v)

Node j= Node v

Node i= Node s
w(u2,v)
Node u2
Ps(s,u2) = length of shortest path from s to u2

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

Minimum over all nodes u that are neighbors of


node v
(c) Prof. Izhak Rubin

40

Bellmans Equation

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


Bellmans 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

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

(c) Prof. Izhak Rubin

h hops

41

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.

(c) Prof. Izhak Rubin

42

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

(c) Prof. Izhak Rubin

43

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
Dijkstras labeling algorithm, complexity of the order
of N2
Examples: OSPF, later version of ARPANET/
INTERNET routing

(c) Prof. Izhak Rubin

44

Dijkstras Algorithm
Algorithm Dijkstra:
begin
T=V
d(s) = 0 and pred(s) = 0
for u T \ {s} do d(u) =
od

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

and pred(u) = -1
While loop executes O(|V|) times

while T is not empty do


Choose u T such that d(u) is minimal
Update T: T = T\{u}
Update temporary labels:
for all v T Au do
if d(v) > d(u)+w(u,v) then
d(v) = d(u) + w(u,v)
pred(v) = u
fi
od
end

For loop executes O(|V|)times


Dijkstras 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|).

(c) Prof. Izhak Rubin

45

Example
{current min distance, predecessor}

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

inf,nil

5,A

5,A

5,A

5,A

D inf,nil

inf,nil

inf,nil

4,B

4,B

4,B

5
B

C inf,nil

A,2

3
D
C,5

E inf,nil

inf,nil

inf,nil

inf,nil

7,D

E,7

7,D
(c) Prof. Izhak Rubin

B,3

D,4

46

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)

Methods based on link state routing

For each class of <=h routes, identify the available BW levels


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

(c) Prof. Izhak Rubin

47

Das könnte Ihnen auch gefallen