How to cope with last hop impairments? Part 2 ARQ #5

Victor S. Frost Dan F. Servey Distinguished Professor Electrical Engineering and Computer Science University of Kansas 2335 Irving Hill Dr. Lawrence, Kansas 66045 Phone: (785) 864-4833 FAX:(785) 864-7789 e-mail: [email protected] http://www.ittc.ku.edu/

All material copyright 2006 # 5 1 Victor S. Frost, All Rights Reserved

How to cope with last hop impairments?

• Techniques for coping with noise – Forward error detection/correction coding – (ARQ) – Co-existance or modifications to end-to-end protocols • Techniques for coping with multipath fadingÆ fading mitigation techniques, e.g., – Equalizers –Diversity –RAKE receivers –OFDM

# 5 2 ARQ

• ARQ is used for both – – Error control • For access networks the main issue is error control

# 5 3

Error and Flow Control Protocol 1: The Unrestricted Simplex Protocol

• Assumptions – One directional information flow – Infinite buffers – No errors – Network Layer always has a packet to send

Network Data Link Data Link Network Layer Layer Layer Layer

# 5 4 Error and Flow Control Protocol 2: The Simplex Stop & Wait Protocol: Assumptions

• One directional information flow • No errors • Network Layer always has a packet to send • Finite receive buffers – Finite buffer means that there must be some way to stop the transmitter from sending when the buffer is full

# 5 5

Error and Flow Control Protocol 2: The Simplex Stop & Wait Protocol

Assume Network Layer always has data to send

Network Data Link Data Link Network Layer Layer Layer Layer ACK Channel

# 5 6 Error and Flow Control Protocol 2: The Simplex Stop & Wait Protocol

Assume Network Layer always has data to send

Network Data Link Data Link Network Layer Layer Layer Layer ACK Channel

# 5 7

Error and Flow Control Protocol 2: The Simplex Stop & Wait Protocol

Assume Network Layer always has data to send

Network Data Link Data Link Network Layer Layer Layer Layer ACK Channel

# 5 8 Error and Flow Control Protocol 3: The Simplex Protocol for a Noisy Channel

•Assumptions – One directional information flow – Network Layer always has a packet to send – Finite receive buffers – Allow errors • Data link protocols must address – What to transmit (in access networks) – When to retransmit – What to retransmit

# 5 9

Error and Flow Control Access Networks-What to Transmit

• Scheduling based on – Requests for upstream transmission opportunities – Channel conditions –CoS –QoS

# 5 10 Error and Flow Control Protocol 3: The Simplex Protocol for a Noisy Channel

• Timeout to determine when to retransmitt •Example: – Assume a 1 ms propagation time – Assume a .1 ms receiver packet processing time – Timeout interval >2.1 ms • If no acknowledgment received in 2.1 ms then, – Packet in error – Acknowledgment lost

# 5 11

Error and Flow Control Protocol 3: The Simplex Protocol for a Noisy Channel

–Timeout interval too short •Duplicate packets –Timeout interval too long •Reduced throughput

# 5 12 Error and Flow Control Protocol 3: The Simplex Protocol for a Noisy Channel

• Sequence numbers are used to determine what to retransmitt – Transmitter assigns a number to each frame – Receiver keeps track of the expected frame number – How to deal with out of sequence frames, i.e., if the received sequence number does not match what is expected, • The frame is dumped (for some DLC protocols) •Frame stored • Again faced with the issue of how to schedule the retransmission wrt current state of buffers and channels.

# 5 13

Error and Flow Control Protocol 3: One Simplex Protocol for a Noisy Channel

Event Transmitter Action Receiver Action

Packet arrived to DLL Store in Buffer. from NL Insert s.seq. Transmit Frame & start timer. Frame arrive at receiver Get frame from physical layer. If in error then dump it. If out of sequence then dump it. If in-sequence and error free then, send to NL, increment Frame Expected, Send Acknowledgement

Receive Remove from buffer Acknolwedgement Get next packet from NL Increment s.seq Store packet in Buffer. Insert s.seq. Transmit Frame & start timer.

# 5 14 Error and Flow Control Sliding Window Protocols: Assumptions

• Two directional information flow • Network Layer always has a packet to send • Finite receive buffers • Finite number of bits/sequence number • Piggybacking – Put Acknowledgments in reverse traffic flow – Increases protocol efficiency – Reduces interrupts

