620 likes | 791 Views
Improved Compression-Latency Trade-Off via Delayed-Dictionary Compression. Raanan Refua Tel Aviv University Under the supervision of Prof. Yossi Matias. Improved Compression-Latency Trade-Off. Improving compression ratio for a given latency constraint
E N D
Improved Compression-Latency Trade-Off viaDelayed-Dictionary Compression Raanan Refua Tel Aviv University Under the supervision of Prof. Yossi Matias
Improved Compression-Latency Trade-Off • Improving compression ratio for a given latency constraint • Improving latency for a given compression ratio
End-to-End Compression Net 1 Decoder Encoder Y Net 2 X X Lenc Ltx Ldec (Transmission Latency) (Encoding Latency) (Decoding Latency) User Latency
Network Processor Network Processor Network Processor Network Processor Public Network The LAN-to-LAN Framework
Network Processor Network Processor Network Processor IP-Tunnel IP Tunnel 1 Public Network IP Tunnel 2
Network Processor Network Processor VPN over IPSec Public Network
Packet Compression Algorithms Types • Stateless compression (Packet By Packet comp.) • Streaming compression (Continuous comp.) • dependency among packets • “Offline” compression • compress & send
Compression Ratios vs Mode and Packet Sizes Small Packets Improvement
Streaming Compression Implementation Decoder Encoder Y X Decoder X Encoder Rx1 Tx1 Rx1 Tx1 Packets Packets [ACKs Data] Dictionary Dictionary ACKs ACKs ACKs Tx2 Rx2 Tx2 Rx2
Encoder Decoder Packets Packets X Y X Dictionary Dictionary Latency in Streaming Compression Large Decoding Latency due to • Packet drops • dominating latency • Packet reordering due to • retransmissions • different paths
Decoding Latency in Streaming 1, 2, 3, 4, 5, 7, 8, 9, 10, 6 • Packet 6 is dropped and retransmitted • Ldec for packet 7 = 4 • Packets 7…10 cannot be decoded until 6 is received. • The phrases of packets 7…10 cannot be added to the dictionary until packet 6 is received.
Actual Decoding Latency of Streaming • Average Ldec for each of 269 Planet-Lab nodes • 26012 packets per node • Total Average Ldec = 62 packets • Ldec=0 for Stateless
Improved Compression & Latency? • We would like • Compression ratio of Streaming • Latency of Stateless
Delayed-Dictionary Compression (DDC) • Contains a sub-method called Basic-DDC (BDDC) • Streaming with enforced delay in the creation of the dictionary • Dictionary does not use the most recent history • Compression ratio is close to Streaming • Decoding Latency is close to Stateless
On-line Dictionary Compression Algorithms Model dictionary parser Pd dictionary D output parser Po Input: T Output: C(T) Encoder - a model for incremental dictionary compression algorithm C. The model enables complete separation between the dictionary parser and the output parser.
On-line Dictionary Compression Algorithms Model dictionary parser Pd dictionary D output decoder Original text: T Compressed text: C(T) Decoder - a model for incremental dictionary decompression C’. The model enables complete separation between the dictionary parser and the output decoder.
On-line Dictionary Compression Algorithms Model Generalization dictionary parser Pd dictionary D(Δ) output parser Po Input: T Output: C(T) D at point t is a function of text up to point t-Δ
On-line Dictionary Compression Algorithms Model Generalization dictionary parser Pd dictionary D(Δ) output decoder Original text: T Compressed text: C(T)
Lempel-Ziv 77 with Delay Pointer Coding position Characters ABABCAADAA... ABCBBBAC… |Window|=W Delay (Δ) Lookahead Buffer
LZ77 with Delay in Terms of Packets Pointer Coding position ABC… ABC… Delay (Δ) Currently Encoded Packet |Window|=W
Basic Delayed-Dictionary Compression (BDDC) in Terms of Packets Currently decoded packet 1………………….1000…………1100……………….. Received by decoder Δ=99 P1100=f(P1…P1000) P1101=f(P1…P1001) … Encoder Decoder Encoding 1100=f(1…1000) Decoding 1100……..1000………..1
BDDC Implementation Header Information: S.N. of the last packet used for encoding Packet is Compressed Y/N (a bit) S.N. of the current packet
BDDC Implementation (cont.) Decoder Encoder Y X Decoder X Encoder Rx1 Tx1 Rx1 Tx1 Packets Packets [ACKs Data] Q Δ Dictionary Dictionary ACKs ACKs ACKs Tx2 Rx2 Tx2 Rx2
Decoding Latency in BDDC (Δ=5) 1, 2, 3, 4, 5, 7, 8, 9, 10, 6 • Packet 6 dropped and retransmitted • Now we can decode packets 7…10 • No decoding latency • The phrases of packets 7…10 still can not be added to the dictionary until packet 6 is received
Encoding Delay Vs. Compression Quality Pointer Coding position Characters ABABABADAA... ABABCDAA... ABCDBBBAC… |Window|=W Lookahead Buffer Without delay
Encoding Delay Vs. Compression Quality (cont.) Pointer Coding position Characters ABABBADAA... ABABCDAA... ABCDBBBAC… Delay (Δ) |Window|=W Lookahead Buffer With delay
DDC vs Stateless vs StreamingLarge Packets |header|=20 bytes, |payload|=1500 bytes Concatenation of 18 Calgary-Corpus files
DDC vs Stateless vs StreamingSmall Packets |header|=20 bytes, |payload|=125 bytes Concatenation of 18 Calgary-Corpus files
Effect of Encoding delay on Decoding Latency Currently decoded packet 1………………m…………………………..i1=m+Δ Δ1=Δ Received by the decoder 1………………m……………i2=m+Δ/2 Δ2=Δ/2 Δ1 > Δ2 > Δ3 Ldec1 < Ldec2 < Ldec3 1………………m……i3=m+Δ/4 Δ3=Δ/4
The Compression-Latency Trade-off r Ldec Δ
1.0 0.5 0 BDDC Av Ldec (packets) DDC Traffic Compression Ratio BDDC Conflict
Trade-off between the Decoding-Latency and the Compression Ratio Compression Ratio Stateless (Δ=∞) Confirmed-Dictionary Compression (ΔConf) DDC (Δ) Streaming (Δ=0) Ldec
DDC algorithms • BDDC - Fixed Delay Algorithm • BDDC - Adaptive Delay Algorithm • Confirmed-Dictionary Compression (CDC) • DDC-min • DDC
DDC Algorithms (cont.) Fixed Delay Algorithm • ∆ is constant • ∆ is proportional to the network propagation delay (requires calibration)
DDC Algorithms (cont.) Adaptive Delay Algorithm • Maintains a delay parameter, depending on • decoding success • changes in p for packet drops
DDC Algorithms (cont.) Confirmed-Dictionary Compression (CDC) Algorithm • The Encoder registers the ACKs • max Δ s.t. ACK received for all packets prior to previous Δ packets • Ensures immediate decoding • Tradeoff in the compression ratio • Does not required a retransmission Currently decoded packet ACKs List 1…………………x……x……x……x……x….. max Δ All packets received by the decoder
DDC Algorithms (cont.) CDC Variant – good for lossy traffic • Choose a large enough Δ • If Packet i was not ACKed • Throw it from the queue • Does not required a retransmission
DDC vs Stateless, Streaming DDC vs Stateless • Saves much larger amounts of Bandwidth • Especially for small packets DDC vs Streaming • Smaller latency • DDC good for latency sensitive applications • Packet drops allowed (up to Δ) for decoding • Packet reordering allowed
DDC-min • Compress in parallel with Stateless and BDDC • Transmit according to min {Stateless,BDDC,Uncompressed} • Use a bit in the header to sign the compression method
DDC = BDDC Stateless • DBDDC i =D(1…i-Δ-1) • DDDC i = DBDDC i DStateless i DBDDC i = D(1…i-Δ-1) DBDDCi+1 Rollback DDDCi-1 DDDCi+1 DDDCi = DBDDCiDStatelessi
DDDC i DDC Implementation DBDDC i DStateless i First Phrase Number=j+1 Last Phrase Number=j Dictionary Insertion: if (phrase xDBDDC i) & (phrase xDStateless i) add x to DStateless i
Graph Based Dictionaries BDDC DDC BDDC
$ B G I $ Non Compact Tries O O L G $ O S W G BIG$ L L D H E $ I R BILL$ $ $ N GOOD$ GOSH$ $ G BIGGER$ $ A new phrase BOWLING$
Eager Decoding • Each packet contains data about the history • The Decoder may be able to decode received packets, without all the required history
When to Use DDC? • Latency critical applications • Order is not required by application (preferable) • Packet drops are allowed • use retransmission for dictionary update purposes
Example Applications • VoIP Compression • Raw Video Compression • TFTP (over UDP) • Fast transfer of files • Fast transfer of memory areas
Example Applications (cont.) • SMS Chat from a PC to a Mobile Phone • SMS messages are transferred via the SS7 network • SMS uses “Submit ACK” ICQ Clients Mobile Phone Users PC1 Decoding Latency TCP SS7 SMSC PC2 Encoder Decoder PC3 PC4 User Latency