Hi OpenVPN developers,

I would like to propose and share a lightweight, protocol-independent header
compression algorithm called PIhC (Protocol Independent Header Compression)
for potential evaluation in OpenVPN (especially for bandwidth-constrained
links, TAP/TUN setups, and embedded/IoT devices).

1. Motivation & Core Idea
Unlike traditional header compression schemes (like VJ or ROHC) that require
protocol-specific state machines for IPv4, IPv6, TCP, or UDP, PIhC operates
entirely protocol-agnostically on the first N bytes of any frame (default:
100 bytes).

- Both encoder (PIC) and decoder (PID) maintain an identical ring buffer
  of the last 64 packet headers (6.4 KB static footprint, zero heap/malloc).
- For an incoming packet, the encoder selects the best-matching history
  entry and dynamically computes up to 4 similarity consensus levels using
  64-bit bitmasks.
- Bytes matching the consensus across the selected history subset are
  omitted implicitly; varying header fields and unexpected deviations are
  encoded via compact 1-byte descriptors (3-bit literal count + 5-bit
  regular count, plus 0x00/0xFF fast-path terminators).
- Uncompressed payload bytes are appended untouched.

2. Security Aspect (VORACLE)
Because PIhC strictly compresses the outer/inner header window and leaves
encrypted or application payloads completely untouched, it avoids the
payload-length side-channel issues (such as VORACLE) associated with
general-purpose stream compression (LZO/LZ4).

3. Benchmark Results
Tested against a real-world capture of 154,077 packets (evaluated on the
first ~100 bytes per frame):
- Total input:      15,151,804 bytes
- Compressed size:   8,245,905 bytes
- Total saved:       6,905,899 bytes (45.6% reduction, ~44.82 bytes/packet)
- Reconstruction:   100% lossless (0 decompression mismatches)

4. Transport Synchronization Note
Since encoder and decoder states must stay synchronized, PIhC works out of
the box over reliable transports (e.g., OpenVPN over TCP) or when coupled
with explicit state-update acknowledgments / packet-ID tracking over UDP.

I have a clean, dependency-free C11 implementation (originally developed
and tested on Linux for an ESP32 Application) ready to share:
[https://github.com/carlos62/Protocol-Independent-Header-Compression


Would there be interest in exploring PIhC as an optional header-only
compression module or plugin for OpenVPN? Feedback and critique on the
design are very welcome.

Best regards
Hans Carlos Hofmann

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to