# 5 15

Error and Flow Control Sliding Window Protocols:

• AdvantageÆ pipeline • Why called sliding window – Assume 2 bits/Sequence number – Possible frame numbers 0, 1, 2, 3

0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3

Receive ack and advance window

# 5 16 Error and Flow Control Sliding Window Protocols:

A to B Data Traffic B to A Ack Traffic A B B to A Data Traffic A to B Ack Traffic

# 5 17

Error and Flow Control Sliding Window Protocols

• Transmitter keeps a list of sequence #’s it can use –Sending window • Receiver keeps a list of sequence #’s it will accept – Receiving window • n = # bits/(sequence number)

# 5 18 Error and Flow Control Sliding Window Protocols

• Sequence numbers in range 0...2n-1 • This allows N=2n-1 packets to be sent before getting and acknowledgment • Requires N=2n-1 packets buffers

# 5 19

Error and Flow Control

Sliding Window Protocols: How many frames can be pipelined: Problem if max # frames in pipeline = 2n • Assume that # frames in pipeline ≤ 2n • Assume n = 3, Node A sends 0...7 (8 frames) • Node B receives 0...7 ok and sends Ack • First Ack gets lost •Packet 0 of Node A times out • Node B receives another packet 0, expects a packet 0, but this is a duplicate • Thus: # frames in pipline <= 2n-1

# 5 20 Error and Flow Control Sliding Window Protocols: How many frames can be pipelined (1)

•Now with # frames in pipline = N= 2n-1 – 0....6 (7 frames) • Node A sends 0...6 • Node B receives 0...6 ok • Node B sends Ack •Ackgets lost

# 5 21

Error and Flow Control Sliding Window Protocols: How many frames can be pipelined (2)

• Node A times out • Node A retransmitts 0...6 • But Node B is expecting frame #7 • Node ignores 0...6 (often will send a RR frame explicitly telling Node A it is expecting Frame #7)

# 5 22 Error and Flow Control

• Focus on which frames to retransmit • Pipeline: send up to N frames before receiving an acknowledgment

# 5 23

Error and Flow Control Example

• Distance between nodes = 1 km • Frame length = 1000 bits • Capacity = 150 Mb/s • No errors • Delay-bandwidth product – Assume free space – τ =1000m/c = 3.33 us –2 τR= 1000 bits

# 5 24 Error and Flow Control Example

• Case 1: Stop and Wait (N=1) – Frame transmission time = 6.66us – Propagation time = 3.33us – Transmit frame at t=0, – At 6.66 us + 3.33us frame received – At 6.66us + 6.66us the acknowledgment is received, therefore transmitted 1000 bits in 6.66us + 6.66us – Effective transmission rate is 1000/13.3us ~ 75Mb/s – Efficiency: (75Mb/s)/(150Mb/s) ~ 50.0% efficient

# 5 25

Error and Flow Control Example • Case 2: Stop and Wait (N=1) – Reduce capacity to 1.5 Mb/s (like a 3G rate) – Frame transmission time = 666us – Propagation time = 3.33us – Transmit frame at t=0, – At 666 us + 3.33us frame received – At 666us + 6.66us the acknowledgment is received, therefore transmitted 1000 bits in 666us + 6.66us – Effective transmission rate is 1000/672us ~ 1.488 Mb/s – Efficiency: (1.488Mb/s)/(1.50Mb/s) ~ 99.2% efficient

# 5 26 Error and Flow Control Example • Case 3: Stop and Wait (N=1) – Capacity to 150 Mb/s – Frame transmission time = 6.66us – WAN: D=1000km Propagation time = 3333us – Transmit frame at t=0, – At 6.66 us + 3333us frame received – At 6.66us + 6666us the acknowledgment is received, therefore transmitted 1000 bits in 6.66us + 6666us – Effective transmission rate is 1000/6672us ~ .149Mb/s – Efficiency: (.149Mb/s)/(150Mb/s) ~ 0.1% efficient

# 5 27

Error and Flow Control Example

• Case 4: Sliding window (N=1023) – Capacity to 150 Mb/s – Frame transmission time = 6.66us – WAN: D=1000km Propagation time = 3333us – Transmit frame at t=0, –Note 2 τR = 999,900 bits or in frames 999.9 frames – Since time to transmit 1023 frames > 999.9 • Always have a sequence number to use • Never have to wait for ACK – EfficiencyÆ 100%

