460 likes | 563 Views
資料通訊 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: 李威賢 walker1202@gmail.com Course Website:
E N D
資料通訊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: 李威賢 walker1202@gmail.com • Course Website: • http://www.iis.sinica.edu.tw/~cclljj/teaching/ • Google Groups: NTNU-2011-data-communication
Textbook • 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.
Grading • In-Class Participation: 5% • Homework: 30% • Midterm (closed book): 30% • Final (open book): 35%
Week 2 • Textbook: Section 2.3, 2.4 • Additional materials • FEC • Adaptive ARQ
Sec 2.3 Error Detection • Question: How to detect errors? • Error Detection Techniques • Single Parity ChecksThe parity check bit (c) is the sum k, modulo j, of the bit values in the original bit string. • 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)
Sec 2.3 Error Detection (cont.) • code: refers to the transmission itself • code word: refers to an encoded bit string (data K + parity checks L) • K + L = frame length • The effectivenessof 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
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: correctness vs efficiency • Three types of ARQ • Stop and wait ARQ • Go back n ARQ • Selective repeat ARQ
Packet 0 Sec 2.4 ARQ (cont.) • Stop and wait ARQ (1/4) * We need Sequence Number (SN) in the data packets. Time at A Node A Ack Node B Time at B Packet 0 or 1?
Sec 2.4 ARQ (cont.) • Stop and wait ARQ (2/4) * We need Request Number (RN) in the ACK packets. ? ? 0 0 1 2 Time at A Node A Ack Ack Nak Node B Time at B Packet 0
Sec 2.4 ARQ (cont.) • Stop and wait ARQ (3/4) 0 0 1 2 3 Node A Node B 1 1 2 3 0 1 2 3
Even numbered packet received at B 0,0 0,1 Request for odd packet received at A Request for even packet received at A 1,0 1,1 Odd numbered packet received at B state: (SN mode 2, RN mode 2) Sec 2.4 ARQ (cont.) • Stop and wait ARQ (4/4) • S&W ARQ is safe: it never produces incorrect results. • S&W ARQ is live: it can continue forever to produce results.
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
Sec 2.4 ARQ (cont.) • Go back n ARQ (2/6) • No errors (n=7) [0,6] [1,7] [2,8] [3,9] [5,11] 0 1 2 3 4 5 6 Node A Node B 5 5 0 0 1 2 3 0 1 2 3 4 5
timeout 0 1 2 3 Sec 2.4 ARQ (cont.) • Go back n ARQ (3/6) • Errors in the forward direction (n=4) [0,3] [1,4] [2,5] 0 1 2 3 4 1 2 3 4 Node A Node B 0 1 1 1 1 1 2 3
timeout 0 1 2 3 4 5 Sec 2.4 ARQ (cont.) • Go back n ARQ (4/6) • Errors in the backward direction (n=4) [0,3] [2,5] [4,7] [5,8] 0 1 2 3 4 5 2 4 5 Node A Node B 0 1 2 3 4 5 6
timeout 0 1 2 3 4 Sec 2.4 ARQ (cont.) • Go back n ARQ (5/6) • Long delay in the backward direction (n=4) [0,3] [1,4] [3,6] [4,7] 0 1 2 3 4 1 3 4 5 Node A Node B 0 1 3 4 5
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
0 1 … b 0 0 b+1 … 2b 2b+1 Node A Node B b+1 0 … 0 0 … 0 0 0 … Sec 2.4 ARQ (cont.) • Selective repeat ARQ 0 1 … b 0 b+1 … 2b 0 b+1 Node A Node B 0 … 0 0 … 0 0 0 … 0 1 b 0 1 b
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!!
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 via Packet Type Adaptation Ling-Jyh Chen, Rohit Kapoor, M. Y. Sanadidi, Mario Gerla Dept. of Computer Science, UCLA
Outline 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.
Who still remembers Bluetooth? Personal Area Network Designed for “cable” replacement Application Examples • Automatic synchronization of calendars, address books, business cards • Proximity operation (camera to cellphone, etc)
Bluetooth Overview • The “enabler” of Personal Area Network (PAN) • Low power, low cost, and smaller chips
Bluetooth 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.
Throughput 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
Proposed 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.
Simulation 1: Fixed BER Time: 600 secondsTCP Packet Size: 500 bytesBuffer Size: 9000 bytes
Simulation 2: Varying BER Time: 600 secondsTCP Packet Size: 500 bytesBuffer Size: 9000 bytesBER: changes between 0.0001 and 0.0005 every 1 second
Conclusions • 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: An 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
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.
Decrease delay Increase reliability Retransmission timeout High Low More packets will be dropped, and the streaming quality will become poor Enlarge the delay, and degrade the streaming quality 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.
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
RTO Update Equation • Initialization • Update • Reset
Audio Client Audio Server RTP Packet BNEP BNEP BlueZ L2CAP L2CAP HCI HCI BluetoothDevice Baseband Baseband Implementation 128kbps MP380 ms/RTP packet Average DelayRTP Packet Loss Rate RTP Packet BufferFlush Timeout Packets RTP Packet RTTLink Quality DH5 packet
Conclusion • Such cross-layer optimization can significantly improve application performance in PAN. • Our proposed approach is simple and applicable to other wireless technologies.
Summary • 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.