資料通訊 Week 2 (9/20)

46
資資資資 資資資資 Week 2 (9/20) Instructor: Ling-Jyh Chen

description

資料通訊 Week 2 (9/20). Instructor: Ling-Jyh Chen. General Information. Time: Tuesday 2:10pm~5:00pm Place: S203 Instructor: 陳伶志 Ling-Jyh Chen Phone: 02-27883799 ext. 1702 Email: cclljj@ iis.sinica.edu.tw TA: 李威賢 [email protected] Course Website: - PowerPoint PPT Presentation

Transcript of 資料通訊 Week 2 (9/20)

Page 1: 資料通訊 Week 2 (9/20)

資料通訊資料通訊 Week 2 (9/20)

Instructor: Ling-Jyh Chen

Page 2: 資料通訊 Week 2 (9/20)

General InformationGeneral Information Time: Tuesday 2:10pm~5:00pm Place: S203 Instructor: 陳伶志 Ling-Jyh Chen

Phone: 02-27883799 ext. 1702 Email: [email protected]

TA: 李威賢 [email protected] Course Website:

http://www.iis.sinica.edu.tw/~cclljj/teaching/ Google Groups: NTNU-2011-data-

communication

Page 3: 資料通訊 Week 2 (9/20)

TextbookTextbook Required:

Data Networks, 2nd edition, Dimitri Bertsekas and Robert Gallager, Prentice Hall, 1992. ( 新月圖書代理 )

Recommended: An Engineering Approach to

Computer Networking, S. Keshav, Addision-Wesley.

Computer Networks, 4th ed., Andrew S. Tanenbaum, Prentice-Hall.

Page 4: 資料通訊 Week 2 (9/20)

ScheduleSchedule

Page 5: 資料通訊 Week 2 (9/20)

GradingGrading

In-Class Participation: 5% Homework: 30% Midterm (closed book): 30% Final (open book): 35%

Page 6: 資料通訊 Week 2 (9/20)

6

Week 2

Textbook: Section 2.3, 2.4

Additional materials FEC Adaptive ARQ

Page 7: 資料通訊 Week 2 (9/20)

7

Sec 2.3 Error Detection Question: How to detect errors?

Error Detection Techniques1. Single Parity Checks

The parity check bit (c) is the sum k, modulo j, of the bit values in the original bit string.

2. Horizontal and Vertical Parity Checks Arrange a string of data bits in a two-dimensional

array. Apply single parity checks to each row and column of

the 2D array.

Ex: Cyclic Redundancy Checks (CRC)

Page 8: 資料通訊 Week 2 (9/20)

8

Sec 2.3 Error Detection (cont.) codecode: refers to the transmission itself code wordcode word: refers to an encoded bit

string (data KK + parity checks LL) KK + L L = frame length

The effectivenesseffectiveness of a code is measured by

The min distance d of the code (ps: 2/4 for method 1/2) => error correction can be possible if there are fewer than d/2 errors

The burst-detecting capability The prob. that a completely random string

will be accepted as error-free

Page 9: 資料通訊 Week 2 (9/20)

9

Sec 2.4 ARQ Question: how to deal with errors? ARQ: Automatic Retransmission reQuest

retransmit the erroneous packets/frames There is always a trade-off for data

transmission: correctnesscorrectness vs efficiencyefficiency

Three types of ARQ Stop and wait ARQ Go back n ARQ Selective repeat ARQ

Page 10: 資料通訊 Week 2 (9/20)

10

Sec 2.4 ARQ (cont.) Stop and wait ARQ (1/4)

* We need Sequence Number (SN)Sequence Number (SN) in the data packets.

Packet 0Packet 0 or 1?

Ack

Node A

Node B

Time at A

Time at B

Page 11: 資料通訊 Week 2 (9/20)

11

Sec 2.4 ARQ (cont.) Stop and wait ARQ (2/4)

* We need Request Number (RN)Request Number (RN) in the ACK packets.

0

Packet 0

Ack

Node A

Node B

Time at A

Time at B

0 1 2

Ack

Nak

?? ??

Page 12: 資料通訊 Week 2 (9/20)

12

Sec 2.4 ARQ (cont.)

Stop and wait ARQ (3/4)

0

0