# 5 28 Error and Flow Control Example

6.66us 3333us

Frame # 1,000

Ack for Frame 1

# 5 29

Error and Flow Control Go-Back-N Protocol (1)

•Problem: If there is an error or lost frame then what rules are used to determine the frames to retransmit. • Go-back-N – Retransmit all frames transmitted after the erred frame – The receiver ignores all out-of sequence frames

# 5 30 Error and Flow Control Go-Back-N Protocol (2)

Example: Transmit 1,2,3,4,5 and frame 2 is in error then 3, 4, and 5 are received out of sequence and retransmit 2,3,4,5

# 5 31

Error and Flow Control Selective Repeat

• Receiver accepts out of sequence frames • Requires buffers in receiver and transmitter • Requires extra processing to deliver packets in order to the Network Layer

# 5 32 Error and Flow Control Other Enhancements

•Negative Acknowledgment – When an out-of-sequence frame is received the receiver sends a NAK frame to the transmitter, the NAK frame contains the sequence number of the expected data frame. – NAK enables faster error recovery, without a NAK time-out must be used to learn about errors.

# 5 33

Error and Flow Control

Sliding Window Protocols: Piggyback ACKS

Reverse traffic is used to Piggyback ACKS

A to B Data Traffic B to A Ack Traffic A B B to A Data Traffic A to B Ack Traffic

# 5 34 Error and Flow Control Other Enhancements: Acknowledgment timer

• If there is light (or no) reverse traffic then ACKS may not be sent. • An acknowledgment timer is used to insure ACKS are sent. • Upon receipt of a frame an AckTimer is started. If reverse traffic arrives before the AckTimer fires then piggyback the ACK. If the AckTimer fires then send a supervisory ACK frame.

# 5 35

Error and Flow Control Performance

• Definition for effective rate

# Bits Delivered R = eff Time to transfer Bits given the protocol

# 5 36 Error and Flow Control Performance

• Length of data packet (bits) = D

• Number of overhead bits/packet = no •Link Rate(b/s) = R

• Length of Ack Packet (bits)= na

•Frame size = nf = D+ no • One-way propagation delay = τ • Processing time (in receiver and

transmitter) = tproc

# 5 37

Error and Flow Control Performance-Stop & Wait

• Effective rate and efficiency for simplex stop-and-wait protocol

– tack = na/R

– tf = nf/R

– Time to transmit one frame = to to = 2 τ + tf + tack + 2 tproc = 2(τ + tproc ) + (na + nf)/R

# 5 38 Error and Flow Control Performance-Stop & Wait

• Reff = (nf - no)/ to

• Efficiency = Reff/R =

n 1− o n η = f o n 2R(τ + t ) 1+ a + proc n f n f

# 5 39

Error and Flow Control Performance-Stop & Wait: Limiting Case

Assuming

na 1) na 〈〈 n f so ⎯⎯→ 0 n f Define 2tR = Delay-Bandwidth Product 2)t proc 〈〈τ so t proc +τ ≈τ n 3) n 〈〈 n so o ⎯⎯→ 0 o f n For fixed DLL parameters f As Delay-Bandwidth Product ↑ then Efficiency ↓ 1 η = o 2τ R 1+ n f

# 5 40 Error and Flow Control Performance-Stop & Wait

•Example – Frame size = 1024 bytes –Overhead = Ack= 8 bytes – τ = 50 ms • Case 1: R=30 Kb/s →Efficiency = 73% • Case 2: R=1.5 Mb/s →Efficiency = 5%

# 5 41

Error and Flow Control Performance-Sliding Window Protocol

• Case 1: Large window –Window Size = N – Transmit N packet and wait for Ack – Making the same assumption as before – First Ack arrives at sender at:

n 2τ + f R

# 5 42 Error and Flow Control Performance-Sliding Window Protocol

• Case 1: Large window – If time to transmit N packets > time to get first ack

•Or Nnf / R > 2τ + nf / R • Then channel is always busy sending packets

• Efficiency = (nf -no)/ nf

# 5 43

Error and Flow Control Performance-Sliding Window Protocol

• Case 2: Small Window – If time to transmit N packets < time to get first ack

