IPsec sequence number integrity check value
Huawei Technologiesjifei.song@huawei.comHuawei Technologies2330 Central ExpresswaySanta ClaraUSA+1-408-330-4424tina.tsou.zouting@huawei.comHewlett-Packard Company3000 Hanover St.Palo AltoUSAvishwas.manral@hp.comIPSECME Working GroupIPsec, sequence number, ICVThis document specifies an IPsec AH and ESP sequence number validation scheme, which is complementary to the existing ICV mechanism and anti-replay mechanism of AH and ESP in defense against DOS attack. It is an optional feature negotiable through IKE, for this feature to be negotiated, both sender and receiver must implement it. If any party doesn't support it, then this feature should be excluded from negotiation. The rationale for such a scheme is discussed first; then requirements and guidelines for design of the scheme are laid out. There can be various ways to implement the scheme,
some reference designs are discussed to set the base for effort of identifying best practice and eventually establishing a standard on the subject.As defense against replay attack, IPsec, both AH and ESP, uses anti-replay window to keep track of the sequence numbers of received packets, and reject packets with sequence number that is either too old (below anti-replay window) or duplicate (within anti-replay window, but marked as received).
Anti-replay window is not effective against DOS attack by packets with sequence number that are above anti-replay window, in which case the sequence number is neither considered too old, nor duplicate. Attack packets with sequence number above anti-replay window would penetrate anti-replay check and only be rejected after failing ICV check. The issue is that ICV check, which involves hashing operation, is rather expensive in terms of resource and time consumption. In case of ESP, when hardware crypto acceleration engine is used, ICV check and decryption often need to be performed together to optimize bandwidth efficiency, which makes the operation even more expensive. Large number of such packets would cause recevier's service degradation or interruption because significant amount of receiver's resource and time would be consumed by performing expensive ICV check on these packets.An inexpensive mechanism to check sequence number would allow rejecting such packets without causing service degradation or interruption. This check can be performed either before or after anti-replay check depending on policy and situation, but must be performed before ICV check. Such check doesn't have to be 100% accurate as long as it doesn't yield false positive result, i.e. mistaking correct sequence number as incorrect sequence number, since the packet with false negative result, i.e. incorrect sequence number passing the check, will be caught by ICV check eventually. But it must be significantly more resource and time efficient than ICV check to be beneficial.This check will increase packet length slightly, and incur slight computation overhead per packet, but greatly improve IPsec's capability to withstand DOS attack. This check would not be effective if attacker can prevent original packets from reaching destination, since in such case the attacker doesn't need to change sequence number, instead he or she can change payload, then the packet would pass both anti-replay check and this proposed sequence number check. But in order to shoot down original packets, attacker must compromise intermediate router. The proposed sequence number check is not designed to defend against attacks that involves compromised intermediate router, instead it is designed against attacks where attacker does not control intermediate router, but is able to obtain copy of original packets and launch attack by changing sequence number of the original packets to values that are greater so that anti-replay check would pass and ICV check is required. The latter is simpler attack and easier to carry out therefore is a more serious threat.This check is not designed for systems that are capable of line rate ICV check; instead it is designed for systems that are not capable of line rate ICV check. This check makes it possible for systems that are not capable of line rate ICV check to continue with normal function when under attacks, as long as the original packets are still being delivered, or in another words, as long as the network in between is not compromised. Systems that are capable of line rate ICV check should decline SEQ-ICV in negotiation.
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 RFC 2119.SEQ-ICV is a 4 byte value generated by sender for each IPsec packet based on 4 byte packet sequence number, 12 byte ICV value, and 16 byte secret key known and only known to sender and receiver. The value is appended to immediately follow ICV and transmitted together with the packet to receiver, which generates its own value locally the same way as sender, then compares with the transmitted value. If the value is the same, then the sequence number is considered to be good, otherwise the sequence number is considered to be bad.Following figure illustrates AH header format with SEQ-ICV,Following figure illustrates ESP packet format with SEQ-ICV,SEQ-ICV is generated as the following,AH transport/tunnel modegenerate ICVgenerate SEQ-ICVadjust packet length in IP headerPacket length field can only be adjusted after generating ICV, since ICV must be based on the packet length without SEQ-ICVESP transport/tunnel modeencrypt packet payloadgenerate ICVgenerate SEQ-ICVadjust packet length in IP headerAH transport/tunnel modereject if failed anti-replay checkgenerate SEQ-ICVCompare locally generated SEQ-ICV with received SEQ-ICVReject packet if not same, otherwise adjust packet length field of IP header proceed to AH processingPacket length field must be adjusted before AH processingESP transport/tunnel modereject if failed anti-replay checkgenerate SEQ-ICVCompare locally generated SEQ-ICV with received SEQ-ICVReject packet if not same, otherwise proceed to ESP processingIn calculating ESP payload length, SEQ-ICV must be excluded.Enable SEQ-ICV dynamicallyIf too many packets passed anti-replay but failed ICV check, then notify sender to enable SEQ-ICV, and receiver begins SEQ-ICV check but would not reject packets that failed SEQ-ICV check,
once receiver no longer observes packets passing ICV check but failing SEQ-ICV check, then receiver considers SEQ-ICV has been enabled, and begins to reject packet that failed SEQ-ICV check.Disable SEQ-ICV dynamicallyIf no packets passed anti-replay but failed SEQ-ICV, then notify sender to disable SEQ-ICV, and receiver stops rejecting packets that failed SEQ-ICV check,
once receiver no longer observes packets passing both SEQ-ICV and ICV check, but only packets passing ICV check, then receiver considers SEQ-ICV has been disabled, and stops checking SEQ-ICV Following is summary of conditions that could occur throughout the whole process of dynamically enabling and disabling SEQ-ICV with assumption that original packets are delivered,1 - normal, SEQ-ICV disabled2 - under attack, SEQ-ICV disabled3 - under attack, enabling SEQ-ICV4 - under attack, enabling SEQ-ICV ready5 - under attack, SEQ-ICV enabled6 - normal, SEQ-ICV enabled7 - normal, disabling SEQ-ICVSEQ-ICV enabling process is 1 through 5SEQ-ICV disabling process is 6 -> 7 -> 1SEQ-ICV will be a type of transform used in AH/ESP.Following is list of transform IDs that will be defined for transform type of SEQ-ICVNote that an initiator who supports SEQ-ICV will usually construct two proposal, one with SEQ-ICV transform, another without SEQ-ICV transform. It allows implementation that doesn't support SEQ-ICV to choose proposal without SEQ-ICV. In the proposal containing SEQ-ICV transform, an initiator will usually include at least two SEQ-ICV transforms, one with value "0", one with value "1" or "2". A proposal containing a single SEQ-ICV transform with value "1" or "2" means that SEQ-ICV must be used.A Notify payload with Notify Message Type of SEQ-ICV_ENABLE in an Informational Exchange will be used to notify sender of SEQ-ICV enabling when receiver is under attack by packets with modified sequence number. This document makes no request of IANA.Note to RFC Editor: this section may be removed on
publication as an RFC.Robert Moskowitz reminded us of importance of grammatical integrity.Tero Kivinen pointed out issue with original sample SEQ-ICV-4 generation algorithm and provided insightful feedback on issues like compatibility with existing standard and usage scenario of SEQ-ICV.