Node A

Node B

0 1 2 3

1 1 2 3

1 2 3

Page 13: 資料通訊 Week 2 (9/20)

13

Sec 2.4 ARQ (cont.)

Stop and wait ARQ (4/4) S&W ARQ is safesafe: it never produces

incorrect results. S&W ARQ is livelive: it can continue

forever to produce results.

0,0 0,1

1,0 1,1

Even numbered packet received at B

Odd numbered packet received at B

Request for odd packet received at A

Request for even packet received at A

state: (SN mode 2, RN mode 2)

Page 14: 資料通訊 Week 2 (9/20)

14

Sec 2.4 ARQ (cont.)

Go back n ARQ (1/6) S&W ARQ is simple, but ineffective. Go back n ARQ is the most popular

scheme. Idea: several successive packets can

be sent w/o waiting for the next packet to be requested.

a.k.a. sliding window ARQ

Page 15: 資料通訊 Week 2 (9/20)

15

Sec 2.4 ARQ (cont.)

Go back n ARQ (2/6) No errors (n=7)

0

0

Node A

Node B

1 2 3

0 1 2 3

1 2 3

4 5 6

0 5 5

4 5

[0,6] [1,7] [2,8] [3,9] [5,11]

Page 16: 資料通訊 Week 2 (9/20)

16

Sec 2.4 ARQ (cont.)

Go back n ARQ (3/6) Errors in the forward direction (n=4)

Node A

Node B

1 2 3

1 1 1

4

0 1 1

0

0

[0,3] [2,5]

1

1 43

3

2

2

2 3

[1,4]

timeouttimeout

Page 17: 資料通訊 Week 2 (9/20)

17

Sec 2.4 ARQ (cont.)

Go back n ARQ (4/6) Errors in the backward direction

(n=4)

Node A

Node B

1 2 3

1 2 3

4

0 4 5

0

0

[0,3] [5,8]

1

5 54

3

2

2

6

[2,5] [4,7]

54

timeouttimeout

Page 18: 資料通訊 Week 2 (9/20)

18

Sec 2.4 ARQ (cont.)

Go back n ARQ (5/6) Long delay in the backward direction

(n=4)

Node A

Node B

1 2 3

1 3 4

4

0 5

0

0

[0,3] [4,7]

1

1 54

3

3

2

[1,4] [3,6]

4

timeouttimeout

Page 19: 資料通訊 Week 2 (9/20)

19

Sec 2.4 ARQ (cont.) Go back n ARQ (6/6)

Go back n ARQ is safe and live when SN and RN are integers modulo m, for m > n.

The timeout value should be chosen long enough to include round-trip propagation and processing delay plus transmission time for two MAX length packets in the reverse direction.

Go back n ARQ with buffers -> Selective repeat ARQ

Page 20: 資料通訊 Week 2 (9/20)

20

Sec 2.4 ARQ (cont.) Selective repeat ARQ

0

Node A

Node B

1 b

1 … b 0 b+1 … 2b 0 b+1

0 … 0 0 … 0 0 0 …

0

1 b 0

0

Node A

Node B

1 … b 0 b+1 … 2b 2b+1

0 … 0 0 … 0 0 0 …

0

b+1

Page 21: 資料通訊 Week 2 (9/20)

21

FEC: Forward Error Correction

FEC: using redundancy to provide capabilities of correcting minor bit errors in a packet Example: IEEE 802.11a, Bluetooth

Pros: using FEC to correct minor errors in a packet -> reduce the number of retransmissions

Cons: FEC causes overhead -> reduce effectiveness

Solution: adaptation!!

Page 22: 資料通訊 Week 2 (9/20)

22

Adaptive ARQ

We use Bluetooth as the examples.

Example 1: Adaptive Packet Type (ICC’04)

Example 2: Adaptive ARQ Timeout (MNSA’04)

Page 23: 資料通訊 Week 2 (9/20)

Enhancing Bluetooth TCP Throughput Enhancing Bluetooth TCP Throughput

via Packet Type Adaptationvia Packet Type Adaptation

Ling-Jyh Chen, Rohit Kapoor, M. Y. Sanadidi, Mario GerlaLing-Jyh Chen, Rohit Kapoor, M. Y. Sanadidi, Mario GerlaDept. of Computer Science, UCLADept. of Computer Science, UCLA