•Or Nnf / R < 2τ + nf / R • Then channel is Not always busy sending packets: Time is wasted waiting for an Ack

# 5 44 Error and Flow Control Performance-Sliding Window Protocol

• Time to send one window = Nnf / R

• Number of bits sent = Nnf

•Time to send Nnf bits = 2τ + nf / R

• Effective rate = Nnf /(2τ + nf / R )

• Efficiency = Nnf /(2τR + nf ) = N /(2τR/ nf + 1)

# 5 45

Error and Flow Control Performance-Sliding Window Protocol • Example: – Frame size = 1024 bytes –Overhead = Ack= 0 bytes – τ = 1 ms – Rate = 40 Mb/s •Case 1: N = 12 → Efficiency = 100% →40 Mb/s • Case 2: N = 8 → Efficiency = ~75% →30 Mb/s • Case 3: N = 4 → Efficiency = ~ 37% →15 Mb/s

Note you can control the rate by changing N

# 5 46 With bit errors

• Let p = Probability of a bit error • Assume bits errors are random

•Let Pf = Probability of a frame error n •Pf = 1 - (1-p) f

• If p << 1 then Pf = pnf

# 5 47

Stop and Wait Performance

• The Probability that it takes 1 transmission to

send a frame = 1- Pf • The Probability that it takes 2 transmission to

send a frame = Pf(1- Pf) • The Probability that it takes 3 transmission to

send a frame = Pf Pf(1- Pf)

∞ k-1 1 Average number of transmissions = ∑ kPf (1− Pf ) = k=1 (1− Pf )

# 5 48 Stop and Wait Performance

• Without errors to = 2 τ + tf + tack + 2 tproc = 2(τ + tproc ) + (na + nf)/R ~ 2 τ + nf/R • With Errors to = (2 τ + nf/R)/ (1- Pf) • ηwith errors= (1- Pf)ηwithout errors

# 5 49

Stop and Wait Performance

•Stop and wait Performance of Stop and Wait with Errors

1

• Capacity = 2 Mb/s 0.95

0.9

•Frame size= 512 bits 0.85 •Propagation time = 0.8 0.75

10us Efficiency 0.7 0.65

• Efficiency without 0.6 errors = 0.92 0.55 0.5 0.000001 0.00001 0.0001 0.001 0.01 Bit error rate

# 5 50 Performance of Sliding Window

• Assume Go-Back-N (GBN)

• Assume large window case with Ws = window size

• Assume Pf frame loss probability, then time to deliver a frame is:

–tf if first frame transmission succeeds (1 – Pf )

–tf + Wstf /(1-Pf) if the first transmission does not succeed Pf

Nt f Nt f tGBN = t f (1− Pf ) + Pf {t f + } = t f + Pf and 1− Pf 1− Pf n − n n f o 1− o tGBN n f ηGBN = = (1− Pf ) R 1+ (N −1)Pf

Modified from: Leon-Garcia & Widjaja: Communication Networks # 5 51

Performance of Sliding Window

• Assume Selective repeat

•Assume Pf frame loss probability, then number of transmissions required to deliver a frame is: –tf / (1-Pf) n f − no

t f /(1− Pf ) no ηSR = = (1− )(1− Pf ) R n f

Modified from: Leon-Garcia & Widjaja: Communication Networks # 5 52 Error and Flow Control With Errors

ARQ Efficiency Comparison Selective 1.5 Repeat Go Back N 10 1

0.5 Stop and Wait

Efficiency 100 0 Go Back N 100 10-9-9 10 -8-8 10 -7-7 10 -6-6 10 -5-5 10 -4-4 10 -3-3 -210-2 -110-1

- LOG(p)p Stop and Wait 10 Delay-Bandwidth product = 10, 100

Modified from: Leon-Garcia & Widjaja: Communication Networks # 5 53

Impact of ARQ

•Increase delayÆ wait for successful retransmission • Increase the delay variation • Reduce the effective throughput • Significantly reduces the probability of an errored packet reaching upper layers especially when combined with FEC. • Practical issue: The link layer will only try to send a packet for so long, eventually it will time out and let high layers deal with the problem; therefore higher layers can still see losses

# 5 54 Other actions to cope with errors

