Section 5 Error, Flow and Routing Control
description
Transcript of Section 5 Error, Flow and Routing Control
ARQ Error Control, Flow
Control and Routing
Prof. Izhak Rubin
Electrical Engineering Department
UCLA
© 2014-2015 by Professor Izhak Rubin
(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
(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
(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
(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
(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)
(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
(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
(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.
(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.
(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
(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)
(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)
(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)
(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
(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)
(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
(c) Prof. Izhak Rubin 18
GO BACK N ARQ:
ILLUSTRATIVE EXAMPLE
Space
F1
A1
F 2
F3
F2
Time
Error
F3
t(T0)
(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
(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
(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
(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
(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.
(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
(c) Prof. Izhak Rubin 25
Selective-Repeat ARQ:
Illustrative Example
Space F1
A1 F 2
F3
F2
Time
Error
A3
F4
t(T0)
(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)](([
(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
(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
(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)
(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
(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
(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
(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
(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
(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
(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
(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
(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
(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
(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)
(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
(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.
(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)]
(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
(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
(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
(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