RFC 2894
Router Renumbering for IPv6
RFC 2894: Router Renumbering for IPv6 ๐
okay bestie, this is RFC 2894, and it's called Router Renumbering for IPv6! ๐ธ It was written by M. Crawford at Fermilab and came out in August 2000 as part of the Network Working Group series. It's a Standards Track document, so it's the real deal ๐. The title block doesn't list anything it obsoletes or updates, so no drama there ๐ .
Status of This Memo โจ
This document describes an Internet standards track protocol for the Internet community and asks for discussion and suggestions for improvements ๐ฆ. If you want to know where this protocol stands in standardization, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐. Distribution of this memo is unlimited ๐.
Copyright Notice ๐
Copyright (C) The Internet Society (2000). All Rights Reserved.
IESG Note:
this part is giving honest, humble researcher energy ๐ง. The document defines ways to tell a group of routers which renumbering operations to carry out, including a mode for networks where the exact number of routers isn't known. Reliably telling every router when you don't even know how many there are is genuinely hard ๐ญ. The IESG says implementation and operational experience will be needed to understand how well these mechanisms apply and scale when the router count is unknown ๐ฅ.
Abstract ๐
IPv6 Neighbor Discovery and Address Autoconfiguration make first-time address prefix assignments to hosts super convenient ๐ง. Apart from the problem of keeping connections alive across a renumbering event, these two mechanisms also make it simpler to reconfigure hosts when the set of valid prefixes changes โจ.
This document defines a mechanism called Router Renumbering ("RR"). It lets routers have their address prefixes configured and reconfigured almost as easily as Neighbor Discovery and Address Autoconfiguration do for hosts ๐. It gives a network manager a way to update the prefixes that IPv6 routers use and advertise across a whole site ๐.
Table of Contents ๐
1. Functional Overview ....................................... 2
2. Definitions ............................................... 4
2.1. Terminology ......................................... 4
2.2. Requirements ........................................ 5
3. Message Format ............................................ 5
3.1. Router Renumbering Header ........................... 7
3.2. Message Body -- Command Message ..................... 9
3.2.1. Prefix Control Operation ...................... 9
3.2.1.1. Match-Prefix Part ....................... 9
3.2.1.2. Use-Prefix Part ......................... 11
3.3. Message Body -- Result Message ...................... 12
4. Message Processing ........................................ 14
4.1. Header Check ........................................ 14
4.2. Bounds Check ........................................ 15
4.3. Execution ........................................... 16
4.4. Summary of Effects .................................. 17
5. Sequence Number Reset ..................................... 18
6. IANA Considerations ....................................... 19
7. Security Considerations ................................... 19
7.1. Security Policy and Association Database Entries .... 19
8. Implementation and Usage Advice for Reliability ........... 20
8.1. Outline and Definitions ............................. 21
8.2. Computations ........................................ 23
8.3. Additional Assurance Methods ........................ 24
9. Usage Examples ............................................ 25
9.1. Maintaining Global-Scope Prefixes ................... 25
9.2. Renumbering a Subnet ................................ 26
10. Acknowledgments .......................................... 27
11. References ............................................... 28
12. Author's Address ......................................... 29
Appendix -- Derivation of Reliability Estimates ............... 30
Full Copyright Statement ...................................... 32
1. Functional Overview โจ
okay so Router Renumbering Command packets hold a bunch of Prefix Control Operations (PCOs) ๐. Each PCO has an operation, a Match-Prefix, and zero or more Use-Prefixes. A router goes through the PCOs in order and checks each of its interfaces for an address or prefix that matches the Match-Prefix ๐. Whenever a match turns up on an interface, the operation gets applied there ๐
. The operation is one of ADD, CHANGE, or SET-GLOBAL. ADD tells the router to add the Use-Prefixes to its configured prefixes. CHANGE removes the prefix that matched and swaps in the Use-Prefixes. SET-GLOBAL replaces all the global-scope prefixes with the Use-Prefixes ๐ธ. If the PCO's set of Use-Prefixes is empty, ADD does nothing and the other two just turn into deletions ๐.
Each Use-Prefix also gets extra info inside the PCO ๐. That includes the valid and preferred lifetimes that go into Router Advertisement Prefix Information Options [ND]. It also includes either the L and A flags for that same option, or a note saying they should be copied from the prefix that matched the Match-Prefix โจ.
Routers can even make brand new prefixes by mixing the Use-Prefixes in a PCO with some of the existing prefix that matched the Match-Prefix ๐ฆ. This makes a few super common operations way simpler. For every Use-Prefix, the PCO says how many bits should be copied from the existing address or prefix that matched and tacked onto the use-prefix before the new prefix gets configured on the interface ๐ง. The copied bits are zero or more bits starting right after the length of the Use-Prefix. If the subnetting info sits in the same spot in the old and new prefixes, this synthesis lets one PCO define a new global prefix on every router in a site while keeping the subnetting structure intact ๐.
Because the Router Renumbering mechanism is so powerful, every RR message has a sequence number to guard against replays, and it is required to be authenticated and integrity-checked ๐. Each individual PCO is idempotent, so it could be retransmitted for better reliability, as long as the sequence number is current, without worrying about it getting processed more than once ๐. But non-idempotent combinations of PCOs can easily be built, and messages with those combos couldn't be safely reprocessed ๐ฌ. So all routers are required to guard against processing an RR message more than once ๐ก๏ธ. To let people reliably verify that Commands got received and processed by routers, the spec includes a duplicate-command notification to the management station ๐ฌ.
A network manager might want to renumber more, or control things in more detail, than a single Router Renumbering packet can handle on the available media ๐ฆ. The RR mechanism works best when RR packets are multicast, so IP fragmentation is undesirable ๐ . For these reasons, every RR packet carries a "Segment Number" ๐. All RR packets with a Sequence Number greater than or equal to the highest value seen are valid and must be processed โ . A router has to keep track of the Segment Numbers of RR messages it already processed, and it should avoid reprocessing any message whose Sequence Number and Segment Number both match a message it already handled ๐งพ. (This list of processed segment numbers gets reset whenever a new highest Sequence Number shows up ๐.)
The Segment Number doesn't impose any ordering on packet processing ๐ โโ๏ธ. If you want a specific sequence of operations, you can get it by ordering the PCOs in a single RR Command message, or through the Sequence Number field ๐ข.
There's a Test flag that tells all routers to simulate processing the RR message without doing any actual reconfiguration ๐งช. There's also a separate Report flag that tells routers to send a Router Renumbering Result message back to the source of the RR Command message. That result shows the actual or simulated outcome of the operations in the command ๐จ.
The effect, or simulated effect, of an RR Command message may also be reported to network management by means outside the scope of this document, no matter what the Report flag is set to ๐.
2. Definitions ๐
2.1. Terminology ๐
Address
This term always means a 128-bit IPv6 address [AARCH] ๐. When talking about bits inside an address, they're numbered from 0 to 127, with bit 0 being the first bit of the Format Prefix ๐ข.
Prefix
You can think of a prefix as an address plus a length. The length is an integer from 0 to 128 that says how many leading bits are significant ๐. Bits within a prefix are numbered the same way as bits in an address. For example, the significant bits of a prefix with length L are the bits numbered 0 through L-1, inclusive โจ.
Match
An address A "matches" a prefix P with length L if the first L bits of A are identical to the first L bits of P ๐ฆ. (Every address matches a prefix of length 0 ๐ธ.) A prefix P1 with length L1 matches a prefix P2 of length L2 if L1 >= L2 and the first L2 bits of P1 and P2 are identical ๐.
Prefix Control Operation
This is the tiniest individual unit of a Router Renumbering operation ๐งฉ. An RR Command packet holds zero or more of these. Each one has one matching condition, called a Match-Prefix Part, plus zero or more substitution specifications, called Use-Prefix Parts ๐.
Match-Prefix
This is a Prefix that a router compares against the addresses and prefixes configured on its interfaces ๐.
Use-Prefix
This is the prefix and its associated info that gets configured on a router interface when certain conditions are met ๐.
Matched Prefix
This is the existing prefix or address that matched a Match-Prefix ๐ซถ.
New Prefix
This is a prefix built from a Use-Prefix, possibly including some of the Matched Prefix ๐.
Recorded Sequence Number
The highest sequence number found in a valid message MUST be recorded in non-volatile storage ๐พ.
Also, "matches" is a transitive relation but not symmetric ๐คฏ. If two prefixes match each other, they are identical ๐ฏโโ๏ธ.
2.2. Requirements ๐
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [KWORD] ๐ โจ
3. Message Format โจ
okay bestie, so there are two kinds of Router Renumbering messages ๐ : Commands, which get sent to routers, and Results, which routers send back ๐ฆ. There's also a third type that syncs a reset of the Recorded Sequence Number with cancelling cryptographic keys ๐. You can tell all three apart by the ICMPv6 "Code" field, and they differ in what's inside the "Message Body" field ๐.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ IPv6 header, extension headers /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ ICMPv6 & RR Header (16 octets) /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
/ RR Message Body /
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Router Renumbering Message Format
Router Renumbering messages are carried in ICMPv6 packets with Type = 138 ๐ธ. The RR message is made up of an RR Header, which holds the ICMPv6 header, the sequence and segment numbers and other info, plus the RR Message Body, which is variable length ๐ง.
All fields marked "reserved" or "res" MUST be set to zero when an RR message is generated, and ignored when it's received ๐ซถ.
All implementations which generate Router Renumbering Command messages MUST support sending them to the All Routers multicast address with link and site scopes, and to unicast addresses of link-local and site-local formats ๐. All routers MUST be capable of receiving RR Commands sent to those multicast addresses and to any of their link local and site local unicast addresses โจ. Implementations SHOULD support sending and receiving RR messages addressed to other unicast addresses ๐ฆ. An implementation which is both a sender and receiver of RR commands SHOULD support use of the All Routers multicast address with node scope ๐.
Security alert ๐ญ๐: Data authentication and message integrity MUST be provided for all Router Renumbering Command messages by appropriate IP Security [IPSEC] means. The integrity assurance must include the IPv6 destination address and the RR Header and Message Body. See section 7, "Security Considerations". This part is SERIOUS, bestie, don't skip it ๐.
The use of authentication for Router Renumbering Result messages is RECOMMENDED ๐.
3.1. Router Renumbering Header
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SequenceNumber |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SegmentNumber | Flags | MaxDelay |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Fields:
Type๐:138(decimal), the ICMPv6 type value assigned to Router RenumberingCode๐ข:0for a Router Renumbering Command;1for a Router Renumbering Result;255for a Sequence Number Reset. The Sequence Number Reset is described in section 5.Checksum๐งฎ: The ICMPv6 checksum, as specified in [ICMPV6]. The checksum covers the IPv6 pseudo-header and all fields of the RR message from the Type field onward.SequenceNumber๐: An unsigned 32-bit sequence number. The sequence number MUST be non-decreasing between Sequence Number Resets.SegmentNumber๐งฉ: An unsigned 8-bit field which enumerates different valid RR messages having the same SequenceNumber. No ordering among RR messages is imposed by the SegmentNumber.Flags๐ฉ: A combination of one-bit flags. Five are defined and three bits are reserved.
+-+-+-+-+-+-+-+-+
|T|R|A|S|P| res |
+-+-+-+-+-+-+-+-+
The flags T, R, A and S have defined meanings in an RR Command message. In a Result message they MUST be copied from the corresponding Command ๐ช. The P flag is only meaningful in a Result message, and it MUST be zero in a transmitted Command and ignored in a received Command ๐.
TTest command --0indicates that the router configuration is to be modified;1indicates a "Test" message: processing is to be simulated and no configuration changes are to be made.
RResult requested --0indicates that a Result message MUST NOT be sent (but other forms of logging are not precluded);1indicates that the router MUST send a Result message upon completion of processing the Command message.
AAll interfaces --0indicates that the Command MUST NOT be applied to interfaces which are administratively shut down;1indicates that the Command MUST be applied to all interfaces regardless of administrative shutdown status.
SSite-specific -- This flag MUST be ignored unless the router treats interfaces as belonging to different "sites". ๐ก0indicates that the Command MUST be applied to interfaces regardless of which site they belong to;1indicates that the Command MUST be applied only to interfaces which belong to the same site as the interface to which the Command is addressed. If the destination address is appropriate for interfaces belonging to more than one site, then the Command MUST be applied only to interfaces belonging to the same site as the interface on which the Command was received.
PProcessed previously --0indicates that the Result message contains the complete report of processing the Command;1indicates that the Command message was previously processed (and is not a Test) and the responding router is not processing it again. This Result message MAY have an empty body.
MaxDelay โฑ๏ธ: An unsigned 16-bit field specifying the maximum time, in milliseconds, by which a router MUST delay sending any reply to this Command. Implementations MAY generate the random delay between 0 and MaxDelay milliseconds with a finer granularity than 1ms ๐ฆ.
3.2. Message Body -- Command Message
The body of an RR Command message is a sequence of zero or more Prefix Control Operations, each of variable length ๐. The end of the sequence MAY be inferred from the IPv6 length and the lengths of extension headers which precede the ICMPv6 header ๐.
3.2.1. Prefix Control Operation
A Prefix Control Operation has one Match-Prefix Part of 24 octets, followed by zero or more Use-Prefix Parts of 32 octets each ๐ .
3.2.1.1. Match-Prefix Part
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OpCode | OpLength | Ordinal | MatchLen |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MinLen | MaxLen | reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- -+
| |
+- MatchPrefix -+
| |
+- -+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Fields:
OpCode๐ฏ: An unsigned 8-bit field specifying the operation to be performed when the associated MatchPrefix matches an interface's prefix or address. Values are:1the ADD operation2the CHANGE operation3the SET-GLOBAL operation
OpLength๐: The total length of this Prefix Control Operation, in units of 8 octets. A valid OpLength will always be of the form 4N+3, with N equal to the number of UsePrefix parts (possibly zero).Ordinal๐ท๏ธ: An 8-bit field which MUST have a different value in each Prefix Control Operation contained in a given RR Command message. The value is otherwise unconstrained.MatchLen๐ข: An 8-bit unsigned integer between 0 and 128 inclusive specifying the number of initial bits of MatchPrefix which are significant in matching.MinLen๐: An 8-bit unsigned integer specifying the minimum length which any configured prefix must have in order to be eligible for testing against the MatchPrefix.MaxLen๐: An 8-bit unsigned integer specifying the maximum length which any configured prefix may have in order to be eligible for testing against the MatchPrefix.MatchPrefix๐: The 128-bit prefix to be compared with each interface's prefix or address.
3.2.1.2. Use-Prefix Part ๐
okay bestie, this is where the new prefix actually gets made ๐ง here's the layout:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| UseLen | KeepLen | FlagMask | RAFlags |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Valid Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Preferred Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V|P| reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- -+
| |
+- UsePrefix -+
| |
+- -+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Fields:
UseLen: An 8-bit unsigned integer less than or equal to 128 specifying the number of initial bits ofUsePrefixto use in creating a new prefix for an interface. ๐ธKeepLen: An 8-bit unsigned integer less than or equal to (128-UseLen) specifying the number of bits of the prefix or address which matched the associated Match-Prefix which should be retained in the new prefix. The retained bits are those at positions UseLen through (UseLen+KeepLen-1) in the matched address or prefix, and they are copied to the same positions in the New Prefix. โจFlagMask: An 8-bit mask. A 1 bit in any position means that the corresponding flag bit in a Router Advertisement (RA) Prefix Information Option for the New Prefix should be set from the RAFlags field in this Use-Prefix Part. A 0 bit in the FlagMask means that the RA flag bit for the New Prefix should be copied from the corresponding RA flag bit of the Matched Prefix. ๐ฆRAFlags: An 8 bit field which, under control of the FlagMask field, may be used to initialize the flags in Router Advertisement Prefix Information Options [ND] which advertise the New Prefix. Note that only two flags have defined meanings to date: the L (on-link) and A (autonomous configuration) flags. These flags occupy the two leftmost bit positions in the RAFlags field, corresponding to their position in the Prefix Information Option. ๐Valid Lifetime: A 32-bit unsigned integer which is the number of seconds for which the New Prefix will be valid [ND, SAA]. โญPreferred Lifetime: A 32-bit unsigned integer which is the number of seconds for which the New Prefix will be preferred [ND, SAA]. ๐V: A 1-bit flag indicating that the valid lifetime of the New Prefix MUST be effectively decremented in real time. this one is giving countdown energy โณP: A 1-bit flag indicating that the preferred lifetime of the New Prefix MUST be effectively decremented in real time. ๐ซถUsePrefix: The 128-bit Use-prefix which either becomes or is used in forming (if KeepLen is nonzero) the New Prefix. It MUST NOT have the form of a multicast or link-local address [AARCH]. no multicast or link-local, periodt ๐ โโ๏ธ
3.3. Message Body -- Result Message ๐
okay so the body of an RR Result message is a sequence of zero or more Match Reports, and each one is 24 octets ๐ง an RR Command message with the "R" flag set will get a Result message back with one Match Report for each Prefix Control Operation, for each different prefix it matches on each interface. the Match Report looks like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| reserved |B|F| Ordinal | MatchedLen |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| InterfaceIndex |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+- -+
| |
+- MatchedPrefix -+
| |
+- -+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Fields:
B: A one-bit flag which, when set, indicates that one or more fields in the associated PCO were out of bounds. The bounds check is described in section 4.2. ๐F: A one-bit flag which, when set, indicates that one or more Use-Prefix parts from the associated PCO were not honored by the router because of attempted formation of a forbidden prefix format, such as a multicast or loopback address. ๐ซOrdinal: Copied from the Prefix Control Operation whose MatchPrefix matched the MatchedPrefix on the interface indicated by InterfaceIndex. ๐ขMatchedLen: The length of the Matched Prefix. ๐InterfaceIndex: The router's numeric designation of the interface on which the MatchedPrefix was configured. This MUST be the same as the value of ipv6IfIndex which designates that index in the SNMP IPv6 MIB General Group [IPV6MIB]. this one is non-negotiable, bestie ๐
It is possible for a Result message to be larger than the Command message which elicited it. Such a Result message may have to be fragmented for transmission. If so, it SHOULD be fragmented to the IPv6 minimum required MTU [IPV6]. so basically: big result, chop it to the IPv6 minimum required MTU ๐ช
4. Message Processing ๐
Processing of received Router Renumbering Result messages is entirely implementation-defined. Implementation of Command message processing may vary in detail from the procedure set forth below, so long as the result is not affected. โจ
Processing of received Router Renumbering Command messages consists of three conceptual parts: header check, bounds check, and execution. ๐งฉ
4.1. Header Check ๐
The ICMPv6 checksum and type are presumed to have been checked before a Router Renumbering module receives a Command to process. In an implementation environment where this may not be the case, those checks MUST be made at this point in the processing. ๐ซถ
If the ICMPv6 length derived from the IPv6 length is less than 16 octets, the message MUST be discarded and SHOULD be logged to network management. ๐๏ธ
If the ICMPv6 Code field indicates a Result message, a router which is not a source of RR Command messages MUST discard the message and SHOULD NOT log it to network management. ๐ โโ๏ธ
If the IPv6 destination address is neither an All Routers multicast address [AARCH] nor one of the receiving router's unicast addresses, the message MUST be discarded and SHOULD be logged to network management. ๐ญ
Next, the SequenceNumber is compared to the Recorded Sequence Number. (If no RR messages have been received and accepted since system initialization, the Recorded Sequence Number is zero.) This comparison is done with the two numbers considered as unsigned integers, not as DNS-style serial numbers. If the SequenceNumber is less than the Recorded Sequence Number, the message MUST be discarded and SHOULD be logged to network management. ๐ข
Finally, if the SequenceNumber in the message is greater than the Recorded Sequence Number or the T flag is set, skip to the bounds check. Otherwise the SegmentNumber MUST now be checked. If a correctly authenticated message with the same SequenceNumber and SegmentNumber has not already been processed, skip to the bounds check. Otherwise, this Command is a duplicate and not a Test Command. If the R flag is not set, the duplicate message MUST be discarded and SHOULD NOT be logged to network management. If R is set, an RR Result message with the P flag set MUST be scheduled for transmission to the source address of the Command after a random time uniformly distributed between 0 and MaxDelay milliseconds. The body of that Result message MUST either be empty or be a saved copy of the Result message body generated by processing of the previous message with the same SequenceNumber and SegmentNumber. After scheduling the Result message, the Command MUST be discarded without further processing. phew, that's a lot of MUSTs, but they're all doing important jobs ๐ช
4.2. Bounds Check ๐งฎ
If the SequenceNumber is greater than the Recorded Sequence Number, then the list of processed SegmentNumbers and the set of saved Result messages, if any, MUST be cleared and the Recorded Sequence Number MUST be updated to the value used in the current message, regardless of subsequent processing errors. ๐งน
Next, if the ICMPv6 Code field indicates a Sequence Number Reset, skip to section 5. โญ๏ธ
At this point, if T is set in the RR header and R is not set, the message MAY be discarded without further processing. ๐คทโโ๏ธ
If the R flag is set, begin constructing an RR Result message. The RR header of the Result message is completely determined at this time except for the Checksum. ๐งฑ
The values of the following fields of a PCO MUST be checked to ensure that they are within the appropriate bounds.
OpCode: must be a defined value.OpLength: must be of the form 4N+3 and consistent with the length of the Command packet and the PCO's offset within the packet.MatchLen: must be between 0 and 128 inclusive.UseLen,KeepLen: in each Use-Prefix Part must be between 0 and 128 inclusive, as must the sum of the two.
If any of these fields are out of range in a PCO, the entire PCO MUST NOT be performed on any interface. If the R flag is set in the RR header then add to the RR Result message a Match Report with the B flag set, the F flag clear, the Ordinal copied from the PCO, and all other fields zero. This Match Report MUST be included only once, not once per interface. not once per interface, bestie, I'm serious ๐จ
Note that MinLen and MaxLen need not be explicitly bounds checked, even though certain combinations of values will make any matches impossible. ๐
4.3. Execution ๐
okay bestie, this is where the router actually DOES the renumbering ๐ for each applicable router interface (picked out by the A and S flags), the Prefix Control Operations in an RR Command message must be carried out in order of appearance. how PCOs get processed across different interfaces is not specified ๐ซถ
if the T flag is set, make a copy of each interface's configuration to operate on, because one PCO's results can change how the next PCO behaves ๐ง ngl this is so smart. if you finish every operation on one interface before moving to the next, you only ever need one configuration copy at a time โจ
for each interface and each Prefix Control Operation, every prefix configured on that interface whose length falls between the MinLen and MaxLen values in the PCO gets checked to see if it matches (as defined in section 2.1) the MatchPrefix of the PCO. the prefixes get checked in an arbitrary order ๐ธ any new prefix that a given PCO creates on an interface MUST NOT be checked against that same PCO, but it MUST be checked against all the later PCOs in the same RR Command message ๐
there's also a special case where the addresses on an interface get checked too ๐ if and only if a configured prefix "P" has a length between MinLen and MaxLen inclusive, does NOT match the MatchPrefix "M", but M does match P (which can only happen when M is longer than P), then the addresses on that interface that match P MUST be checked to see whether any of them matches M. if any address does match M, the PCO gets processed as if P matched M, but when forming New Prefixes, if KeepLen is non-zero, bits get copied from the address. this is iconic because it lets a PCO target one specific interface in a network ๐ฏ
if P does not match M, processing is finished for this combination of PCO, interface and prefix. keep going with another prefix on the same interface if there are any left that haven't been tested against this PCO and weren't created by this PCO. if no such prefixes remain on the current interface, move on to the next PCO on the same interface, or to another interface ๐ฆ
if P does match M, either directly or because a configured address that matches P also matches M, then P is the Matched Prefix. then do the following steps ๐
- if the Command has the R flag set, add a Match Report to the Result message being built.
- if the OpCode is CHANGE, mark P for deletion from the current interface.
- if the OpCode is SET-GLOBAL, mark all global-scope prefixes on the current interface for deletion.
- if there are any Use-Prefix parts in the current PCO, form the New Prefixes. discard any New Prefix with a forbidden format, and if the R flag is set in the command, set the F flag in the Match Report for this PCO and interface. forbidden prefix formats include, at a minimum, multicast, unspecified and loopback addresses. [AARCH] any implementation MAY forbid, or let the network manager forbid, other formats as well ๐
- for each New Prefix that's already configured on the current interface, unmark it for deletion and update its lifetimes and RA flags. for each New Prefix that isn't configured yet, add the prefix and, if appropriate, configure an address with that prefix โจ
- delete any prefixes still marked for deletion, along with any addresses that match those prefixes but don't match any prefix that isn't marked for deletion ๐๏ธ
- after processing all the Prefix Control Operations on all the interfaces, an implementation MUST record the SegmentNumber of the packet in a list associated with the SequenceNumber ๐
- if the Command has the R flag set, compute the Checksum and schedule the Result message for transmission after a random time interval uniformly distributed between 0 and MaxDelay milliseconds. this interval SHOULD begin at the conclusion of processing, not the beginning โฐ a copy of the Result message MAY be saved so it can be retransmitted in response to a duplicate Command ๐ซถ
4.4. Summary of Effects ๐
the only Neighbor Discovery [ND] parameters that Router Renumbering can affect are these ๐
- a router's addresses and advertised prefixes, including the prefix lengths.
- the flag bits (L and A, plus any that may be defined in the future) and the valid and preferred lifetimes that appear in a Router Advertisement Prefix Information Option.
- that unnamed property of the lifetimes which says whether they're fixed values or decrementing in real time ๐คฏ
other internal router info, like the time until the next unsolicited Router Advertisement or MIB variables, MAY be affected as needed ๐ง
all configuration changes from Router Renumbering SHOULD be saved to non-volatile storage wherever that facility exists ๐พ restoring prefix lifetimes from non-volatile storage is its own problem that exists independently of Router Renumbering. it deserves careful attention, but it's outside the scope of this document ๐
5. Sequence Number Reset ๐
it may prove necessary in practice to reset a router's Recorded Sequence Number ๐ฌ this is only a safe operation when every cryptographic key that was used to authenticate RR Commands has expired or been revoked. that's why the Sequence Number Reset message is defined to do both jobs at once ๐
when a Sequence Number Reset (SNR) has been authenticated and has passed the header check, the router MUST invalidate every key that was used to authenticate previous RR Commands, including the key that authenticated the SNR itself. then it MUST discard any saved RR Result messages, clear the list of recorded SegmentNumbers, and reset the Recorded Sequence Number to zero ๐ซข
if the router doesn't already have other unused authentication keys available for Router Renumbering, it SHOULD establish one or more new valid keys. how this works depends on whether manual keying or a key management protocol is in use. either way, if no keys are available, no new Commands can be processed ๐ซ
an SNR message SHOULD contain no PCOs, since they'll be ignored ๐ โโ๏ธ if and only if the R flag is set in the SNR message, a router MUST respond with a Result Message containing no Match Reports. the header and transmission of the Result work the same as described in section 3 ๐ฆ
invalidating the authentication keys because of a valid SNR message will cause retransmitted copies of that message to be ignored ๐
6. IANA Considerations ๐
following the policies outlined in [IANACON], new values of the Code field in the Router Renumbering Header (section 3.1) and the OpCode field of the Match-Prefix Part (section 3.2.1.1) are to be allocated by IETF consensus only ๐ค
7. Security Considerations ๐
okay this section is SERIOUS bestie. Router Renumbering is very powerful, so stopping spoofing of it is super important ๐จ
replay of old messages must, in general, be prevented (even though there's a narrow class of messages where replay would be harmless). what counts as a strong enough authentication algorithm can change over time, but algorithms should be chosen that are strong against current key-recovery and forgery attacks ๐
authentication keys have to be protected as well as any other access method that lets someone reconfigure a site's routers ๐ distributing keys must not expose them or allow them to be altered, and key validity must be limited in terms of time and the number of messages authenticated ๐ โโ๏ธ
noticed something? resetting the Recorded Sequence Number requires cancelling previously used authentication keys, but introducing new keys and expiring old ones does NOT require resetting the Recorded Sequence Number โจ (the two are different things, so don't mix them up ๐ซถ)
7.1. Security Policy and Association Database Entries ๐ก๏ธ
the Security Policy Database (SPD) [IPSEC] of a router implementing this specification MUST cause incoming Router Renumbering Command packets to either be discarded or to have IPsec applied. (whether something gets "discard" or "apply" MAY be based on the source address ๐) the resulting Security Association Database (SAD) entries MUST ensure authentication and integrity of the destination address, the RR Header and Message Body, and the body length implied by the IPv6 length and any intervening extension headers. these requirements are met by using the Authentication Header [AH] in transport or tunnel mode, or the Encapsulating Security Payload [ESP] in tunnel mode with non-NULL authentication. the mandatory-to-implement IPsec authentication algorithms (other than NULL) seem strong enough for Router Renumbering at the time of writing ๐
note that for the SPD to tell Router Renumbering apart from other ICMP packets, you need to use the ICMP Type field as a selector ๐ฏ this is consistent with the Security Architecture specification [IPSEC], even though it isn't mentioned there ๐ค
at the time of writing, there's no multicast key management protocol for IPsec, and none is on the horizon ๐ so manually configured Security Associations will be super common. that means "from traffic" in the table below would realistically be a wildcard or a fixed range ๐ using a small set of shared keys per management station is enough, as long as key distribution and storage are properly safeguarded ๐
a sufficient set of SPD entries for incoming traffic could select ๐
Field SPD Entry SAD Entry
------- --------- ---------
Source wildcard from traffic
Destination wildcard from SPD
Transport ICMPv6 from SPD
ICMP Type Rtr. Renum. from SPD
Action Apply IPsec
SA Spec AH/Transport Mode
or there might be an entry for each management station and/or each of the router's unicast addresses, plus each of the defined All-Routers multicast addresses, and a final wildcard entry to discard all other incoming RR messages ๐งฑ
the SPD and SAD are conceptually per-interface databases ๐ this can be used to allow shared management of a border router, for example, or to discard all Router Renumbering traffic arriving over tunnels ๐ฆ
8. Implementation and Usage Advice for Reliability โจ
okay so bestie, this is the part where we talk about making sure every single non-trivial message actually reaches every router it's supposed to ๐ซถ and the vibe is "minimally reliable network, maximum confidence" ๐ the way the RR retransmission and response-directing features work together is literally so iconic ๐ฅ
In the most common situation, probably the majority of cases, the network management station already knows the full set of routers it controls ๐ so commands can just keep getting retransmitted, with the "R" (Reply-requested) flag set in the RR header, until Results have come back from all of them ๐ and if unicast Security Associations (or the means to create them) are around, the management station MAY switch from multicast to unicast once the number of routers still unheard-from is suitably small ๐ฆ
For keeping track of managed routers, the station has a few automatic options that can be way more convenient than typing everything in by hand in a big network ๐ธ it can send multicast RR "Test" commands on a schedule and archive the results, or it can use SNMP to "peek" into a link-state routing protocol like OSPF [OSPFMIB] ๐ง (with OSPF, roughly one router per area would need to be examined to build a complete list of routers โจ)
In a large dynamic network where the set of managed routers isn't known but reliable execution is still wanted, this section describes a scalable way to get confidence in delivery ๐ and nothing in this section changes the format or content of Router Renumbering messages, or how routers process them ๐
A management station implementing these reliability mechanisms MUST alert an operator who tries to start a new set of Router Renumbering Commands while retransmission of a previous set is not yet completed ๐ but it SHOULD let the operator override the warning ๐
Bestie, the MUST and SHOULD above are doing a lot of work here. The alert is required, the override is recommended. Don't skip the warning! ๐ญ
8.1. Outline and Definitions ๐
The set of routers being managed with Router Renumbering is treated as a set of populations, and each population has a characteristic probability of successful round-trip delivery of a Command/Result pair ๐ฆ the goal is to estimate a lower bound, P, on the round-trip probability for the whole set ๐ with that estimate and other data about the responses to retransmissions of the Command, a confidence level can be computed for the hypothesis that all routers have been heard from โจ
If the true probability of successful round-trip communication with a managed router were a constant, p, for all managed routers, then an estimate P of p could be derived from either of these statistics:
The expected ratio of the number of routers first heard from after transmission (N + 1) to the number first heard from after N is (1 - p).
When N different routers have been heard from after M transmissions of a Command, the expected total number of Result messages received is pNM. If R is the number of Results actually received, then P = R/MN.
The two methods are not equivalent ๐ the first one has numerical problems when the number of routers still to be heard from gets small, so the P = R/MN estimate should be used ๐
Since the round-trip probability isn't expected to be uniform in the real world, and the less-reliable units matter more to a lower-bound estimate but are also more likely to be missed in sampling, the sample used to compute P is biased toward the less-reliable routers ๐ฅบ after the Nth transmission interval, where N > 2, neglect all routers heard from in intervals 1 through F when computing the reliability estimate, where F is the greatest integer less than one-half of N ๐ for example, after five intervals, only routers first heard from in the third through fifth intervals get counted ๐
A management station implementing the methods in this section should let the user specify the following parameters, and default them to the indicated values ๐ธ
Ct The target delivery confidence, default 0.999.
Pp A presumptive, pessimistic initial estimate of the lower
bound of the round-trip probability, P, to prevent early
termination. (See below.) Default 0.75.
Ti The initial time between Command retransmissions. Default 4
seconds. MaxDelay milliseconds (see section 3.1) must be
added to the retransmission timer. Knowledge of the
routers' processing time for RR Commands may influence the
setting of Ti. Ti+MaxDelay is also the minimum time the
management station must wait for Results after each
transmission before computing a new confidence level. The
phrase "end of the Nth interval" means a time Ti+MaxDelay
after the Nth transmission of a Command.
Tu The upper bound on the period between Command
retransmissions. Default 512 seconds.
The following variables, some of which are a function of the retransmission counter N, are used in the next section ๐ง
T(N) The time between Command transmissions N and N+1 is V*T(N) +
MaxDelay, where V is random and roughly uniform in the range
[0.75, 1.0]. T(1) = Ti and for N > 1, T(N) = min(2*T(N-1),
Tu).
M(N) The cumulative number of distinct routers from which replies
have been received to any of the first N transmissions of
the Command.
F=F(N) FLOOR((N-1)/2). All routers from which responses were
received in the first F intervals will be effectively
omitted from the estimate of the round-trip probability
computed at the Nth interval.
R(N,F) The total number of RR Result messages, including
duplicates, received by the end of the Nth interval from
those routers which were NOT heard from in any of the first
F intervals.
p(N) The estimate of the worst-case round-trip delivery
probability.
c(N) The computed confidence level.
An asterisk (*) is used to denote multiplication and a caret (^) denotes exponentiation ๐ค
If the difference in reliability between the "good" and "bad" parts of a managed network is very great, early c(N) values will be too high ๐ฌ so retransmissions should continue for at least Nmin = log(1-Ct)/log(1-Pp) intervals, no matter what the current confidence estimate says ๐ (in fact, there's no need to compute p(N) and c(N) until after Nmin intervals ๐)
8.2. Computations ๐งฎ
Letting A = N*(M(N)-M(F))/R(N,F) for brevity, the estimate of the round-trip delivery probability is p(N) = 1-Q, where Q is the root of the equation below that lies between 0 and 1 ๐
Q^N - A*Q + (A-1) = 0
(Q = 1 is always a root. If N is odd, there is also a negative root.) ๐ this can be solved numerically, for example with Newton's method (see any standard text, for example [ANM]) ๐ค the first-order approximation
Q1 = 1 - 1/A
may be used as a starting point for iteration ๐ง but Q1 should NOT be used as an approximate solution, because it always underestimates Q, and hence overestimates p(N), which would cause an overestimate of the confidence level ๐ซ
If necessary, the spurious root Q = 1 can be divided out, leaving
Q^(N-1) + Q^(N-2) + ... + Q - (A-1) = 0
as the equation to solve ๐ depending on the numerical method used, this could be desirable, since it's just possible (but very unlikely) that A=N and so Q=1 was a double root of the earlier equation ๐
After N > 2 (or N >= Nmin) intervals have been completed, compute the lower-bound reliability estimate
p(N) = R(N,F)/((N-F)*(M(N) - M(F))).
Then compute the confidence estimate
c(N) = (1 - (1-p(N))^N)^(M(N) - M(F) + 1).
This is the Bayesian probability that M(N) is the number of routers present, given the number of responses that were collected, as opposed to M(N)+1 or any greater number ๐ฆ it's assumed that the a priori probability of there being K routers was no greater than that of K-1 routers, for all K > M(N) ๐
When c(N) >= Ct and N >= Nmin, retransmissions of the Command MAY cease ๐ฅณ otherwise another transmission should be scheduled at a time V*T(N) + MaxDelay after the previous (Nth) transmission, or V*T(N) after the conclusion of processing responses to the Nth transmission, whichever is later โฐ
One corner case needs consideration ๐ divide-by-zero may occur when computing p. This can only happen when no new routers have been heard from in the last N-F intervals ๐ฑ generally the confidence estimate c(N) will be close to unity by then, but in a pathological case, such as a large number of routers with reliable communication and a much smaller number with very poor communication, the confidence estimate may still be less than Ct when p's denominator vanishes ๐ the implementation MAY continue, and SHOULD continue if the minimum number of transmissions given in the previous paragraph hasn't been made yet ๐ซ if new routers are heard from, p(N) will be non-singular again โจ
Of course, no limited retransmission scheme can fully address long-term problems, like a partitioned network ๐ง๏ธ the network manager is expected to be aware of such conditions when they exist ๐ซถ
Yes, I'm writing "MAY" for the one with the RFC weight, but it's still a MAY ๐ the SHOULD in the corner case is the one to actually respect!
8.3. Additional Assurance Methods ๐
As a final means to detect routers which become reachable after missing renumbering commands during an extended network split, a management station MAY adopt the following strategy ๐ต๏ธโโ๏ธ when performing each new operation, increment the SequenceNumber by more than one ๐
After the operation is believed complete, periodically send some "no-op" RR Command with the R (Result Requested) flag set and a SequenceNumber one less than the highest used ๐ง any responses to such a command can only come from a router that missed the last operation ๐ an example of a suitable "no-op" command would be an ADD operation with MatchLen = 0, MinLen = 0, MaxLen = 128, and no Use-Prefix Parts ๐
If the management station saves old authentication keys, even the reappearance of routers which missed a Sequence Number Reset can be detected ๐ this is done by transmitting no-op commands with the invalid key and a SequenceNumber higher than any used before the key was invalidated ๐๏ธ since there's no other way for a management station to tell apart a router that failed to receive an entire sequence of repeated SNR messages from one that lost its single SNR Result Message, this is the RECOMMENDED way to test for universal reception of a SNR Command ๐
9. Usage Examples ๐
okay so this section sketches some sample applications of Router Renumbering ๐ฆ extension headers, including the required IPsec headers, that sit between the IPv6 header and the ICMPv6 header are not shown in the examples ๐
9.1. Maintaining Global-Scope Prefixes ๐ธ
okay so this one is a super common move with Router Renumbering, bestie ๐ . You keep a set of global prefixes whose subnet structure matches the site's site-local address assignments. In the steady state, this keeps the Preferred and Valid lifetimes set to their desired values โจ. During a renumbering transition, similar Command messages can add new prefixes and/or delete old ones ๐ฆ. Here's an outline of a suitable Command message. Fields not listed are presumed set to suitable values. This Command assumes all router interfaces to be maintained already have site-local [AARCH] addresses ๐ง.
IPv6 Header
Next Header = 58 (ICMPv6)
Source Address = (Management Station)
Destination Address = FF05::2 (All Routers, site-local scope)
ICMPv6/RR Header
Type = 138 (Router Renumbering), Code = 0 (Command)
Flags = 60 hex (R, A)
First (and only) PCO:
Match-Prefix Part
OpCode = 3 (SET-GLOBAL)
OpLength = 4 N + 3 (assuming N global prefixes)
Ordinal = 0 (arbitrary)
MatchLen = 10
MatchPrefix = FEC0::0
First Use-Prefix Part
UseLen = 48 (Length of TLA ID + RES + NLA ID [AARCH])
KeepLen = 16 (Length of SLA (subnet) ID [AARCH])
FlagMask, RAFlags, Lifetimes, V & P flags -- as desired
UsePrefix = First global /48 prefix
. . .
Nth Use-Prefix Part
UseLen = 48
KeepLen = 16
FlagMask, RAFlags, Lifetimes, V & P flags -- as desired
UsePrefix = Last global /48 prefix
This will cause N global prefixes to be set (or updated) on each applicable interface. On each interface, the SLA ID (subnet) field of each global prefix will be copied from the existing site-local prefix ๐.
9.2. Renumbering a Subnet ๐
ngl this one is so satisfying ๐ฅน. A subnet can be gracefully renumbered by setting the valid and preferred timers on the old prefix to a short value and letting them run down, while concurrently adding the new prefix. Later, the expired prefix is deleted. The first step is described by the following RR Command.
IPv6 Header
Next Header = 58 (ICMPv6)
Source Address = (Management Station)
Destination Address = FF05::2 (All Routers, site-local scope)
ICMPv6/RR Header
Type = 138 (Router Renumbering), Code = 0 (Command)
Flags = 60 hex (R, A)
First (and only) PCO:
Match-Prefix Part
OpCode = 2 (CHANGE)
OpLength = 11 (reflects 2 Use-Prefix Parts)
Ordinal = 0 (arbitrary)
MatchLen = 64
MatchPrefix = Old /64 prefix
First Use-Prefix Part
UseLen = 0
KeepLen = 64 (this retains the old prefix value intact)
FlagMask = 0, RAFlags = 0
Valid Lifetime = 28800 seconds (8 hours)
Preferred Lifetime = 7200 seconds (2 hours)
V flag = 1, P flag = 1
UsePrefix = 0::0
Second Use-Prefix Part
UseLen = 64
KeepLen = 0
FlagMask = 0, RAFlags = 0
Lifetimes, V & P flags -- as desired
UsePrefix = New /64 prefix
The second step, deletion of the old prefix, can be done by an RR Command with the same Match-Prefix Part (except for an OpLength reduced from 11 to 3) and no Use-Prefix Parts.
Any temptation to set KeepLen = 64 in the second Use-Prefix Part above should be resisted, as it would instruct the router to sidestep address configuration. ๐
10. Acknowledgments ๐
This protocol was designed by Matt Crawford based on an idea of Robert Hinden and Geert Jan de Groot. Many members of the IPNG Working Group contributed useful comments, in particular members of the DIGITAL UNIX IPv6 team. Bill Sommerfeld provided helpful IPsec expertise. Relentless browbeating by various IESG members may have improved the final quality of this specification ๐ญ๐ซถ.
11. References ๐
[AARCH]Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 2373, July 1998.[AH]Kent, S. and R. Atkinson, "IP Authentication Header", RFC 2402, November 1998.[ANM]Isaacson, E. and H. B. Keller, "Analysis of Numerical Methods", John Wiley & Sons, New York, 1966.[ESP]Kent, S. and R. Atkinson, "IP Encapsulating Security Payload (ESP)", RFC 2406, November 1998.[IANACON]Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.[ICMPV6]Conta, A. and S. Deering, "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6)", RFC 2463, December 1998.[IPSEC]Kent, S. and R. Atkinson, "Security Architecture for the Internet Protocol", RFC 2401, November 1998.[IPV6]Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.[IPV6MIB]Haskin, D. and S. Onishi, "Management Information Base for IP Version 6: Textual Conventions and General Group", RFC 2466, December 1998.[KWORD]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[ND]Narten, T., Nordmark, E. and W. Simpson, "Neighbor Discovery for IP Version 6 (IPv6)", RFC 2461, December 1998.[OSPFMIB]Baker, F. and R. Coltun, "OSPF Version 2 Management Information Base", RFC 1850, November 1995.
12. Author's Address ๐ซถ
Matt Crawford
Fermilab MS 368
PO Box 500
Batavia, IL 60510
USA
Phone: +1 630 840 3461
EMail: crawdad@fnal.gov
Appendix -- Derivation of Reliability Estimates ๐งฎ
okay this appendix is the math behind the reliability estimates, and it's giving whole detective energy ๐ต๏ธโโ๏ธโจ. If a population S of size k is repeatedly sampled with an efficiency p, the expected number of members of S first discovered on the nth sampling is:
m = [1 - (1-p)^n] * k
The expected total number of members of S found in samples, including duplicates, is:
r = n * p * k
Taking the ratio of m to r cancels the unknown factor k and yields an equation:
[1 - (1-p)^n] / p = nm/r
which may be solved for p, which is then an estimator of the sampling efficiency. (The statistical properties of the estimator will not be examined here.) Under the substitution p = 1-q, this becomes the first equation of Section 8.2.
With the estimator p in hand, and a count m of members of S discovered after n samplings, we can compute the a posteriori probability that the true size of S is m+j, for j >= 0. Let Hj denote the hypothesis that the true size of S is m+j, and let R denote the result that m members have been found in n samplings. Then:
P{R | Hj} = [(m+j)!/m!j!] * [1-(1-p)^n]^m * [(1-p)^n]^j
We are interested in P{H0 | R}, but to find it we need to assign a priori values to P{Hj}. Let the size of S be exponentially distributed:
P{Hj} / P{H0} = h^(-j)
for arbitrary h in (0, 1). The value of h will be eliminated from the result.
The Bayesian method yields:
P{Hj | R} / P{H0 | R} = [(m+j)!/m!j!] * [h*(1-p)^n]^j
The reciprocal of the sum over j >= 0 of these ratios is:
P{H0 | R} = [1-h*(1-p)^n] ^ (m+1)
and the confidence estimate of Section 8.2 is the h -> 1 limit of this expression. ๐
Full Copyright Statement โ๏ธ
Copyright (C) The Internet Society (2000). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement ๐
Funding for the RFC Editor function is currently provided by the Internet Society. โจ
๐ฆ where this page comes from
- ietf: rfc2894 2000-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms