Skip to content
Draft

spec #1757

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0bbe020
fix(net): Validate the RFC 4884 original datagram field as the RFC says
daniel-noland Aug 19, 2026
65c4257
build(duvet): Track RFC 4884 compliance, and vendor the specification
daniel-noland Aug 19, 2026
72f0763
build(duvet): Track RFC 5382, and record where masquerade departs fro…
daniel-noland Aug 19, 2026
69fd6ee
build(duvet): Track RFC 4787, and record where masquerade departs fro…
daniel-noland Aug 19, 2026
d82c4e6
test(masquerade): State RFC 4787 endpoint independence as a property
daniel-noland Aug 19, 2026
26bf67f
test(masquerade): Assert RFC 4787 outbound refresh, and where it is not
daniel-noland Aug 19, 2026
2cc490c
test(masquerade): Classify the filtering, and check RFC 4787 determinism
daniel-noland Aug 19, 2026
cf3a4df
test(masquerade): State RFC 4787 REQ-12 as an executable contract
daniel-noland Aug 19, 2026
42527c6
test(masquerade): Make a stale citation a build failure
daniel-noland Aug 19, 2026
87c2890
docs(forwarding): Record RFC 4787 REQ-13, and why it is one decision …
daniel-noland Aug 20, 2026
9adc6a1
fix(duvet): Regenerate the snapshot the REQ-12 and REQ-13 commits lef…
daniel-noland Aug 20, 2026
5c7f408
test(net): Take the RFC 4884 minimum from both sides, in both families
daniel-noland Aug 21, 2026
35afeac
test(nat): Cite port overloading on the code that could commit it
daniel-noland Aug 21, 2026
7d4b3e6
test(nat): Cite the exhaustion walk alongside the stage property
daniel-noland Aug 21, 2026
23316ce
ci(dev): Gate on the compliance snapshot and print its tables
daniel-noland Aug 27, 2026
b6d2c11
fix(net): Read the RFC 4884 length attribute from the ICMP header
daniel-noland Aug 27, 2026
d331b79
fix(net): Stop reading a length attribute out of an ICMPv6 pointer
daniel-noland Aug 27, 2026
52968ed
fix(nat): Walk the pool bitmap by runs, and print it without the lock
daniel-noland Aug 27, 2026
77f0320
test(routing): Stop spending the reassembly test's budget on its setup
daniel-noland Aug 27, 2026
ae47b06
fix(nat): Let outbound traffic refresh a mapping nobody has answered
daniel-noland Aug 27, 2026
8aed5c2
fix(net): Measure the quoted datagram from where its lengths are meas…
daniel-noland Aug 27, 2026
ccf95b0
fix(nat): Refuse a port-forwarding ruleset the table cannot hold
daniel-noland Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reports/
19 changes: 19 additions & 0 deletions .duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "*/src/**/*.rs"

[[specification]]
source = "https://www.rfc-editor.org/rfc/rfc4884"

[[specification]]
source = "https://www.rfc-editor.org/rfc/rfc5382"

[report.html]
enabled = true

[report.snapshot]
enabled = true

[[specification]]
source = "https://www.rfc-editor.org/rfc/rfc4787"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-10"


[[spec]]
level = "MUST"
quote = '''
REQ-13: If the packet received on an internal IP address has DF=1,
the NAT MUST send back an ICMP message "Fragmentation needed and
DF set" to the host, as described in [RFC0792].
'''

[[spec]]
level = "MUST"
quote = '''
a) If the packet has DF=0, the NAT MUST fragment the packet and
SHOULD send the fragments in order.
'''

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-11"


[[spec]]
level = "MUST"
quote = '''
REQ-14: A NAT MUST support receiving in-order and out-of-order
fragments, so it MUST have "Received Fragment Out of Order"
behavior.
'''

[[spec]]
level = "MUST"
quote = '''
a) A NAT's out-of-order fragment processing mechanism MUST be
designed so that fragmentation-based DoS attacks do not
compromise the NAT's ability to process in-order and
unfragmented IP packets.
'''

212 changes: 212 additions & 0 deletions .duvet/requirements/www.rfc-editor.org/rfc/rfc4787/section-12.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-12"


[[spec]]
level = "MUST"
quote = '''
REQ-1: A NAT MUST have an "Endpoint-Independent Mapping" behavior.
'''

[[spec]]
level = "SHOULD"
quote = '''
REQ-2: It is RECOMMENDED that a NAT have an "IP address pooling"
behavior of "Paired".
'''

[[spec]]
level = "MUST"
quote = '''
REQ-3: A NAT MUST NOT have a "Port assignment" behavior of "Port
overloading".
'''

[[spec]]
level = "SHOULD"
quote = '''
a) If the host's source port was in the range 0-1023, it is
RECOMMENDED the NAT's source port be in the same range.
'''

[[spec]]
level = "SHOULD"
quote = '''
If the
host's source port was in the range 1024-65535, it is
RECOMMENDED that the NAT's source port be in that range.
'''

[[spec]]
level = "SHOULD"
quote = '''
REQ-4: It is RECOMMENDED that a NAT have a "Port parity
preservation" behavior of "Yes".
'''

[[spec]]
level = "MUST"
quote = '''
REQ-5: A NAT UDP mapping timer MUST NOT expire in less than two
minutes, unless REQ-5a applies.
'''

[[spec]]
level = "MAY"
quote = '''
a) For specific destination ports in the well-known port range
(ports 0-1023), a NAT MAY have shorter UDP mapping timers that
are specific to the IANA-registered application running over
that specific destination port.
'''

[[spec]]
level = "MAY"
quote = '''
b) The value of the NAT UDP mapping timer MAY be configurable.
'''