• Adaptive power control – In CDMA system this increases the interference to other users – Used in fixed wireless deployments • Adaptive bit rate: via measurements the system knows to reduce its transmission rate to keep BER (PER) constant, e.g., adapt the modulation scheme • With constant PER the time in ARQ retransmissions is ~constant • Combine FEC with ARQ: Save the errored packet and ask for retransmission

# 5 55

Adaptive Bit Rate

Rate vs S/N

800

b 600

400

Date Rate (k Rate Date 200

0 -10-50 5 101520 S/ N (dB)

+ S/N obtained via measurements + Measurement called “channel state information” + Rate change by: - Modulation - Number codes assigned # 5 56 - Number of time slots assigned Rate adaptation techniques

* • Basic idea: change the GPRS=General Packet Radio Service modulation and coding GSM=Global System for Mobile scheme during the Communications communication to adapt to EDGE= Enhanced date rates for GSM the changing link Evolution conditions, e.g., radio CS=Coding Scheme environment MCS=Modulation and Coding Scheme

Mode IEEE802.11 IEEE802.11 b a Mb/s Mb/s 1 1 6 2 2 9 3 5.5 12 4 11 18 5 24 6 36 7 48 8 56 *From: Dealing with the EDGE Evolution, Terry Locke, Si Nguyen, and Dominique Moreuil, Nortel Networks CommsDesign.com Sep 24, 2002 # 5 57

Hybrid ARQ: Incremental Redundancy

• Goal: transmit a packet of J information bits • Add c error detection bits to the J information bits to create a J + c packet • Use a convolutional code with 1/K redundancy ratio • Use a 1/K convolution code get K(J+c) bits • Puncture the 1/K convolutional code* to get a rate 1 code and save all K(J+c) bits

• Send the J+c bits *Need to use special Convolutional codes: Rate Compatible Codes (RCPC)

# 5 58 Hybrid ARQ: Incremental Redundancy

• At receiver recive only J+C bits • Pad J+C bits with random bits to get the K(J+c) bits • Use Viterbi decoding •Check CRC – If checks then accept packet and send ACKÆ done – Else save received bits and send NACK • The sender now sends transmitters next J+c bits • At receiver now have higher rate codeÆ1/2 • Use Viterbi decoding •Check CRC – If checks then accept packet and send ACK – Else save received bits and send NACK • Continue until sent all K(J+c) bits

# 5 59

Hybrid ARQ: Incremental Redundancy

Each retransmission adds redundancy that will improve the probability of correct reception Modified From: Incremental Redundancy in EGPRS, Feb, 2005 www.wirelessdesignmag.com # 5 60 Hybrid ARQ: Incremental Redundancy

Rate 1/3 means 3 coded bits for each information bit

Modified From: Incremental Redundancy in EGPRS, Feb, 2005 www.wirelessdesignmag.com # 5 61

Hybrid ARQ: Incremental Redundancy

• Advantage: If mobile is close to BS then lots of power and only first packet (rate =1) will be needed • As the mobile moves away from the BS there is less power and this scheme automatically compensates by sending additional redundancy bits. • Process automatically matches coding rate to the channel S/N without explicit measurement of CSI

# 5 62 References

• Leon-Garcia & Widjaja: Communication Networks, McGraw Hill, 2004 • Dealing with the EDGE Evolution, Terry Locke, Si Nguyen, and Dominique Moreuil, Nortel Networks CommsDesign.com Sep 24, 2002 • Cianca, E., et al., Channel-adaptive techniques in wireless communications: an overview. Wireless Communications and Mobile Computing, 2002. 2(8): p. 799-813. • Falahati, S., et al., Convolutional Coding in Hybrid Type-II ARQ Schemes on Wireless Channels, in Proceedings Radiovetenskap och Kommunikations. 1999: Karlskrona, Sweden. • Langton, C., Coding adn decoding with convolutional codes. p. 1-29. • Mercy, P., Incremental Redundancy in EGPRS. Wireless Design & Development, 2005 p. 30-35. • Mukhtar, R., et al., A model for the performance evaluation of packet transmissions using type-II hybrid ARQ over a correlated error channel Wirel. Netw. , 2004. 10 (1): p. 7-16. • Nanda, S., K. Balachandran, and S. Kumar, Adaptation techniques in wireless packet data services. Communications Magazine, IEEE, 2000. 38(1): p. 54- 64. • Porat, D., Incremental Redundancy. 2002, Communication & Signal Processing Ltd. p. 1-7.

# 5 63