Page 24: 資料通訊 Week 2 (9/20)

24

Outline of the TalkOutline of the Talk The problem: Wireless interference and bit errors

severely affect TCP efficiency.

The opportunity: Bluetooth offers multiple packet type options with different FEC and packet lengths. Moreover, the link layer API provides link error quality information. Opportunity for cross-layer adaptation.

Key idea: dynamically select packet type based on measured link quality.

The results: we show that the “Adaptive Packet Type” approach in Bluetooth can effectively enhance TCP performance.

Page 25: 資料通訊 Week 2 (9/20)

25

Who still remembers Bluetooth?Who still remembers Bluetooth?

Application Examples Automatic synchronization of calendars, address

books, business cards Proximity operation (camera to cellphone, etc)

Personal Area NetworkPersonal Area Network

Designed for “cable” Designed for “cable” replacementreplacement

Page 26: 資料通訊 Week 2 (9/20)

26

Bluetooth Overview

The “enabler” of Personal Area Network (PAN) Low power, low cost, and smaller chips

Mode FEC

Packet SymmetricThroughput

(kbps)

AsymmetricThroughput

(kbps)Size

(bytes)Length(slots)

DM1 yes 17 1 108.8 108.8 108.8

DM3 yes 121 3 258.1 387.2 54.4

DM5 yes 227 5 286.7 477.8 36.3

DH1 no 27 1 172.8 172.8 172.8

DH3 no 183 3 390.4 585.6 86.4

DH5 no 339 5 433.9 723.2 57.6

Page 27: 資料通訊 Week 2 (9/20)

27

Bluetooth packet typesBluetooth packet types DH: Stop and Wait ARQ

DM: ARQ as well as 2/3 FEC codes to correct single bit errors

FEC coding scheme: (15, 10) Hamming code, each block of 10 information bits is encoded into a 15 bit codeword can correcting a single bit error in each block.

Page 28: 資料通訊 Week 2 (9/20)

28

Throughput AnalysisThroughput Analysis DH mode: (ARQ)

PER:

1 hop Throughput:

DM mode: (ARQ+FEC)PER:

1 hop Throughput:

P: Packet Error Rate, B: Bit Error Rate, S: Packet Size, T: Max Throughput

