Summary
- RFC 2004 does not add a second IPv4 header. It edits the packet's own header for the tunnel hop, parks the displaced fields in an eight- or twelve-octet Minimal Forwarding Header, and hands the exit a reconstruction job.
- The S bit drops the original source only when the tunnel entry is already that source — a conformance-dependent compression rule, not a credential.
- The forwarding checksum covers only the small inserted header. A clean reconstruction proves the restoration rules ran, not that the original identity, tunnel authorization, path or delivery were ever verified.
A cheaper envelope: edit the header you already have
Most tunnels are polite. They wrap the packet in a fresh envelope and leave the original untouched — the approach RFC 2003 takes, at the price of a full twenty-octet outer IPv4 header. RFC 2004 chose the cheaper, braver route: leave the payload exactly where it is, rewrite the packet's own header for the journey, and slip a compact forwarding header between the two.
So the tunnel-visible header is not a copy with a life of its own. It is the original header doing a temporary job. Protocol becomes 55. Destination becomes the tunnel exit. If the entry is forwarding someone else's datagram, source becomes one of the entry's own addresses. Total Length grows by the inserted slip, and the IP header checksum is recomputed.
The arithmetic is easy: the short form adds eight octets, twelve fewer than a bare outer header; the long form adds twelve, saving eight. But the count hides the real bargain. A complete inner header is a retained record. RFC 2004 keeps selected fields and a procedure for putting them back.
The optional four bytes are a claim about equality
The Minimal Forwarding Header always preserves the original Protocol and original destination. It preserves the original source only when the S bit is one. In that long form, the entry replaced the IP source with its own address and needs four more octets so the exit can recover the sender's address.
When S is zero, the field is simply absent. The intended reason is precise: the encapsulator was already the original source, so the source still visible in the modified IP header is also the value needed after decapsulation. The protocol does not save a value it believes it already has.
This is efficient conditional encoding. It is not a credential. A conforming receiver may use S to parse eight or twelve octets and to decide whether it must restore a source field. The bit does not prove who configured the tunnel, whether the visible address was authorized, or whether the node that emitted the packet was entitled to speak for that source. Absence reduces bytes; it also removes an independent copy that could have been compared.
Two checksums answer two smaller questions
The inserted header carries a 16-bit one's-complement checksum. Its scope is exactly the Minimal Forwarding Header, with the checksum field treated as zero. The modified IPv4 header and the following payload are explicitly excluded. A valid value therefore supports a limited observation: the saved Protocol, S/reserved bits and saved address words are internally consistent under that checksum at this point.
The modified IPv4 header has its own checksum, updated for its current Protocol, addresses and Total Length. At the exit, restoration changes those fields again, removes eight or twelve octets, reduces Total Length and requires a new IP header checksum. These are separate integrity domains and separate processing events. Neither checksum is a signature; neither authorizes the tunnel; neither covers the application payload end to end.
Restoration is not a rewind
RFC 2004 says the exit restores fields from the forwarding header and removes it. That does not mean the exit reproduces a byte-for-byte photograph of the ingress header. The old IP checksum was not preserved; a new checksum is calculated over the reconstructed current header. More importantly, the original TTL stays in the one modified header for the whole tunnel journey. Ordinary forwarding decrements it, so tunnel hops remain visible to tools such as traceroute. The exit does not restore the earlier TTL.
The reconstructed packet is semantically ready to continue under IPv4 rules. That is a useful and testable result. It is still bounded. A successful decapsulation does not establish which physical path was taken, whether every intermediate action was authorized, whether the source identity was genuine, whether the next hop accepted the packet, or whether an application received anything.
The shortest header refuses already-fragmented input
Minimal encapsulation must not be used when the original datagram is already fragmented: the compact forwarding header has no place to save the existing fragmentation information. This is a precondition at entry, not a ban on all later fragmentation. After encapsulation, ordinary IPv4 options and fragmentation remain available unless DF is set, and RFC 1191 remains relevant to path-MTU behavior.
Routing-loop precautions and tunnel ICMP handling are not reinvented here. RFC 2004 points to RFC 2003, including tunnel soft state. Its security section is even more restrained: security is not addressed, beyond saying the considerations are generally similar to RFC 2003. Protocol 55 and a valid reconstruction therefore cannot carry security claims the document never assigned to them.
Why a 1996 byte-saving trick still matters
RFC 2004 emerged beside RFC 2002 as an optional way to trim Mobile IP carriage overhead, but registration and mobility binding are separate records. The RFC Editor and IETF Datatracker establish the document and its Proposed Standard status; neither shows a deployment. That gap is exactly Lu Heng's Running-Code Primacy: publication is a specification event, while operation must be shown by running evidence. His Minimum Initial Specification and Reality Layers sharpen the same discipline. A compact common format can make reconstruction deterministic without making every surrounding claim true.
The lesson outlives the protocol. Every byte a tunnel saves by omission is a byte someone downstream must reconstruct — and every reconstruction is a small act of trust dressed up as arithmetic.
Sources
- RFC 2004 — Minimal Encapsulation within IP
- RFC Editor record for RFC 2004
- IETF Datatracker record for RFC 2004
- RFC 791 — Internet Protocol
- RFC 1191 — Path MTU Discovery
- RFC 2003 — IP Encapsulation within IP
- RFC 2002 — IP Mobility Support
- RFC 1241 — Scheme for an Internet Encapsulation Protocol
- RFC 1326 — Mutual Encapsulation Considered Dangerous
- Lu Heng — Running-Code Primacy
- Lu Heng — Minimum Initial Specification
- Lu Heng — On Reality Layers
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






