資料通訊 week 2 (9/20)
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 PresentationTRANSCRIPT
資料通訊資料通訊 Week 2 (9/20)
Instructor: Ling-Jyh Chen
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
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.
ScheduleSchedule
GradingGrading
In-Class Participation: 5% Homework: 30% Midterm (closed book): 30% Final (open book): 35%
6
Week 2
Textbook: Section 2.3, 2.4
Additional materials FEC Adaptive ARQ
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)
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
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
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
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
?? ??
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
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)
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
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]
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
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
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
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
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
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!!
22
Adaptive ARQ
We use Bluetooth as the examples.
Example 1: Adaptive Packet Type (ICC’04)
Example 2: Adaptive ARQ Timeout (MNSA’04)
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
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.
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
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
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.
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('
29
PER vs BERPER vs BER
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
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.
32
Simulation 1: Fixed BERSimulation 1: Fixed BER
Time: 600 secondsTCP Packet Size: 500 bytesBuffer Size: 9000 bytes
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
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.
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
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.
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
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
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
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
41
Experiments
42
0
200
400
600
800
1000
1200
1400
400 450 500 550 600
Tim
e (
mse
c)
RTP seqno
RTT
RTO
drop
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
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
45
Conclusion
Such cross-layer optimization can significantly improve application performance in PAN.
Our proposed approach is simple and applicable to other wireless technologies.
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.