[[spec]]
level = "SHOULD"
quote = '''
c) A default value of five minutes or more for the NAT UDP mapping
timer is RECOMMENDED.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-6: The NAT mapping Refresh Direction MUST have a "NAT Outbound
refresh behavior" of "True".
'''

[[spec]]
level = "MAY"
quote = '''
a) The NAT mapping Refresh Direction MAY have a "NAT Inbound
refresh behavior" of "True".
'''

[[spec]]
level = "MUST"
quote = '''
REQ-7 A NAT device whose external IP interface can be configured
dynamically MUST either (1) Automatically ensure that its internal
network uses IP addresses that do not conflict with its external
network, or (2) Be able to translate and forward traffic between
all internal nodes and all external nodes whose IP addresses
numerically conflict with the internal network.
'''

[[spec]]
level = "SHOULD"
quote = '''
REQ-8: If application transparency is most important, it is
RECOMMENDED that a NAT have "Endpoint-Independent Filtering"
behavior.
'''

[[spec]]
level = "SHOULD"
quote = '''
If a more stringent filtering behavior is most
important, it is RECOMMENDED that a NAT have "Address-Dependent
Filtering" behavior.
'''

[[spec]]
level = "MAY"
quote = '''
a) The filtering behavior MAY be an option configurable by the
administrator of the NAT.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-9: A NAT MUST support "Hairpinning".
'''

[[spec]]
level = "MUST"
quote = '''
a) A NAT Hairpinning behavior MUST be "External source IP address
and port".
'''

[[spec]]
level = "SHOULD"
quote = '''
REQ-10: To eliminate interference with UNSAF NAT traversal
mechanisms and allow integrity protection of UDP communications,
NAT ALGs for UDP-based protocols SHOULD be turned off.
'''

[[spec]]
level = "SHOULD"
quote = '''
a) If a NAT includes ALGs, it is RECOMMENDED that the NAT allow
the NAT administrator to enable or disable each ALG separately.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-11: A NAT MUST have deterministic behavior, i.e., it MUST NOT
change the NAT translation (Section 4) or the Filtering
(Section 5) Behavior at any point in time, or under any particular
conditions.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-12: Receipt of any sort of ICMP message MUST NOT terminate the
NAT mapping.
'''

[[spec]]
level = "SHOULD"
quote = '''
a) The NAT's default configuration SHOULD NOT filter ICMP messages
based on their source IP address.
'''

[[spec]]
level = "SHOULD"
quote = '''
b) It is RECOMMENDED that a NAT support ICMP Destination
Unreachable messages.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-13 If the packet received on an internal IP address has DF=1,
the NAT MUST send back an ICMP message "Fragmentation needed and
DF set" to the host, as described in [RFC0792].
'''

[[spec]]
level = "MUST"
quote = '''
a) If the packet has DF=0, the NAT MUST fragment the packet and
SHOULD send the fragments in order.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-14: A NAT MUST support receiving in-order and out-of-order
fragments, so it MUST have "Received Fragment Out of Order"
behavior.
'''

[[spec]]
level = "MUST"
quote = '''
a) A NAT's out-of-order fragment processing mechanism MUST be
designed so that fragmentation-based DoS attacks do not
compromise the NAT's ability to process in-order and
unfragmented IP packets.
'''

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-4.1"


[[spec]]
level = "MUST"
quote = '''
REQ-1: A NAT MUST have an "Endpoint-Independent Mapping" behavior.
'''

[[spec]]
level = "SHOULD"
quote = '''
REQ-2: It is RECOMMENDED that a NAT have an "IP address pooling"
behavior of "Paired".
'''

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-4.2.1"


[[spec]]
level = "MUST"
quote = '''
REQ-3: A NAT MUST NOT have a "Port assignment" behavior of "Port
overloading".
'''

[[spec]]
level = "SHOULD"
quote = '''
a) If the host's source port was in the range 0-1023, it is
RECOMMENDED the NAT's source port be in the same range.
'''

[[spec]]
level = "SHOULD"
quote = '''
If the
host's source port was in the range 1024-65535, it is
RECOMMENDED that the NAT's source port be in that range.
'''

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-4.2.2"


[[spec]]
level = "SHOULD"
quote = '''
REQ-4: It is RECOMMENDED that a NAT have a "Port parity
preservation" behavior of "Yes".
'''

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-4.3"


[[spec]]
level = "MUST"
quote = '''
REQ-5: A NAT UDP mapping timer MUST NOT expire in less than two
minutes, unless REQ-5a applies.
'''

[[spec]]
level = "MAY"
quote = '''
a) For specific destination ports in the well-known port range
(ports 0-1023), a NAT MAY have shorter UDP mapping timers that
are specific to the IANA-registered application running over
that specific destination port.
'''

[[spec]]
level = "MAY"
quote = '''
b) The value of the NAT UDP mapping timer MAY be configurable.
'''

[[spec]]
level = "SHOULD"
quote = '''
c) A default value of five minutes or more for the NAT UDP mapping
timer is RECOMMENDED.
'''

[[spec]]
level = "MUST"
quote = '''
REQ-6: The NAT mapping Refresh Direction MUST have a "NAT Outbound
refresh behavior" of "True".
'''

[[spec]]
level = "MAY"
quote = '''
a) The NAT mapping Refresh Direction MAY have a "NAT Inbound
refresh behavior" of "True".
'''

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
target = "https://www.rfc-editor.org/rfc/rfc4787#section-4.4"


[[spec]]
level = "MUST"
quote = '''
REQ-7: A NAT device whose external IP interface can be configured
dynamically MUST either (1) automatically ensure that its internal
network uses IP addresses that do not conflict with its external
network, or (2) be able to translate and forward traffic between
all internal nodes and all external nodes whose IP addresses
numerically conflict with the internal network.
'''

Loading
Loading