Internet Networking Recitation #3: Header Compression
Internet Networking Recitation #3: Header Compression
Internet Networking Recitation #3: Header Compression
recitation #3
Header Compression
Internet Networking 2
Header Compression
This is not an end to end compression.
Compression is done in the ingress point of the (slow) serial link.
Decompression is done in the egress point of the serial link.
Compression is done between the network and the link layers.
Transparent to the network and transport layers.
RTP RTP
UDP UDP
IP
IP IP
H.C. H.C.
Link Layer
Link Layer Link Link
Internet Networking 3
Basic Idea
Internet Networking 4
TCP/IP Headers
Internet Networking 5
Constant Fields
In a TCP connection
many fields are likely
to remain constant.
A connection is
defined by:
source IP and port,
destination IP and
port.
Internet Networking 6
Unnecessary and Changeable Fields
Internet Networking 7
Changeable Fields
Internet Networking 8
Compressed Packet Format
Internet Networking 9
Compressed Packet Format
Internet Networking 10
Packet Types
Internet Networking 11
The Compression System
IP packets go through the compressor.
TYPE_IP is selected if
Non-TCP packets.
IP fragments.
UNCOMPRESSED_TCP is selected if
The connection is new.
One of the constant fields has changed.
The delta in one of the changeable fields is large or negative.
Otherwise, COMPRESSED_TCP is selected.
Internet Networking 12
The Compression System
The decompressor checks the type of incoming packets.
TYPE_IP packets are simply pass through.
UNCOMPRESSED_TCP packets
The connection number is extracted and used as an index in the
array of saved headers.
The header is copied into the array.
The TCP protocol number is restored to the protocol field in the IP
header.
COMPRESSED_TCP packets
The last packet from that connection is extracted from the array of
saved header using the connection number.
The compressed header is used to restore a new TCP/IP header
and construct a new TCP/IP packet.
The new header is stored in the array.
Internet Networking 13
Error detection
Internet Networking 14
IP/UDP/RTP Headers Compression
Internet Networking 15
IP/UDP/RTP Headers
+-------------------------------+--------------------------------+
| Source Port | Destination Port | U
+-------------------------------+--------------------------------+ D
| Length | Checksum | P
+---+-+-+-------+-+-------------+--------------------------------+
|V |P|X| CC |M| PT | Sequence Number +
+----------------------------------------------------------------+
R
| Time Stamp + T
+----------------------------------------------------------------+ P
| Synchronization Source Identifier +
+----------------------------------------------------------------+
Internet Networking 16
RTP header fields
version (V) - version of RTP (2 bits).
extension (X) – set to 1 if the fixed header is followed by exactly one
header extension (1 bit).
CSRC count (CC) - contains the number of CSRC identifiers that
follow the fixed header (4 bits ).
payload type (PT) - the format of the RTP payload (7 bits ).
sequence number (16 bits).
timestamp – the time sampling of the first octet in the packet (32 bits).
increments by one for each RTP data packet sent.
receiver matches the video with corresponding audio data using timestamp.
SSRC - the synchronization source (32 bits).
receiver may need to synchronize data from several sources.
CSRC list - the contributing sources for the payload contained in this
packet. The number of identifiers is given by the CC field (up to 15
items, 32 bits each).
Set by mixer upon re-synchronizing incoming audio from different sources
Internet Networking 17
Compressed RTP (RFC 2508).
Internet Networking 18
Compressible fields
Constant fields
SSRC identifier is constant in a given context
CC and CSRC list are mostly unchanged.
Constant difference
sequence number will increment by one for each packet.
Timestamp:
• For audio - increment by number of sample periods.
• For video - change on the first packet of each frame.
Redundant fields:
UDP length field.
UDP checksum sometimes set to zero and not calculated.
Internet Networking 19
Packet formats
Internet Networking 20
Compressed RTP header
+-------------------------------+
| msb of session context ID |
M = RTP marker bit +-------------------------------+
| lsb of session context ID |
S = RTP sequence number +---+---+---+---+---+---+---+---+
| M | S | T | I | link sequence |
T = RTP timestamp +---+---+---+---+---+---+---+---+
| |
I = IPv4 packet ID + UDP checksum +
| |
L = RTP CSRC count and list +-------------------------------+
| M'| S'| T'| I'| CC |
Last bits of the sequence +-------------------------------+
| delta IPv4 ID |
number help loss detection. +-------------------------------+
| delta RTP sequence |
If MSTI bits set, then the real +-------------------------------+
values with CC will follow and | delta RTP timestamp |
CSRC list will fully appear. +-------------------------------+
| |
| CSRC list |
+-------------------------------+
| |
/ RTP data /
+-------------------------------+
Internet Networking 21
Error Detection and Recovery
Relies on a layer II error detection.
A 4-bit sequence number is added to every
compressed packet.
Used to detect a missing packet.
In case the receiver detects a corrupted or missing
packet, it requests the sender to retransmit the
packet.
Internet Networking 22