Title: Improved Compression-Latency Trade-Off via Delayed-Dictionary Compression
1Improved Compression-Latency Trade-Off
viaDelayed-Dictionary Compression
- Raanan Refua
- Tel Aviv University
- Under the supervision of Prof. Yossi Matias
2Improved Compression-Latency Trade-Off
- Improving compression ratio for a given latency
constraint - Improving latency for a given compression ratio
3End-to-End Compression
Net 1
Encoder
Decoder
Net 2
Y
X
X
Lenc
Ltx
Ldec
(Transmission Latency)
(Encoding Latency)
(Decoding Latency)
User Latency
4The LAN-to-LAN Framework
5IP-Tunnel
IP Tunnel 1
Public Network
IP Tunnel 2
6VPN over IPSec
Public Network
7Packet Compression Algorithms Types
- Stateless compression (Packet By Packet comp.)
- Streaming compression (Continuous comp.)
- dependency among packets
- Offline compression
- compress send
8Compression Algorithms Comparison
9Compression Ratios vs Mode and Packet Sizes
Small Packets Improvement
10Potential Improvement
11Dictionary Algorithms
Input
Output
Dictionary
12Lempel-Ziv 77
13Lempel-Ziv 77
Pointer
Coding position
Characters
ABABCAADAA...
ABCBBBAC
WindowW
Lookahead Buffer
14LZ77 Dictionary
ABCBBAC
ABCD...
WindowW
Lookahead Buffer
Dictionary A, AB, ABC, ABCD, B, BC, BCD, C,
CD, D,
15Lempel-Ziv-Welch 84
16Streaming Compression Implementation
Encoder
Decoder
Y
X
Decoder
X
Encoder
Rx1
Tx1
Rx1
Tx1
Packets
Packets
ACKs Data
Dictionary
Dictionary
ACKs
ACKs
ACKs
Rx2
Tx2
Rx2
Tx2
17Latency in Streaming Compression
- Large Decoding Latency due to
- Packet drops
- dominating latency
- Packet reordering due to
- retransmissions
- different paths
18Decoding 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 710 cannot be decoded until 6 is
received. - The phrases of packets 710 cannot be added to
the dictionary until packet 6 is received.
19Actual Decoding Latency of Streaming
- Average Ldec for each of 269 Planet-Lab nodes
- 26012 packets per node
- Total Average Ldec 62 packets
- Ldec0 for Stateless
20Ldec Distribution of Streaming
2RTT482 packets
21Improved Compression Latency?
- We would like
- Compression ratio of Streaming
- Latency of Stateless
22Delayed-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
23On-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.
24On-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.
25On-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-?
26On-line Dictionary Compression Algorithms Model
Generalization
dictionary parser Pd
dictionary D(?)
output decoder
Original text T
Compressed text C(T)
27Lempel-Ziv 77 with Delay
Pointer
Coding position
Characters
ABABCAADAA...
ABCBBBAC
WindowW
Delay (?)
Lookahead Buffer
28LZ77 with Delay in Terms of Packets
Pointer
Coding position
ABC
ABC
Currently Encoded Packet
Delay (?)
WindowW
29LZ77 Dictionary with Delay
ABCBBAC
ABCD...
WindowW
Delay (?)
Lookahead Buffer
Dictionary A, AB, ABC, ABCD, B, BC, BCD, C,
CD, D,
30Basic Delayed-Dictionary Compression (BDDC) in
Terms of Packets
Currently decoded packet
1.10001100..
Received by decoder
?99
P1100f(P1P1000) P1101f(P1P1001)
Encoder
Decoder
Encoding
1100f(11000)
Decoding
1100..1000..1
31BDDC Implementation
S.N. of the last packet used for encoding
Packet is Compressed Y/N (a bit)
S.N. of the current packet
32BDDC Implementation (cont.)
Encoder
Decoder
Y
X
Decoder
X
Encoder
Rx1
Tx1
Rx1
Tx1
Packets
Packets
ACKs Data
Q
?
Dictionary
Dictionary
ACKs
ACKs
ACKs
Rx2
Tx2
Rx2
Tx2
33Decoding Latency in BDDC (?5)
- 1, 2, 3, 4, 5, 7, 8, 9, 10, 6
- Packet 6 dropped and retransmitted
- Now we can decode packets 710
- No decoding latency
- The phrases of packets 710 still can not be
added to the dictionary until packet 6 is
received
34Effect of Encoding Delay on Compression Quality
r
?
35Encoding Delay Vs. Compression Quality
Pointer
Coding position
Characters
ABABABADAA...
ABCDBBBAC
ABABCDAA...
WindowW
Lookahead Buffer
Without delay
36Encoding Delay Vs. Compression Quality (cont.)
Pointer
Coding position
Characters
ABABBADAA...
ABCDBBBAC
ABABCDAA...
Delay (?)
WindowW
Lookahead Buffer
With delay
37DDC vs Stateless vs StreamingLarge Packets
header20 bytes, payload1500
bytes Concatenation of 18 Calgary-Corpus files
38DDC vs Stateless vs StreamingSmall Packets
header20 bytes, payload125
bytes Concatenation of 18 Calgary-Corpus files
39Effect of Encoding Delay on Decoding Latency
Ldec
?
40Effect of Encoding delay on Decoding Latency
Currently decoded packet
1m..i1m?
?1?
Received by the decoder
1mi2m?/2
?2?/2
?1 gt ?2 gt ?3 Ldec1 lt Ldec2 lt Ldec3
1mi3m?/4
?3?/4
41The Compression-Latency Trade-off
Ldec
r
?
42BDDC Conflict
43Trade-off between the Decoding-Latency and the
Compression Ratio
Compression Ratio
Stateless (?8)
Confirmed-Dictionary Compression (?Conf)
DDC (?)
Streaming (?0)
Ldec
44DDC algorithms
- BDDC - Fixed Delay Algorithm
- BDDC - Adaptive Delay Algorithm
- Confirmed-Dictionary Compression (CDC)
- DDC-min
- DDC
45DDC Algorithms (cont.)
- Fixed Delay Algorithm
- ? is constant
- ? is proportional to the network propagation
delay (requires calibration)
46DDC Algorithms (cont.)
- Adaptive Delay Algorithm
- Maintains a delay parameter, depending on
- decoding success
- changes in p for packet drops
47DDC 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
1xxxxx..
max ?
All packets received by the decoder
48DDC 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
49Compression Methods Characteristics
Streaming DDC Stateless
ordered displacement lt ? no order Decoding Order
required required not required Retransmissions
O(displacement) O(displacement) O(1) Buffer Size
50DDC 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
51DDC-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
52Advantage of DDC-min
- Encoding assumptions
- 1 CPU implementation
- packet 1100 is current packet
- ?99 (D contains phrases from 11000)
- Packet 1100 was compressed by phrases from
1990,1100 - Decoding assumptions
- Packets 1990,1100 were received
53Advantage of DDC-min (cont.)
- Packet 1100 is undecodable
- Decoder has to wait for packets 9911000 and add
them to D - After packets are added phrase numbers are now
consistent - In 2 CPUs implementation
- We do not depend on packet 1100?
- We do not wait for packets 9911000
54DDC BDDC ? Stateless
- DBDDC i D (1i-?-1)
- DDDC i DBDDC i ? DStateless i
DBDDC i D(1i-?-1)
DBDDC i1
Rollback
DDDC i1
DDDC i-1
DDDCi DBDDC i ? DStateless i
55DDC Implementation
DDDC i
DBDDC i
DStateless i
Last Phrase Numberj
First Phrase Numberj1
Dictionary Insertion if (phrase x?DBDDC i)
(phrase x?DStateless i) add x to DStateless i
56Graph Based Dictionaries
BDDC
DDC
?
BDDC
57Non Compact Tries
B
G
I
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
58Trie Implementation 1
Root
B
G
O
I
G
O
59Trie Implementation 1 (cont.)
Root
G
B
C
O
I
D
O
E
G
60Trie Implementation 2
A
B
G
I
O
G
A
O
A
O
L
T
S
61Suffix Tree
0
O
BOOKK
3
KK
OKK
KK
2
1
4
5
62Suffix Tree (cont.)
0
O
BOOKK
K
3
2
1
OKK
KK
K
E
E
6
7
9
E
4
E
E
5
8
10
11
63Flexible Parsing Finger Print
Entry
short Code char Symbol short Dref long
Tstamp Entry Nptr
Table Size32771
Entry Entry Entry
Dictionary (hash)
Entry
Entry
A new node
Entry
Entry
64Waiting Packets
all_received
0
8kbytes-1
1 1 1
0
00
Received
...0
1
1
0
Waiting
0
...0
Waiting low
Waiting high
Waiting Packets2
65Eager Decoding
- Each packet contains data about the history
- The Decoder may be able to decode received
packets, without all the required history
66When to Use DDC?
- Latency critical applications
- Order is not required by application (preferable)
- Packet drops are allowed
- use retransmission for dictionary update purposes
67Example Applications
- VoIP Compression
- Raw Video Compression
- TFTP (over UDP)
- Fast transfer of files
- Fast transfer of memory areas
68Example 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
TCP
Decoding Latency
SS7
SMSC
PC2
Encoder
Decoder
PC3
PC4
User Latency
69Example Applications (cont.)
- Instant Messaging
- A packet should be enough for each message
- Network Management
- Multicast/Broadcast of control messages
- Deploying information to remote nodes
- Sensor networks
70Experimentation on Internet
TAU
Tx planetlab1.tau.ac.il Rx 269 Planet-Lab nodes
71Packet Drop Probability
- Experiment Description
- Concatenation of 18 Calgary-Corpus files
- 3.25MB
- Transmission with UDP
- Each packet contains 125B of data
- Transmission to 269 nodes
- Results
- Pdrop1.27
- Psuccess98.73
- Var0.002
72Packet Reordering Probability
Probability Retransmissions
134 / 7M no
0.008 yes
73Decoding Latency of Streaming
74Decoding Latency vs Encoding Delay
75Ldec Distribution of Streaming vs. BDDC with ?300
76Ldec Distribution of Streaming vs. BDDC with
?300 (cont.)
Max Ldec Value Waiting Packets
963 or 4RTT 18.8 Streaming
183483-300 or 2RTT-? 0 12 BDDC ?300
77Single Packet Drop
. . . . . . . . . . . ?500
. . 1 82 . . . . . . . ?400
. . 1 82 182 . . . . . . ?300
. . 1 82 182 282 . . . . . ?200
. . 1 82 182 282 382 . . . . ?100
. . 1 82 182 282 382 433 481 482 . Streaming
114001449,1450,1451,14521500155116511751185
11932,1450,1933
- RTT 5000msec
- Each packet 20.1mSec
- 482 packets 9.7Sec
78A favorable trade-off
- Compression ratio close to streaming
- Decoding latency close to stateless
79Related Work
- Header Compression
- J. Lilley, J. Yang, H. Balakrishnan, and S.
Seshan, A unified header compression framework
for low-bandwidth links, ACM/IEEE International
Conference on Mobile Computing and Networking,
pp. 131142, 2000.
80Related Work (cont.)
- Stateless Payload Compression
- A. Shacham et al IP payload compression protocol
(IPComp), IETF, RFC 2393, 1998 - R. Friend and R. Monsour, IP payload compression
using LZS, IETF, RFC 2395, 1998 - R. Pereira, IP payload compression using
DEFLATE, IETF, RFC 2394, 1998
81Related Work (cont.)
- Payload Compression
- S. Dorward and S. Quinlan, Robust data
compression of network packets, Bell Labs, 2000,
Unpublished manuscript
82Related Work (cont.)
S. Dorward and S. Quinlan - thwack
83Possible Extensions
- DDC can be used on any on-line compression
algorithm (e.g. Deflate) - Implementation of eager decoding
- Multi-Media applications
- voice compression
- download Raw images to mobile phones
84Conclusions
- Improved Compression-Latency Trade-off
- Delayed-Dictionary Compression Algorithm
- Experimentation over the internet with Planet-Lab