SB)(P 11

15/1415 )1(15)1(1S

BBBP

kbpsB)(TPTT S 1 )1('

kbpsBBBTTS 15/1415 )1(15)1('

Page 29: 資料通訊 Week 2 (9/20)

29

PER vs BERPER vs BER

Page 30: 資料通訊 Week 2 (9/20)

30

Mode BER range

DH5 <0.0001529

DM5 >0.0001529, and <0.0060795

DM3 >0.0060695, and <0.0157813

DM1 >0.0157813

Bluetooth ThroughputBluetooth Throughput

Page 31: 資料通訊 Week 2 (9/20)

31

Proposed ApproachProposed Approach Adaptive Packet Type (APT):

In BT specs, the function call, Get_Link_Quality, returns the Quality of the specified Link.

We read the returned link Quality Value, and adapt packet type so as to optimize throughput.

Page 32: 資料通訊 Week 2 (9/20)

32

Simulation 1: Fixed BERSimulation 1: Fixed BER

Time: 600 secondsTCP Packet Size: 500 bytesBuffer Size: 9000 bytes

Page 33: 資料通訊 Week 2 (9/20)

33

Simulation 2: Varying BERSimulation 2: Varying BERTime: 600 secondsTCP Packet Size: 500 bytesBuffer Size: 9000 bytesBER: changes between 0.0001 and 0.0005 every 1 second

Page 34: 資料通訊 Week 2 (9/20)

34

ConclusionsConclusions

In Bluetooth, TCP throughput collapses with BER above 0.03% (eg, BER caused by near 802.11 interference)

APT (Adaptive Packet Type) approach can restore TCP throughput to acceptable values for much higher BER (we tested up to .3%)

APT technique can be applied to any wireless link with packet length and FEC options, and with link quality (ie BER) feedback.

Page 35: 資料通訊 Week 2 (9/20)

Audio Streaming over Bluetooth: Audio Streaming over Bluetooth: An Adaptive ARQ Timeout ApproachAn Adaptive ARQ Timeout Approach

Ling-Jyh Chen, Rohit Kapoor, Kevin Lee,

M. Y. Sanadidi, Mario Gerla Department of Computer Science, University of California at Los Angeles

Page 36: 資料通訊 Week 2 (9/20)

36

Introduction

Wireless PAN is becoming popular nowadays. Digital media, such as audio/video streaming, is

becoming more desired than before. The varying nature of the wireless link makes

audio streaming over wireless become a challenging problem.

A well-designed solution should minimize the packet loss rate and delay of perceived streaming data.

Page 37: 資料通訊 Week 2 (9/20)

37

Retransmission - ARQ

Stop-and-wait ARQ: retransmit a packet until either the acknowledgement of a successful reception is received or the retransmission timeout is exceeded.

HighHighLowLowRetransmission timeoutRetransmission timeout

Enlarge the delay, and degrade the streaming quality

Increase reliability

More packets will be dropped, and the streaming quality will become poor

Decrease delay

Page 38: 資料通訊 Week 2 (9/20)

38

Proposed Approach Adaptive ARQ Timeout in Bluetooth

Problem: The deployed stop and wait ARQ is harmful to real-time streaming audio over Bluetooth, especially in the error prone environment.

Aim: to reduce the audio packet delay and loss rate Ideas:

If we spent too much time on sending packet n, then we should decrease RTO on packet n+1

If we save some time on sending packet n, then we should increase RTO on packet n+1

If we drop at least two of the last 5 packets, then we should reset RTO

Page 39: 資料通訊 Week 2 (9/20)

39

RTO Update Equation

Initialization

Update

Reset

9.0 ; 1.1 ; 25.0

%75)(80min

droppedpacket if ;

SRTTRTT if ;

SRTTRTT if ;

'

)1('

SizeUsedBufferizeMaxBufferSRTO

RTO

RTO

RTO

RTO

RTTSRTTSRTT

)2%,75)((80

SizeUsedBufferizeMaxBufferSMaxRTO

RTTSRTT

)2%,75)((80 SizeUsedBufferizeMaxBufferSMaxRTO

Page 40: 資料通訊 Week 2 (9/20)

40

RTP Packet

BNEP

L2CAP

HCI

Baseband

Audio Server

BNEP

L2CAP

HCI

Baseband

Audio Client128kbps MP380 ms/RTP packet

RTP Packet BufferFlush Timeout Packets

RTP Packet RTTLink Quality

Average DelayRTP Packet Loss Rate

Implementation

BlueZBlueZ

BluetoothBluetoothDeviceDevice

DH5 packet

Page 41: 資料通訊 Week 2 (9/20)

41

Experiments

Page 42: 資料通訊 Week 2 (9/20)

42

0

200

400

600

800

1000

1200

1400

400 450 500 550 600

Tim

e (

mse

c)

RTP seqno

RTT

RTO

drop

Page 43: 資料通訊 Week 2 (9/20)

43

10

20

30

40

50

60

70

80

90

100

0 0.0005 0.001 0.0015 0.002 0.0025 0.003 0.0035 0.004 0.0045

Pa

cke

t R

ate

(%

)

Bit Error Rate

Adapt pkt

Fixed 160 pkt

Fixed 400 pkt

Fixed 1200 pkt

Page 44: 資料通訊 Week 2 (9/20)

44

100

150

200

250

300

350

400

0 0.0005 0.001 0.0015 0.002 0.0025 0.003 0.0035 0.004 0.0045

Avg

. D

ela

y T

ime

(m

s)

Bit Error Rate

Adapt delay

Fixed 160 delay

Fixed 400 delay

Fixed 1200 delay

Page 45: 資料通訊 Week 2 (9/20)

45

Conclusion

Such cross-layer optimization can significantly improve application performance in PAN.

Our proposed approach is simple and applicable to other wireless technologies.

Page 46: 資料通訊 Week 2 (9/20)

46

SummarySummary In today’s lecture, we have studied

Error detection schemes Three basic ARQ schemes Two adaptive schemes by combining

ARQ and FEC

What’s next? We will discuss “delay model” in the

next three weeks.