200 likes | 314 Views
Internet Networking Spring 2006. Tutorial 14 Header Compression. Motivation. The size of network and transport layers headers may be a significant overhead for small packets. A problem in slow links. Examples: VoIP traffic over wireless or cellular medium.
E N D
Internet Networking Spring 2006 Tutorial 14 Header Compression
Motivation • The size of network and transport layers headers may be a significant overhead for small packets. • A problem in slow links. • Examples: • VoIP traffic over wireless or cellular medium. • 16kb/s data rate with a 20ms sampling rate produces packets with 40 bytes of data. • Using Telnet over slow modem connection. In many cases the data size is one byte. • Solution: Compress the headers • RTP/UDP/IP headers compression is defined in RFC 2508. • TCP/IP headers compression is defined in RFC 1144.
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.
Header Compression RTP RTP UDP IP H.C. Link Layer UDP IP Link Layer IP H.C. Link Link
Basic Idea • The sender and receiver keep track of active connections. • The receiver keeps a copy of the header from the last packet from each connection. • Differential coding: The delta between the current and the previous packet is sent. • A connection number is sent with the compressed packet.
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.
Unnecessary and Changeable Fields • Some fields are unnecessary • Total length (redundancy with layer II protocols). • IP checksum (only Packet ID is left in the IP header). • The other fields may be changed. However, they do not all change at the same time. • E.g. in an ACK packet the sequence number may remain constant. • The sender sends only the fields that are changed. • It uses the copy of the last packet that was sent for each connection. • A bit mask that indicates which fields were sent precedes these fields.
Changeable Fields • How the fields change? • The difference between current and previous Packet ID is small (usually 1). • The difference between current and previous sequence number is less than 216 (i.e. 2 bytes). • The differences in the changing fields are sent rather than the fields themselves.
Compressed Packet Format • The first byte is a bit mask that identifies which of the fields are actually changed. • TCP Checksum of the original packet is located in the compressed header. • An end-to-end integrity check is still valid. • Used for error detection and resynchronization. • Connection Number may be omitted if is identical to the Connection Number of the previous packet sent.
Packet Types • The sender can send 3 types of packets. • The packet type is stored in the header of the link layer protocol. • TYPE_IP - regular uncompressed IP packets. • UNCOMPRESSED_TCP - identical to the original packets except the IP protocol field is replaced with a connection number. • Use to (re-)synchronizes the receiver. • Use to send a TCP packet of new connection. • COMPRESSED_TCP
The Compression System • IP packets goes 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. • If COMPRESSED_TCP or UNCOMPRESSED_TCP is chosen, then the packet header is copied into the array.
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 into the an 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.
Error detection • Error detection should be provided by layer-II. • Transmission errors are detected by the egress point of the line. • In such a case all following packets without a connection number is discarded. • Problem: a missed packet cannot be detected by the egress node of the line. • This can corrupt all the packets that follow. • TCP checksum is not compressed, hence end-to-end reliability is provided.
IP/UDP/RTP Headers Compression • Real-time Transport Protocol provides network transport functions for real-time applications such as audio and video. • IP, UDP and RTP are typically used in conjunction when delivering real-time traffic. • The three headers contain 40 bytes. • When the payload is small (e.g. VoIP) it is desirable to compress the three headers.
UDP RTP IP/UDP/RTP Headers +-------------------------------+--------------------------------+ | Source Port | Destination Port | +-------------------------------+--------------------------------+ | Length | Checksum | +---+-+-+-------+-+-------------+--------------------------------+ |V |P|X| CC |M| PT | Sequence Number + +----------------------------------------------------------------+ | Time Stamp + +----------------------------------------------------------------+ | Synchronization Source Identifier + +----------------------------------------------------------------+
IP/UDP/RTP Headers • Headers compression is done in the same way as IP/TCP compression. • Constant fields are removed. • Differential coding of the changeable fields. • However, • Constant first order differences are not sent (Packet ID, Time Stamp). • A connection is identified by: source IP and port, destination IP and port, synchronization source of the RTP.
Changeable fields +-------------------------------+ | msb of session context ID | +-------------------------------+ | lsb of session context ID | +---+---+---+---+---+---+---+---+ | M | S | T | I | link sequence | +---+---+---+---+---+---+---+---+ | | + UDP checksum + | | +-------------------------------+ | M'| S'| T'| I'| CC | +-------------------------------+ | delta IPv4 ID | +-------------------------------+ | delta RTP sequence | +-------------------------------+ | delta RTP timestamp | +-------------------------------+ | | | CSRC list | +-------------------------------+ | | / RTP data / +-------------------------------+ • M = RTP marker bit • S = RTP sequence number • T = RTP timestamp • I = IPv4 packet ID • L = RTP CSRC count and list
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.