RFC 4808
Key Change Strategies for TCP-MD5
RFC 4808: Key Change Strategies for TCP-MD5 ๐ฆ
Okay bestie, this is RFC 4808, and it's all about Key Change Strategies for TCP-MD5 ๐โจ. It's from the Network Working Group and was written by Steven M. Bellovin at Columbia University (he shows up as S. Bellovin in the header). It was published in March 2007 and it's Informational, so it's sharing info, not setting a standard ๐ . The header doesn't list anything it obsoletes or updates, so it's a solo act ๐.
Status of This Memo
Okay, so this memo is giving info for the Internet community ๐ธ. It doesn't specify an Internet standard of any kind. Distribution of it is unlimited, so share away ๐.
Copyright Notice
Copyright (C) The IETF Trust (2007) ยฉ๏ธ๐.
Abstract
The TCP-MD5 option is most commonly used to secure BGP sessions between routers ๐. The annoying part is that changing the long-term key is hard, because the change has to be synchronized between different organizations ๐ฉ. This doc describes single-ended strategies that will permit (mostly) unsynchronized key changes โจ.
1. Introduction โจ
Okay so the TCP-MD5 option [RFC2385] is most commonly used to secure BGP sessions between routers ๐. Changing the long-term key is difficult, since the change needs to be synchronized between different organizations ๐. Worse yet, if the keys are out of sync, it may break the connection between the two routers, and then repair attempts get really hard ๐.
The proper solution involves some sort of key management protocol ๐ง. Apart from the complexity of those, RFC 2385 was not written with key changes in mind ๐. In particular, there is no KeyID field in the option, which means even a key management protocol would run into the same problem ๐ญ.
Fortunately, a heuristic permits key change despite this protocol deficiency ๐. The change can be installed unilaterally at one end of a connection, and it is fully compatible with the existing protocol ๐.
1.1. Terminology
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 [RFC2119] ๐.
2. The Algorithm ๐ง
Separate algorithms are necessary for transmission and reception ๐. Reception is easier, so we're doing it first ๐ซถ.
2.1. Reception
A receiver has a list of valid keys ๐. Each key has a (conceptual) timestamp associated with it โฐ. When a segment arrives, each key gets tried in turn ๐. The segment is discarded if and only if it cannot be validated by any key in the list ๐๏ธ.
In principle, there's no need to test keys in any particular order ๐. For performance reasons though, a simple most-recently-used (MRU) strategy, where you try the last valid key first, should work well ๐ฅ. More complex mechanisms, like examining the TCP sequence number of an arriving segment to see whether it fits in a hole, are almost certainly unnecessary ๐ โโ๏ธ. On the other hand, validating that a received segment is putatively legal, by checking its sequence number against the advertised window, can help avoid denial of service attacks ๐ก๏ธ๐ .
The newest key that has successfully validated a segment is marked as the "preferred" key, see below ๐.
Implicit in this scheme is the assumption that older keys will eventually be unneeded and can be removed ๐๏ธ. So implementations SHOULD provide an indication of when a key was last used successfully ๐.
2.2. Transmission
Transmission is more complex, because the sender doesn't know which keys can be accepted at the far end ๐คทโโ๏ธ. So the conservative strategy is to delay using any new keys for a considerable amount of time, probably measured in days ๐๏ธ. This time interval is the amount of asynchronicity the parties wish to permit, and it's agreed upon out of band and configured manually ๐ค.
Some automation is possible though ๐ค. If a key has been used successfully to validate an incoming segment, clearly the other side knows it ๐ง โจ. So any key marked as "preferred" by the receiving part of a stack SHOULD be used for transmissions ๐.
A sophisticated implementation could try alternate keys if the TCP retransmission counter gets too high ๐ง. (This is analogous to dead gateway detection ๐ชฆ.) In particular, if a key change has just been attempted but those segments aren't acknowledged, it's reasonable to fall back to the previous key and issue an alert of some sort ๐จ. Similarly, an implementation with a new but unused key could occasionally try to use it, kind of like how TCP implementations probe closed windows ๐ช. Doing this avoids the "silent host" problem discussed in Section 3.1 ๐คซ. This should be done at a moderately slow rate ๐ข.
Note that there's an ambiguity when an acknowledgment is received for a segment transmitted with two different keys ๐. The TCP Timestamp option [RFC1323] can be used for disambiguation โฑ๏ธ.
3. Operations ๐ ๏ธ
3.1. Single-Ended Operations
Suppose only one end of the connection has this algorithm implemented ๐โโ๏ธ. The new key gets provisioned on that system, with a start time far in the future, so far that it won't be used spontaneously ๐ฎ. After the key is ready, the other end is notified, out-of-band, that a key change can commence ๐ฃ.
At some point, the other end gets upgraded ๐. Because it doesn't have multiple keys available, it will start using the new key immediately for its transmission, and it will drop all segments that use the old key ๐ค. As soon as it tries to transmit, the upgraded side designates the new key as preferred, and uses it for all of its transmissions ๐ . Note specifically that this includes retransmissions of any segments rejected because they used the old key ๐.
There's a problem if the unchanged machine is a "silent host", meaning a host that has nothing to say and so doesn't transmit ๐. The best way to avoid this is for an upgraded machine to try a variety of keys in the event of repeated unacknowledged packets, and to probe for new unused keys during silent periods, as discussed in Section 2.2 ๐ฏ. Alternatively, application-level KeepAlive messages may be used to make sure neither end of the connection is completely silent ๐. See, for example, Section 4.4 of [RFC4271] or Section 3.5.4 of [RFC3036] ๐.
3.2. Double-Ended Operations
Double-ended operations are similar, except both sides deploy the new key at about the same time ๐ฏ. One should be configured to start using the new key at a point where it's reasonably certain the other side would have it installed too ๐๏ธ. Assuming that's actually happened, the new key gets marked "preferred" on both sides ๐.
3.3. Monitoring
As noted, implementations should monitor when a key was last used for transmission or reception ๐๏ธ. Any monitoring mechanism can be used. Most likely it'll be one or both of a MIB object or objects, plus the vendor's usual command-line mechanism for displaying data of this type ๐ป. Either way, the network operations center should keep track of this ๐ฅ๏ธ. When a new key has been used successfully for both transmission and reception for a reasonable amount of time, the old key can be marked for deletion ๐๏ธ. The exact value isn't crucial, but it should probably be longer than twice the maximum segment lifetime โณ. There's an implicit assumption here that there won't be substantial overlap in the usage period of such keys, so monitoring systems should look for any such anomalies, of course ๐จ.
To be continued in part 2 ๐โจ
Full Copyright Statement โจ
Copyright (C) The IETF Trust (2007). ๐
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. So the authors keep their rights unless BCP 78 says otherwise ๐
This document and the information in it are provided "AS IS", and that's a big deal. THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE all say there are NO WARRANTIES, express or implied. That includes no promise that using the info won't infringe anyone's rights, and no implied warranties of merchantability or fitness for a particular purpose. Nobody is promising it'll work for your thing ๐
Intellectual Property ๐ฅ
Okay, so the IETF doesn't take a side on whether any Intellectual Property Rights or other rights could apply to the tech in this document. That covers whether someone's claim is valid, what the scope is, and whether you can even get a license for it. It also doesn't claim it went looking for any of those rights itself ๐ Info about how rights work for RFC documents lives in BCP 78 and BCP 79.
Copies of IPR disclosures sent to the IETF Secretariat are available, and so are any assurances of licenses. You can also find the result of an attempt to get a general license or permission for implementers or users to use the proprietary rights. All of that is in the IETF's online IPR repository at http://www.ietf.org/ipr ๐ฆ
The IETF also invites anyone to flag copyrights, patents, patent applications, or other proprietary rights that might cover technology needed to implement this standard. Send that to the IETF at ietf-ipr@ietf.org ๐
Acknowledgement ๐ซถ
Funding for the RFC Editor function is currently provided by the Internet Society. Thank you to the Internet Society for keeping the RFC Editor running ๐ธ
๐ฆ where this page comes from
- ietf: rfc4808 2007-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms