draft-ietf-hip-base-03.txt   draft-ietf-hip-base-04.txt 
Network Working Group R. Moskowitz Network Working Group R. Moskowitz
Internet-Draft ICSAlabs, a Division of TruSecure Internet-Draft ICSAlabs, a Division of TruSecure
Expires: December 25, 2005 Corporation Expires: April 27, 2006 Corporation
P. Nikander P. Nikander
P. Jokela (editor) P. Jokela (editor)
Ericsson Research NomadicLab Ericsson Research NomadicLab
T. Henderson T. Henderson
The Boeing Company The Boeing Company
June 23, 2005 October 24, 2005
Host Identity Protocol Host Identity Protocol
draft-ietf-hip-base-03 draft-ietf-hip-base-04
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 39 skipping to change at page 1, line 39
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on December 25, 2005. This Internet-Draft will expire on April 27, 2006.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2005). Copyright (C) The Internet Society (2005).
Abstract Abstract
This memo specifies the details of the Host Identity Protocol (HIP). This memo specifies the details of the Host Identity Protocol (HIP).
HIP provides a rapid exchange of Host Identities (public keys) HIP allows consenting hosts to securely establish and maintain shared
between hosts and uses a Sigma-compliant [REF] Diffie-Hellman key IP-layer state, allowing separation of the identifier and locator
exchange to establish shared secrets between such endpoints. The roles of IP addresses, thereby enabling continuity of communications
protocol is designed to be resistant to Denial-of-Service (DoS) and across IP address changes. HIP is based on a Sigma-compliant Diffie-
Man-in-the-middle (MitM) attacks, and when used together with another Hellman key exchange, using public-key identifiers from a new Host
suitable security protocol, such as Encapsulated Security Payload Identity name space for mutual peer authentication. The protocol is
(ESP) [24], it provides encryption and/or authentication protection designed to be resistant to Denial-of-Service (DoS) and Man-in-the-
for upper layer protocols such as TCP and UDP, while enabling middle (MitM) attacks, and when used together with another suitable
continuity of communications across network layer address changes. security protocol, such as Encapsulated Security Payload (ESP), it
provides integrity protection and optional encryption for upper layer
protocols, suchs as TCP and UDP. Discussion related to this document
is going on at the IETF HIP Working Group mailing list.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 A New Name Space and Identifiers . . . . . . . . . . . . . 5 1.1. A New Name Space and Identifiers . . . . . . . . . . . . . 5
1.2 The HIP Base Exchange . . . . . . . . . . . . . . . . . . 5 1.2. The HIP Base Exchange . . . . . . . . . . . . . . . . . . 5
2. Terms and Definitions . . . . . . . . . . . . . . . . . . . 7 1.3. Memo structure . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Requirements Terminology . . . . . . . . . . . . . . . . . 7 2. Terms and Definitions . . . . . . . . . . . . . . . . . . . . 7
2.2 Notation . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1. Requirements Terminology . . . . . . . . . . . . . . . . . 7
2.3 Definitions . . . . . . . . . . . . . . . . . . . . . . . 7 2.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . 7
3. Host Identifier (HI) and its Representations . . . . . . . . 8 2.3. Definitions . . . . . . . . . . . . . . . . . . . . . . . 7
3.1 Host Identity Tag (HIT) . . . . . . . . . . . . . . . . . 8 3. Host Identifier (HI) and its Representations . . . . . . . . . 9
3.2 Generating a HIT from a HI . . . . . . . . . . . . . . . . 9 3.1. Host Identity Tag (HIT) . . . . . . . . . . . . . . . . . 9
4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . 11 3.2. Generating a HIT from a HI . . . . . . . . . . . . . . . . 10
4.1 Creating a HIP Association . . . . . . . . . . . . . . . . 11 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 12
4.1.1 HIP Cookie Mechanism . . . . . . . . . . . . . . . . . 12 4.1. Creating a HIP Association . . . . . . . . . . . . . . . . 12
4.1.2 Authenticated Diffie-Hellman Protocol . . . . . . . . 14 4.1.1. HIP Puzzle Mechanism . . . . . . . . . . . . . . . . . 13
4.1.3 HIP Replay Protection . . . . . . . . . . . . . . . . 15 4.1.2. Puzzle exchange . . . . . . . . . . . . . . . . . . . 14
4.1.4 Refusing a HIP Exchange . . . . . . . . . . . . . . . 16 4.1.3. Authenticated Diffie-Hellman Protocol . . . . . . . . 15
4.2 Updating a HIP Association . . . . . . . . . . . . . . . . 16 4.1.4. HIP Replay Protection . . . . . . . . . . . . . . . . 16
4.3 Error Processing . . . . . . . . . . . . . . . . . . . . . 17 4.1.5. Refusing a HIP Exchange . . . . . . . . . . . . . . . 17
4.4 HIP State Machine . . . . . . . . . . . . . . . . . . . . 17 4.2. Updating a HIP Association . . . . . . . . . . . . . . . . 17
4.4.1 HIP States . . . . . . . . . . . . . . . . . . . . . . 18 4.3. Error Processing . . . . . . . . . . . . . . . . . . . . . 18
4.4.2 HIP State Processes . . . . . . . . . . . . . . . . . 18 4.4. HIP State Machine . . . . . . . . . . . . . . . . . . . . 19
4.4.3 Simplified HIP State Diagram . . . . . . . . . . . . . 22 4.4.1. HIP States . . . . . . . . . . . . . . . . . . . . . . 19
4.5 User Data Considerations . . . . . . . . . . . . . . . . . 24 4.4.2. HIP State Processes . . . . . . . . . . . . . . . . . 20
4.5.1 TCP and UDP Pseudo-header Computation for User Data . 24 4.4.3. Simplified HIP State Diagram . . . . . . . . . . . . . 27
4.5.2 Sending Data on HIP Packets . . . . . . . . . . . . . 24 4.5. User Data Considerations . . . . . . . . . . . . . . . . . 29
4.5.3 Transport Formats . . . . . . . . . . . . . . . . . . 24 4.5.1. TCP and UDP Pseudo-header Computation for User Data . 29
4.5.4 Reboot and SA Timeout Restart of HIP . . . . . . . . . 24 4.5.2. Sending Data on HIP Packets . . . . . . . . . . . . . 29
4.6 Certificate Distribution . . . . . . . . . . . . . . . . . 25 4.5.3. Transport Formats . . . . . . . . . . . . . . . . . . 29
5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 26 4.5.4. Reboot and SA Timeout Restart of HIP . . . . . . . . . 29
5.1 Payload Format . . . . . . . . . . . . . . . . . . . . . . 26 4.6. Certificate Distribution . . . . . . . . . . . . . . . . . 30
5.1.1 HIP Controls . . . . . . . . . . . . . . . . . . . . . 27 5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.2 Checksum . . . . . . . . . . . . . . . . . . . . . . . 28 5.1. Payload Format . . . . . . . . . . . . . . . . . . . . . . 31
5.1.3 HIP Fragmentation Support . . . . . . . . . . . . . . 28 5.1.1. Checksum . . . . . . . . . . . . . . . . . . . . . . . 32
5.1.4 Solving the Puzzle . . . . . . . . . . . . . . . . . . 28 5.1.2. HIP Controls . . . . . . . . . . . . . . . . . . . . . 32
5.2 HIP Parameters . . . . . . . . . . . . . . . . . . . . . . 30 5.1.3. HIP Fragmentation Support . . . . . . . . . . . . . . 33
5.2.1 TLV Format . . . . . . . . . . . . . . . . . . . . . . 32 5.2. HIP Parameters . . . . . . . . . . . . . . . . . . . . . . 33
5.2.2 Defining New Parameters . . . . . . . . . . . . . . . 33 5.2.1. TLV Format . . . . . . . . . . . . . . . . . . . . . . 35
5.2.3 R1_COUNTER . . . . . . . . . . . . . . . . . . . . . . 34 5.2.2. Defining New Parameters . . . . . . . . . . . . . . . 36
5.2.4 PUZZLE . . . . . . . . . . . . . . . . . . . . . . . . 35 5.2.3. R1_COUNTER . . . . . . . . . . . . . . . . . . . . . . 37
5.2.5 SOLUTION . . . . . . . . . . . . . . . . . . . . . . . 36 5.2.4. PUZZLE . . . . . . . . . . . . . . . . . . . . . . . . 38
5.2.6 DIFFIE_HELLMAN . . . . . . . . . . . . . . . . . . . . 36 5.2.5. SOLUTION . . . . . . . . . . . . . . . . . . . . . . . 39
5.2.7 HIP_TRANSFORM . . . . . . . . . . . . . . . . . . . . 37 5.2.6. DIFFIE_HELLMAN . . . . . . . . . . . . . . . . . . . . 40
5.2.8 HOST_ID . . . . . . . . . . . . . . . . . . . . . . . 38 5.2.7. HIP_TRANSFORM . . . . . . . . . . . . . . . . . . . . 41
5.2.9 HMAC . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.2.8. HOST_ID . . . . . . . . . . . . . . . . . . . . . . . 42
5.2.10 HMAC_2 . . . . . . . . . . . . . . . . . . . . . . . 40 5.2.9. HMAC . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.2.11 HIP_SIGNATURE . . . . . . . . . . . . . . . . . . . 41 5.2.10. HMAC_2 . . . . . . . . . . . . . . . . . . . . . . . . 43
5.2.12 HIP_SIGNATURE_2 . . . . . . . . . . . . . . . . . . 41 5.2.11. HIP_SIGNATURE . . . . . . . . . . . . . . . . . . . . 44
5.2.13 SEQ . . . . . . . . . . . . . . . . . . . . . . . . 42 5.2.12. HIP_SIGNATURE_2 . . . . . . . . . . . . . . . . . . . 45
5.2.14 ACK . . . . . . . . . . . . . . . . . . . . . . . . 43 5.2.13. SEQ . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2.15 ENCRYPTED . . . . . . . . . . . . . . . . . . . . . 44 5.2.14. ACK . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2.16 NOTIFY . . . . . . . . . . . . . . . . . . . . . . . 45 5.2.15. ENCRYPTED . . . . . . . . . . . . . . . . . . . . . . 47
5.2.17 ECHO_REQUEST . . . . . . . . . . . . . . . . . . . . 48 5.2.16. NOTIFY . . . . . . . . . . . . . . . . . . . . . . . . 48
5.2.18 ECHO_RESPONSE . . . . . . . . . . . . . . . . . . . 49 5.2.17. ECHO_REQUEST . . . . . . . . . . . . . . . . . . . . . 51
5.3 HIP Packets . . . . . . . . . . . . . . . . . . . . . . . 49 5.2.18. ECHO_RESPONSE . . . . . . . . . . . . . . . . . . . . 52
5.3.1 I1 - the HIP Initiator Packet . . . . . . . . . . . . 50 5.3. HIP Packets . . . . . . . . . . . . . . . . . . . . . . . 52
5.3.2 R1 - the HIP Responder Packet . . . . . . . . . . . . 50 5.3.1. I1 - the HIP Initiator Packet . . . . . . . . . . . . 53
5.3.3 I2 - the Second HIP Initiator Packet . . . . . . . . . 52 5.3.2. R1 - the HIP Responder Packet . . . . . . . . . . . . 54
5.3.4 R2 - the Second HIP Responder Packet . . . . . . . . . 53 5.3.3. I2 - the Second HIP Initiator Packet . . . . . . . . . 55
5.3.5 UPDATE - the HIP Update Packet . . . . . . . . . . . . 54 5.3.4. R2 - the Second HIP Responder Packet . . . . . . . . . 57
5.3.6 NOTIFY - the HIP Notify Packet . . . . . . . . . . . . 55 5.3.5. UPDATE - the HIP Update Packet . . . . . . . . . . . . 57
5.3.7 CLOSE - the HIP association closing packet . . . . . . 55 5.3.6. NOTIFY - the HIP Notify Packet . . . . . . . . . . . . 58
5.3.8 CLOSE_ACK - the HIP Closing Acknowledgment Packet . . 55 5.3.7. CLOSE - the HIP Association Closing Packet . . . . . . 59
5.4 ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 56 5.3.8. CLOSE_ACK - the HIP Closing Acknowledgment Packet . . 59
5.4.1 Invalid Version . . . . . . . . . . . . . . . . . . . 56 5.4. ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 59
5.4.2 Other Problems with the HIP Header and Packet 5.4.1. Invalid Version . . . . . . . . . . . . . . . . . . . 60
Structure . . . . . . . . . . . . . . . . . . . . . . 56 5.4.2. Other Problems with the HIP Header and Packet
5.4.3 Invalid Cookie Solution . . . . . . . . . . . . . . . 56 Structure . . . . . . . . . . . . . . . . . . . . . . 60
5.4.4 Non-existing HIP Association . . . . . . . . . . . . . 57 5.4.3. Invalid Puzzle Solution . . . . . . . . . . . . . . . 60
6. Packet Processing . . . . . . . . . . . . . . . . . . . . . 58 5.4.4. Non-existing HIP Association . . . . . . . . . . . . . 60
6.1 Processing Outgoing Application Data . . . . . . . . . . . 58 6. Packet Processing . . . . . . . . . . . . . . . . . . . . . . 62
6.2 Processing Incoming Application Data . . . . . . . . . . . 59 6.1. Processing Outgoing Application Data . . . . . . . . . . . 62
6.3 HMAC and SIGNATURE Calculation and Verification . . . . . 60 6.2. Processing Incoming Application Data . . . . . . . . . . . 63
6.3.1 HMAC Calculation . . . . . . . . . . . . . . . . . . . 60 6.3. Solving the Puzzle . . . . . . . . . . . . . . . . . . . . 64
6.3.2 Signature Calculation . . . . . . . . . . . . . . . . 61 6.4. HMAC and SIGNATURE Calculation and Verification . . . . . 65
6.4 HIP KEYMAT Generation . . . . . . . . . . . . . . . . . . 62 6.4.1. HMAC Calculation . . . . . . . . . . . . . . . . . . . 65
6.5 Initiation of a HIP Exchange . . . . . . . . . . . . . . . 63 6.4.2. Signature Calculation . . . . . . . . . . . . . . . . 66
6.5.1 Sending Multiple I1s in Parallel . . . . . . . . . . . 64 6.5. HIP KEYMAT Generation . . . . . . . . . . . . . . . . . . 67
6.5.2 Processing Incoming ICMP Protocol Unreachable 6.6. Initiation of a HIP Exchange . . . . . . . . . . . . . . . 68
Messages . . . . . . . . . . . . . . . . . . . . . . . 64 6.6.1. Sending Multiple I1s in Parallel . . . . . . . . . . . 69
6.6 Processing Incoming I1 Packets . . . . . . . . . . . . . . 65 6.6.2. Processing Incoming ICMP Protocol Unreachable
6.6.1 R1 Management . . . . . . . . . . . . . . . . . . . . 66 Messages . . . . . . . . . . . . . . . . . . . . . . . 70
6.6.2 Handling Malformed Messages . . . . . . . . . . . . . 66 6.7. Processing Incoming I1 Packets . . . . . . . . . . . . . . 70
6.7 Processing Incoming R1 Packets . . . . . . . . . . . . . . 66 6.7.1. R1 Management . . . . . . . . . . . . . . . . . . . . 71
6.7.1 Handling Malformed Messages . . . . . . . . . . . . . 68 6.7.2. Handling Malformed Messages . . . . . . . . . . . . . 71
6.8 Processing Incoming I2 Packets . . . . . . . . . . . . . . 68 6.8. Processing Incoming R1 Packets . . . . . . . . . . . . . . 71
6.8.1 Handling Malformed Messages . . . . . . . . . . . . . 71 6.8.1. Handling Malformed Messages . . . . . . . . . . . . . 73
6.9 Processing Incoming R2 Packets . . . . . . . . . . . . . . 71 6.9. Processing Incoming I2 Packets . . . . . . . . . . . . . . 74
6.10 Sending UPDATE Packets . . . . . . . . . . . . . . . . . 71 6.9.1. Handling Malformed Messages . . . . . . . . . . . . . 76
6.11 Receiving UPDATE Packets . . . . . . . . . . . . . . . . 72 6.10. Processing Incoming R2 Packets . . . . . . . . . . . . . . 76
6.11.1 Handling a SEQ paramaeter in a received UPDATE 6.11. Sending UPDATE Packets . . . . . . . . . . . . . . . . . . 77
message . . . . . . . . . . . . . . . . . . . . . . 72 6.12. Receiving UPDATE Packets . . . . . . . . . . . . . . . . . 77
6.11.2 Handling an ACK Parameter in a Received UPDATE 6.12.1. Handling a SEQ parameter in a received UPDATE
Packet . . . . . . . . . . . . . . . . . . . . . . . 73 message . . . . . . . . . . . . . . . . . . . . . . . 78
6.12 Processing NOTIFY Packets . . . . . . . . . . . . . . . 74 6.12.2. Handling an ACK Parameter in a Received UPDATE
6.13 Processing CLOSE Packets . . . . . . . . . . . . . . . . 74 Packet . . . . . . . . . . . . . . . . . . . . . . . . 78
6.14 Processing CLOSE_ACK Packets . . . . . . . . . . . . . . 74 6.13. Processing NOTIFY Packets . . . . . . . . . . . . . . . . 79
6.15 Dropping HIP Associations . . . . . . . . . . . . . . . 74 6.14. Processing CLOSE Packets . . . . . . . . . . . . . . . . . 79
7. HIP Policies . . . . . . . . . . . . . . . . . . . . . . . . 75 6.15. Processing CLOSE_ACK Packets . . . . . . . . . . . . . . . 79
8. Security Considerations . . . . . . . . . . . . . . . . . . 76 6.16. Dropping HIP Associations . . . . . . . . . . . . . . . . 79
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . 79 7. HIP Policies . . . . . . . . . . . . . . . . . . . . . . . . . 80
10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 84 8. Security Considerations . . . . . . . . . . . . . . . . . . . 81
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 85 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 84
11.1 Normative References . . . . . . . . . . . . . . . . . . 85 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 89
11.2 Informative References . . . . . . . . . . . . . . . . . 86 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 87 11.1. Normative References . . . . . . . . . . . . . . . . . . . 90
A. Probabilities of HIT Collisions . . . . . . . . . . . . . . 89 11.2. Informative References . . . . . . . . . . . . . . . . . . 91
B. Probabilities in the Cookie Calculation . . . . . . . . . . 90 Appendix A. Using Responder Puzzles . . . . . . . . . . . . . . . 93
C. Using Responder Cookies . . . . . . . . . . . . . . . . . . 91 Appendix B. Generating a HIT from a HI . . . . . . . . . . . . . 94
D. Generating a HIT from a HI . . . . . . . . . . . . . . . . . 92 Appendix C. Example Checksums for HIP Packets . . . . . . . . . . 95
E. Example Checksums for HIP Packets . . . . . . . . . . . . . 93 C.1. IPv6 HIP Example (I1) . . . . . . . . . . . . . . . . . . 95
E.1 IPv6 HIP Example (I1) . . . . . . . . . . . . . . . . . . 93 C.2. IPv4 HIP Packet (I1) . . . . . . . . . . . . . . . . . . . 95
E.2 IPv4 HIP Packet (I1) . . . . . . . . . . . . . . . . . . . 93 C.3. TCP Segment . . . . . . . . . . . . . . . . . . . . . . . 95
E.3 TCP Segment . . . . . . . . . . . . . . . . . . . . . . . 93 Appendix D. 384-bit Group . . . . . . . . . . . . . . . . . . . . 97
F. 384-bit Group . . . . . . . . . . . . . . . . . . . . . . . 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 98
Intellectual Property and Copyright Statements . . . . . . . 96 Intellectual Property and Copyright Statements . . . . . . . . . . 99
1. Introduction 1. Introduction
This memo specifies the details of the Host Identity Protocol (HIP). This memo specifies the details of the Host Identity Protocol (HIP).
A high-level description of the protocol and the underlying A high-level description of the protocol and the underlying
architectural thinking is available in the separate HIP architecture architectural thinking is available in the separate HIP architecture
description [25]. Briefly, the HIP architecture proposes an description [26]. Briefly, the HIP architecture proposes an
alternative to the dual use of IP addresses as "locators" (routing alternative to the dual use of IP addresses as "locators" (routing
labels) and "identifiers" (endpoint, or host, identifiers). Instead, labels) and "identifiers" (endpoint, or host, identifiers). In HIP,
in HIP, the host identifiers are public keys of a public/private key public cryptographic keys, of a public/private key pair, are used as
pair. By using public keys (and their representations) as host Host Identifiers, to which higher ayer protocols are bound instead of
identifiers, to which higher layer protocols are bound instead of an an IP address. By using public keys (and their representations) as
IP address, dynamic changes to IP address sets can be directly host identifiers, dynamic changes to IP address sets can be directly
authenticated between hosts, and if desired, strong authentication authenticated between hosts and if desired, strong authentication
between hosts at the TCP/IP stack level can be obtained. between hosts at the TCP/IP stack level can be obtained.
This memo specifies the base HIP protocol ("base exchange") used This memo specifies the base HIP protocol ("base exchange") used
between hosts to establish communications context (keying material, between hosts to establish an IP-layer communications context, called
per-packet context tags) prior to communications. It also defines a HIP association, prior to communications. It also defines a packet
packet format and procedures for updating an active HIP association. format and procedures for updating an active HIP association. Other
Other elements of the HIP architecture are specified in other elements of the HIP architecture are specified in other documents,
documents, including how HIP can be combined with a variant of the including how HIP can be combined with a variant of the Encapsulating
Encapsulating Security Payload (ESP) for encryption and/or Security Payload (ESP) for integrity protection and optional
authentication protection, mobility and host multihoming extensions, encryption, mobility and multi-homing extensions to HIP, extensions
DNS extensions for storing host identities, HIP-related to the Domain Name System (DNS) for storing Host Identities there,
infrastructure in the network, techniques for NAT traversal, and proposals on added HIP-related infrastructure into the networks, and
possibly other future extensions. techniques for NAT traversal.
1.1 A New Name Space and Identifiers 1.1. A New Name Space and Identifiers
The Host Identity Protocol introduces a new namespace, the Host The Host Identity Protocol introduces a new namespace, the Host
Identity. Some ramifications of this new namespace are explained in Identity name space. Some ramifications of this new namespace are
the companion document, the HIP architecture [25] specification. explained in the HIP architecture description [26].
There are two main representations of the Host Identity, the full There are two main representations of the Host Identity, the full
Host Identifier (HI) and the Host Identity Tag (HIT). The HI is a Host Identifier (HI) and the Host Identity Tag (HIT The HI is a
public key and directly represents the Identity. Since there are public key and directly represents the Identity. Since there are
different public key algorithms that can be used with different key different public key algorithms that can be used with different key
lengths, the HI is not good for use as a packet identifier, or as an lengths, the HI is not good for use as a packet identifier, or as an
index into the various operational tables needed to support HIP. index into the various operational tables needed to support HIP.
Consequently, a hash of the HI, the Host Identity Tag (HIT), becomes Consequently, a hash of the HI, the Host Identity Tag (HIT), becomes
the operational representation. It is 128 bits long and is used in the operational representation. It is 128 bits long and is used in
the HIP payloads and to index the corresponding state in the end the HIP payloads and to index the corresponding state in the end
hosts. The HIT has an important security property in that it is hosts. The HIT has an important security property in that it is
self-certifying (see Section 3). self-certifying (see Section 3).
1.2 The HIP Base Exchange 1.2. The HIP Base Exchange
The HIP base exchange is a two-party cryptographic protocol used to The HIP base exchange is a two-party cryptographic protocol used to
establish communications context between hosts. The base exchange is establish communications context between hosts. The base exchange is
a Sigma-compliant [REF] four packet exchange. The first party is a Sigma-compliant [30] four packet exchange. The first party is
called the Initiator and the second party the Responder. The four- called the Initiator and the second party the Responder. The four-
packet design helps to make HIP DoS resilient. The protocol packet design helps to make HIP DoS resilient. The protocol
exchanges Diffie-Hellman keys in the 2nd and 3rd packets, and exchanges Diffie-Hellman keys in the 2nd and 3rd packets, and
authenticates the parties in the 3rd and 4th packets. Additionally, authenticates the parties in the 3rd and 4th packets. Additionally,
the Responder starts a cookie puzzle exchange in the 2nd packet, with the Responder starts a puzzle exchange in the 2nd packet, with the
the Initiator completing it in the 3rd packet before the Responder Initiator completing it in the 3rd packet before the Responder stores
stores any state from the exchange. any state from the exchange.
The exchange can use the Diffie-Hellman output to encrypt the Host The exchange can use the Diffie-Hellman output to encrypt the Host
Identity of the Initiator in packet 3 (although Aura et al. [29] Identity of the Initiator in packet 3 (although Aura et al. [29]
notes that such operation may interfere with packet-inspecting notes that such operation may interfere with packet-inspecting
middleboxes), or the Host Identity may instead be sent unencrypted. middleboxes), or the Host Identity may instead be sent unencrypted.
The Responder's Host Identity is not protected. It should be noted, The Responder's Host Identity is not protected. It should be noted,
however, that both the Initiator's and the Responder's HITs are however, that both the Initiator's and the Responder's HITs are
transported as such (in cleartext) in the packets, allowing an transported as such (in cleartext) in the packets, allowing an
eavesdropper with a priori knowledge about the parties to verify eavesdropper with a priori knowledge about the parties to verify
their identities. their identities.
Data packets start to flow after the 4th packet. The 3rd and 4th HIP Data packets start to flow after the 4th packet. The 3rd and 4th HIP
packets may carry a data payload in the future. However, the details packets may carry a data payload in the future. However, the details
of this are to be defined later as more implementation experience is of this are to be defined later as more implementation experience is
gained. gained.
An existing HIP association can be updated using the update mechanism
defined in this document, and when the association is no longer
needed, it can be closed using the defined closing mechanism.
Finally, HIP is designed as an end-to-end authentication and key Finally, HIP is designed as an end-to-end authentication and key
establishment protocol, to be used with Encapsulated Security Payload establishment protocol, to be used with Encapsulated Security Payload
(ESP) [24] and other end-to-end security protocols. The base (ESP) [24] and other end-to-end security protocols. The base
protocol lacks the details for security association management and protocol lacks the details for security association management and
much of the fine-grained policy control found in Internet Key much of the fine-grained policy control found in Internet Key
Exchange IKE RFC2409 [8] that allows IKE to support complex gateway Exchange IKE RFC2409 [7] that allows IKE to support complex gateway
policies. Thus, HIP is not a replacement for IKE. policies. Thus, HIP is not a replacement for IKE.
1.3. Memo structure
The rest of this memo is structured as follows. Section 2 defines
the central keywords, notation, and terms used throughout the rest of
the document. Section 3 defines the structure of the Host Identity
and its various representations. Section 4 gives an overview of the
HIP base exchange protocol. Section 5 and Section 6 define the
detail packet formats and rules for packet processing. Finally,
Section 7, Section 8, and Section 9 discuss policy, security, and
IANA considerations, respectively.
2. Terms and Definitions 2. Terms and Definitions
2.1 Requirements Terminology 2.1. Requirements Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC2119 [5]. document are to be interpreted as described in RFC2119 [5].
2.2 Notation 2.2. Notation
[x] indicates that x is optional. [x] indicates that x is optional.
{x} indicates that x is encrypted. {x} indicates that x is encrypted.
<x>y indicates that "x" is encrypted with the key "y". X(y) indicates that y is a parameter of X.
<x>i indicates that x exists i times.
--> signifies "Initiator to Responder" communication (requests). --> signifies "Initiator to Responder" communication (requests).
<-- signifies "Responder to Initiator" communication (replies). <-- signifies "Responder to Initiator" communication (replies).
| signifies concatenation of information-- e.g. X | Y is the | signifies concatenation of information-- e.g. X | Y is the
concatenation of X with Y. concatenation of X with Y.
Ltrunc (SHA-1(), K) denotes the lowest order K bits of the SHA-1 Ltrunc (SHA-1(), K) denotes the lowest order K bits of the SHA-1
result. result.
(This section needs work.) 2.3. Definitions
2.3 Definitions
(This section needs work. Examples from IKE include "Perfect Forward
Secrecy", "Security Association")
Unused Association Lifetime (UAL): Implementation-specific time for Unused Association Lifetime (UAL): Implementation-specific time for
which, if no packet is sent or received for this time interval, a which, if no packet is sent or received for this time interval, a
host MAY begin to tear down an active association. host MAY begin to tear down an active association.
Maximum Segment Lifetime (MSL): Maximum time that a TCP segment is
expected to spend in the network.
Exchange Complete (EC): Time that the host spends at the R2-SENT
before it moves to ESTABLISHED state. The time is n * I2
retransmission timeout, where n ~ I2_RETRIES_MAX.
HIT Hash Algorithm: hash algorithm used to generate a Host Identity HIT Hash Algorithm: hash algorithm used to generate a Host Identity
Tag (HIT) from the Host Identity public key. Currently SHA-1 [23] is Tag (HIT) from the Host Identity public key. Currently SHA-1 [25]
used. is used.
Puzzle Hash Algorithm (PHASH): hash algorithm used to calculate the
puzzle hash. The algorithm is the same as is used to generate the
Responder's HIT.
Opportunistic mode: HIP base exchange where the Responder's HIT is
not a priori known to the Initiator.
3. Host Identifier (HI) and its Representations 3. Host Identifier (HI) and its Representations
A public key of an asymmetric key pair is used as the Host Identifier In this section, the properties of the Host Identifier and Host
(HI). Correspondingly, the host itself is defined as the entity that Identifier Tag are discussed, and the exact format for them is
holds the private key from the key pair. See the HIP architecture defined. In HIP, public key of an asymmetric key pair is used as the
specification [25] for more details about the difference between an Host Identifier (HI). Correspondingly, the host itself is defined as
identity and the corresponding identifier. the entity that holds the private key from the key pair. See the HIP
architecture specification [26] for more details about the difference
between an identity and the corresponding identifier.
HIP implementations MUST support the Rivest Shamir Adelman (RSA) [15] HIP implementations MUST support the Rivest Shamir Adelman (RSA) [15]
public key algorithm, and SHOULD support the Digital Signature public key algorithm, and SHOULD support the Digital Signature
Algorithm (DSA) [13] algorithm; other algorithms MAY be supported. Algorithm (DSA) [13] algorithm; other algorithms MAY be supported.
A hash of the HI, the Host Identity Tag (HIT), is used in protocols A hashed encoding of the HI, the Host Identity Tag (HIT), is used in
to represent the Host Identity. The HIT is 128 bits long and has the protocols to represent the Host Identity. The HIT is 128 bits long
following three key properties: i) it is the same length as an IPv6 and has the following three key properties: i) it is the same length
address and can be used in address-sized fields in APIs and as an IPv6 address and can be used in address-sized fields in APIs
protocols, ii) it is self-certifying (i.e., given a HIT, it is and protocols, ii) it is self-certifying (i.e., given a HIT, it is
computationally hard to find a Host Identity key that matches the computationally hard to find a Host Identity key that matches the
HIT), and iii) the probability of HIT collision between two hosts is HIT), and iii) the probability of HIT collision between two hosts is
very low. very low.
Finally, HIs and HITs are not expected to be carried explicitly in Carrying HIs and HITs in the header of user data packets would
the headers of user data packets, due to their sizes. Depending on increase the overhead of packets. Thus, it is not expected that they
the form of further communication, other methods are used to map the are carried in every packet, but other methods are used to map the
data packet to the these representatives of host identities. For data packets to the corresponding HIs. In some cases, this makes it
example, if ESP is used to protect data traffic, the Security possible to use HIP without any additional headers in the user data
Parameter Index (SPI) can be used for this purpose. In some cases, packets. For example, if ESP is used to protect data traffic, the
this makes it possible to use HIP without an additional explicit Security Parameter Index (SPI) carried in the ESP header, can be used
protocol header. to map the encrypted data packet to the correct HIP association.
3.1 Host Identity Tag (HIT)
The Host Identity Tag is a 128 bits long value -- a hash of the Host
Identifier. There are two advantages of using a hash over the actual
Host Identity public key in protocols. Firstly, its fixed length
makes for easier protocol coding and also better manages the packet
size cost of this technology. Secondly, it presents a consistent
format to the protocol whatever underlying identity technology is
used.
There are two types of HITs. HITs of the first type, called _Type 1
HIT_, consist of an 8-bit prefix followed by 120 bits of the hash of
the public key. HITs of the second type (Type 2 HIT) consist of a
Host Assigning Authority Field (HAA), and only the last 64 bits come
from a SHA-1 hash of the Host Identity. This latter format for HIT
is recommended for 'well known' systems. It is possible to support a
resolution mechanism for these names in hierarchical directories,
like the DNS. Another use of HAA is in policy controls, see
Section 7.
This document fully specifies only Type 1 HITs. HITs that consists 3.1. Host Identity Tag (HIT)
of the HAA field and the hash are specified in [27].
Any conforming implementation MUST be able to deal with Type 1 HITs. The Host Identity Tag is a 128 bits long value -- a hashed encoding
When handling other than Type 1 HITs, the implementation is of the Host Identifier. There are two advantages of using a hashed
RECOMMENDED to explicitly learn and record the binding between the encoding over the actual Host Identity public key in protocols.
Host Identifier and the HIT, as it may not be able to generate such Firstly, its fixed length makes for easier protocol coding and also
HITs from the Host Identifiers. It is a matter of policy whether a better manages the packet size cost of this technology. Secondly, it
host will accept a HIP connection when such binding is not known. presents a consistent format to the protocol whatever underlying
identity technology is used.
The following figure shows the structure of a Type 1 HIT. "A Non-Routable IPv6 Prefix for Keyed Hash Identifiers" [22] has been
specified to store 128-bit hash based identifier called Keyed Hash
Identifier (KHI) under an 8-bit prefix, proposed to be allocated from
the IPv6 address block 1000::/4. The Host Identity Tag is a KHI
valid for the Context ID [22] value for HIP, 0xF0EF F02F BFF4 3D0F
E793 0C3C 6E61 74EA (The tag value has been generated randomly by the
editor of this specification.) The following figure shows, for
informal purposes only, the format of a HIT specified by [22], and
used in this document:
1 1
0 2 0 2
0 1 2 3 4 5 6 7 8 ... 7 0 1 2 3 4 5 6 7 8 ... 7
+-+-+-+-+-+-+-+-+-+-//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Prefix | Hash | | Prefix | Hash |
+-+-+-+-+-+-+-+-+-+-//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Prefix (8 bits) - Fixed prefix, TBD. All other values reserved. Prefix (8 bits) - Fixed prefix, TBD (0x11, TO BE DISCUSSED), as
defined per [22].
0x40 - SHA-1 hash algorithm
All other values reserved.
Hash (120 bits) - Lower-order bits of the hash (as specified by Encoding (120 bits) - Encoding of the public key and KHI context
the hash algorithm) of the public key identifier as defined per [22].
Additional values for the prefix (including different hash Additional values for the prefix (including different hash
algorithms, or other information) may be defined in the future. A algorithms, or other information) may be defined in the future. A
host may receive a HIT for which it does not understand the prefix. host may receive a HIT for which it does not understand the prefix.
In such a case, it will not be able to check the mapping between HI In such a case, it will not be able to check the mapping between HI
and HIT. and HIT.
3.2 Generating a HIT from a HI 3.2. Generating a HIT from a HI
The 120 or 64 hash bits in a HIT MUST be generated by taking the
least significant 120 or 64 bits of the HIT Hash Algorithm hash of
the Host Identifier as it is represented in the Host Identity field
in a HIP payload packet.
For Identities that are either RSA or DSA public keys, the HIT is
formed as follows:
1. The public key is encoded as specified in the corresponding
DNSSEC document, taking the algorithm specific portion of the
RDATA part of the KEY RR. There is currently only two defined
public key algorithms: RSA and DSA. Hence, either of the
following applies:
The RSA public key is encoded as defined in RFC3110 [15] The HIT MUST be generated according to the KHI generation method
Section 2, taking the exponent length (e_len), exponent (e) described in [22] using a context ID value of 0xF0EF F02F BFF4 3D0F
and modulus (n) fields concatenated. The length (n_len) of E793 0C3C 6E61 74EA, and an input encoding the Host Identity field
the modulus (n) can be determined from the total HI length (see Section 5.2.8) present in a HIP payload packet.
(hi_len) and the preceding HI fields including the exponent
(e). Thus, the data to be hashed has the same length as the
HI (hi_len). The fields MUST be encoded in network byte
order, as defined in RFC3110 [15].
The DSA public key is encoded as defined in RFC2536 [13] For Identities that are either RSA or DSA public keys, this input
Section 2, taking the fields T, Q, P, G, and Y, concatenated. consists of the public key encoding as specified in the corresponding
Thus, the data to be hashed is 1 + 20 + 3 * 64 + 3 * 8 * T DNSSEC document, taking the algorithm specific portion of the RDATA
octets long, where T is the size parameter as defined in part of the KEY RR. There is currently only two defined public key
RFC2536 [13]. The size parameter T, affecting the field algorithms: RSA and DSA. Hence, either of the following applies:
lengths, MUST be selected as the minimum value that is long
enough to accommodate P, G, and Y. The fields MUST be encoded
in network byte order, as defined in RFC2536 [13].
2. A SHA-1 hash [23] is calculated over the encoded key. The RSA public key is encoded as defined in RFC3110 [15] Section
2, taking the exponent length (e_len), exponent (e) and modulus
(n) fields concatenated. The length (n_len) of the modulus (n)
can be determined from the total HI Length and the preceding HI
fields including the exponent (e). Thus, the data to be hashed
has the same length as the HI. The fields MUST be encoded in
network byte order, as defined in RFC3110 [15].
3. The least significant 120 or 64 bits of the hash result are used The DSA public key is encoded as defined in RFC2536 [13] Section
to create the HIT, as defined above. 2, taking the fields T, Q, P, G, and Y, concatenated. Thus, the
data to be hashed is 1 + 20 + 3 * 64 + 3 * 8 * T octets long,
where T is the size parameter as defined in RFC2536 [13]. The
size parameter T, affecting the field lengths, MUST be selected as
the minimum value that is long enough to accommodate P, G, and Y.
The fields MUST be encoded in network byte order, as defined in
RFC2536 [13].
In Appendix D the HIT generation process is illustrated using pseudo- In Appendix B the public key encoding generation process is
code. illustrated using pseudo-code.
4. Protocol Overview 4. Protocol Overview
The following material is an overview of the HIP protocol operation, The following material is an overview of the HIP protocol operation,
and does not contain all details of the packet formats or the packet and does not contain all details of the packet formats or the packet
processing steps. Section 5 and Section 6 describe in more detail processing steps. Section 5 and Section 6 describe in more detail
the packet formats and packet processing steps, respectively, and are the packet formats and packet processing steps, respectively, and are
normative in case of any conflicts with this section. normative in case of any conflicts with this section.
The Host Identity Protocol is IP protocol TBD (Editor's note: The protocol number for Host Identity Protocol will be assigned by
protocol number will be assigned by IANA; for testing purposes, the IANA. For testing purposes, the protocol number 253 is currently
protocol number 99 is currently used). The HIP payload (Section 5.1) used. This number has been reserved by IANA for experimental use
header could be carried in every IP datagram. However, since HIP (see [19]).
headers are relatively large (40 bytes), it is desirable to
'compress' the HIP header so that the HIP header only occurs in
control packets used to establish or change HIP state. The actual
method for header 'compression' and for matching data packets with
existing HIP associations (if any) is defined in separate extension
documents, describing transport formats and methods. All HIP
implementations MUST implement, at minimum, the ESP transport format
for HIP [24].
4.1 Creating a HIP Association The HIP payload (Section 5.1) header could be carried in every IP
datagram. However, since HIP headers are relatively large (40
bytes), it is desirable to 'compress' the HIP header so that the HIP
header only occurs in control packets used to establish or change HIP
association state. The actual method for header 'compression' and
for matching data packets with existing HIP associations (if any) is
defined in separate documents, describing transport formats and
methods. All HIP implementations MUST implement, at minimum, the ESP
transport format for HIP [24].
4.1. Creating a HIP Association
By definition, the system initiating a HIP exchange is the Initiator, By definition, the system initiating a HIP exchange is the Initiator,
and the peer is the Responder. This distinction is forgotten once and the peer is the Responder. This distinction is forgotten once
the base exchange completes, and either party can become the the base exchange completes, and either party can become the
Initiator in future communications. Initiator in future communications.
The HIP base exchange serves to manage the establishment of state The HIP base exchange serves to manage the establishment of state
between an Initiator and a Responder. The first packet, I1, between an Initiator and a Responder. The first packet, I1,
initiates the exchange, and the last three packets, R1, I2, and R2, initiates the exchange, and the last three packets, R1, I2, and R2,
constitute a standard authenticated Diffie-Hellman key exchange for constitute a standard authenticated Diffie-Hellman key exchange for
session key generation. During the Diffie-Hellman key exchange, a session key generation. During the Diffie-Hellman key exchange, a
piece of keying material is generated. The HIP association keys are piece of keying material is generated. The HIP association keys are
drawn from this keying material. If other cryptographic keys are drawn from this keying material. If other cryptographic keys are
needed, e.g., to be used with ESP, they are expected to be drawn from needed, e.g., to be used with ESP, they are expected to be drawn from
the same keying material. the same keying material.
The Initiator first sends a trigger packet, I1, to the Responder. The Initiator first sends a trigger packet, I1, to the Responder.
The packet contains only the HIT of the Initiator and possibly the The packet contains only the HIT of the Initiator and possibly the
HIT of the Responder, if it is known. HIT of the Responder, if it is known. Note that in some cases it may
be possible to replace this trigger packet by some other form of a
trigger, in which case the protocol starts with the Responder sending
the R1 packet.
The second packet, R1, starts the actual exchange. It contains a The second packet, R1, starts the actual exchange. It contains a
puzzle-- a cryptographic challenge that the Initiator must solve puzzle-- a cryptographic challenge that the Initiator must solve
before continuing the exchange. The level of difficulty of the before continuing the exchange. The level of difficulty of the
puzzle can be adjusted based on level of trust with the Initiator, puzzle can be adjusted based on level of trust with the Initiator,
current load, or other factors. In addition, the R1 contains the current load, or other factors. In addition, the R1 contains the
initial Diffie-Hellman parameters and a signature, covering part of initial Diffie-Hellman parameters and a signature, covering part of
the message. Some fields are left outside the signature to support the message. Some fields are left outside the signature to support
pre-created R1s. pre-created R1s.
In the I2 packet, the Initiator must display the solution to the In the I2 packet, the Initiator must display the solution to the
received puzzle. Without a correct solution, the I2 message is received puzzle. Without a correct solution, the I2 message is
discarded. The I2 also contains a Diffie-Hellman parameter that discarded. The I2 also contains a Diffie-Hellman parameter that
carries needed information for the Responder. The packet is signed carries needed information for the Responder. The packet is signed
by the sender. by the sender.
The R2 packet finalizes the base exchange. The packet is signed. The R2 packet finalizes the base exchange. The packet is signed.
The base exchange is illustrated below. The term "key" refers to the The base exchange is illustrated below. The term "key" refers to the
host identity public key, and "sig" represents a signature using such host identity public key, and "sig" represents a signature using such
key. The packets contain other parameters not shown in this figure. a key. The packets contain other parameters not shown in this
figure.
Initiator Responder Initiator Responder
I1: trigger exchange I1: trigger exchange
--------------------------> -------------------------->
select pre-computed R1 select pre-computed R1
R1: puzzle, D-H, key, sig R1: puzzle, D-H, key, sig
<------------------------- <-------------------------
check sig remain stateless check sig remain stateless
solve puzzle solve puzzle
I2: solution, D-H, {key}, sig I2: solution, D-H, {key}, sig
--------------------------> -------------------------->
compute D-H check cookie compute D-H check puzzle
check puzzle
check sig check sig
R2: sig R2: sig
<-------------------------- <--------------------------
check sig compute D-H check sig compute D-H
4.1.1 HIP Cookie Mechanism 4.1.1. HIP Puzzle Mechanism
The purpose of the HIP cookie mechanism is to protect the Responder The purpose of the HIP puzzle mechanism is to protect the Responder
from a number of denial-of-service threats. It allows the Responder from a number of denial-of-service threats. It allows the Responder
to delay state creation until receiving I2. Furthermore, the puzzle to delay state creation until receiving I2. Furthermore, the puzzle
included in the cookie allows the Responder to use a fairly cheap allows the Responder to use a fairly cheap calculation to check that
calculation to check that the Initiator is "sincere" in the sense the Initiator is "sincere" in the sense that it has churned CPU
that it has churned CPU cycles in solving the puzzle. cycles in solving the puzzle.
The Cookie mechanism has been explicitly designed to give space for The Puzzle mechanism has been explicitly designed to give space for
various implementation options. It allows a Responder implementation various implementation options. It allows a Responder implementation
to completely delay session specific state creation until a valid I2 to completely delay session specific state creation until a valid I2
is received. In such a case a correctly formatted I2 can be rejected is received. In such a case a correctly formatted I2 can be rejected
only once the Responder has checked its validity by computing one only once the Responder has checked its validity by computing one
hash function. On the other hand, the design also allows a Responder hash function. On the other hand, the design also allows a Responder
implementation to keep state about received I1s, and match the implementation to keep state about received I1s, and match the
received I2s against the state, thereby allowing the implementation received I2s against the state, thereby allowing the implementation
to avoid the computational cost of the hash function. The drawback to avoid the computational cost of the hash function. The drawback
of this latter approach is the requirement of creating state. of this latter approach is the requirement of creating state.
Finally, it also allows an implementation to use other combinations Finally, it also allows an implementation to use other combinations
of the space-saving and computation-saving mechanisms. of the space-saving and computation-saving mechanisms.
One possible way for a Responder to remain stateless but drop most One possible way for a Responder to remain stateless but drop most
spoofed I2s is to base the selection of the cookie on some function spoofed I2s is to base the selection of the puzzle on some function
over the Initiator's Host Identity. The idea is that the Responder over the Initiator's Host Identity. The idea is that the Responder
has a (perhaps varying) number of pre-calculated R1 packets, and it has a (perhaps varying) number of pre-calculated R1 packets, and it
selects one of these based on the information carried in I1. When selects one of these based on the information carried in I1. When
the Responder then later receives I2, it checks that the cookie in the Responder then later receives I2, it checks that the puzzle in
the I2 matches with the cookie sent in the R1, thereby making it the I2 matches with the puzzle sent in the R1, thereby making it
impractical for the attacker to first exchange one I1/R1, and then impractical for the attacker to first exchange one I1/R1, and then
generate a large number of spoofed I2s that seemingly come from generate a large number of spoofed I2s that seemingly come from
different IP addresses or use different HITs. The method does not different IP addresses or use different HITs. The method does not
protect from an attacker that uses fixed IP addresses and HITs, protect from an attacker that uses fixed IP addresses and HITs,
though. Against such an attacker it is probably best to create a though. Against such an attacker a viable approach may be to create
piece of local state, and remember that the puzzle check has a piece of local state, and remember that the puzzle check has
previously failed. See Appendix C for one possible implementation. previously failed. See Appendix A for one possible implementation.
Implementations SHOULD include sufficient randomness to the algorithm Implementations SHOULD include sufficient randomness to the algorithm
so that algorithm complexity attacks become impossible [30]. so that algorithm complexity attacks become impossible [31].
The Responder can set the puzzle difficulty for Initiator, based on The Responder can set the puzzle difficulty for Initiator, based on
its level of trust of the Initiator. The Responder SHOULD use its level of trust of the Initiator. The Responder SHOULD use
heuristics to determine when it is under a denial-of-service attack, heuristics to determine when it is under a denial-of-service attack,
and set the puzzle difficulty value K appropriately; see below. and set the puzzle difficulty value K appropriately; see below.
The Responder starts the cookie exchange when it receives an I1. The 4.1.2. Puzzle exchange
The Responder starts the puzzle exchange when it receives an I1. The
Responder supplies a random number I, and requires the Initiator to Responder supplies a random number I, and requires the Initiator to
find a number J. To select a proper J, the Initiator must create the find a number J. To select a proper J, the Initiator must create the
concatenation of I, the HITs of the parties, and J, and take a SHA-1 concatenation of I, the HITs of the parties, and J, and take a SHA-1
hash over this concatenation. The lowest order K bits of the result hash over this concatenation. The lowest order K bits of the result
MUST be zeros. The value K sets the difficulty of the puzzle. MUST be zeros. The value K sets the difficulty of the puzzle.
To generate a proper number J, the Initiator will have to generate a To generate a proper number J, the Initiator will have to generate a
number of Js until one produces the hash target of zero. The number of Js until one produces the hash target of zero. The
Initiator SHOULD give up after exceeding the puzzle lifetime in the Initiator SHOULD give up after exceeding the puzzle lifetime in the
PUZZLE TLV. The Responder needs to re-create the concatenation of I, PUZZLE parameter (Section 5.2.4). The Responder needs to re-create
the HITs, and the provided J, and compute the hash once to prove that the concatenation of I, the HITs, and the provided J, and compute the
the Initiator did its assigned task. hash once to prove that the Initiator did its assigned task.
To prevent pre-computation attacks, the Responder MUST select the To prevent pre-computation attacks, the Responder MUST select the
number I in such a way that the Initiator cannot guess it. number I in such a way that the Initiator cannot guess it.
Furthermore, the construction MUST allow the Responder to verify that Furthermore, the construction MUST allow the Responder to verify that
the value was indeed selected by it and not by the Initiator. See the value was indeed selected by it and not by the Initiator. See
Appendix C for an example on how to implement this. Appendix A for an example on how to implement this.
Using the Opaque data field in an ECHO_REQUEST parameter, the Using the Opaque data field in an ECHO_REQUEST parameter
Responder can include some data in R1 that the Initiator must copy (Section 5.2.17), the Responder can include some data in R1 that the
unmodified in the corresponding I2 packet. The Responder can Initiator must copy unmodified in the corresponding I2 packet. The
generate the Opaque data in various ways; e.g. using the sent I, some Responder can generate the Opaque data in various ways; e.g. using
secret, and possibly other related data. Using this same secret, the sent I, some secret, and possibly other related data. Using this
received I in I2 packet and possible other data, the Receiver can same secret, received I in I2 packet and possible other data, the
verify that it has itself sent the I to the Initiator. The Responder Receiver can verify that it has itself sent the I to the Initiator.
MUST change the secret periodically. The Responder MUST change such a secret periodically.
It is RECOMMENDED that the Responder generates a new cookie and a new It is RECOMMENDED that the Responder generates a new puzzle and a new
R1 once every few minutes. Furthermore, it is RECOMMENDED that the R1 once every few minutes. Furthermore, it is RECOMMENDED that the
Responder remembers an old cookie at least 2*lifetime seconds after Responder remembers an old puzzle at least 2*lifetime seconds after
it has been deprecated. These time values allow a slower Initiator it has been deprecated. These time values allow a slower Initiator
to solve the cookie puzzle while limiting the usability that an old, to solve the puzzle while limiting the usability that an old, solved
solved cookie has to an attacker. puzzle has to an attacker.
NOTE: The protocol developers explicitly considered whether R1 should NOTE: The protocol developers explicitly considered whether R1 should
include a timestamp in order to protect the Initiator from replay include a timestamp in order to protect the Initiator from replay
attacks. The decision was to NOT include a timestamp. attacks. The decision was to NOT include a timestamp.
NOTE: The protocol developers explicitly considered whether a memory NOTE: The protocol developers explicitly considered whether a memory
bound function should be used for the puzzle instead of a CPU bound bound function should be used for the puzzle instead of a CPU bound
function. The decision was not to use memory bound functions. At function. The decision was not to use memory bound functions. At
the time of the decision the idea of memory bound functions was the time of the decision the idea of memory bound functions was
relatively new and their IPR status were unknown. Once there is more relatively new and their IPR status were unknown. Once there is more
experience about memory bound functions and once their IPR status is experience about memory bound functions and once their IPR status is
better known, it may be reasonable to reconsider this decision. better known, it may be reasonable to reconsider this decision.
4.1.2 Authenticated Diffie-Hellman Protocol 4.1.3. Authenticated Diffie-Hellman Protocol
The packets R1, I2, and R2 implement a standard authenticated Diffie- The packets R1, I2, and R2 implement a standard authenticated Diffie-
Hellman exchange. The Responder sends its public Diffie-Hellman key Hellman exchange. The Responder sends its public Diffie-Hellman key
and its public authentication key, i.e., its host identity, in R1. and its public authentication key, i.e., its host identity, in R1.
The signature in R1 allows the Initiator to verify that the R1 has The signature in R1 allows the Initiator to verify that the R1 has
been once generated by the Responder. However, since it is been once generated by the Responder. However, since it is
precomputed and therefore does not cover all of the packet, it does precomputed and therefore does not cover all of the packet, it does
not protect from replay attacks. not protect from replay attacks.
When the Initiator receives an R1, it computes the Diffie-Hellman When the Initiator receives an R1, it computes the Diffie-Hellman
session key. It creates a HIP association using keying material from session key. It creates a HIP association using keying material from
the session key (see Section 6.4), and may use the association to the session key (see Section 6.5), and may use the association to
encrypt its public authentication key, i.e., host identity. The encrypt its public authentication key, i.e., host identity. The
resulting I2 contains the Initiator's Diffie-Hellman key and its resulting I2 contains the Initiator's Diffie-Hellman key and its
(optionally) encrypted public authentication key. The signature in (optionally encrypted) public authentication key. The signature in
I2 covers all of the packet. I2 covers all of the packet.
The Responder extracts the Initiator Diffie-Hellman public key from The Responder extracts the Initiator Diffie-Hellman public key from
the I2, computes the Diffie-Hellman session key, creates a the I2, computes the Diffie-Hellman session key, creates a
corresponding HIP association, and decrypts the Initiator's public corresponding HIP association, and decrypts the Initiator's public
authentication key. It can then verify the signature using the authentication key. It can then verify the signature using the
authentication key. authentication key.
The final message, R2, is needed to protect the Initiator from replay The final message, R2, is needed to protect the Initiator from replay
attacks. attacks.
4.1.3 HIP Replay Protection 4.1.4. HIP Replay Protection
The HIP protocol includes the following mechanisms to protect against The HIP protocol includes the following mechanisms to protect against
malicious replays. Responders are protected against replays of I1 malicious replays. Responders are protected against replays of I1
packets by virtue of the stateless response to I1s with presigned R1 packets by virtue of the stateless response to I1s with presigned R1
messages. Initiators are protected against R1 replays by a messages. Initiators are protected against R1 replays by a
monotonically increasing "R1 generation counter" included in the R1. monotonically increasing "R1 generation counter" included in the R1.
Responders are protected against replays or false I2s by the cookie Responders are protected against replays or false I2s by the puzzle
mechanism (Section 4.1.1 above), and optional use of opaque data. mechanism (Section 4.1.1 above), and optional use of opaque data.
Hosts are protected against replays to R2s and UPDATEs by use of a Hosts are protected against replays to R2s and UPDATEs by use of a
less expensive HMAC verification preceding HIP signature less expensive HMAC verification preceding HIP signature
verification. verification.
The R1 generation counter is a monotonically increasing 64-bit The R1 generation counter is a monotonically increasing 64-bit
counter that may be initialized to any value. The scope of the counter that may be initialized to any value. The scope of the
counter MAY be system-wide but SHOULD be per host identity, if there counter MAY be system-wide but SHOULD be per host identity, if there
is more than one local host identity. The value of this counter is more than one local host identity. The value of this counter
SHOULD be kept across system reboots and invocations of the HIP base SHOULD be kept across system reboots and invocations of the HIP base
exchange. This counter indicates the current generation of cookie exchange. This counter indicates the current generation of puzzles.
puzzles. Implementations MUST accept puzzles from the current Implementations MUST accept puzzles from the current generation and
generation and MAY accept puzzles from earlier generations. A MAY accept puzzles from earlier generations. A system's local
system's local counter MUST be incremented at least as often as every counter MUST be incremented at least as often as every time old R1s
time old R1s cease to be valid, and SHOULD never be decremented, lest cease to be valid, and SHOULD never be decremented, lest the host
the host expose its peers to the replay of previously generated, expose its peers to the replay of previously generated, higher
higher numbered R1s. Also, the R1 generation counter MUST NOT roll numbered R1s. Also, the R1 generation counter MUST NOT roll over; if
over; if the counter is about to become exhausted, the corresponding the counter is about to become exhausted, the corresponding HI must
HI must be abandoned and replaced with a new one. be abandoned and replaced with a new one.
A host may receive more than one R1, either due to sending multiple A host may receive more than one R1, either due to sending multiple
I1s (Section 6.5.1) or due to a replay of an old R1. When sending I1s (Section 6.6.1) or due to a replay of an old R1. When sending
multiple I1s, an initiator SHOULD wait for a small amount of time multiple I1s, an initiator SHOULD wait for a small amount of time
after the first R1 reception to allow possibly multiple R1s to after the first R1 reception to allow possibly multiple R1s to
arrive, and it SHOULD respond to an R1 among the set with the largest arrive, and it SHOULD respond to an R1 among the set with the largest
R1 generation counter. If an Initiator is processing an R1 or has R1 generation counter. If an Initiator is processing an R1 or has
already sent an I2 (still waiting for R2) and it receives another R1 already sent an I2 (still waiting for R2) and it receives another R1
with a larger R1 generation counter, it MAY elect to restart R1 with a larger R1 generation counter, it MAY elect to restart R1
processing with the fresher R1, as if it were the first R1 to arrive. processing with the fresher R1, as if it were the first R1 to arrive.
Upon conclusion of an active HIP association with another host, the Upon conclusion of an active HIP association with another host, the
R1 generation counter associated with the peer host SHOULD be R1 generation counter associated with the peer host SHOULD be
flushed. A local policy MAY override the default flushing of R1 flushed. A local policy MAY override the default flushing of R1
counters on a per-HIT basis. The reason for recommending the counters on a per-HIT basis. The reason for recommending the
flushing of this counter is that there may be hosts where the R1 flushing of this counter is that there may be hosts where the R1
generation counter (occasionally) decreases; e.g., due to hardware generation counter (occasionally) decreases; e.g., due to hardware
failure. failure.
4.1.4 Refusing a HIP Exchange 4.1.5. Refusing a HIP Exchange
A HIP aware host may choose not to accept a HIP exchange. If the A HIP aware host may choose not to accept a HIP exchange. If the
host's policy is to only be an Initiator, it should begin its own HIP host's policy is to only be an Initiator, it should begin its own HIP
exchange. A host MAY choose to have such a policy since only the exchange. A host MAY choose to have such a policy since only the
Initiator HI is protected in the exchange. There is a risk of a race Initiator HI is protected in the exchange. There is a risk of a race
condition if each host's policy is to only be an Initiator, at which condition if each host's policy is to only be an Initiator, at which
point the HIP exchange will fail. point the HIP exchange will fail.
If the host's policy does not permit it to enter into a HIP exchange If the host's policy does not permit it to enter into a HIP exchange
with the Initiator, it should send an ICMP 'Destination Unreachable, with the Initiator, it should send an ICMP 'Destination Unreachable,
Administratively Prohibited' message. A more complex HIP packet is Administratively Prohibited' message. A more complex HIP packet is
not used here as it actually opens up more potential DoS attacks than not used here as it actually opens up more potential DoS attacks than
a simple ICMP message. a simple ICMP message.
4.2 Updating a HIP Association 4.2. Updating a HIP Association
A HIP association between two hosts may need to be updated over time. A HIP association between two hosts may need to be updated over time.
Examples include the need to rekey expiring user data security Examples include the need to rekey expiring user data security
associations, add new security associations, or change IP addresses associations, add new security associations, or change IP addresses
associated with hosts. The UPDATE packet is used for those and other associated with hosts. The UPDATE packet is used for those and other
similar purposes. This document only specifies the UPDATE packet similar purposes. This document only specifies the UPDATE packet
format and basic processing rules, with mandatory TLVs. The actual format and basic processing rules, with mandatory parameters. The
usage is defined in separate specifications. actual usage is defined in separate specifications.
HIP provides a general purpose UPDATE packet, which can carry HIP provides a general purpose UPDATE packet, which can carry
multiple HIP parameters, for updating the HIP state between two multiple HIP parameters, for updating the HIP state between two
peers. The UPDATE mechanism has the following properties: peers. The UPDATE mechanism has the following properties:
UPDATE messages carry a monotonically increasing sequence number UPDATE messages carry a monotonically increasing sequence number
and are explicitly acknowledged by the peer. Lost UPDATEs or and are explicitly acknowledged by the peer. Lost UPDATEs or
acknowledgments may be recovered via retransmission. Multiple acknowledgments may be recovered via retransmission. Multiple
UPDATE messages may be outstanding. UPDATE messages may be outstanding.
UPDATE is protected by both HMAC and HIP_SIGNATURE parameters, UPDATE is protected by both HMAC and HIP_SIGNATURE parameters,
since processing UPDATE signatures alone is a potential DoS attack since processing UPDATE signatures alone is a potential DoS attack
against intermediate systems. against intermediate systems.
The UPDATE packet is defined in Section 5.3.5. The UPDATE packet is defined in Section 5.3.5.
4.3 Error Processing 4.3. Error Processing
HIP error processing behavior depends on whether there exists an HIP error processing behavior depends on whether there exists an
active HIP association or not. In general, if an HIP association active HIP association or not. In general, if an HIP association
exists between the sender and receiver of a packet causing an error exists between the sender and receiver of a packet causing an error
condition, the receiver SHOULD respond with a NOTIFY packet. On the condition, the receiver SHOULD respond with a NOTIFY packet. On the
other hand, if there are no existing HIP associations between the other hand, if there are no existing HIP associations between the
sender and receiver, or the receiver cannot reasonably determine the sender and receiver, or the receiver cannot reasonably determine the
identity of the sender, the receiver MAY respond with a suitable ICMP identity of the sender, the receiver MAY respond with a suitable ICMP
message; see Section 5.4 for more details. message; see Section 5.4 for more details.
skipping to change at page 17, line 48 skipping to change at page 19, line 5
The system sends data on the outbound user data security The system sends data on the outbound user data security
association. The receiver 'detects' the situation when it association. The receiver 'detects' the situation when it
receives a user data packet that it cannot match to any HIP receives a user data packet that it cannot match to any HIP
association. The receiving host MUST discard this packet. association. The receiving host MUST discard this packet.
Optionally, the receiving host MAY send an ICMP packet with the Optionally, the receiving host MAY send an ICMP packet with the
Parameter Problem type to inform about non-existing HIP Parameter Problem type to inform about non-existing HIP
association (see Section 5.4), and it MAY initiate a new HIP association (see Section 5.4), and it MAY initiate a new HIP
negotiation. However, responding with these optional negotiation. However, responding with these optional
mechanisms is implementation or policy dependent. mechanisms is implementation or policy dependent.
4.4 HIP State Machine 4.4. HIP State Machine
The HIP protocol itself has little state. In the HIP base exchange, The HIP protocol itself has little state. In the HIP base exchange,
there is an Initiator and a Responder. Once the SAs are established, there is an Initiator and a Responder. Once the SAs are established,
this distinction is lost. If the HIP state needs to be re- this distinction is lost. If the HIP state needs to be re-
established, the controlling parameters are which peer still has established, the controlling parameters are which peer still has
state and which has a datagram to send to its peer. The following state and which has a datagram to send to its peer. The following
state machine attempts to capture these processes. state machine attempts to capture these processes.
The state machine is presented in a single system view, representing The state machine is presented in a single system view, representing
either an Initiator or a Responder. There is not a complete overlap either an Initiator or a Responder. There is not a complete overlap
of processing logic here and in the packet definitions. Both are of processing logic here and in the packet definitions. Both are
needed to completely implement HIP. needed to completely implement HIP.
Implementors must understand that the state machine, as described Implementors must understand that the state machine, as described
here, is informational. Specific implementations are free to here, is informational. Specific implementations are free to
implement the actual functions differently. Section 6 describes the implement the actual functions differently. Section 6 describes the
packet processing rules in more detail. This state machine focuses packet processing rules in more detail. This state machine focuses
on the HIP I1, R1, I2, and R2 packets only. Other states may be on the HIP I1, R1, I2, and R2 packets only. Other states may be
introduced by mechanisms in other drafts (such as mobility and introduced by mechanisms in other specifications (such as mobility
multihoming). and multihoming).
4.4.1 HIP States 4.4.1. HIP States
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| State | Explanation | | State | Explanation |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| UNASSOCIATED | State machine start | | UNASSOCIATED | State machine start |
| | | | | |
| I1-SENT | Initiating HIP | | I1-SENT | Initiating base exchange |
| | | | | |
| I2-SENT | Waiting to finish HIP | | I2-SENT | Waiting to complete base exchange |
| | | | | |
| R2-SENT | Waiting to finish HIP | | R2-SENT | Waiting to complete base exchange |
| | | | | |
| ESTABLISHED | HIP association established | | ESTABLISHED | HIP association established |
| | | | | |
| CLOSING | HIP association closing, no data can be | | CLOSING | HIP association closing, no data can be |
| | sent | | | sent |
| | | | | |
| CLOSED | HIP association closed, no data can be sent | | CLOSED | HIP association closed, no data can be sent |
| | | | | |
| E-FAILED | HIP exchange failed | | E-FAILED | HIP exchange failed |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
4.4.2 HIP State Processes 4.4.2. HIP State Processes
+------------+
|UNASSOCIATED| Start state
+------------+
User data to send requiring a new HIP association, send I1 and go to
I1-SENT
Receive I1, send R1 and stay at UNASSOCIATED
Receive I2, process
if successful, send R2 and go to R2-SENT
if fail, stay at UNASSOCIATED
Receive user data for unknown HIP association, optionally send ICMP
as defined in
Section 5.4
and stay at UNASSOCIATED
Receive CLOSE, optionally send ICMP Parameter Problem and stay
in UNASSOCIATED.
Receive ANYOTHER, drop and stay at UNASSOCIATED
+---------+
| I1-SENT | Initiating HIP
+---------+
Receive I1,
if the local HIT is smaller than the peer HIT, drop I1 and stay
at I1-SENT
if the local HIT is greater than the peer HIT, send R1 and stay
at I1-SENT
Receive I2, process
if successful, send R2 and go to R2-SENT
if fail, stay at I1-SENT
Receive R1, process
if successful, send I2 and go to I2-SENT
if fail, go to E-FAILED
Receive ANYOTHER, drop and stay at I1-SENT
Timeout, increment timeout counter
If counter is less than I1_RETRIES_MAX, send I1 and stay at
I1-SENT
If counter is greater than I1_RETRIES_MAX, go to E-FAILED
+---------+
| I2-SENT | Waiting to finish HIP
+---------+
Receive I1, send R1 and stay at I2-SENT
Receive R1, process
if successful, send I2 and cycle at I2-SENT
if fail, stay at I2-SENT
Receive I2, process
if successful, and
if local HIT is smaller than the peer HIT, drop I2 and stay
at I2-SENT
if local HIT is greater than the peer HIT, send R2 and go to
R2-SENT
if fail, stay at I2-SENT
Receive R2, process
if successful, go to ESTABLISHED
if fail, go to E-FAILED
Receive ANYOTHER, drop and stay at I2-SENT
Timeout, increment timeout counter
If counter is less than I2_RETRIES_MAX, send I2 and stay at
I2-SENT
If counter is greater than I2_RETRIES_MAX, go to E-FAILED
+---------+
| R2-SENT | Waiting to finish HIP
+---------+
Receive I1, send R1 and stay at R2-SENT
Receive I2, process,
if successful, send R2, and cycle at R2-SENT
if failed, stay at R2-SENT
Receive R1, drop and stay at R2-SENT
Receive R2, drop and stay at R2-SENT
Receive data, move to ESTABLISHED
No packet sent/received during UAL minutes, send CLOSE and go to
CLOSING
+------------+
|ESTABLISHED | HIP association established
+------------+
Receive I1, send R1 and stay at ESTABLISHED
Receive I2, process with cookie and possible Opaque data verification
if successful, send R2, drop old HIP association, establish a
new HIP association, to to R2-SENT
if fail, stay at ESTABLISHED
Receive R1, drop and stay at ESTABLISHED
Receive R2, drop and stay at ESTABLISHED
Receive user data for HIP association, process and stay at System behaviour in state UNASSOCIATED, Table 2.
ESTABLISHED
No packet sent/received during UAL minutes, send CLOSE and go to
CLOSING.
Receive CLOSE, process
if successful, send CLOSE_ACK and go to CLOSED
if failed, stay at ESTABLISHED
+---------+ +---------------------+---------------------------------------------+
| CLOSING | HIP association has not been used for UAL (Unused | Trigger | Action |
+---------+ Association Lifetime) minutes. +---------------------+---------------------------------------------+
| User data to send, | Send I1 and go to I1-SENT |
| requiring a new HIP | |
| association | |
| | |
| Receive I1 | Send R1 and stay at UNASSOCIATED |
| | |
| Receive I2, process | If successful, send R2 and go to R2-SENT |
| | |
| | If fail, stay at UNASSOCIATED |
| | |
| Receive user data | Optionally send ICMP as defined in |
| for unknown HIP | Section 5.4 and stay at UNASSOCIATED |
| association | |
| | |
| Receive CLOSE | Optionally send ICMP Parameter Problem and |
| | stay at UNASSOCIATED |
| | |
| Receive ANYOTHER | Drop and stay at UNASSOCIATED |
+---------------------+---------------------------------------------+
User data to send, requires the creation of another incarnation Table 2: UNASSOCIATED - Start state
of the HIP association, started by sending an I1, System behaviour in state I1-SENT, Table 3.
and stay at CLOSING
Receive I1, send R1 and stay at CLOSING +---------------------+---------------------------------------------+
Receive I2, process | Trigger | Action |
if successful, send R2 and go to R2-SENT +---------------------+---------------------------------------------+
if fail, stay at CLOSING | Receive I1 | If the local HIT is smaller than the peer |
| | HIT, drop I1 and stay at I1-SENT |
| | |
| | If the local HIT is greater than the peer |
| | HIT, send R1 and stay at I1_SENT |
| | |
| Receive I2, process | If successful, send R2 and go to R2-SENT |
| | |
| | If fail, stay at I1-SENT |
| | |
| Receive R1, process | If successful, send I2 and go to I2-SENT |
| | |
| | If fail, go to E-FAILED |
| | |
| Receive ANYOTHER | Drop and stay at I1-SENT |
| | |
| Timeout, increment | If counter is less than I1_RETRIES_MAX, |
| timeout counter | send I1 and stay at I1-SENT |
| | |
| | If counter is greater than I1_RETRIES_MAX, |
| | go to E-FAILED |
+---------------------+---------------------------------------------+
Receive R1, process Table 3: I1-SENT - Initiating HIP
if successful, send I2 and go to I2-SENT System behaviour in state I2-SENT, Table 4.
if fail, stay at CLOSING
Receive CLOSE, process +---------------------+---------------------------------------------+
if successful, send CLOSE_ACK, discard state and go to CLOSED | Trigger | Action |
if failed, stay at CLOSING +---------------------+---------------------------------------------+
Receive CLOSE_ACK, process | Receive I1 | Send R1 and stay at I2-SENT |
if successful, discard state and go to UNASSOCIATED | | |
if failed, stay at CLOSING | Receive R1, process | If successful, send I2 and cycle at I2-SENT |
| | |
| | If fail, stay at I2-SENT |
| | |
| Receive I2, process | If successful and local HIT is smaller than |
| | the peer HIT, drop I2 and stay at I2-SENT |
| | |
| | If succesful and local HIT is greater than |
| | the peer HIT, send R2 and go to R2-SENT |
| | |
| | If fail, stay at I2-SENT |
| | |
| Receive R2, process | If successful, go to ESTABLISHED |
| | |
| | If fail, go to E-FAILED |
| | |
| Receive ANYOTHER | Drop and stay at I2-SENT |
| | |
| Timeout, increment | If counter is less than I2_RETRIES_MAX, |
| timeout counter | send I2 and stay at I2-SENT |
| | |
| | If counter is greater than I2_RETRIES_MAX, |
| | go to E-FAILED |
+---------------------+---------------------------------------------+
Receive ANYOTHER, drop and stay at CLOSING Table 4: I2-SENT - Waiting to finish HIP
System behaviour in state R2-SENT, Table 5.
Timeout, increment timeout sum, reset timer +---------------------+---------------------------------------------+
if timeout sum is less than UAL+MSL minutes, retransmit CLOSE | Trigger | Action |
and stay at CLOSING +---------------------+---------------------------------------------+
if timeout sum is greater than UAL+MSL minutes, go to | Receive I1 | Send R1 and stay at R2-SENT |
UNASSOCIATED | | |
| Receive I2, process | If successful, send R2 and cycle at R2-SENT |
| | |
| | If fail, stay at R2-SENT |
| | |
| Receive R1 | Drop and stay at R2-SENT |
| | |
| Receive R2 | Drop and stay at R2-SENT |
| | |
| Receive data or | Move to ESTABLISHED |
| UPDATE | |
| | |
| Exchange Complete | Move to ESTABLISHED |
| Timeout | |
+---------------------+---------------------------------------------+
+--------+ Table 5: R2-SENT - Waiting to finish HIP
| CLOSED | CLOSE_ACK sent, resending CLOSE_ACK if necessary System behaviour in state ESTABLISHED, Table 6.
+--------+
Datagram to send, requires the creation of another incarnation +---------------------+---------------------------------------------+
of the HIP association, started by sending an I1, | Trigger | Action |
and stay at CLOSED +---------------------+---------------------------------------------+
| Receive I1 | Send R1 and stay at ESTABLISHED |
| | |
| Receive I2, process | If successful, send R2, drop old HIP |
| with puzzle and | association, establish a new HIP |
| possible Opaque | association, go to R2-SENT |
| data verification | |
| | |
| | If fail, stay at ESTABLISHED |
| | |
| Receive R1 | Drop and stay at ESTABLISHED |
| | |
| Receive R2 | Drop and stay at ESTABLISHED |
| | |
| Receive user data | Process and stay at ESTABLISHED |
| for HIP association | |
| | |
| No packet | Send CLOSE and go to CLOSING |
| sent/received | |
| during UAL minutes | |
| | |
| Receive CLOSE, | If successful, send CLOSE_ACK and go to |
| process | CLOSED |
| | |
| | If fail, stay at ESTABLISHED |
+---------------------+---------------------------------------------+
Receive I1, send R1 and stay at CLOSED Table 6: ESTABLISHED - HIP association established
Receive I2, process System behaviour in state CLOSING, Table 7.
if successful, send R2 and go to R2-SENT
if fail, stay at CLOSED
Receive R1, process
if successful, send I2 and go to I2-SENT
if fail, stay at CLOSED
Receive CLOSE, process +---------------------+---------------------------------------------+
if successful, send CLOSE_ACK, stay at CLOSED | Trigger | Action |
if failed, stay at CLOSED +---------------------+---------------------------------------------+
| User data to send, | Send I1 and stay at CLOSING |
| requires the | |
| creation of another | |
| incarnation of the | |
| HIP association | |
| | |
| Receive I1 | Send R1 and stay at CLOSING |
| | |
| Receive I2, process | If successful, send R2 and go to R2-SENT |
| | |
| | If fail, stay at CLOSING |
| | |
| Receive R1, process | If successful, send I2 and go to I2-SENT |
| | |
| | If fail, stay at CLOSING |
| | |
| Receive CLOSE, | If successful, send CLOSE_ACK, discard |
| process | state and go to CLOSED |
| | |
| | If fail, stay at CLOSING |
| | |
| Receive CLOSE_ACK, | If successful, discard state and go to |
| process | UNASSOCIATED |
| | |
| | If fail, stay at CLOSING |
| | |
| Receive ANYOTHER | Drop and stay at CLOSING |
| | |
| Timeout, increment | If timeout sum is less than UAL+MSL |
| timeout sum, reset | minutes, retransmit CLOSE and stay at |
| timer | CLOSING |
| | |
| | If timeout sum is greater than UAL+MSL |
| | minutes, go to UNASSOCIATED |
+---------------------+---------------------------------------------+
Receive CLOSE_ACK, process Table 7: CLOSING - HIP association has not been used for UAL minutes
if successful, discard state and go to UNASSOCIATED System behaviour in state CLOSED, Table 8.
if failed, stay at CLOSED
Receive ANYOTHER, drop and stay at CLOSED +---------------------+---------------------------------------------+
| Trigger | Action |
+---------------------+---------------------------------------------+
| Datagram to send, | Send I1, and stay at CLOSED |
| requires the | |
| creation of another | |
| incarnation of the | |
| HIP association | |
| | |
| Receive I1 | Send R1 and stay at CLOSED |
| | |
| Receive I2, process | If successful, send R2 and go to R2-SENT |
| | |
| | If fail, stay at CLOSED |
| | |
| Receive R1, process | If successful, send I2 and go to I2-SENT |
| | |
| | If fail, stay at CLOSED |
| | |
| Receive CLOSE, | If successful, send CLOSE_ACK, stay at |
| process | CLOSED |
| | |
| | If fail, stay at CLOSED |
| | |
| Receive CLOSE_ACK, | If successful, discard state and go to |
| process | UNASSOCIATED |
| | |
| | If fail, stay at CLOSED |
| | |
| Receive ANYOTHER | Drop and stay at CLOSED |
| | |
| Timeout (UAL+2MSL) | Discard state and go to UNASSOCIATED |
+---------------------+---------------------------------------------+
Timeout (UAL + 2MSL), discard state and go to UNASSOCIATED Table 8: CLOSED - CLOSE_ACK sent, resending CLOSE_ACK if necessary
System behaviour in state E-FAILED, Table 9.
+----------+ +---------------------+---------------------------------------------+
| E-FAILED | HIP failed to establish association with peer | Trigger | Action |
+----------+ +---------------------+---------------------------------------------+
| Wait for | Go to UNASSOCIATED. Re-negotiation is |
| implementation | possible after moving to UNASSOCIATED |
| specific time | state. |
+---------------------+---------------------------------------------+
Move to UNASSOCIATED after an implementation specific time. Table 9: E-FAILED - HIP failed to establish association with peer
Re-negotiation is possible after moving to UNASSOCIATED state.
4.4.3 Simplified HIP State Diagram 4.4.3. Simplified HIP State Diagram
The following diagram shows the major state transitions. Transitions The following diagram shows the major state transitions. Transitions
based on received packets implicitly assume that the packets are based on received packets implicitly assume that the packets are
successfully authenticated or processed. successfully authenticated or processed.
+-+ +---------------------------+ +-+ +---------------------------+
I1 received, send R1 | | | | I1 received, send R1 | | | |
| v v | | v v |
Datagram to send +--------------+ I2 received, send R2 | Datagram to send +--------------+ I2 received, send R2 |
+---------------| UNASSOCIATED |---------------+ | +---------------| UNASSOCIATED |---------------+ |
skipping to change at page 23, line 21 skipping to change at page 28, line 21
v | | v | |
+---------+ I2 received, send R2 | | +---------+ I2 received, send R2 | |
+---->| I1-SENT |---------------------------------------+ | | +---->| I1-SENT |---------------------------------------+ | |
| +---------+ | | | | +---------+ | | |
| | +------------------------+ | | | | | +------------------------+ | | |
| | R1 received, | I2 received, send R2 | | | | | | R1 received, | I2 received, send R2 | | | |
| v send I2 | v v v | | v send I2 | v v v |
| +---------+ | +---------+ | | +---------+ | +---------+ |
| +->| I2-SENT |------------+ | R2-SENT |<----+ | | +->| I2-SENT |------------+ | R2-SENT |<----+ |
| | +---------+ +---------+ | | | | +---------+ +---------+ | |
| | | || | | | | | | | |
| | | ||timeout | | | | | data| | |
| |receive | || | | | |receive | or| | |
| |R1, send | || receive I2,| | | |R1, send | EC timeout| receive I2,| |
| |I2 |R2 received +--------------+ data || send R2| | | |I2 |R2 received +--------------+ | send R2| |
| | +----------->| ESTABLISHED |<-------+| | | | | +----------->| ESTABLISHED |<-------+| | |
| | +--------------+ | | | | | +--------------+ | |
| | | | | | | |
| | +------------+ | +------------------------+ |
| | | | | | | | | | | | | |
| | | No packet sent| | | | | | +------------+ | +------------------------+ |
| | | /received for | +----+ | | | | recv| | | |
| | | UAL min, send | V | | | | CLOSE,| No packet sent| | |
| | send| /received for | | |
| | CLOSE_ACK| UAL min, send | | |
| | | CLOSE | +---------+<-+ timeout | | | | | CLOSE | +---------+<-+ timeout | |
| | | +--->| CLOSING |--+ (UAL+MSL) | | | | | +--->| CLOSING |--+ (UAL+MSL) | |
| | | +---------+ retransmit | | | | | +---------+ retransmit | |
+--|------------|----------------------+ | | | | CLOSE | | +--|------------|----------------------+ | | | | CLOSE | |
| +------------|------------------------+ | | +----------------+ | | +------------|------------------------+ | | +----------------+ |
| | | +-----------+ +------------------|--+ | | | +-----------+ +------------------|--+
| | +------------+ | receive CLOSE, CLOSE_ACK | | | | +------------+ | receive CLOSE, CLOSE_ACK | |
| | | | send CLOSE_ACK received or | | | | | | send CLOSE_ACK received or | |
| | v v timeout | | | | v v timeout | |
| | +--------+ (UAL+MSL) | | | | +--------+ (UAL+MSL) | |
| +------------------------| CLOSED |---------------------------+ | | +------------------------| CLOSED |---------------------------+ |
+---------------------------+--------+------------------------------+ +---------------------------+--------+------------------------------+
Datagram to send ^ | timeout (UAL+2MSL), Datagram to send ^ | timeout (UAL+2MSL),
+-+ move to UNASSOCIATED +-+ move to UNASSOCIATED
CLOSE received, CLOSE received,
send CLOSE_ACK send CLOSE_ACK
4.5 User Data Considerations 4.5. User Data Considerations
4.5.1 TCP and UDP Pseudo-header Computation for User Data 4.5.1. TCP and UDP Pseudo-header Computation for User Data
When computing TCP and UDP checksums on user data packets that flow When computing TCP and UDP checksums on user data packets that flow
through sockets bound to HITs, the IPv6 pseudo-header format [11] through sockets bound to HITs, the IPv6 pseudo-header format [11]
MUST be used, even if the outer addresses on the packet are IPv4 MUST be used, even if the actual addresses on the packet are IPv4
addresses. Additionally, the HITs MUST be used in the place of the addresses. Additionally, the HITs MUST be used in the place of the
IPv6 addresses in the IPv6 pseudo-header. Note that the pseudo- IPv6 addresses in the IPv6 pseudo-header. Note that the pseudo-
header for actual HIP payloads is computed differently; see header for actual HIP payloads is computed differently; see
Section 5.1.2. Section 5.1.1.
4.5.2 Sending Data on HIP Packets 4.5.2. Sending Data on HIP Packets
A future version of this document may define how to include user data A future version of this document may define how to include user data
on various HIP packets. However, currently the HIP header is a on various HIP packets. However, currently the HIP header is a
terminal header, and not followed by any other headers. terminal header, and not followed by any other headers.
4.5.3 Transport Formats 4.5.3. Transport Formats
The actual data transmission format, used for user data after the HIP The actual data transmission format, used for user data after the HIP
base exchange, is not defined in this document. Such transport base exchange, is not defined in this document. Such transport
formats and methods are described in separate specifications. All formats and methods are described in separate specifications. All
HIP implementations MUST implement, at minimum, the ESP transport HIP implementations MUST implement, at minimum, the ESP transport
format for HIP [24]. format for HIP [24].
When new transport formats are defined, they get the type value from When new transport formats are defined, they get the type value from
the HIP Transform type value space 2048 - 4095. The order in which the HIP Transform type value space 2048 - 4095. The order in which
the transport formats are presented in the R1 packet, is the the transport formats are presented in the R1 packet, is the
preferred order. The last of the transport formats MUST be ESP preferred order. The last of the transport formats MUST be ESP
transport format, represented by the ESP_TRANSFORM parameter. transport format, represented by the ESP_TRANSFORM parameter.
4.5.4 Reboot and SA Timeout Restart of HIP 4.5.4. Reboot and SA Timeout Restart of HIP
Simulating a loss of state is a potential DoS attack. The following Simulating a loss of state is a potential DoS attack. The following
process has been crafted to manage state recovery without presenting process has been crafted to manage state recovery without presenting
a DoS opportunity. a DoS opportunity.
If a host reboots or times out, it has lost its HIP state. If the If a host reboots or the HIP association times out, it has lost its
system that lost state has a datagram to deliver to its peer, it HIP state. If the host that lost state has a datagram to send to the
simply restarts the HIP exchange. The peer replies with an R1 HIP peer, it simply restarts the HIP base exchange. After the base
packet, but does not reset its state until it receives the I2 HIP exchange has completed, the Initiator can create a new SA and start
packet. The I2 packet MUST have a valid solution to the puzzle and, sending data. The peer does not reset its state until it receives a
if inserted in R1, a valid Opaque data as well as a valid signature. valid I2 HIP packet.
Note that either the original Initiator or the Responder could end up
restarting the exchange, becoming the new Initiator.
If a system receives a user data packet that cannot be matched to any If a system receives a user data packet that cannot be matched to any
existing HIP association, it is possible that it has lost the state existing HIP association, it is possible that it has lost the state
and its peer has not. It MAY send an ICMP packet with the Parameter and its peer has not. It MAY send an ICMP packet with the Parameter
Problem type, the Pointer pointing to the referred HIP-related Problem type, the Pointer pointing to the referred HIP-related
association information. Reacting to such traffic depends on the association information. Reacting to such traffic depends on the
implementation and the environment where the implementation is used. implementation and the environment where the implementation is used.
After sending the I1, the HIP negotiation proceeds as normally and, If the host, that apparently has lost its state, decides to restart
when successful, the SA is created at the initiating end. The peer the HIP base exchange, it sends an I1 packet to the peer. After the
end removes the OLD SA and replaces it with the new one. base exchange has been completed successfully, the Initiator can
create a new HIP association and the peer drops its OLD SA and
creates a new one.
4.6 Certificate Distribution 4.6. Certificate Distribution
HIP base specification does not define how to use certificates or how HIP base specification does not define how to use certificates or how
to transfer them between hosts. These functions are defined in a to transfer them between hosts. These functions are defined in a
separate specification. The parameter type value, used for carrying separate specification. A parameter type value, meant to be used for
certificates, is reserved: CERT, Type 768. carrying certificates, is reserved, though: CERT, Type 768; see
Section 5.2.
5. Packet Formats 5. Packet Formats
5.1 Payload Format 5.1. Payload Format
All HIP packets start with a fixed header. All HIP packets start with a fixed header.
0 1 2 3 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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Header Length | Packet Type | VER. | RES. | | Next Header | Header Length |0| Packet Type | VER. | RES.|1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Controls | Checksum | | Checksum | Controls |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sender's Host Identity Tag (HIT) | | Sender's Host Identity Tag (HIT) |
| | | |
| | | |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Receiver's Host Identity Tag (HIT) | | Receiver's Host Identity Tag (HIT) |
| | | |
| | | |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
/ HIP Parameters / / HIP Parameters /
/ / / /
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The HIP header is logically an IPv6 extension header. However, this The HIP header is logically an IPv6 extension header. However, this
document does not describe processing for Next Header values other document does not describe processing for Next Header values other
than decimal 59, IPPROTO_NONE, the IPV6 no next header value. Future than decimal 59, IPPROTO_NONE, the IPv6 no next header value. Future
documents MAY do so. However, implementations MUST ignore trailing documents MAY do so. However, current implementations MUST ignore
data if an unimplemented Next Header value is received. trailing data if an unimplemented Next Header value is received.
The Header Length field contains the length of the HIP Header and HIP The Header Length field contains the length of the HIP Header and HIP
parameters in 8 bytes units, excluding the first 8 bytes. Since all parameters in 8 bytes units, excluding the first 8 bytes. Since all
HIP headers MUST contain the sender's and receiver's HIT fields, the HIP headers MUST contain the sender's and receiver's HIT fields, the
minimum value for this field is 4, and conversely, the maximum length minimum value for this field is 4, and conversely, the maximum length
of the HIP Parameters field is (255*8)-32 = 2008 bytes. Note: this of the HIP Parameters field is (255*8)-32 = 2008 bytes. Note: this
sets an additional limit for sizes of TLVs included in the Parameters sets an additional limit for sizes of parameters included in the
field, independent of the individual TLV parameter maximum lengths. Parameters field, independent of the individual parameter maximum
lengths.
The Packet Type indicates the HIP packet type. The individual packet The Packet Type indicates the HIP packet type. The individual packet
types are defined in the relevant sections. If a HIP host receives a types are defined in the relevant sections. If a HIP host receives a
HIP packet that contains an unknown packet type, it MUST drop the HIP packet that contains an unknown packet type, it MUST drop the
packet. packet.
The HIP Version is four bits. The current version is 1. The version The HIP Version is four bits. The current version is 1. The version
number is expected to be incremented only if there are incompatible number is expected to be incremented only if there are incompatible
changes to the protocol. Most extensions can be handled by defining changes to the protocol. Most extensions can be handled by defining
new packet types, new parameter types, or new controls. new packet types, new parameter types, or new controls.
The following four bits are reserved for future use. They MUST be The following three bits are reserved for future use. They MUST be
zero when sent, and they SHOULD be ignored when handling a received zero when sent, and they SHOULD be ignored when handling a received
packet. packet.
The two fixed bits in the header are reserved for potential SHIM6
compatibility [27]. For implementations adhering (only) to this
specification, they MUST be set as shown when sending and MUST be
ignored when receiving. This is to ensure optimal forward
compatibility. Note that implementations that implement other
compatible specifications in addition to this specification, the
corresponding rules may well be different. For example, in the case
that the forthcoming SHIM6 protocol happens to be compatible with
this specification, an implementation that implements both this
specification and the SHIM6 protocol may need to check these bits in
order to determine how to handle the packet.
The HIT fields are always 128 bits (16 bytes) long. The HIT fields are always 128 bits (16 bytes) long.
5.1.1 HIP Controls 5.1.1. Checksum
Since the checksum covers the source and destination addresses in the
IP header, it must be recomputed on HIP-aware NAT devies.
If IPv6 is used to carry the HIP packet, the pseudo-header [11]
contains the source and destination IPv6 addresses, HIP packet length
in the pseudo-header length field, a zero field, and the HIP protocol
number (see Section 4) in the Next Header field. The length field is
in bytes and can be calculated from the HIP header length field: (HIP
Header Length + 1) * 8.
In case of using IPv4, the IPv4 UDP pseudo header format [1] is used.
In the pseudo header, the source and destination addresses are those
used in the IP header, the zero field is obviously zero, the protocol
is the HIP protocol number (see Section 4), and the length is
calculated as in the IPv6 case.
5.1.2. HIP Controls
The HIP Controls section conveys information about the structure of The HIP Controls section conveys information about the structure of
the packet and capabilities of the host. the packet and capabilities of the host.
The following fields have been defined: The following fields have been defined:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SHT | DHT | | | | | | | | | |A| | | | | | | | | | | | | | | | |A|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
SHT - Sender's HIT Type: Currently the following values are
specified:
0 RESERVED
1 Type 1 HIT
2 Type 2 HIT
3-6 UNASSIGNED
7 RESERVED
DHT - Destination's HIT Type: Uses the same values as the SHT.
A - Anonymous: If this is set, the sender's HI in this packet is A - Anonymous: If this is set, the sender's HI in this packet is
anonymous, i.e., one not listed in a directory. Anonymous HIs anonymous, i.e., one not listed in a directory. Anonymous HIs
SHOULD NOT be stored. This control is set in packets R1 and/or SHOULD NOT be stored. This control is set in packets R1 and/or
I2. The peer receiving an anonymous HI may choose to refuse it. I2. The peer receiving an anonymous HI may choose to refuse it.
The rest of the fields are reserved for future use and MUST be set to The rest of the fields are reserved for future use and MUST be set to
zero on sent packets and ignored on received packets. zero on sent packets and ignored on received packets.
5.1.2 Checksum 5.1.3. HIP Fragmentation Support
The checksum field is located at the same location in the header as
the checksum field in UDP packets, aiding hardware assisted checksum
generation and verification. Note that since the checksum covers the
source and destination addresses in the IP header, it must be
recomputed on HIP-aware NAT devices.
If IPv6 is used to carry the HIP packet, the pseudo-header [11]
contains the source and destination IPv6 addresses, HIP packet length
in the pseudo-header length field, a zero field, and the HIP protocol
number (TBD, see Section 4) in the Next Header field. The length
field is in bytes and can be calculated from the HIP header length
field: (HIP Header Length + 1) * 8.
In case of using IPv4, the IPv4 UDP pseudo header format [1] is used.
In the pseudo header, the source and destination addresses are those
used in the IP header, the zero field is obviously zero, the protocol
is the HIP protocol number (TBD, see Section 4), and the length is
calculated as in the IPv6 case.
5.1.3 HIP Fragmentation Support
A HIP implementation must support IP fragmentation / reassembly. A HIP implementation must support IP fragmentation / reassembly.
Fragment reassembly MUST be implemented in both IPv4 and IPv6, but Fragment reassembly MUST be implemented in both IPv4 and IPv6, but
fragment generation MUST be implemented only in IPv4 (IPv4 stacks and fragment generation is REQUIRED to be implemented in IPv4 (IPv4
networks will usually do this by default) and SHOULD be implemented stacks and networks will usually do this by default) and RECOMMENDED
in IPv6. In IPv6 networks, the minimum MTU is larger, 1280 bytes, to be implemented in IPv6. In IPv6 networks, the minimum MTU is
than in IPv4 networks. The larger MTU size is usually sufficient for larger, 1280 bytes, than in IPv4 networks. The larger MTU size is
most HIP packets, and therefore fragment generation may not be usually sufficient for most HIP packets, and therefore fragment
needed. If a host expects to send HIP packets that are larger than generation may not be needed. If a host expects to send HIP packets
the minimum IPv6 MTU, it MUST implement fragment generation even for that are larger than the minimum IPv6 MTU, it MUST implement fragment
IPv6. generation even for IPv6.
In IPv4 networks, HIP packets may encounter low MTUs along their In IPv4 networks, HIP packets may encounter low MTUs along their
routed path. Since HIP does not provide a mechanism to use multiple routed path. Since HIP does not provide a mechanism to use multiple
IP datagrams for a single HIP packet, support for path MTU discovery IP datagrams for a single HIP packet, support for path MTU discovery
does not bring any value to HIP in IPv4 networks. HIP-aware NAT does not bring any value to HIP in IPv4 networks. HIP-aware NAT
devices MUST perform any IPv4 reassembly/fragmentation. devices MUST perform any IPv4 reassembly/fragmentation.
All HIP implementations MUST employ a reassembly algorithm that is All HIP implementations MUST employ a reassembly algorithm that is
sufficiently resistant to DoS attacks. sufficiently resistant to DoS attacks.
5.1.4 Solving the Puzzle 5.2. HIP Parameters
This subsection describes the puzzle solving details.
In R1, the values I and K are sent in network byte order. Similarly,
in I2 the values I and J are sent in network byte order. The SHA-1
hash is created by concatenating, in network byte order, the
following data, in the following order:
64-bit random value I, in network byte order, as appearing in R1
and I2.
128-bit Initiator HIT, in network byte order, as appearing in the
HIP Payload in R1 and I2.
128-bit Responder HIT, in network byte order, as appearing in the
HIP Payload in R1 and I2.
64-bit random value J, in network byte order, as appearing in I2.
In order to be a valid response cookie, the K low-order bits of the
resulting SHA-1 digest must be zero.
Notes:
i) The length of the data to be hashed is 48 bytes.
ii) All the data in the hash input MUST be in network byte order.
iii) The order of the Initiator and Responder HITs are different
in the R1 and I2 packets, see Section 5.1. Care must be taken to
copy the values in right order to the hash input.
The following procedure describes the processing steps involved,
assuming that the Responder chooses to precompute the R1 packets:
Precomputation by the Responder:
Sets up the puzzle difficulty K.
Creates a signed R1 and caches it.
Responder:
Selects a suitable cached R1.
Generates a random number I.
Sends I and K in an R1.
Saves I and K for a Delta time.
Initiator:
Generates repeated attempts to solve the puzzle until a matching J
is found:
Ltrunc( SHA-1( I | HIT-I | HIT-R | J ), K ) == 0
Sends I and J in an I2.
Responder:
Verifies that the received I is a saved one.
Finds the right K based on I.
Computes V := Ltrunc( SHA-1( I | HIT-I | HIT-R | J ), K )
Rejects if V != 0
Accept if V == 0
5.2 HIP Parameters
The HIP Parameters are used to carry the public key associated with The HIP Parameters are used to carry the public key associated with
the sender's HIT, together with related security and other the sender's HIT, together with related security and other
information. They consist of ordered parameters, encoded in TLV information. They consist of ordered parameters, encoded in TLV
format. format.
The following parameter types are currently defined. The following parameter types are currently defined.
+-----------------+-------+----------+------------------------------+ +------------------+-------+----------+-----------------------------+
| TLV | Type | Length | Data | | TLV | Type | Length | Data |
+-----------------+-------+----------+------------------------------+ +------------------+-------+----------+-----------------------------+
| R1_COUNTER | 128 | 12 | System Boot Counter | | R1_COUNTER | 128 | 12 | System Boot Counter |
| | | | | | | | | |
| PUZZLE | 257 | 12 | K and Random #I | | PUZZLE | 257 | 12 | K and Random #I |
| | | | | | | | | |
| SOLUTION | 321 | 20 | K, Random #I and puzzle | | SOLUTION | 321 | 20 | K, Random #I and puzzle |
| | | | solution J | | | | | solution J |
| | | | | | | | | |
| SEQ | 385 | 4 | Update packet ID number | | SEQ | 385 | 4 | Update packet ID number |
| | | | | | | | | |
| ACK | 449 | variable | Update packet ID number | | ACK | 449 | variable | Update packet ID number |
| | | | | | | | | |
| DIFFIE_HELLMAN | 513 | variable | public key | | DIFFIE_HELLMAN | 513 | variable | public key |
| | | | | | | | | |
| HIP_TRANSFORM | 577 | variable | HIP Encryption and Integrity | | HIP_TRANSFORM | 577 | variable | HIP Encryption and |
| | | | Transform | | | | | Integrity Transform |
| | | | | | | | | |
| ENCRYPTED | 641 | variable | Encrypted part of I2 packet | | ENCRYPTED | 641 | variable | Encrypted part of I2 packet |
| | | | | | | | | |
| HOST_ID | 705 | variable | Host Identity with Fully | | HOST_ID | 705 | variable | Host Identity with Fully |
| | | | Qualified Domain Name or NAI | | | | | Qualified Domain Name or |
| | | | NAI |
| | | | | | | | | |
| CERT | 768 | variable | HI Certificate; used to | | CERT | 768 | variable | HI Certificate; used to |
| | | | transfer certificates. Usage | | | | | transfer certificates. |
| | | | defined in a separate | | | | | Usage defined in a separate |
| | | | document. | | | | | document. |
| | | | | | | | | |
| NOTIFY | 832 | variable | Informational data | | NOTIFY | 832 | variable | Informational data |
| | | | | | | | | |
| ECHO_REQUEST | 897 | variable | Opaque data to be echoed | | ECHO_REQUEST | 897 | variable | Opaque data to be echoed |
| | | | back; under signature | | | | | back; under signature |
| | | | | | | | | |
| ECHO_RESPONSE | 961 | variable | Opaque data echoed back; | | ECHO_RESPONSE | 961 | variable | Opaque data echoed back; |
| | | | under signature | | | | | under signature |
| | | | | | | | | |
skipping to change at page 32, line 4 skipping to change at page 35, line 5
| | | | authentication code, with | | | | | authentication code, with |
| | | | key material from | | | | | key material from |
| | | | HIP_TRANSFORM | | | | | HIP_TRANSFORM |
| | | | | | | | | |
| HMAC_2 | 61569 | 20 | HMAC based message | | HMAC_2 | 61569 | 20 | HMAC based message |
| | | | authentication code, with | | | | | authentication code, with |
| | | | key material from | | | | | key material from |
| | | | HIP_TRANSFORM | | | | | HIP_TRANSFORM |
| | | | | | | | | |
| HIP_SIGNATURE_2 | 61633 | variable | Signature of the R1 packet | | HIP_SIGNATURE_2 | 61633 | variable | Signature of the R1 packet |
| | | | |
| HIP_SIGNATURE | 61697 | variable | Signature of the packet | | HIP_SIGNATURE | 61697 | variable | Signature of the packet |
| | | | | | | | | |
| ECHO_REQUEST | 63661 | variable | Opaque data to be echoed | | ECHO_REQUEST | 63661 | variable | Opaque data to be echoed |
| | | | back; after signature | | | | | back; after signature |
| | | | | | | | | |
| ECHO_RESPONSE | 63425 | variable | Opaque data echoed back; | | ECHO_RESPONSE | 63425 | variable | Opaque data echoed back; |
| | | | after signature | | | | | after signature |
+-----------------+-------+----------+------------------------------+ +------------------+-------+----------+-----------------------------+
Because the ordering (from lowest to highest) of HIP parameters is Because the ordering (from lowest to highest) of HIP parameters is
strictly enforced, the parameter type values for existing parameters strictly enforced (see Section 5.2.1), the parameter type values for
have been spaced to allow for future protocol extensions. Parameters existing parameters have been spaced to allow for future protocol
numbered between 0-1023 are used in HIP handshake and update extensions. Parameters numbered between 0-1023 are used in HIP
procedures and are covered by signatures. Parameters numbered handshake and update procedures and are covered by signatures.
between 1024-2047 are reserved. Parameters numbered between 2048- Parameters numbered between 1024-2047 are reserved. Parameters
4095 are used for parameters related to HIP transform types. numbered between 2048-4095 are used for parameters related to HIP
Parameters numbered between 4096 and (2^16 - 2^12) 61439 are transform types. Parameters numbered between 4096 and (2^16 - 2^12)
reserved. Parameters numbered beteween 61440-62463 are used for 61439 are reserved. Parameters numbered between 61440-62463 are used
signatures and signed MACs. Parameters numbered between 62464-63487 for signatures and signed MACs. Parameters numbered between 62464-
are used for parameters that fall outside of the signed area of the 63487 are used for parameters that fall outside of the signed area of
packet. Parameters numbered between 63488-64511 are used for the packet. Parameters numbered between 63488-64511 are used for
rendezvous and other relaying services. Parameters numbered between rendezvous and other relaying services. Parameters numbered between
64512-65535 are reserved. 64512-65535 are reserved.
5.2.1 TLV Format 5.2.1. TLV Format
The TLV-encoded parameters are described in the following The TLV-encoded parameters are described in the following
subsections. The type-field value also describes the order of these subsections. The type-field value also describes the order of these
fields in the packet, except for type values from 2048 to 4095 which fields in the packet, except for type values from 2048 to 4095 which
are reserved for new transport forms. The parameters MUST be are reserved for new transport forms. The parameters MUST be
included in the packet such that their types form an increasing included in the packet such that their types form an increasing
order. If the order does not follow this rule, the packet is order. If the order does not follow this rule, the packet is
considered to be malformed and it MUST be discarded. considered to be malformed and it MUST be discarded.
Parameters using type values from 2048 up to 4095 are transport Parameters using type values from 2048 up to 4095 are transport
skipping to change at page 33, line 44 skipping to change at page 36, line 46
Critical parameters MUST be recognized by the recipient. If a Critical parameters MUST be recognized by the recipient. If a
recipient encounters a critical parameter that it does not recognize, recipient encounters a critical parameter that it does not recognize,
it MUST NOT process the packet any further. It MAY send an ICMP or it MUST NOT process the packet any further. It MAY send an ICMP or
NOTIFY, as defined in Section 4.3. NOTIFY, as defined in Section 4.3.
Non-critical parameters MAY be safely ignored. If a recipient Non-critical parameters MAY be safely ignored. If a recipient
encounters a non-critical parameter that it does not recognize, it encounters a non-critical parameter that it does not recognize, it
SHOULD proceed as if the parameter was not present in the received SHOULD proceed as if the parameter was not present in the received
packet. packet.
5.2.2 Defining New Parameters 5.2.2. Defining New Parameters
Future specifications may define new parameters as needed. When Future specifications may define new parameters as needed. When
defining new parameters, care must be taken to ensure that the defining new parameters, care must be taken to ensure that the
parameter type values are appropriate and leave suitable space for parameter type values are appropriate and leave suitable space for
other future extensions. One must remember that the parameters MUST other future extensions. One must remember that the parameters MUST
always be arranged in the increasing order by type code, thereby always be arranged in the increasing order by type code, thereby
limiting the order of parameters. limiting the order of parameters (see Section 5.2.1).
The following rules must be followed when defining new parameters. The following rules must be followed when defining new parameters.
1. The low order bit C of the Type code is used to distinguish 1. The low order bit C of the Type code is used to distinguish
between critical and non-critical parameters. between critical and non-critical parameters.
2. A new parameter may be critical only if an old recipient ignoring 2. A new parameter may be critical only if an old recipient ignoring
it would cause security problems. In general, new parameters it would cause security problems. In general, new parameters
SHOULD be defined as non-critical, and expect a reply from the SHOULD be defined as non-critical, and expect a reply from the
recipient. recipient.
skipping to change at page 34, line 26 skipping to change at page 37, line 28
the ability to configure the associated feature off, such that the ability to configure the associated feature off, such that
the critical parameter is not sent at all. The configuration the critical parameter is not sent at all. The configuration
option must be well documented. By default, sending of such a option must be well documented. By default, sending of such a
new critical parameter SHOULD be off. In other words, the new critical parameter SHOULD be off. In other words, the
management interface MUST allow vanilla standards-only mode as a management interface MUST allow vanilla standards-only mode as a
default configuration setting, and MAY allow new critical default configuration setting, and MAY allow new critical
payloads to be configured on (and off). payloads to be configured on (and off).
4. See section Section 9 for allocation rules regarding type codes. 4. See section Section 9 for allocation rules regarding type codes.
5.2.3 R1_COUNTER 5.2.3. R1_COUNTER
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved, 4 bytes | | Reserved, 4 bytes |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| R1 generation counter, 8 bytes | | R1 generation counter, 8 bytes |
| | | |
skipping to change at page 35, line 10 skipping to change at page 38, line 11
puzzles. The sender is supposed to increment this counter puzzles. The sender is supposed to increment this counter
periodically. It is RECOMMENDED that the counter value is periodically. It is RECOMMENDED that the counter value is
incremented at least as often as old PUZZLE values are deprecated so incremented at least as often as old PUZZLE values are deprecated so
that SOLUTIONs to them are no longer accepted. that SOLUTIONs to them are no longer accepted.
The R1_COUNTER parameter is optional. It SHOULD be included in the The R1_COUNTER parameter is optional. It SHOULD be included in the
R1 (in which case it is covered by the signature), and if present in R1 (in which case it is covered by the signature), and if present in
the R1, it MAY be echoed (including the Reserved field verbatim) by the R1, it MAY be echoed (including the Reserved field verbatim) by
the Initiator in the I2. the Initiator in the I2.
5.2.4 PUZZLE 5.2.4. PUZZLE
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| K, 1 byte | Lifetime | Opaque, 2 bytes | | K, 1 byte | Lifetime | Opaque, 2 bytes |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Random # I, 8 bytes | | Random # I, 8 bytes |
| | | |
skipping to change at page 36, line 5 skipping to change at page 39, line 5
solve the puzzle. The lifetime is indicated as a power of 2 using solve the puzzle. The lifetime is indicated as a power of 2 using
the formula 2^(Lifetime-32) seconds. A puzzle MAY be augmented with the formula 2^(Lifetime-32) seconds. A puzzle MAY be augmented with
an ECHO_REQUEST parameter included in the R1; the contents of the an ECHO_REQUEST parameter included in the R1; the contents of the
ECHO_REQUEST are then echoed back in the ECHO_RESPONSE, allowing the ECHO_REQUEST are then echoed back in the ECHO_RESPONSE, allowing the
Responder to use the included information as a part of its puzzle Responder to use the included information as a part of its puzzle
processing. processing.
The Opaque and Random #I field are not covered by the HIP_SIGNATURE_2 The Opaque and Random #I field are not covered by the HIP_SIGNATURE_2
parameter. parameter.
5.2.5 SOLUTION 5.2.5. SOLUTION
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| K, 1 byte | Reserved | Opaque, 2 bytes | | K, 1 byte | Reserved | Opaque, 2 bytes |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Random #I, 8 bytes | | Random #I, 8 bytes |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Puzzle solution #J, 8 bytes | | Puzzle solution #J, 8 bytes |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 321 Type 321
Length 20 Length 20
K K is the number of verified bits K K is the number of verified bits
Reserved zero when sent, ignored when received Reserved zero when sent, ignored when received
Opaque copied unmodified from the received PUZZLE TLV Opaque copied unmodified from the received PUZZLE
parameter
Random #I random number Random #I random number
Puzzle solution Puzzle solution
#J random number #J random number
Random #I, and Random #J are represented as 64-bit integers, K as an Random #I, and Random #J are represented as 64-bit integers, K as an
8-bit integer, all in network byte order. 8-bit integer, all in network byte order.
The SOLUTION parameter contains a solution to a puzzle. It also The SOLUTION parameter contains a solution to a puzzle. It also
echoes back the random difficulty K, the Opaque field, and the puzzle echoes back the random difficulty K, the Opaque field, and the puzzle
integer #I. integer #I.
5.2.6 DIFFIE_HELLMAN 5.2.6. DIFFIE_HELLMAN
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Group ID | Public Value / | Group ID | Public Value /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ | padding | / | padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 37, line 17 skipping to change at page 40, line 34
Group Value Group Value
Reserved 0 Reserved 0
384-bit group 1 384-bit group 1
OAKLEY well known group 1 2 OAKLEY well known group 1 2
1536-bit MODP group 3 1536-bit MODP group 3
3072-bit MODP group 4 3072-bit MODP group 4
6144-bit MODP group 5 6144-bit MODP group 5
8192-bit MODP group 6 8192-bit MODP group 6
The MODP Diffie-Hellman groups are defined in [18]. The OAKLEY group The MODP Diffie-Hellman groups are defined in [17]. The OAKLEY group
is defined in [9]. The OAKLEY well known group 5 is the same as the is defined in [8]. The OAKLEY well known group 5 is the same as the
1536-bit MODP group. 1536-bit MODP group.
A HIP implementation MUST support Group IDs 1 and 3. The 384-bit A HIP implementation MUST support Group IDs 1 and 3. The 384-bit
group can be used when lower security is enough (e.g. web surfing) group can be used when lower security is enough (e.g. web surfing)
and when the equipment is not powerful enough (e.g. some PDAs). and when the equipment is not powerful enough (e.g. some PDAs).
Equipment powerful enough SHOULD implement also group ID 5. The 384- Equipment powerful enough SHOULD implement also group ID 5. The 384-
bit group is defined in Appendix F. bit group is defined in Appendix D.
To avoid unnecessary failures during the base exchange, the rest of To avoid unnecessary failures during the base exchange, the rest of
the groups SHOULD be implemented in hosts where resources are the groups SHOULD be implemented in hosts where resources are
adequate. adequate.
5.2.7 HIP_TRANSFORM 5.2.7. HIP_TRANSFORM
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Transform-ID #1 | Transform-ID #2 | | Transform-ID #1 | Transform-ID #2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Transform-ID #n | Padding | | Transform-ID #n | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 577 Type 577
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
padding padding
Transform-ID Defines the HIP Suite to be used Transform-ID Defines the HIP Suite to be used
The following Suite-IDs are defined ([21],[26]): The following Suite-IDs are defined ([21],[10]):
XXX: Deprecate MD5 in the light of recent development?
Suite-ID Value Suite-ID Value
RESERVED 0 RESERVED 0
AES-CBC with HMAC-SHA1 1 AES-CBC with HMAC-SHA1 1
3DES-CBC with HMAC-SHA1 2 3DES-CBC with HMAC-SHA1 2
3DES-CBC with HMAC-MD5 3 3DES-CBC with HMAC-MD5 3
BLOWFISH-CBC with HMAC-SHA1 4 BLOWFISH-CBC with HMAC-SHA1 4
NULL-ENCRYPT with HMAC-SHA1 5 NULL-ENCRYPT with HMAC-SHA1 5
NULL-ENCRYPT with HMAC-MD5 6 NULL-ENCRYPT with HMAC-MD5 6
There MUST NOT be more than six (6) HIP Suite-IDs in one HIP There MUST NOT be more than six (6) HIP Suite-IDs in one HIP
transform TLV. The limited number of transforms sets the maximum transform parameter. The limited number of transforms sets the
size of HIP_TRANSFORM TLV. The HIP_TRANSFORM TLV MUST contain at maximum size of HIP_TRANSFORM parameter. The HIP_TRANSFORM parameter
least one of the mandatory Suite-IDs. MUST contain at least one of the mandatory Suite-IDs.
The Responder lists supported and desired Suite-IDs in order of The Responder lists supported and desired Suite-IDs in order of
preference in the R1, up to the maximum of six Suite-IDs. In the I2, preference in the R1, up to the maximum of six Suite-IDs. In the I2,
the Initiator MUST choose and insert only one of the corresponding the Initiator MUST choose and insert only one of the corresponding
Suite-IDs that will be used for generating the I2. Suite-IDs that will be used for generating the I2.
Mandatory implementations: AES-CBC with HMAC-SHA1 and NULL-ENCRYPTION Mandatory implementations: AES-CBC with HMAC-SHA1 and NULL-ENCRYPTION
with HMAC-SHA1. with HMAC-SHA1.
5.2.8 HOST_ID 5.2.8. HOST_ID
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HI Length |DI-type| DI Length | | HI Length |DI-type| DI Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Host Identity / | Host Identity /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 39, line 22 skipping to change at page 42, line 48
The following DI-types have been defined: The following DI-types have been defined:
Type Value Type Value
none included 0 none included 0
FQDN 1 FQDN 1
NAI 2 NAI 2
FQDN Fully Qualified Domain Name, in binary format. FQDN Fully Qualified Domain Name, in binary format.
NAI Network Access Identifier NAI Network Access Identifier
[22] [23]
The format for the FQDN is defined in RFC1035 [3] Section 3.1. The format for the FQDN is defined in RFC1035 [3] Section 3.1.
If there is no Domain Identifier, i.e. the DI-type field is zero, If there is no Domain Identifier, i.e. the DI-type field is zero,
also the DI Length field is set to zero. also the DI Length field is set to zero.
5.2.9 HMAC 5.2.9. HMAC
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
| HMAC | | HMAC |
| | | |
| | | |
skipping to change at page 40, line 31 skipping to change at page 43, line 35
HMAC 160 low order bits of the HMAC computed over the HMAC 160 low order bits of the HMAC computed over the
HIP packet, excluding the HMAC parameter and any HIP packet, excluding the HMAC parameter and any
following parameters, such as HIP_SIGNATURE, following parameters, such as HIP_SIGNATURE,
HIP_SIGNATURE_2, ECHO_REQUEST, or ECHO_RESPONSE. HIP_SIGNATURE_2, ECHO_REQUEST, or ECHO_RESPONSE.
The checksum field MUST be set to zero The checksum field MUST be set to zero
and the HIP header length in the HIP common header and the HIP header length in the HIP common header
MUST be calculated not to cover any excluded MUST be calculated not to cover any excluded
parameters when the HMAC is calculated. parameters when the HMAC is calculated.
The HMAC calculation and verification process is presented in The HMAC calculation and verification process is presented in
Section 6.3.1 Section 6.4.1
5.2.10 HMAC_2 5.2.10. HMAC_2
The TLV structure is the same as in Section 5.2.9. The fields are: The parameter structure is the same as in Section 5.2.9. The fields
are:
Type 61569 Type 61569
Length 20 Length 20
HMAC 160 low order bits of the HMAC computed over the HMAC 160 low order bits of the HMAC computed over the
HIP packet, excluding the HMAC parameter and any HIP packet, excluding the HMAC parameter and any
following parameters such as HIP_SIGNATURE, following parameters such as HIP_SIGNATURE,
HIP_SIGNATURE_2, ECHO_REQUEST, or ECHO_RESPONSE, HIP_SIGNATURE_2, ECHO_REQUEST, or ECHO_RESPONSE,
and including an additional sender's and including an additional sender's
HOST_ID TLV during the HMAC calculation. The HOST_ID parameter during the HMAC calculation. The
checksum field MUST be set to zero and the HIP checksum field MUST be set to zero and the HIP
header length in the HIP common header MUST be header length in the HIP common header MUST be
calculated not to cover any excluded parameters calculated not to cover any excluded parameters
when the HMAC is calculated. when the HMAC is calculated.
The HMAC calculation and verification process is presented in The HMAC calculation and verification process is presented in
Section 6.3.1 Section 6.4.1
5.2.11 HIP_SIGNATURE 5.2.11. HIP_SIGNATURE
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SIG alg | Signature / | SIG alg | Signature /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ | Padding | / | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 61697 Type 61697
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
SIG alg Signature algorithm SIG alg Signature algorithm
Signature the signature is calculated over the HIP packet, Signature the signature is calculated over the HIP packet,
excluding the HIP_SIGNATURE parameter and any excluding the HIP_SIGNATURE parameter and any
parameters that follow the HIP_SIGNATURE TLV. parameters that follow the HIP_SIGNATURE parameter.
The checksum field MUST be set to zero, and the HIP The checksum field MUST be set to zero, and the HIP
header length in the HIP common header MUST be header length in the HIP common header MUST be
calculated only to the beginning of the calculated only to the beginning of the
HIP_SIGNATURE TLV when the signature is calculated. HIP_SIGNATURE parameter when the signature is
calculated.
The signature algorithms are defined in Section 5.2.8. The signature The signature algorithms are defined in Section 5.2.8. The signature
in the Signature field is encoded using the proper method depending in the Signature field is encoded using the proper method depending
on the signature algorithm (e.g. according to [15] in case of RSA, or on the signature algorithm (e.g. according to [15] in case of RSA, or
according to [13] in case of DSA). according to [13] in case of DSA).
The HIP_SIGNATURE calculation and verification process is presented The HIP_SIGNATURE calculation and verification process is presented
in Section 6.3.2 in Section 6.4.2
5.2.12 HIP_SIGNATURE_2 5.2.12. HIP_SIGNATURE_2
The TLV structure is the same as in Section 5.2.11. The fields are: The parameter structure is the same as in Section 5.2.11. The fields
are:
Type 61633 Type 61633
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
SIG alg Signature algorithm SIG alg Signature algorithm
Signature the signature is calculated over the HIP R1 packet, Signature the signature is calculated over the HIP R1 packet,
excluding the HIP_SIGNATURE_2 parameter and any excluding the HIP_SIGNATURE_2 parameter and any
parameters that follow. Initiator's HIT, checksum parameters that follow. Initiator's HIT, checksum
field, and the Opaque and Random #I fields in the field, and the Opaque and Random #I fields in the
PUZZLE TLV MUST be set to zero while computing the PUZZLE parameter MUST be set to zero while
HIP_SIGNATURE_2 signature. Further, the HIP packet computing the HIP_SIGNATURE_2 signature. Further,
length in the HIP header MUST be calculated to the the HIP packet length in the HIP header MUST be
beginning of the HIP_SIGNATURE_2 TLV when the calculated to the beginning of the HIP_SIGNATURE_2
signature is calculated. parameter when the signature is calculated.
Zeroing the Initiator's HIT makes it possible to create R1 packets Zeroing the Initiator's HIT makes it possible to create R1 packets
beforehand to minimize the effects of possible DoS attacks. Zeroing beforehand to minimize the effects of possible DoS attacks. Zeroing
the I and Opaque fields allows these fields to be populated the I and Opaque fields allows these fields to be populated
dynamically on precomputed R1s. dynamically on precomputed R1s.
Signature calculation and verification follows the process in Signature calculation and verification follows the process in
Section 6.3.2. Section 6.4.2.
5.2.13 SEQ 5.2.13. SEQ
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Update ID | | Update ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 385 Type 385
Length 4 Length 4
Update ID 32-bit sequence number Update ID 32-bit sequence number
The Update ID is an unsigned quantity, initialized by a host to zero The Update ID is an unsigned quantity, initialized by a host to zero
upon moving to ESTABLISHED state. The Update ID has scope within a upon moving to ESTABLISHED state. The Update ID has scope within a
single HIP association, and not across multiple associations or single HIP association, and not across multiple associations or
multiple hosts. The Update ID is incremented by one before each new multiple hosts. The Update ID is incremented by one before each new
UPDATE that is sent by the host (i.e., the first UPDATE packet UPDATE that is sent by the host (i.e., the first UPDATE packet
originated by a host has an Update ID of 1). originated by a host has an Update ID of 1).
5.2.14 ACK 5.2.14. ACK
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| peer Update ID | | peer Update ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 449 Type 449
Length variable (multiple of 4) Length variable (multiple of 4)
peer Update ID 32-bit sequence number corresponding to the peer Update ID 32-bit sequence number corresponding to the
Update ID being acked. Update ID being acked.
The ACK parameter includes one or more Update IDs that have been The ACK parameter includes one or more Update IDs that have been
received from the peer. The Length field identifies the number of received from the peer. The Length field identifies the number of
peer Update IDs that are present in the parameter. peer Update IDs that are present in the parameter.
5.2.15 ENCRYPTED 5.2.15. ENCRYPTED
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IV / | IV /
/ / / /
skipping to change at page 44, line 33 skipping to change at page 47, line 33
Type 641 Type 641
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
Reserved zero when sent, ignored when received Reserved zero when sent, ignored when received
IV Initialization vector, if needed, otherwise IV Initialization vector, if needed, otherwise
nonexistent. The length of the IV is inferred from nonexistent. The length of the IV is inferred from
the HIP transform. the HIP transform.
Encrypted The data is encrypted using an encryption algorithm Encrypted The data is encrypted using an encryption algorithm
data as defined in HIP transform. data as defined in HIP transform.
Padding Any Padding, if necessary, to make the TLV a Padding Any Padding, if necessary, to make the parameter a
multiple of 8 bytes. multiple of 8 bytes.
The ENCRYPTED parameter encapsulates another TLV, the encrypted data, The ENCRYPTED parameter encapsulates another parameter, the encrypted
which is also in TLV format. Consequently, the first fields in the data, which is also in TLV format. Consequently, the first fields in
encapsulated parameter(s) are Type and Length, allowing the contents the encapsulated parameter(s) are Type and Length, allowing the
to be easily parsed after decryption. contents to be easily parsed after decryption.
Both the ENCRYPTED parameter and the encapsulated TLV(s) MUST be Both the ENCRYPTED parameter and the encapsulated parameter(s) MUST
padded. The padding needed for the ENCRYPTED parameter is referred be padded. The padding needed for the ENCRYPTED parameter is
as the "outer" padding. Correspondingly, the padding for the referred as the "outer" padding. Correspondingly, the padding for
parameter(s) encapsulated within the ENCRYPTED parameter is referred the parameter(s) encapsulated within the ENCRYPTED parameter is
as the "inner" padding. referred as the "inner" padding.
The inner padding follows exactly the rules of Section 5.2.1. The The inner padding follows exactly the rules of Section 5.2.1. The
outer padding also follows the same rules but with an exception. outer padding also follows the same rules but with an exception.
Namely, some algorithms require that the data to be encrypted must be Namely, some algorithms require that the data to be encrypted must be
a multiple of the cipher algorithm block size. In this case, the a multiple of the cipher algorithm block size. In this case, the
outer padding MUST include extra padding, as specified by the outer padding MUST include extra padding, as specified by the
encryption algorithm. The size of the extra padding is selected so encryption algorithm. The size of the extra padding is selected so
that the the length of the ENCRYPTED is the minimum value that is that the the length of the ENCRYPTED is the minimum value that is
both multiple of eight and the cipher block size. The encryption both multiple of eight and the cipher block size. The encryption
algorithm may specify padding bytes other than zero; for example, AES algorithm may specify padding bytes other than zero; for example, AES
[33] uses the PKCS5 padding scheme [14] (see section 6.1.1) where the [32] uses the PKCS5 padding scheme [14] (see section 6.1.1) where the
remaining n bytes to fill the block each have the value n. remaining n bytes to fill the block each have the value n.
Note that the length of the cipher suite output may be smaller or Note that the length of the cipher suite output may be smaller or
larger than the length of the data to be encrypted, since the larger than the length of the data to be encrypted, since the
encryption process may compress the data or add additional padding to encryption process may compress the data or add additional padding to
the data. the data.
5.2.16 NOTIFY 5.2.16. NOTIFY
The NOTIFY parameter is used to transmit informational data, such as The NOTIFY parameter is used to transmit informational data, such as
error conditions and state transitions, to a HIP peer. A NOTIFY error conditions and state transitions, to a HIP peer. A NOTIFY
parameter may appear in the NOTIFY packet type. The use of the parameter may appear in the NOTIFY packet type. The use of the
NOTIFY parameter in other packet types is for further study. NOTIFY parameter in other packet types is for further study.
0 1 2 3 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 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 | Length | | Type | Length |
skipping to change at page 45, line 44 skipping to change at page 48, line 44
Type 832 Type 832
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
Reserved zero when sent, ignored when received Reserved zero when sent, ignored when received
Notify Message Specifies the type of notification Notify Message Specifies the type of notification
Type Type
Notification Informational or error data transmitted in addition Notification Informational or error data transmitted in addition
Data to the Notify Message Type. Values for this field Data to the Notify Message Type. Values for this field
are type specific (see below). are type specific (see below).
Padding Any Padding, if necessary, to make the TLV a Padding Any Padding, if necessary, to make the parameter a
multiple of 8 bytes. multiple of 8 bytes.
Notification information can be error messages specifying why an SA Notification information can be error messages specifying why an SA
could not be established. It can also be status data that a process could not be established. It can also be status data that a process
managing an SA database wishes to communicate with a peer process. managing an SA database wishes to communicate with a peer process.
The table below lists the Notification messages and their The table below lists the Notification messages and their
corresponding values. corresponding values.
To avoid certain types of attacks, a Responder SHOULD avoid sending a To avoid certain types of attacks, a Responder SHOULD avoid sending a
NOTIFY to any host with which it has not successfully verified a NOTIFY to any host with which it has not successfully verified a
skipping to change at page 46, line 30 skipping to change at page 49, line 30
UNSUPPORTED_CRITICAL_PARAMETER_TYPE 1 UNSUPPORTED_CRITICAL_PARAMETER_TYPE 1
Sent if the parameter type has the "critical" bit set and the Sent if the parameter type has the "critical" bit set and the
parameter type is not recognized. Notification Data contains parameter type is not recognized. Notification Data contains
the two octet parameter type. the two octet parameter type.
INVALID_SYNTAX 7 INVALID_SYNTAX 7
Indicates that the HIP message received was invalid because Indicates that the HIP message received was invalid because
some type, length, or value was out of range or because the some type, length, or value was out of range or because the
request was rejected for policy reasons. To avoid a denial request was rejected for policy reasons. To avoid a denial of
of service attack using forged messages, this status may service attack using forged messages, this status may only be
only be returned for and in an encrypted packet if the returned for packets whose HMAC (if present) and SIGNATURE have
message ID and cryptographic checksum were valid. To avoid been verified. This status MUST be sent in response to any
leaking information to someone probing a node, this status error not covered by one of the other status types, and should
MUST be sent in response to any error not covered by one of not contain details to avoid leaking information to someone
the other status types. To aid debugging, more detailed probing a node. To aid debugging, more detailed error
error information SHOULD be written to a console or log. information SHOULD be written to a console or log.
NO_DH_PROPOSAL_CHOSEN 14 NO_DH_PROPOSAL_CHOSEN 14
None of the proposed group IDs was acceptable. None of the proposed group IDs was acceptable.
INVALID_DH_CHOSEN 15 INVALID_DH_CHOSEN 15
The D-H Group ID field does not correspond to one offered The D-H Group ID field does not correspond to one offered
by the Responder. by the Responder.
skipping to change at page 47, line 14 skipping to change at page 50, line 12
None of the proposed HIP Transform crypto suites was None of the proposed HIP Transform crypto suites was
acceptable. acceptable.
INVALID_HIP_TRANSFORM_CHOSEN 17 INVALID_HIP_TRANSFORM_CHOSEN 17
The HIP Transform crypto suite does not correspond to The HIP Transform crypto suite does not correspond to
one offered by the Responder. one offered by the Responder.
AUTHENTICATION_FAILED 24 AUTHENTICATION_FAILED 24
Sent in response to a HIP signature failure. Sent in response to a HIP signature failure, except when
the signature verification fails in a NOTIFY message.
CHECKSUM_FAILED 26 CHECKSUM_FAILED 26
Sent in response to a HIP checksum failure. Sent in response to a HIP checksum failure.
HMAC_FAILED 28 HMAC_FAILED 28
Sent in response to a HIP HMAC failure. Sent in response to a HIP HMAC failure.
ENCRYPTION_FAILED 32 ENCRYPTION_FAILED 32
The Responder could not successfully decrypt the The Responder could not successfully decrypt the
ENCRYPTED TLV. ENCRYPTED parameter.
INVALID_HIT 40 INVALID_HIT 40
Sent in response to a failure to validate the peer's Sent in response to a failure to validate the peer's
HIT from the corresponding HI. HIT from the corresponding HI.
BLOCKED_BY_POLICY 42 BLOCKED_BY_POLICY 42
The Responder is unwilling to set up an association The Responder is unwilling to set up an association
for some policy reason (e.g. received HIT is NULL for some policy reason (e.g. received HIT is NULL
skipping to change at page 48, line 15 skipping to change at page 51, line 13
the I2 for processing. The puzzle was correctly solved the I2 for processing. The puzzle was correctly solved
and the Responder is willing to set up an association and the Responder is willing to set up an association
but has currently a number of I2s in processing queue. but has currently a number of I2s in processing queue.
R2 will be sent after the I2 has been processed. R2 will be sent after the I2 has been processed.
NOTIFY MESSAGES - STATUS TYPES Value NOTIFY MESSAGES - STATUS TYPES Value
------------------------------ ----- ------------------------------ -----
(None defined at present) (None defined at present)
5.2.17 ECHO_REQUEST 5.2.17. ECHO_REQUEST
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opaque data (variable length) | | Opaque data (variable length) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 63661 or 897 Type 63661 or 897
skipping to change at page 49, line 5 skipping to change at page 52, line 5
sender wants to get echoed back in the corresponding reply packet. sender wants to get echoed back in the corresponding reply packet.
The ECHO_REQUEST and ECHO_RESPONSE parameters MAY be used for any The ECHO_REQUEST and ECHO_RESPONSE parameters MAY be used for any
purpose where a node wants to carry some state in a request packet purpose where a node wants to carry some state in a request packet
and get it back in a response packet. The ECHO_REQUEST MAY be and get it back in a response packet. The ECHO_REQUEST MAY be
covered by the HMAC and SIGNATURE. This is dictated by the Type covered by the HMAC and SIGNATURE. This is dictated by the Type
field selected for the parameter; Type 897 ECHO_REQUEST is covered field selected for the parameter; Type 897 ECHO_REQUEST is covered
and Type 63661 is not covered. A HIP packet can contain only one and Type 63661 is not covered. A HIP packet can contain only one
ECHO_REQUEST parameter. ECHO_REQUEST parameter.
5.2.18 ECHO_RESPONSE 5.2.18. ECHO_RESPONSE
0 1 2 3 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 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 | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opaque data (variable length) | | Opaque data (variable length) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 63425 or 961 Type 63425 or 961
skipping to change at page 49, line 31 skipping to change at page 52, line 31
sender of the ECHO_REQUEST wants to get echoed back. The opaque data sender of the ECHO_REQUEST wants to get echoed back. The opaque data
is copied unmodified from the ECHO_REQUEST parameter. is copied unmodified from the ECHO_REQUEST parameter.
The ECHO_REQUEST and ECHO_RESPONSE parameters MAY be used for any The ECHO_REQUEST and ECHO_RESPONSE parameters MAY be used for any
purpose where a node wants to carry some state in a request packet purpose where a node wants to carry some state in a request packet
and get it back in a response packet. The ECHO_RESPONSE MAY be and get it back in a response packet. The ECHO_RESPONSE MAY be
covered by the HMAC and SIGNATURE. This is dictated by the Type covered by the HMAC and SIGNATURE. This is dictated by the Type
field selected for the parameter; Type 961 ECHO_RESPONSE is covered field selected for the parameter; Type 961 ECHO_RESPONSE is covered
and Type 63425 is not. and Type 63425 is not.
5.3 HIP Packets 5.3. HIP Packets
There are eight basic HIP packets. Four are for the HIP base There are eight basic HIP packets (see Table 11). Four are for the
exchange, one is for updating, one is for sending notifications, and HIP base exchange, one is for updating, one is for sending
two for closing a HIP association. notifications, and two for closing a HIP association.
+-------------+---------------------------------------------------+
| Packet type | Packet name |
+-------------+---------------------------------------------------+
| 1 | I1 - the HIP Initiator Packet |
| | |
| 2 | R1 - the HIP Responder Packet |
| | |
| 3 | I2 - the Second HIP Initiator Packet |
| | |
| 4 | R2 - the Second HIP Responder Packet |
| | |
| 16 | UPDATE - the HIP Update Packet |
| | |
| 17 | NOTIFY - the HIP Notify Packet |
| | |
| 18 | CLOSE - the HIP Association Closing Packet |
| | |
| 19 | CLOSE_ACK - the HIP Closing Acknowledgment Packet |
+-------------+---------------------------------------------------+
Table 11: HIP packets and packet type numbers
Packets consist of the fixed header as described in Section 5.1, Packets consist of the fixed header as described in Section 5.1,
followed by the parameters. The parameter part, in turn, consists of followed by the parameters. The parameter part, in turn, consists of
zero or more TLV coded parameters. zero or more parameter coded parameters.
In addition to the base packets, other packets types will be defined In addition to the base packets, other packets types will be defined
later in separate specifications. For example, support for mobility later in separate specifications. For example, support for mobility
and multi-homing is not included in this specification. and multi-homing is not included in this specification.
Packet representation uses the following operations: See Notation (Section 2.2) for used operations.
() parameter
x{y} operation x on content y
<x>i x exists i times
[] optional parameter
x | y x or y
In the future, an OPTIONAL upper layer payload MAY follow the HIP In the future, an OPTIONAL upper layer payload MAY follow the HIP
header. The Next Header field in the header indicates if there is header. The Next Header field in the header indicates if there is
additional data following the HIP header. The HIP packet, however, additional data following the HIP header. The HIP packet, however,
MUST NOT be fragmented. This limits the size of the possible MUST NOT be fragmented. This limits the size of the possible
additional data in the packet. additional data in the packet.
5.3.1 I1 - the HIP Initiator Packet 5.3.1. I1 - the HIP Initiator Packet
The HIP header values for the I1 packet: The HIP header values for the I1 packet:
Header: Header:
Packet Type = 1 Packet Type = 1
SRC HIT = Initiator's HIT SRC HIT = Initiator's HIT
DST HIT = Responder's HIT, or NULL DST HIT = Responder's HIT, or NULL
IP ( HIP () ) IP ( HIP () )
The I1 packet contains only the fixed HIP header. The I1 packet contains only the fixed HIP header.
Valid control bits: none Valid control bits: none
The Initiator gets the Responder's HIT either from a DNS lookup of The Initiator gets the Responder's HIT either from a DNS lookup of
the Responder's FQDN, from some other repository, or from a local the Responder's FQDN, from some other repository, or from a local
table. If the Initiator does not know the Responder's HIT, it may table. If the Initiator does not know the Responder's HIT, it may
attempt opportunistic mode by using NULL (all zeros) as the attempt opportunistic mode by using NULL (all zeros) as the
Responder's HIT. If the Initiator sends a NULL as the Responder's Responder's HIT. If the Initiator sends a NULL as the Responder's
HIT, it MUST be able to handle all MUST and SHOULD algorithms from HIT, it MUST be able to handle all MUST and SHOULD algorithms from
skipping to change at page 50, line 40 skipping to change at page 54, line 23
HIT, it MUST be able to handle all MUST and SHOULD algorithms from HIT, it MUST be able to handle all MUST and SHOULD algorithms from
Section 3, which are currently RSA and DSA. Section 3, which are currently RSA and DSA.
Since this packet is so easy to spoof even if it were signed, no Since this packet is so easy to spoof even if it were signed, no
attempt is made to add to its generation or processing cost. attempt is made to add to its generation or processing cost.
Implementations MUST be able to handle a storm of received I1 Implementations MUST be able to handle a storm of received I1
packets, discarding those with common content that arrive within a packets, discarding those with common content that arrive within a
small time delta. small time delta.
5.3.2 R1 - the HIP Responder Packet 5.3.2. R1 - the HIP Responder Packet
The HIP header values for the R1 packet: The HIP header values for the R1 packet:
Header: Header:
Packet Type = 2 Packet Type = 2
SRC HIT = Responder's HIT SRC HIT = Responder's HIT
DST HIT = Initiator's HIT DST HIT = Initiator's HIT
IP ( HIP ( [ R1_COUNTER, ] IP ( HIP ( [ R1_COUNTER, ]
PUZZLE, PUZZLE,
DIFFIE_HELLMAN, DIFFIE_HELLMAN,
HIP_TRANSFORM, HIP_TRANSFORM,
HOST_ID, HOST_ID,
[ ECHO_REQUEST, ] [ ECHO_REQUEST, ]
HIP_SIGNATURE_2 ) HIP_SIGNATURE_2 )
[, ECHO_REQUEST ]) [, ECHO_REQUEST ])
Valid control bits: C, A Valid control bits: A
If the Responder HI is an anonymous one, the A control MUST be set. If the Responder HI is an anonymous one, the A control MUST be set.
The Initiator HIT MUST match the one received in I1. If the The Initiator HIT MUST match the one received in I1. If the
Responder has multiple HIs, the Responder HIT used MUST match Responder has multiple HIs, the Responder HIT used MUST match
Initiator's request. If the Initiator used opportunistic mode, the Initiator's request. If the Initiator used opportunistic mode, the
Responder may select freely among its HIs. Responder may select freely among its HIs.
The R1 generation counter is used to determine the currently valid The R1 generation counter is used to determine the currently valid
generation of puzzles. The value is increased periodically, and it generation of puzzles. The value is increased periodically, and it
skipping to change at page 51, line 44 skipping to change at page 55, line 18
K is the number of bits that the Initiator must get zero in the K is the number of bits that the Initiator must get zero in the
puzzle. The random #I is not covered by the signature and must be puzzle. The random #I is not covered by the signature and must be
zeroed during the signature calculation, allowing the sender to zeroed during the signature calculation, allowing the sender to
select and set the #I into a pre-computed R1 just prior sending it to select and set the #I into a pre-computed R1 just prior sending it to
the peer. the peer.
The Diffie-Hellman value is ephemeral, but can be reused over a The Diffie-Hellman value is ephemeral, but can be reused over a
number of connections. In fact, as a defense against I1 storms, an number of connections. In fact, as a defense against I1 storms, an
implementation MAY use the same Diffie-Hellman value for a period of implementation MAY use the same Diffie-Hellman value for a period of
time, for example, 15 minutes. By using a small number of different time, for example, 15 minutes. By using a small number of different
Cookies for a given Diffie-Hellman value, the R1 packets can be pre- puzzles for a given Diffie-Hellman value, the R1 packets can be pre-
computed and delivered as quickly as I1 packets arrive. A scavenger computed and delivered as quickly as I1 packets arrive. A scavenger
process should clean up unused DHs and Cookies. process should clean up unused DHs and puzzles.
The HIP_TRANSFORM contains the encryption and integrity algorithms The HIP_TRANSFORM contains the encryption and integrity algorithms
supported by the Responder to protect the HI exchange, in the order supported by the Responder to protect the HI exchange, in the order
of preference. All implementations MUST support the AES [19] with of preference. All implementations MUST support the AES [18] with
HMAC-SHA-1-96 [6]. HMAC-SHA-1-96 [6].
The ECHO_REQUEST contains data that the sender wants to receive The ECHO_REQUEST contains data that the sender wants to receive
unmodified in the corresponding response packet in the ECHO_RESPONSE unmodified in the corresponding response packet in the ECHO_RESPONSE
parameter. The ECHO_REQUEST can be either covered by the signature, parameter. The ECHO_REQUEST can be either covered by the signature,
or it can be left out from it. In the first case, the ECHO_REQUEST or it can be left out from it. In the first case, the ECHO_REQUEST
gets Type number 897 and in the latter case 63661. gets Type number 897 and in the latter case 63661.
The signature is calculated over the whole HIP envelope, after The signature is calculated over the whole HIP envelope, after
setting the Initiator HIT, header checksum as well as the Opaque setting the Initiator HIT, header checksum as well as the Opaque
field and the Random #I in the PUZZLE parameter temporarily to zero, field and the Random #I in the PUZZLE parameter temporarily to zero,
and excluding any TLVs that follow the signature, as described in and excluding any parameters that follow the signature, as described
Section 5.2.12. This allows the Responder to use precomputed R1s. in Section 5.2.12. This allows the Responder to use precomputed R1s.
The Initiator SHOULD validate this signature. It SHOULD check that The Initiator SHOULD validate this signature. It SHOULD check that
the Responder HI received matches with the one expected, if any. the Responder HI received matches with the one expected, if any.
5.3.3 I2 - the Second HIP Initiator Packet 5.3.3. I2 - the Second HIP Initiator Packet
The HIP header values for the I2 packet: The HIP header values for the I2 packet:
Header: Header:
Type = 3 Type = 3
SRC HIT = Initiator's HIT SRC HIT = Initiator's HIT
DST HIT = Responder's HIT DST HIT = Responder's HIT
IP ( HIP ( [R1_COUNTER,] IP ( HIP ( [R1_COUNTER,]
SOLUTION, SOLUTION,
DIFFIE_HELLMAN, DIFFIE_HELLMAN,
HIP_TRANSFORM, HIP_TRANSFORM,
ENCRYPTED { HOST_ID } or HOST_ID, ENCRYPTED { HOST_ID } or HOST_ID,
[ ECHO_RESPONSE ,] [ ECHO_RESPONSE ,]
HMAC, HMAC,
HIP_SIGNATURE HIP_SIGNATURE
[, ECHO_RESPONSE] ) ) [, ECHO_RESPONSE] ) )
Valid control bits: C, A Valid control bits: A
The HITs used MUST match the ones used previously. The HITs used MUST match the ones used previously.
If the Initiator HI is an anonymous one, the A control MUST be set. If the Initiator HI is an anonymous one, the A control MUST be set.
The Initiator MAY include an unmodified copy of the R1_COUNTER The Initiator MAY include an unmodified copy of the R1_COUNTER
parameter received in the corresponding R1 packet into the I2 packet. parameter received in the corresponding R1 packet into the I2 packet.
The Solution contains the random # I from R1 and the computed # J. The Solution contains the random # I from R1 and the computed # J.
The low order K bits of the SHA-1(I | ... | J) MUST be zero. The low order K bits of the PHASH(I | ... | J) MUST be zero.
The Diffie-Hellman value is ephemeral. If precomputed, a scavenger The Diffie-Hellman value is ephemeral. If precomputed, a scavenger
process should clean up unused DHs. process should clean up unused DHs.
The HIP_TRANSFORM contains the single encryption and integrity The HIP_TRANSFORM contains the single encryption and integrity
transform selected by the Initiator, that will be used to protect the transform selected by the Initiator, that will be used to protect the
HI exchange. The chosen transform MUST correspond to one offered by HI exchange. The chosen transform MUST correspond to one offered by
the Responder in the R1. All implementations MUST support the AES the Responder in the R1. All implementations MUST support the AES
transform [19]. transform [18].
The Initiator's HI MAY be encrypted using the HIP_TRANSFORM The Initiator's HI MAY be encrypted using the HIP_TRANSFORM
encryption algorithm. The keying material is derived from the encryption algorithm. The keying material is derived from the
Diffie-Hellman exchanged as defined in Section 6.4. Diffie-Hellman exchanged as defined in Section 6.5.
The ECHO_RESPONSE contains the the unmodified Opaque data copied from The ECHO_RESPONSE contains the the unmodified Opaque data copied from
the corresponding ECHO_REQUEST TLV. The ECHO_RESPONSE can be either the corresponding ECHO_REQUEST parameter. The ECHO_RESPONSE can be
covered by the HMAC and SIGNATURE or not covered. In the former either covered by the HMAC and SIGNATURE or not covered. In the
case, the ECHO_RESPONSE gets Type number 961, in the latter it is former case, the ECHO_RESPONSE gets Type number 961, in the latter it
63425. is 63425.
The HMAC is calculated over whole HIP envelope, excluding any TLVs The HMAC is calculated over whole HIP envelope, excluding any
after the HMAC, as described in Section 6.3.1. The Responder MUST parameters after the HMAC, as described in Section 6.4.1. The
validate the HMAC. Responder MUST validate the HMAC.
The signature is calculated over whole HIP envelope, excluding any The signature is calculated over whole HIP envelope, excluding any
TLVs after the HIP_SIGNATURE, as described in Section 5.2.11. The parameters after the HIP_SIGNATURE, as described in Section 5.2.11.
Responder MUST validate this signature. It MAY use either the HI in The Responder MUST validate this signature. It MAY use either the HI
the packet or the HI acquired by some other means. in the packet or the HI acquired by some other means.
5.3.4 R2 - the Second HIP Responder Packet 5.3.4. R2 - the Second HIP Responder Packet
The HIP header values for the R2 packet: The HIP header values for the R2 packet:
Header: Header:
Packet Type = 4 Packet Type = 4
SRC HIT = Responder's HIT SRC HIT = Responder's HIT
DST HIT = Initiator's HIT DST HIT = Initiator's HIT
IP ( HIP ( HMAC_2, HIP_SIGNATURE ) ) IP ( HIP ( HMAC_2, HIP_SIGNATURE ) )
Valid control bits: none Valid control bits: none
The HMAC_2 is calculated over whole HIP envelope, with Responder's The HMAC_2 is calculated over whole HIP envelope, with Responder's
HOST_ID TLV concatenated with the HIP envelope. The HOST_ID TLV is HOST_ID parameter concatenated with the HIP envelope. The HOST_ID
removed after the HMAC calculation. The procedure is described in parameter is removed after the HMAC calculation. The procedure is
8.3.1. described in 8.3.1.
The signature is calculated over whole HIP envelope. The signature is calculated over whole HIP envelope.
The Initiator MUST validate both the HMAC and the signature. The Initiator MUST validate both the HMAC and the signature.
5.3.5 UPDATE - the HIP Update Packet 5.3.5. UPDATE - the HIP Update Packet
Support for the UPDATE packet is MANDATORY. Support for the UPDATE packet is MANDATORY.
The HIP header values for the UPDATE packet: The HIP header values for the UPDATE packet:
Header: Header:
Packet Type = 6 Packet Type = 16
SRC HIT = Sender's HIT SRC HIT = Sender's HIT
DST HIT = Recipient's HIT DST HIT = Recipient's HIT
IP ( HIP ( [SEQ, ACK, ] HMAC, HIP_SIGNATURE ) ) IP ( HIP ( [SEQ, ACK, ] HMAC, HIP_SIGNATURE ) )
Valid control bits: None Valid control bits: None
The UPDATE packet contains mandatory HMAC and HIP_SIGNATURE The UPDATE packet contains mandatory HMAC and HIP_SIGNATURE
parameters, and other optional parameters. parameters, and other optional parameters.
skipping to change at page 55, line 5 skipping to change at page 58, line 36
A sender MAY choose to forego reliable transmission of a particular A sender MAY choose to forego reliable transmission of a particular
UPDATE (e.g., it becomes overcome by events). The semantics are such UPDATE (e.g., it becomes overcome by events). The semantics are such
that the receiver MUST acknowledge the UPDATE but the sender MAY that the receiver MUST acknowledge the UPDATE but the sender MAY
choose to not care about receiving the ACK. choose to not care about receiving the ACK.
UPDATEs MAY be retransmitted without incrementing SEQ. If the same UPDATEs MAY be retransmitted without incrementing SEQ. If the same
subset of parameters is included in multiple UPDATEs with different subset of parameters is included in multiple UPDATEs with different
SEQs, the host MUST ensure that receiver processing of the parameters SEQs, the host MUST ensure that receiver processing of the parameters
multiple times will not result in a protocol error. multiple times will not result in a protocol error.
5.3.6 NOTIFY - the HIP Notify Packet 5.3.6. NOTIFY - the HIP Notify Packet
The NOTIFY packet is OPTIONAL. The NOTIFY packet MAY be used to The NOTIFY packet is OPTIONAL. The NOTIFY packet MAY be used to
provide information to a peer. Typically, NOTIFY is used to indicate provide information to a peer. Typically, NOTIFY is used to indicate
some type of protocol error or negotiation failure. some type of protocol error or negotiation failure.
The HIP header values for the NOTIFY packet: The HIP header values for the NOTIFY packet:
Header: Header:
Packet Type = 7 Packet Type = 17
SRC HIT = Sender's HIT SRC HIT = Sender's HIT
DST HIT = Recipient's HIT, or zero if unknown DST HIT = Recipient's HIT, or zero if unknown
IP ( HIP (<NOTIFY>i, [HOST_ID, ] HIP_SIGNATURE) ) IP ( HIP (<NOTIFY>i, [HOST_ID, ] HIP_SIGNATURE) )
Valid control bits: None Valid control bits: None
The NOTIFY packet is used to carry one or more NOTIFY parameters. The NOTIFY packet is used to carry one or more NOTIFY parameters.
5.3.7 CLOSE - the HIP association closing packet 5.3.7. CLOSE - the HIP Association Closing Packet
The HIP header values for the CLOSE packet: The HIP header values for the CLOSE packet:
Header: Header:
Packet Type = 8 Packet Type = 18
SRC HIT = Sender's HIT SRC HIT = Sender's HIT
DST HIT = Recipient's HIT DST HIT = Recipient's HIT
IP ( HIP ( ECHO_REQUEST, HMAC, HIP_SIGNATURE ) ) IP ( HIP ( ECHO_REQUEST, HMAC, HIP_SIGNATURE ) )
Valid control bits: none Valid control bits: none
The sender MUST include an ECHO_REQUEST used to validate CLOSE_ACK The sender MUST include an ECHO_REQUEST used to validate CLOSE_ACK
received in response, and both an HMAC and a signature (calculated received in response, and both an HMAC and a signature (calculated
over the whole HIP envelope). over the whole HIP envelope).
The receiver peer MUST validate both the HMAC and the signature if it The receiver peer MUST validate both the HMAC and the signature if it
has a HIP association state, and MUST reply with a CLOSE_ACK has a HIP association state, and MUST reply with a CLOSE_ACK
containing an ECHO_REPLY corresponding to the received ECHO_REQUEST. containing an ECHO_REPLY corresponding to the received ECHO_REQUEST.
5.3.8 CLOSE_ACK - the HIP Closing Acknowledgment Packet 5.3.8. CLOSE_ACK - the HIP Closing Acknowledgment Packet
The HIP header values for the CLOSE_ACK packet: The HIP header values for the CLOSE_ACK packet:
Header: Header:
Packet Type = 9 Packet Type = 19
SRC HIT = Sender's HIT SRC HIT = Sender's HIT
DST HIT = Recipient's HIT DST HIT = Recipient's HIT
IP ( HIP ( ECHO_REPLY, HMAC, HIP_SIGNATURE ) ) IP ( HIP ( ECHO_REPLY, HMAC, HIP_SIGNATURE ) )
Valid control bits: none Valid control bits: none
The sender MUST include both an HMAC and signature (calculated over The sender MUST include both an HMAC and signature (calculated over
the whole HIP envelope). the whole HIP envelope).
The receiver peer MUST validate both the HMAC and the signature. The receiver peer MUST validate both the HMAC and the signature.
5.4 ICMP Messages 5.4. ICMP Messages
When a HIP implementation detects a problem with an incoming packet, When a HIP implementation detects a problem with an incoming packet,
and it either cannot determine the identity of the sender of the and it either cannot determine the identity of the sender of the
packet or does not have any existing HIP association with the sender packet or does not have any existing HIP association with the sender
of the packet, it MAY respond with an ICMP packet. Any such replies of the packet, it MAY respond with an ICMP packet. Any such replies
MUST be rate limited as described in [4]. In most cases, the ICMP MUST be rate limited as described in [4]. In most cases, the ICMP
packet will have the Parameter Problem type (12 for ICMPv4, 4 for packet will have the Parameter Problem type (12 for ICMPv4, 4 for
ICMPv6), with the Pointer field pointing to the field that caused the ICMPv6), with the Pointer field pointing to the field that caused the
ICMP message to be generated. ICMP message to be generated.
5.4.1 Invalid Version 5.4.1. Invalid Version
If a HIP implementation receives a HIP packet that has an If a HIP implementation receives a HIP packet that has an
unrecognized HIP version number, it SHOULD respond, rate limited, unrecognized HIP version number, it SHOULD respond, rate limited,
with an ICMP packet with type Parameter Problem, the Pointer pointing with an ICMP packet with type Parameter Problem, the Pointer pointing
to the VER./RES. byte in the HIP header. to the VER./RES. byte in the HIP header.
5.4.2 Other Problems with the HIP Header and Packet Structure 5.4.2. Other Problems with the HIP Header and Packet Structure
If a HIP implementation receives a HIP packet that has other If a HIP implementation receives a HIP packet that has other
unrecoverable problems in the header or packet format, it MAY unrecoverable problems in the header or packet format, it MAY
respond, rate limited, with an ICMP packet with type Parameter respond, rate limited, with an ICMP packet with type Parameter
Problem, the Pointer pointing to the field that failed to pass the Problem, the Pointer pointing to the field that failed to pass the
format checks. However, an implementation MUST NOT send an ICMP format checks. However, an implementation MUST NOT send an ICMP
message if the Checksum fails; instead, it MUST silently drop the message if the Checksum fails; instead, it MUST silently drop the
packet. packet.
5.4.3 Invalid Cookie Solution 5.4.3. Invalid Puzzle Solution
If a HIP implementation receives an I2 packet that has an invalid If a HIP implementation receives an I2 packet that has an invalid
cookie solution, the behavior depends on the underlying version of puzzle solution, the behavior depends on the underlying version of
IP. If IPv6 is used, the implementation SHOULD respond with an ICMP IP. If IPv6 is used, the implementation SHOULD respond with an ICMP
packet with type Parameter Problem, the Pointer pointing to the packet with type Parameter Problem, the Pointer pointing to the
beginning of the Puzzle solution #J field in the SOLUTION payload in beginning of the Puzzle solution #J field in the SOLUTION payload in
the HIP message. the HIP message.
If IPv4 is used, the implementation MAY respond with an ICMP packet If IPv4 is used, the implementation MAY respond with an ICMP packet
with the type Parameter Problem, copying enough of bytes from the I2 with the type Parameter Problem, copying enough of bytes from the I2
message so that the SOLUTION parameter fits into the ICMP message, message so that the SOLUTION parameter fits into the ICMP message,
the Pointer pointing to the beginning of the Puzzle solution #J the Pointer pointing to the beginning of the Puzzle solution #J
field, as in the IPv6 case. Note, however, that the resulting ICMPv4 field, as in the IPv6 case. Note, however, that the resulting ICMPv4
message exceeds the typical ICMPv4 message size as defined in [2]. message exceeds the typical ICMPv4 message size as defined in [2].
5.4.4 Non-existing HIP Association 5.4.4. Non-existing HIP Association
If a HIP implementation receives a CLOSE, or UPDATE packet, or any If a HIP implementation receives a CLOSE, or UPDATE packet, or any
other packet whose handling requires an existing association, that other packet whose handling requires an existing association, that
has either a Receiver or Sender HIT that does not match with any has either a Receiver or Sender HIT that does not match with any
existing HIP association, the implementation MAY respond, rate existing HIP association, the implementation MAY respond, rate
limited, with an ICMP packet with the type Parameter Problem, the limited, with an ICMP packet with the type Parameter Problem, the
Pointer pointing to the the beginning of the first HIT that does not Pointer pointing to the the beginning of the first HIT that does not
match. match.
A host MUST NOT reply with such an ICMP if it receives any of the A host MUST NOT reply with such an ICMP if it receives any of the
skipping to change at page 58, line 28 skipping to change at page 62, line 28
end. end.
The processing of packets depends on the state of the HIP The processing of packets depends on the state of the HIP
association(s) with respect to the authenticated or apparent association(s) with respect to the authenticated or apparent
originator of the packet. A HIP implementation determines whether it originator of the packet. A HIP implementation determines whether it
has an active association with the originator of the packet based on has an active association with the originator of the packet based on
the HITs. In the case of user data carried in a specific transport the HITs. In the case of user data carried in a specific transport
format, the transport format document specifies how the incoming format, the transport format document specifies how the incoming
packets are matched with the active associations. packets are matched with the active associations.
6.1 Processing Outgoing Application Data 6.1. Processing Outgoing Application Data
In a HIP host, an application can send application level data using In a HIP host, an application can send application level data using
HITs or local scope identifiers (LSIs) as source and destination an identifier specified via the underlying API. The API can be a
identifiers. The HITs and LSIs may be specified via a backwards backwards compatible API (see [28]), using identifiers that look
compatible API (see [32]) or a completely new API. The exact format similar to IP addresses, or a completely new API, providing enhanced
and method for transferring the data from the source HIP host to the services related to Host Identities. Depending on the HIP
destination HIP host is defined in the corresponding transport format implementation, the identifier provided to the application may be
document. The actual data is transmitted in the network using the different; it can be e.g. a HIT or an IP address.
appropriate source and destination IP addresses. Here, we specify
the processing rules only for the base case where both hosts have
only single usable IP addresses; the multi-address multi-homing case
will be specified separately.
If the IPv4 or IPv6 backward compatible APIs and therefore LSIs are The exact format and method for transferring the data from the source
supported, it is assumed that the LSIs will be converted into proper HIP host to the destination HIP host is defined in the corresponding
HITs somewhere in the stack. The exact location of the conversion is transport format document. The actual data is transferred in the
an implementation specific issue and not discussed here. The network using the appropriate source and destination IP addresses.
following conceptual algorithm discusses only HITs, with the
assumption that the LSI-to-HIT conversion takes place somewhere.
The following steps define the conceptual processing rules for In this document, conceptual processing rules are defined only for
outgoing datagrams destined to a HIT. the base case where both hosts have only single usable IP addresses;
the multi-address multi-homing case will be specified separately.
The following conceptual algorithm describes the steps that are
required for handling outgoing datagrams destined to a HIT.
1. If the datagram has a specified source address, it MUST be a HIT. 1. If the datagram has a specified source address, it MUST be a HIT.
If it is not, the implementation MAY replace the source address If it is not, the implementation MAY replace the source address
with a HIT. Otherwise it MUST drop the packet. with a HIT. Otherwise it MUST drop the packet.
2. If the datagram has an unspecified source address, the 2. If the datagram has an unspecified source address, the
implementation must choose a suitable source HIT for the implementation must choose a suitable source HIT for the
datagram. datagram.
3. If there is no active HIP session with the given < source, 3. If there is no active HIP association with the given < source,
destination > HIT pair, one must be created by running the base destination > HIT pair, one must be created by running the base
exchange. While waiting for the base exchange to complete, the exchange. While waiting for the base exchange to complete, the
implementation SHOULD queue at least one packet per HIP session implementation SHOULD queue at least one packet per HIP
to be formed, and it MAY queue more than one. association to be formed, and it MAY queue more than one.
4. Once there is an active HIP session for the given < source, 4. Once there is an active HIP association for the given < source,
destination > HIT pair, the outgoing datagram is passed to destination > HIT pair, the outgoing datagram is passed to
transport handling. The possible transport formats are defined transport handling. The possible transport formats are defined
in separate documents, of which the ESP transport format for HIP in separate documents, of which the ESP transport format for HIP
is mandatory for all HIP implementations. is mandatory for all HIP implementations.
5. Before sending the packet, the HITs in the datagram are replaced 5. Before sending the packet, the HITs in the datagram are replaced
with suitable IP addresses. For IPv6, the rules defined in [16] with suitable IP addresses. For IPv6, the rules defined in [16]
SHOULD be followed. Note that this HIT-to-IP-address conversion SHOULD be followed. Note that this HIT-to-IP-address conversion
step MAY also be performed at some other point in the stack, step MAY also be performed at some other point in the stack,
e.g., before wrapping the packet into the output format. e.g., before wrapping the packet into the output format.
6.2 Processing Incoming Application Data 6.2. Processing Incoming Application Data
The transport format and method (defined in separate specifications) The following conceptual algorithm describes the incoming datagram
determines the format in which incoming HIP packets arrive to the handling when HITs are used at the receiving host as application
host. The following steps define the conceptual processing rules for level identifiers. More detailed steps for processing packets are
incoming datagrams. The specific transport format and method defined in corresponding transport format documents.
specifications define in more detail the packet processing, related
to the method.
1. The incoming datagram is mapped to an existing HIP association, 1. The incoming datagram is mapped to an existing HIP association,
typically using some information from the packet. For example, typically using some information from the packet. For example,
such mapping may be based on ESP Security Parameter Index (SPI). such mapping may be based on ESP Security Parameter Index (SPI).
2. The specific transport format is unwrapped, in a way depending on 2. The specific transport format is unwrapped, in a way depending on
the transport format, yielding a packet that looks like a the transport format, yielding a packet that looks like a
standard (unencrypted) IP packet. If possible, this step SHOULD standard (unencrypted) IP packet. If possible, this step SHOULD
also verify that the packet was indeed (once) sent by the remote also verify that the packet was indeed (once) sent by the remote
HIP host, as identified by the HIP association. HIP host, as identified by the HIP association.
3. The IP addresses in the datagram are replaced with the HITs 3. The IP addresses in the datagram are replaced with the HITs
associated with the HIP association. Note that this IP-address- associated with the HIP association. Note that this IP-address-
to-HIT conversion step MAY also be performed at some other point to-HIT conversion step MAY also be performed at some other point
in the stack. in the stack.
4. The datagram is delivered to the upper layer. Demultiplexing the 4. The datagram is delivered to the upper layer. Demultiplexing the
datagram the right upper layer socket is based on the HITs (or datagram the right upper layer socket is based on the HITs.
LSIs).
6.3 HMAC and SIGNATURE Calculation and Verification 6.3. Solving the Puzzle
This subsection describes the puzzle solving details.
In R1, the values I and K are sent in network byte order. Similarly,
in I2 the values I and J are sent in network byte order. The SHA-1
hash is created by concatenating, in network byte order, the
following data, in the following order:
64-bit random value I, in network byte order, as appearing in R1
and I2.
128-bit Initiator HIT, in network byte order, as appearing in the
HIP Payload in R1 and I2.
128-bit Responder HIT, in network byte order, as appearing in the
HIP Payload in R1 and I2.
64-bit random value J, in network byte order, as appearing in I2.
In order to be a valid response puzzle, the K low-order bits of the
resulting PHASH digest must be zero.
Notes:
i) The length of the data to be hashed is 48 bytes.
ii) All the data in the hash input MUST be in network byte order.
iii) The order of the Initiator and Responder HITs are different
in the R1 and I2 packets, see Section 5.1. Care must be taken to
copy the values in right order to the hash input.
The following procedure describes the processing steps involved,
assuming that the Responder chooses to precompute the R1 packets:
Precomputation by the Responder:
Sets up the puzzle difficulty K.
Creates a signed R1 and caches it.
Responder:
Selects a suitable cached R1.
Generates a random number I.
Sends I and K in an R1.
Saves I and K for a Delta time.
Initiator:
Generates repeated attempts to solve the puzzle until a matching J
is found:
Ltrunc( PHASH( I | HIT-I | HIT-R | J ), K ) == 0
Sends I and J in an I2.
Responder:
Verifies that the received I is a saved one.
Finds the right K based on I.
Computes V := Ltrunc( PHASH( I | HIT-I | HIT-R | J ), K )
Rejects if V != 0
Accept if V == 0
6.4. HMAC and SIGNATURE Calculation and Verification
The following subsections define the actions for processing HMAC, The following subsections define the actions for processing HMAC,
HIP_SIGNATURE and HIP_SIGNATURE_2 TLVs. HIP_SIGNATURE and HIP_SIGNATURE_2 parameters.
6.3.1 HMAC Calculation 6.4.1. HMAC Calculation
The following process applies both to the HMAC and HMAC_2 TLVs. When The following process applies both to the HMAC and HMAC_2 parameters.
processing HMAC_2, the difference is that the HMAC calculation When processing HMAC_2, the difference is that the HMAC calculation
includes a pseudo HOST_ID field containing the Responder's includes a pseudo HOST_ID field containing the Responder's
information as sent in the R1 packet earlier. information as sent in the R1 packet earlier.
Both the Initiator and the Responder should take some care when Both the Initiator and the Responder should take some care when
verifying or calculating the HMAC_2. Specifically, the Responder verifying or calculating the HMAC_2. Specifically, the Responder
should preserve other parameters than the HOST_ID when sending the should preserve other parameters than the HOST_ID when sending the
R2. Also, the Initiator has to preserve the HOST_ID exactly as it R2. Also, the Initiator has to preserve the HOST_ID exactly as it
was received in the R1 packet. was received in the R1 packet.
The HMAC TLV is defined in Section 5.2.9 and HMAC_2 TLV in The HMAC parameter is defined in Section 5.2.9 and HMAC_2 parameter
Section 5.2.10. HMAC calculation and verification process: in Section 5.2.10. HMAC calculation and verification process:
Packet sender: Packet sender:
1. Create the HIP packet, without the HMAC or any possible 1. Create the HIP packet, without the HMAC or any possible
HIP_SIGNATURE or HIP_SIGNATURE_2 TLVs. HIP_SIGNATURE or HIP_SIGNATURE_2 parameters.
2. In case of HMAC_2 calculation, add a HOST_ID (Responder) TLV to 2. In case of HMAC_2 calculation, add a HOST_ID (Responder)
the packet. parameter to the packet.
3. Calculate the Length field in the HIP header. 3. Calculate the Length field in the HIP header.
4. Compute the HMAC. 4. Compute the HMAC.
5. In case of HMAC_2, remove the HOST_ID TLV from the packet. 5. In case of HMAC_2, remove the HOST_ID parameter from the packet.
6. Add the HMAC TLV to the packet and any HIP_SIGNATURE or 6. Add the HMAC parameter to the packet and any HIP_SIGNATURE or
HIP_SIGNATURE_2 TLVs that may follow. HIP_SIGNATURE_2 parameters that may follow.
7. Recalculate the Length field in the HIP header. 7. Recalculate the Length field in the HIP header.
Packet receiver: Packet receiver:
1. Verify the HIP header Length field. 1. Verify the HIP header Length field.
2. Remove the HMAC or HMAC_2 TLV, and if the packet contains any 2. Remove the HMAC or HMAC_2 parameter, and if the packet contains
HIP_SIGNATURE or HIP_SIGNATURE_2 fields, remove them too, saving any HIP_SIGNATURE or HIP_SIGNATURE_2 fields, remove them too,
the contents if they will be needed later. saving the contents if they will be needed later.
3. In case of HMAC_2, build and add a HOST_ID TLV (with Responder 3. In case of HMAC_2, build and add a HOST_ID parameter (with
information) to the packet. The HOST_ID TLV should be identical Responder information) to the packet. The HOST_ID parameter
to the one previously received from the Responder. should be identical to the one previously received from the
Responder.
4. Recalculate the HIP packet length in the HIP header and clear the 4. Recalculate the HIP packet length in the HIP header and clear the
Checksum field (set it to all zeros). Checksum field (set it to all zeros).
5. Compute the HMAC and verify it against the received HMAC. 5. Compute the HMAC and verify it against the received HMAC.
6. In case of HMAC_2, remove the HOST_ID TLV from the packet before 6. In case of HMAC_2, remove the HOST_ID parameter from the packet
further processing. before further processing.
6.3.2 Signature Calculation 6.4.2. Signature Calculation
The following process applies both to the HIP_SIGNATURE and The following process applies both to the HIP_SIGNATURE and
HIP_SIGNATURE_2 TLVs. When processing HIP_SIGNATURE_2, the only HIP_SIGNATURE_2 parameters. When processing HIP_SIGNATURE_2, the
difference is that instead of HIP_SIGNATURE TLV, the HIP_SIGNATURE_2 only difference is that instead of HIP_SIGNATURE parameter, the
TLV is used, and the Initiator's HIT and PUZZLE Opaque and Random #I HIP_SIGNATURE_2 parameter is used, and the Initiator's HIT and PUZZLE
fields are cleared (set to all zeros) before computing the signature. Opaque and Random #I fields are cleared (set to all zeros) before
The HIP_SIGNATURE TLV is defined in Section 5.2.11 and the computing the signature. The HIP_SIGNATURE parameter is defined in
HIP_SIGNATURE_2 TLV in Section 5.2.12. Section 5.2.11 and the HIP_SIGNATURE_2 parameter in Section 5.2.12.
Signature calculation and verification process: Signature calculation and verification process:
Packet sender: Packet sender:
1. Create the HIP packet without the HIP_SIGNATURE TLV or any TLVs 1. Create the HIP packet without the HIP_SIGNATURE parameter or any
that follow the HIP_SIGNATURE TLV. parameters that follow the HIP_SIGNATURE parameter.
2. Calculate the Length field and zero the Checksum field in the HIP 2. Calculate the Length field and zero the Checksum field in the HIP
header. header.
3. Compute the signature. 3. Compute the signature.
4. Add the HIP_SIGNATURE TLV to the packet. 4. Add the HIP_SIGNATURE parameter to the packet.
5. Add any TLVs that follow the HIP_SIGNATURE TLV. 5. Add any parameters that follow the HIP_SIGNATURE parameter.
6. Recalculate the Length field in the HIP header, and calculate the 6. Recalculate the Length field in the HIP header, and calculate the
Checksum field. Checksum field.
Packet receiver: Packet receiver:
1. Verify the HIP header Length field. 1. Verify the HIP header Length field.
2. Save the contents of the HIP_SIGNATURE TLV and any TLVs following 2. Save the contents of the HIP_SIGNATURE parameter and any
the HIP_SIGNATURE TLV and remove them from the packet. parameters following the HIP_SIGNATURE parameter and remove them
from the packet.
3. Recalculate the HIP packet Length in the HIP header and clear the 3. Recalculate the HIP packet Length in the HIP header and clear the
Checksum field (set it to all zeros). Checksum field (set it to all zeros).
4. Compute the signature and verify it against the received 4. Compute the signature and verify it against the received
signature. signature.
The verification can use either the HI received from a HIP packet, The verification can use either the HI received from a HIP packet,
the HI from a DNS query, if the FQDN has been received in the HOST_ID the HI from a DNS query, if the FQDN has been received in the HOST_ID
packet, or one received by some other means. packet, or one received by some other means.
6.4 HIP KEYMAT Generation 6.5. HIP KEYMAT Generation
HIP keying material is derived from the Diffie-Hellman Kij produced HIP keying material is derived from the Diffie-Hellman Kij produced
during the HIP base exchange. The Initiator has Kij during the during the HIP base exchange. The Initiator has Kij during the
creation of the I2 packet, and the Responder has Kij once it receives creation of the I2 packet, and the Responder has Kij once it receives
the I2 packet. This is why I2 can already contain encrypted the I2 packet. This is why I2 can already contain encrypted
information. information.
The KEYMAT is derived by feeding Kij and the HITs into the following The KEYMAT is derived by feeding Kij and the HITs into the following
operation; the | operation denotes concatenation. operation; the | operation denotes concatenation.
skipping to change at page 63, line 37 skipping to change at page 68, line 43
The number of bits drawn for a given algorithm is the "natural" size The number of bits drawn for a given algorithm is the "natural" size
of the keys. For the mandatory algorithms, the following sizes of the keys. For the mandatory algorithms, the following sizes
apply: apply:
AES 128 bits AES 128 bits
SHA-1 160 bits SHA-1 160 bits
NULL 0 bits NULL 0 bits
6.5 Initiation of a HIP Exchange 6.6. Initiation of a HIP Exchange
An implementation may originate a HIP exchange to another host based An implementation may originate a HIP exchange to another host based
on a local policy decision, usually triggered by an application on a local policy decision, usually triggered by an application
datagram, in much the same way that an IPsec IKE key exchange can datagram, in much the same way that an IPsec IKE key exchange can
dynamically create a Security Association. Alternatively, a system dynamically create a Security Association. Alternatively, a system
may initiate a HIP exchange if it has rebooted or timed out, or may initiate a HIP exchange if it has rebooted or timed out, or
otherwise lost its HIP state, as described in Section 4.5.4. otherwise lost its HIP state, as described in Section 4.5.4.
The implementation prepares an I1 packet and sends it to the IP The implementation prepares an I1 packet and sends it to the IP
address that corresponds to the peer host. The IP address of the address that corresponds to the peer host. The IP address of the
skipping to change at page 64, line 25 skipping to change at page 69, line 30
The selection of which address to use is a local policy decision. The selection of which address to use is a local policy decision.
3. Upon sending an I1, the sender shall transition to state I1-SENT, 3. Upon sending an I1, the sender shall transition to state I1-SENT,
start a timer whose timeout value should be larger than the start a timer whose timeout value should be larger than the
worst-case anticipated RTT, and shall increment a timeout counter worst-case anticipated RTT, and shall increment a timeout counter
associated with the I1. associated with the I1.
4. Upon timeout, the sender SHOULD retransmit the I1 and restart the 4. Upon timeout, the sender SHOULD retransmit the I1 and restart the
timer, up to a maximum of I1_RETRIES_MAX tries. timer, up to a maximum of I1_RETRIES_MAX tries.
6.5.1 Sending Multiple I1s in Parallel 6.6.1. Sending Multiple I1s in Parallel
For the sake of minimizing the session establishment latency, an For the sake of minimizing the session establishment latency, an
implementation MAY send the same I1 to more than one of the implementation MAY send the same I1 to more than one of the
Responder's addresses. However, it MUST NOT send to more than three Responder's addresses. However, it MUST NOT send to more than three
(3) addresses in parallel. Furthermore, upon timeout, the (3) addresses in parallel. Furthermore, upon timeout, the
implementation MUST refrain from sending the same I1 packet to implementation MUST refrain from sending the same I1 packet to
multiple addresses. These limitations are placed order to avoid multiple addresses. These limitations are placed order to avoid
congestion of the network, and potential DoS attacks that might congestion of the network, and potential DoS attacks that might
happen, e.g., because someone claims to have hundreds or thousands of happen, e.g., because someone claims to have hundreds or thousands of
addresses. addresses.
As the Responder is not guaranteed to distinguish the duplicate I1's As the Responder is not guaranteed to distinguish the duplicate I1's
it receives at several of its addresses (because it avoids to store it receives at several of its addresses (because it avoids to store
states when it answers back an R1), the Initiator may receive several states when it answers back an R1), the Initiator may receive several
duplicate R1's. duplicate R1's.
The Initiator SHOULD then select the initial preferred destination The Initiator SHOULD then select the initial preferred destination
address using the source address of the selected received R1, and use address using the source address of the selected received R1, and use
the preferred address as a source address for the I2. Processing the preferred address as a source address for the I2. Processing
rules for received R1s are discussed in Section 6.7. rules for received R1s are discussed in Section 6.8.
6.5.2 Processing Incoming ICMP Protocol Unreachable Messages 6.6.2. Processing Incoming ICMP Protocol Unreachable Messages
A host may receive an ICMP Destination Protocol Unreachable message A host may receive an ICMP Destination Protocol Unreachable message
as a response to sending an HIP I1 packet. Such a packet may be an as a response to sending an HIP I1 packet. Such a packet may be an
indication that the peer does not support HIP, or it may be an indication that the peer does not support HIP, or it may be an
attempt to launch an attack by making the Initiator believe that the attempt to launch an attack by making the Initiator believe that the
Responder does not support HIP. Responder does not support HIP.
When a system receives an ICMP Destination Protocol Unreachable When a system receives an ICMP Destination Protocol Unreachable
message while it is waiting for an R1, it MUST NOT terminate the message while it is waiting for an R1, it MUST NOT terminate the
wait. It MAY continue as if it had not received the ICMP message, wait. It MAY continue as if it had not received the ICMP message,
and send a few more I1s. Alternatively, it MAY take the ICMP message and send a few more I1s. Alternatively, it MAY take the ICMP message
as a hint that the peer most probably does not support HIP, and as a hint that the peer most probably does not support HIP, and
return to state UNASSOCIATED earlier than otherwise. However, at return to state UNASSOCIATED earlier than otherwise. However, at
minimum, it MUST continue waiting for an R1 for a reasonable time minimum, it MUST continue waiting for an R1 for a reasonable time
before returning to UNASSOCIATED. before returning to UNASSOCIATED.
6.6 Processing Incoming I1 Packets 6.7. Processing Incoming I1 Packets
An implementation SHOULD reply to an I1 with an R1 packet, unless the An implementation SHOULD reply to an I1 with an R1 packet, unless the
implementation is unable or unwilling to setup a HIP association. If implementation is unable or unwilling to setup a HIP association. If
the implementation is unable to setup a HIP association, the host the implementation is unable to setup a HIP association, the host
SHOULD send an ICMP Destination Protocol Unreachable, SHOULD send an ICMP Destination Protocol Unreachable,
Administratively Prohibited, message to the I1 source address. If Administratively Prohibited, message to the I1 source address. If
the implementation is unwilling to setup a HIP association, the host the implementation is unwilling to setup a HIP association, the host
MAY ignore the I1. This latter case may occur during a DoS attack MAY ignore the I1. This latter case may occur during a DoS attack
such as an I1 flood. such as an I1 flood.
skipping to change at page 66, line 4 skipping to change at page 71, line 10
2. If the Responder is in ESTABLISHED state, the Responder MAY 2. If the Responder is in ESTABLISHED state, the Responder MAY
respond to this with an R1 packet, prepare to drop existing SAs respond to this with an R1 packet, prepare to drop existing SAs
and stay at ESTABLISHED state. and stay at ESTABLISHED state.
3. If the Responder is in I1-SENT state, it must make a comparison 3. If the Responder is in I1-SENT state, it must make a comparison
between the sender's HIT and its own HIT. If the sender's HIT is between the sender's HIT and its own HIT. If the sender's HIT is
greater than its own HIT, it should drop the I1 and stay at I1- greater than its own HIT, it should drop the I1 and stay at I1-
SENT. If the sender's HIT is smaller than its own HIT, it should SENT. If the sender's HIT is smaller than its own HIT, it should
send R1 and stay at I1-SENT. The HIT comparison goes similarly send R1 and stay at I1-SENT. The HIT comparison goes similarly
as in Section 6.4. as in Section 6.5.
4. If the implementation chooses to respond to the I1 with an R1 4. If the implementation chooses to respond to the I1 with an R1
packet, it creates a new R1 or selects a precomputed R1 according packet, it creates a new R1 or selects a precomputed R1 according
to the format described in Section 5.3.2. to the format described in Section 5.3.2.
5. The R1 MUST contain the received Responder HIT, unless the 5. The R1 MUST contain the received Responder HIT, unless the
received HIT is NULL, in which case the Responder SHOULD select a received HIT is NULL, in which case the Responder SHOULD select a
HIT that is constructed with the MUST algorithm in Section 3, HIT that is constructed with the MUST algorithm in Section 3,
which is currently RSA. Other than that, selecting the HIT is a which is currently RSA. Other than that, selecting the HIT is a
local policy matter. local policy matter.
6. The Responder sends the R1 to the source IP address of the I1 6. The Responder sends the R1 to the source IP address of the I1
packet. packet.
6.6.1 R1 Management 6.7.1. R1 Management
All compliant implementations MUST produce R1 packets. An R1 packet All compliant implementations MUST produce R1 packets. An R1 packet
MAY be precomputed. An R1 packet MAY be reused for time Delta T, MAY be precomputed. An R1 packet MAY be reused for time Delta T,
which is implementation dependent. R1 information MUST not be which is implementation dependent. R1 information MUST not be
discarded until Delta S after T. Time S is the delay needed for the discarded until Delta S after T. Time S is the delay needed for the
last I2 to arrive back to the Responder. last I2 to arrive back to the Responder.
An implementation MAY keep state about received I1s and match the An implementation MAY keep state about received I1s and match the
received I2s against the state, as discussed in Section 4.1.1. received I2s against the state, as discussed in Section 4.1.1.
6.6.2 Handling Malformed Messages 6.7.2. Handling Malformed Messages
If an implementation receives a malformed I1 message, it SHOULD NOT If an implementation receives a malformed I1 message, it SHOULD NOT
respond with a NOTIFY message, as such practice could open up a respond with a NOTIFY message, as such practice could open up a
potential denial-of-service danger. Instead, it MAY respond with an potential denial-of-service danger. Instead, it MAY respond with an
ICMP packet, as defined in Section 5.4. ICMP packet, as defined in Section 5.4.
6.7 Processing Incoming R1 Packets 6.8. Processing Incoming R1 Packets
A system receiving an R1 MUST first check to see if it has sent an I1 A system receiving an R1 MUST first check to see if it has sent an I1
to the originator of the R1 (i.e., it is in state I1-SENT). If so, to the originator of the R1 (i.e., it is in state I1-SENT). If so,
it SHOULD process the R1 as described below, send an I2, and go to it SHOULD process the R1 as described below, send an I2, and go to
state I2-SENT, setting a timer to protect the I2. If the system is state I2-SENT, setting a timer to protect the I2. If the system is
in state I2-SENT, it MAY respond to an R1 if the R1 has a larger R1 in state I2-SENT, it MAY respond to an R1 if the R1 has a larger R1
generation counter; if so, it should drop its state due to processing generation counter; if so, it should drop its state due to processing
the previous R1 and start over from state I1-SENT. If the system is the previous R1 and start over from state I1-SENT. If the system is
in any other state with respect to that host, it SHOULD silently drop in any other state with respect to that host, it SHOULD silently drop
the R1. the R1.
skipping to change at page 67, line 13 skipping to change at page 72, line 17
amount of time after the first R1 reception to allow possibly amount of time after the first R1 reception to allow possibly
multiple R1s to arrive, and it SHOULD respond to an R1 among the set multiple R1s to arrive, and it SHOULD respond to an R1 among the set
with the largest R1 generation counter. with the largest R1 generation counter.
The following steps define the conceptual processing rules for The following steps define the conceptual processing rules for
responding to an R1 packet: responding to an R1 packet:
1. A system receiving an R1 MUST first check to see if it has sent 1. A system receiving an R1 MUST first check to see if it has sent
an I1 to the originator of the R1 (i.e., it has a HIP an I1 to the originator of the R1 (i.e., it has a HIP
association that is in state I1-SENT and that is associated with association that is in state I1-SENT and that is associated with
the HITs in the R1). If so, it should process the R1 as the HITs in the R1. IP addresses in the received R1 packet
described below. SHOULD be ignored and the match SHOULD be based on HITs only).
If so, it should process the R1 as described below. Note that
when the connection was initialized in opportunistic mode, HITs
cannot be used, but the Initiator must rely on the Responder's
IP address in the received R1 packet.
2. Otherwise, if the system is in any other state than I1-SENT or 2. Otherwise, if the system is in any other state than I1-SENT or
I2-SENT with respect to the HITs included in the R1, it SHOULD I2-SENT with respect to the HITs included in the R1, it SHOULD
silently drop the R1 and remain in the current state. silently drop the R1 and remain in the current state.
3. If the HIP association state is I1-SENT or I2-SENT, the received 3. If the HIP association state is I1-SENT or I2-SENT, the received
Initiator's HIT MUST correspond to the HIT used in the original, Initiator's HIT MUST correspond to the HIT used in the original,
I1 and the Responder's HIT MUST correspond to the one used, I1 and the Responder's HIT MUST correspond to the one used,
unless the I1 contained a NULL HIT. unless the I1 contained a NULL HIT.
skipping to change at page 67, line 48 skipping to change at page 73, line 8
state UNASSOCIATED. The system SHOULD consider dropping the R1 state UNASSOCIATED. The system SHOULD consider dropping the R1
only if it used a NULL HIT in I1. If the A bit is set, the only if it used a NULL HIT in I1. If the A bit is set, the
Responder's HIT is anonymous and should not be stored. Responder's HIT is anonymous and should not be stored.
8. The system SHOULD attempt to validate the HIT against the 8. The system SHOULD attempt to validate the HIT against the
received Host Identity. received Host Identity.
9. The system MUST store the received R1 generation counter for 9. The system MUST store the received R1 generation counter for
future reference. future reference.
10. The system attempts to solve the cookie puzzle in R1. The 10. The system attempts to solve the puzzle in R1. The system MUST
system MUST terminate the search after exceeding the remaining terminate the search after exceeding the remaining lifetime of
lifetime of the puzzle. If the cookie puzzle is not the puzzle. If the puzzle is not successfully solved, the
successfully solved, the implementation may either resend I1 implementation may either resend I1 within the retry bounds or
within the retry bounds or abandon the HIP exchange. abandon the HIP exchange.
11. The system computes standard Diffie-Hellman keying material 11. The system computes standard Diffie-Hellman keying material
according to the public value and Group ID provided in the according to the public value and Group ID provided in the
DIFFIE_HELLMAN parameter. The Diffie-Hellman keying material DIFFIE_HELLMAN parameter. The Diffie-Hellman keying material
Kij is used for key extraction as specified in Section 6.4. If Kij is used for key extraction as specified in Section 6.5. If
the received Diffie-Hellman Group ID is not supported, the the received Diffie-Hellman Group ID is not supported, the
implementation may either resend I1 within the retry bounds or implementation may either resend I1 within the retry bounds or
abandon the HIP exchange. abandon the HIP exchange.
12. The system selects the HIP transform from the choices presented 12. The system selects the HIP transform from the choices presented
in the R1 packet and uses the selected values subsequently when in the R1 packet and uses the selected values subsequently when
generating and using encryption keys, and when sending the I2. generating and using encryption keys, and when sending the I2.
If the proposed alternatives are not acceptable to the system, If the proposed alternatives are not acceptable to the system,
it may either resend I1 within the retry bounds or abandon the it may either resend I1 within the retry bounds or abandon the
HIP exchange. HIP exchange.
skipping to change at page 68, line 37 skipping to change at page 73, line 45
15. The system SHOULD start a timer whose timeout value should be 15. The system SHOULD start a timer whose timeout value should be
larger than the worst-case anticipated RTT, and MUST increment a larger than the worst-case anticipated RTT, and MUST increment a
timeout counter associated with the I2. The sender SHOULD timeout counter associated with the I2. The sender SHOULD
retransmit the I2 upon a timeout and restart the timer, up to a retransmit the I2 upon a timeout and restart the timer, up to a
maximum of I2_RETRIES_MAX tries. maximum of I2_RETRIES_MAX tries.
16. If the system is in state I1-SENT, it shall transition to state 16. If the system is in state I1-SENT, it shall transition to state
I2-SENT. If the system is in any other state, it remains in the I2-SENT. If the system is in any other state, it remains in the
current state. current state.
6.7.1 Handling Malformed Messages 6.8.1. Handling Malformed Messages
If an implementation receives a malformed R1 message, it MUST If an implementation receives a malformed R1 message, it MUST
silently drop the packet. Sending a NOTIFY or ICMP would not help, silently drop the packet. Sending a NOTIFY or ICMP would not help,
as the sender of the R1 typically doesn't have any state. An as the sender of the R1 typically doesn't have any state. An
implementation SHOULD wait for some more time for a possible good R1, implementation SHOULD wait for some more time for a possible good R1,
after which it MAY try again by sending a new I1 packet. after which it MAY try again by sending a new I1 packet.
6.8 Processing Incoming I2 Packets 6.9. Processing Incoming I2 Packets
Upon receipt of an I2, the system MAY perform initial checks to Upon receipt of an I2, the system MAY perform initial checks to
determine whether the I2 corresponds to a recent R1 that has been determine whether the I2 corresponds to a recent R1 that has been
sent out, if the Responder keeps such state. For example, the sender sent out, if the Responder keeps such state. For example, the sender
could check whether the I2 is from an address or HIT that has could check whether the I2 is from an address or HIT that has
recently received an R1 from it. The R1 may have had Opaque data recently received an R1 from it. The R1 may have had Opaque data
included that was echoed back in the I2. If the I2 is considered to included that was echoed back in the I2. If the I2 is considered to
be suspect, it MAY be silently discarded by the system. be suspect, it MAY be silently discarded by the system.
Otherwise, the HIP implementation SHOULD process the I2. This Otherwise, the HIP implementation SHOULD process the I2. This
includes validation of the cookie puzzle solution, generating the includes validation of the puzzle solution, generating the Diffie-
Diffie-Hellman key, decrypting the Initiator's Host Identity, Hellman key, decrypting the Initiator's Host Identity, verifying the
verifying the signature, creating state, and finally sending an R2. signature, creating state, and finally sending an R2.
The following steps define the conceptual processing rules for The following steps define the conceptual processing rules for
responding to an I2 packet: responding to an I2 packet:
1. The system MAY perform checks to verify that the I2 corresponds 1. The system MAY perform checks to verify that the I2 corresponds
to a recently sent R1. Such checks are implementation to a recently sent R1. Such checks are implementation
dependent. See Appendix C for a description of an example dependent. See Appendix A for a description of an example
implementation. implementation.
2. The system MUST check that the Responder's HIT corresponds to 2. The system MUST check that the Responder's HIT corresponds to
one of its own HITs. one of its own HITs.
3. If the system is in the R2-SENT state, it MAY check if the newly 3. If the system is in the R2-SENT state, it MAY check if the newly
received I2 is similar to the one that triggered moving to R2- received I2 is similar to the one that triggered moving to R2-
SENT. If so, it MAY retransmit a previously sent R2, reset the SENT. If so, it MAY retransmit a previously sent R2, reset the
R2-SENT timer, and stay in R2-SENT. R2-SENT timer, and stay in R2-SENT.
4. If the system is in the I2-SENT state, it makes a comparison 4. If the system is in the I2-SENT state, it makes a comparison
between its local and sender's HITs (similarly as in between its local and sender's HITs (similarly as in
Section 6.4). If the local HIT is smaller than the sender's Section 6.5). If the local HIT is smaller than the sender's
HIT, it should drop the I2 packet. Otherwise, the system should HIT, it should drop the I2 packet. Otherwise, the system should
process the received I2 packet. process the received I2 packet.
5. To avoid the possibility to end up with different session keys 5. To avoid the possibility to end up with different session keys
due to symmetric operation of the peer nodes, the Diffie-Hellman due to symmetric operation of the peer nodes, the Diffie-Hellman
key, I, and J selection is also based on the HIT comparison. If key, I, and J selection is also based on the HIT comparison. If
the local HIT is smaller than the peer HIT, the system uses peer the local HIT is smaller than the peer HIT, the system uses peer
Diffie-Hellman key and nonce I from the R1 packet received Diffie-Hellman key and nonce I from the R1 packet received
earlier. The local Diffie-Hellman key and nonce J are taken earlier. The local Diffie-Hellman key and nonce J are taken
from the I2 packet sent to the peer earlier. Otherwise, it uses from the I2 packet sent to the peer earlier. Otherwise, it uses
skipping to change at page 70, line 5 skipping to change at page 75, line 12
The local Diffie-Hellman key and nonce I are the ones that it The local Diffie-Hellman key and nonce I are the ones that it
sent ealier in the R1 packet. sent ealier in the R1 packet.
6. If the system is in any other state than R2-SENT, it SHOULD 6. If the system is in any other state than R2-SENT, it SHOULD
check that the echoed R1 generation counter in I2 is within the check that the echoed R1 generation counter in I2 is within the
acceptable range. Implementations MUST accept puzzles from the acceptable range. Implementations MUST accept puzzles from the
current generation and MAY accept puzzles from earlier current generation and MAY accept puzzles from earlier
generations. If the newly received I2 is outside the accepted generations. If the newly received I2 is outside the accepted
range, the I2 is stale (perhaps replayed) and SHOULD be dropped. range, the I2 is stale (perhaps replayed) and SHOULD be dropped.
7. The system MUST validate the solution to the cookie puzzle by 7. The system MUST validate the solution to the puzzle by computing
computing the SHA-1 hash described in Section 5.3.3. the hash described in Section 5.3.3 using the same hash
algorithm used to generate the Responder's HIT.
8. The I2 MUST have a single value in the HIP_TRANSFORM parameter, 8. The I2 MUST have a single value in the HIP_TRANSFORM parameter,
which MUST match one of the values offered to the Initiator in which MUST match one of the values offered to the Initiator in
the R1 packet. the R1 packet.
9. The system must derive Diffie-Hellman keying material Kij based 9. The system must derive Diffie-Hellman keying material Kij based
on the public value and Group ID in the DIFFIE_HELLMAN on the public value and Group ID in the DIFFIE_HELLMAN
parameter. This key is used to derive the HIP association keys, parameter. This key is used to derive the HIP association keys,
as described in Section 6.4. If the Diffie-Hellman Group ID is as described in Section 6.5. If the Diffie-Hellman Group ID is
unsupported, the I2 packet is silently dropped. unsupported, the I2 packet is silently dropped.
10. The encrypted HOST_ID decrypted by the Initiator encryption key 10. The encrypted HOST_ID decrypted by the Initiator encryption key
defined in Section 6.4. If the decrypted data is not a HOST_ID defined in Section 6.5. If the decrypted data is not a HOST_ID
parameter, the I2 packet is silently dropped. parameter, the I2 packet is silently dropped.
11. The implementation SHOULD also verify that the Initiator's HIT 11. The implementation SHOULD also verify that the Initiator's HIT
in the I2 corresponds to the Host Identity sent in the I2. in the I2 corresponds to the Host Identity sent in the I2.
12. The system MUST verify the HMAC according to the procedures in 12. The system MUST verify the HMAC according to the procedures in
Section 5.2.9. Section 5.2.9.
13. The system MUST verify the HIP_SIGNATURE according to 13. The system MUST verify the HIP_SIGNATURE according to
Section 5.2.11 and Section 5.3.3. Section 5.2.11 and Section 5.3.3.
skipping to change at page 71, line 9 skipping to change at page 76, line 17
old HIP association is dropped and a new one is installed, an R2 old HIP association is dropped and a new one is installed, an R2
is sent, and the state machine transitions to R2-SENT. is sent, and the state machine transitions to R2-SENT.
19. Upon transitioning to R2-SENT, start a timer. Move to 19. Upon transitioning to R2-SENT, start a timer. Move to
ESTABLISHED if some data has been received on the incoming HIP ESTABLISHED if some data has been received on the incoming HIP
association, or an UPDATE packet has been received (or some association, or an UPDATE packet has been received (or some
other packet that indicates that the peer has moved to other packet that indicates that the peer has moved to
ESTABLISHED). If the timer expires (allowing for maximal ESTABLISHED). If the timer expires (allowing for maximal
retransmissions of I2s), move to UNASSOCIATED. retransmissions of I2s), move to UNASSOCIATED.
6.8.1 Handling Malformed Messages 6.9.1. Handling Malformed Messages
If an implementation receives a malformed I2 message, the behavior If an implementation receives a malformed I2 message, the behavior
SHOULD depend on how much checks the message has already passed. If SHOULD depend on how much checks the message has already passed. If
the puzzle solution in the message has already been checked, the the puzzle solution in the message has already been checked, the
implementation SHOULD report the error by responding with a NOTIFY implementation SHOULD report the error by responding with a NOTIFY
packet. Otherwise the implementation MAY respond with an ICMP packet. Otherwise the implementation MAY respond with an ICMP
message as defined in Section 5.4. message as defined in Section 5.4.
6.9 Processing Incoming R2 Packets 6.10. Processing Incoming R2 Packets
An R2 received in states UNASSOCIATED, I1-SENT, ESTABLISHED, or An R2 received in states UNASSOCIATED, I1-SENT, or ESTABLISHED
REKEYING results in the R2 being dropped and the state machine results in the R2 being dropped and the state machine staying in the
staying in the same state. If an R2 is received in state I2-SENT, it same state. If an R2 is received in state I2-SENT, it SHOULD be
SHOULD be processed. processed.
The following steps define the conceptual processing rules for The following steps define the conceptual processing rules for
incoming R2 packet: incoming R2 packet:
1. The system MUST verify that the HITs in use correspond to the 1. The system MUST verify that the HITs in use correspond to the
HITs that were received in R1. HITs that were received in R1.
2. The system MUST verify the HMAC_2 according to the procedures in 2. The system MUST verify the HMAC_2 according to the procedures in
Section 5.2.10. Section 5.2.10.
skipping to change at page 71, line 47 skipping to change at page 77, line 8
4. If any of the checks above fail, there is a high probability of 4. If any of the checks above fail, there is a high probability of
an ongoing man-in-the-middle or other security attack. The an ongoing man-in-the-middle or other security attack. The
system SHOULD act accordingly, based on its local policy. system SHOULD act accordingly, based on its local policy.
5. If the system is in any other state than I2-SENT, the R2 is 5. If the system is in any other state than I2-SENT, the R2 is
silently dropped. silently dropped.
6. Upon successful processing of the R2, the state machine moves to 6. Upon successful processing of the R2, the state machine moves to
state ESTABLISHED. state ESTABLISHED.
6.10 Sending UPDATE Packets 6.11. Sending UPDATE Packets
A host sends an UPDATE packet when it wants to update some A host sends an UPDATE packet when it wants to update some
information related to a HIP association. There are a number of information related to a HIP association. There are a number of
likely situations, e.g. mobility management and rekeying of an likely situations, e.g. mobility management and rekeying of an
existing ESP Security Association. The following paragraphs define existing ESP Security Association. The following paragraphs define
the conceptual rules for sending an UPDATE packet to the peer. the conceptual rules for sending an UPDATE packet to the peer.
Additional steps can be defined in other documents where the UPDATE Additional steps can be defined in other documents where the UPDATE
packet is used. packet is used.
1. The system increments its own Update ID value by one. 1. The system increments its own Update ID value by one.
skipping to change at page 72, line 25 skipping to change at page 77, line 32
include an ACK of the Update ID found in a received UPDATE SEQ include an ACK of the Update ID found in a received UPDATE SEQ
parameter, if any. parameter, if any.
3. The system sends the created UPDATE packet and starts an UPDATE 3. The system sends the created UPDATE packet and starts an UPDATE
timer. The default value for the timer is 2 * RTT estimate. timer. The default value for the timer is 2 * RTT estimate.
4. If the UPDATE timer expires, the UPDATE is resent. The UPDATE 4. If the UPDATE timer expires, the UPDATE is resent. The UPDATE
can be resent UPDATE_RETRY_MAX times. The UPDATE timer SHOULD be can be resent UPDATE_RETRY_MAX times. The UPDATE timer SHOULD be
exponentially backed off for subsequent retransmissions. exponentially backed off for subsequent retransmissions.
6.11 Receiving UPDATE Packets 6.12. Receiving UPDATE Packets
When a system receives an UPDATE packet, its processing depends on When a system receives an UPDATE packet, its processing depends on
the state of the HIP association and the presence of and values of the state of the HIP association and the presence of and values of
the SEQ and ACK parameters. Typically, an UPDATE message also the SEQ and ACK parameters. Typically, an UPDATE message also
carries optional parameters whose handling is defined in separate carries optional parameters whose handling is defined in separate
documents. documents.
1. If there is no corresponding HIP association, the implementation 1. If there is no corresponding HIP association, the implementation
MAY reply with an ICMP Parameter Problem, as specified in MAY reply with an ICMP Parameter Problem, as specified in
Section 5.4.4. Section 5.4.4.
2. If the association is in the ESTABLISHED state and the SEQ 2. If the association is in the ESTABLISHED state and the SEQ
parameter is present, the UPDATE is processed and replied as parameter is present, the UPDATE is processed and replied as
described in Section 6.11.1. described in Section 6.12.1.
3. Additionally (or alternatively), if the association is in the 3. Additionally (or alternatively), if the association is in the
ESTABLISHED state and there is an ACK (of outstanding Update ID) ESTABLISHED state and there is an ACK (of outstanding Update ID)
in the UPDATE, the UPDATE is processed as described in in the UPDATE, the UPDATE is processed as described in
Section 6.11.2. Section 6.12.2.
6.12.1. Handling a SEQ parameter in a received UPDATE message
6.11.1 Handling a SEQ paramaeter in a received UPDATE message
1. If the Update ID in the received SEQ is smaller than the stored 1. If the Update ID in the received SEQ is smaller than the stored
Update ID for the peer host, the packet MUST BE dropped as a Update ID for the peer host, the packet MUST BE dropped as a
duplicate. duplicate.
2. If the Update ID in the received SEQ is equal to the stored 2. If the Update ID in the received SEQ is equal to the stored
Update ID for the host, the packet is treated as a Update ID for the host, the packet is treated as a
retransmission. The HMAC verification (next step) MUST NOT be retransmission. The HMAC verification (next step) MUST NOT be
skipped. (A byte-by-byte comparison of the received and a stored skipped. (A byte-by-byte comparison of the received and a stored
packet would be OK, though.) It is recommended that a host cache packet would be OK, though.) It is recommended that a host cache
the last packet that was acked to avoid the cost of generating a the last packet that was acked to avoid the cost of generating a
skipping to change at page 73, line 33 skipping to change at page 78, line 36
verification fails, the packet SHOULD be dropped and an error verification fails, the packet SHOULD be dropped and an error
message logged. message logged.
5. If a new SEQ parameter is being processed, the system MUST record 5. If a new SEQ parameter is being processed, the system MUST record
the Update ID in the received SEQ parameter, for replay the Update ID in the received SEQ parameter, for replay
protection. protection.
6. An UPDATE acknowledgement packet with ACK parameter is prepared 6. An UPDATE acknowledgement packet with ACK parameter is prepared
and sent to the peer. and sent to the peer.
6.11.2 Handling an ACK Parameter in a Received UPDATE Packet 6.12.2. Handling an ACK Parameter in a Received UPDATE Packet
1. The UPDATE packet with ACK must match with an earlier sent UPDATE 1. The UPDATE packet with ACK must match with an earlier sent UPDATE
packet. If no match is found, the packet MUST be dropped. packet. If no match is found, the packet MUST be dropped.
2. The system MUST verify the HMAC in the UPDATE packet. If the 2. The system MUST verify the HMAC in the UPDATE packet. If the
verification fails, the packet MUST be dropped. verification fails, the packet MUST be dropped.
3. The system MAY verify the SIGNATURE in the UPDATE packet. If the 3. The system MAY verify the SIGNATURE in the UPDATE packet. If the
verification fails, the packet SHOULD be dropped and an error verification fails, the packet SHOULD be dropped and an error
message logged. message logged.
4. The corresponding UPDATE timer is stopped (see Section 6.10) so 4. The corresponding UPDATE timer is stopped (see Section 6.11) so
that the now acknowledged UPDATE is no longer retransmitted. that the now acknowledged UPDATE is no longer retransmitted.
6.12 Processing NOTIFY Packets 6.13. Processing NOTIFY Packets
Processing NOTIFY packets is OPTIONAL. If processed, any errors Processing NOTIFY packets is OPTIONAL. If processed, any errors
noted by the NOTIFY parameter SHOULD be taken into account by the HIP noted by the NOTIFY parameter SHOULD be taken into account by the HIP
state machine (e.g., by terminating a HIP handshake), and the error state machine (e.g., by terminating a HIP handshake), and the error
SHOULD be logged. SHOULD be logged.
6.13 Processing CLOSE Packets 6.14. Processing CLOSE Packets
When the host receives a CLOSE message it responds with a CLOSE_ACK When the host receives a CLOSE message it responds with a CLOSE_ACK
message and moves to CLOSED state. (The authenticity of the CLOSE message and moves to CLOSED state. (The authenticity of the CLOSE
message is verified using both HMAC and SIGNATURE). This processing message is verified using both HMAC and SIGNATURE). This processing
applies whether or not the HIP association state is CLOSING in order applies whether or not the HIP association state is CLOSING in order
to handle CLOSE messages from both ends crossing in flight. to handle CLOSE messages from both ends crossing in flight.
The HIP association is not discarded before the host moves from the The HIP association is not discarded before the host moves from the
UNASSOCIATED state. UNASSOCIATED state.
Once the closing process has started, any need to send data packets Once the closing process has started, any need to send data packets
will trigger creating and establishing of a new HIP association, will trigger creating and establishing of a new HIP association,
starting with sending an I1. starting with sending an I1.
If there is no corresponding HIP association, the implementation MAY If there is no corresponding HIP association, the CLOSE packet is
reply to a CLOSE with an ICMP Parameter Problem, as specified in dropped.
Section 5.4.4.
6.14 Processing CLOSE_ACK Packets 6.15. Processing CLOSE_ACK Packets
When a host receives a CLOSE_ACK message it verifies that it is in When a host receives a CLOSE_ACK message it verifies that it is in
CLOSING or CLOSED state and that the CLOSE_ACK was in response to the CLOSING or CLOSED state and that the CLOSE_ACK was in response to the
CLOSE (using the included ECHO_REPLY in response to the sent CLOSE (using the included ECHO_REPLY in response to the sent
ECHO_REQUEST). ECHO_REQUEST).
The CLOSE_ACK uses HMAC and SIGNATURE for verification. The state is The CLOSE_ACK uses HMAC and SIGNATURE for verification. The state is
discarded when the state changes to UNASSOCIATED and, after that, discarded when the state changes to UNASSOCIATED and, after that, the
NOTIFY is sent as a response to a CLOSE message. host MAY respond with an ICMP Parameter Problem to an incoming CLOSE
message (See Section 5.4.4).
6.15 Dropping HIP Associations 6.16. Dropping HIP Associations
A HIP implementation is free to drop a HIP association at any time, A HIP implementation is free to drop a HIP association at any time,
based on its own policy. If a HIP host decides to drop a HIP based on its own policy. If a HIP host decides to drop a HIP
association, it deletes the corresponding HIP state, including the association, it deletes the corresponding HIP state, including the
keying material. The implementation MUST also drop the peer's R1 keying material. The implementation MUST also drop the peer's R1
generation counter value, unless a local policy explicitly defines generation counter value, unless a local policy explicitly defines
that the value of that particular host is stored. An implementation that the value of that particular host is stored. An implementation
MUST NOT store R1 generation counters by default, but storing R1 MUST NOT store R1 generation counters by default, but storing R1
generation counter values, if done, MUST be configured by explicit generation counter values, if done, MUST be configured by explicit
HITs. HITs.
skipping to change at page 75, line 17 skipping to change at page 80, line 17
There are a number of variables that will influence the HIP exchanges There are a number of variables that will influence the HIP exchanges
that each host must support. All HIP implementations MUST support that each host must support. All HIP implementations MUST support
more than one simultaneous HIs, at least one of which SHOULD be more than one simultaneous HIs, at least one of which SHOULD be
reserved for anonymous usage. Although anonymous HIs will be rarely reserved for anonymous usage. Although anonymous HIs will be rarely
used as Responder HIs, they will be common for Initiators. Support used as Responder HIs, they will be common for Initiators. Support
for more than two HIs is RECOMMENDED. for more than two HIs is RECOMMENDED.
Many Initiators would want to use a different HI for different Many Initiators would want to use a different HI for different
Responders. The implementations SHOULD provide for an ACL of Responders. The implementations SHOULD provide for an ACL of
Initiator HIT to Responder HIT. This ACL SHOULD also include Initiator HIT to Responder HIT. This ACL SHOULD also include
preferred transform and local lifetimes. For HITs with HAAs, preferred transform and local lifetimes.
wildcarding SHOULD be supported. Thus if a Community of Interest,
like Banking, gets a HAA, a single ACL could be used. A global
wildcard would represent the general policy to be used. Policy
selection would be from most specific to most general.
The value of K used in the HIP R1 packet can also vary by policy. K The value of K used in the HIP R1 packet can also vary by policy. K
should never be greater than 20, but for trusted partners it could be should never be greater than 20, but for trusted partners it could be
as low as 0. as low as 0.
Responders would need a similar ACL, representing which hosts they Responders would need a similar ACL, representing which hosts they
accept HIP exchanges, and the preferred transform and local accept HIP exchanges, and the preferred transform and local
lifetimes. Wildcarding SHOULD be supported for this ACL also. lifetimes. Wildcarding SHOULD be supported for this ACL also.
8. Security Considerations 8. Security Considerations
skipping to change at page 77, line 20 skipping to change at page 82, line 20
these messages and discard the associated state (for e.g., these messages and discard the associated state (for e.g.,
firewalling, SPI-based NATing, etc.). However, the optional behavior firewalling, SPI-based NATing, etc.). However, the optional behavior
of replying to CLOSE with an ICMP Parameter Problem packet (as of replying to CLOSE with an ICMP Parameter Problem packet (as
described in Section 5.4.4) might allow an IP spoofer sending CLOSE described in Section 5.4.4) might allow an IP spoofer sending CLOSE
messages to launch reflection attacks. messages to launch reflection attacks.
A fifth form of DoS attack is replaying R1s to cause the Initiator to A fifth form of DoS attack is replaying R1s to cause the Initiator to
solve stale puzzles and become out of synchronization with the solve stale puzzles and become out of synchronization with the
Responder. The R1 generation counter is a monotonically increasing Responder. The R1 generation counter is a monotonically increasing
counter designed to protect against this attack, as described in counter designed to protect against this attack, as described in
section Section 4.1.3. section Section 4.1.4.
Man-in-the-middle attacks are difficult to defend against, without Man-in-the-middle attacks are difficult to defend against, without
third-party authentication. A skillful MitM could easily handle all third-party authentication. A skillful MitM could easily handle all
parts of HIP; but HIP indirectly provides the following protection parts of HIP; but HIP indirectly provides the following protection
from a MitM attack. If the Responder's HI is retrieved from a signed from a MitM attack. If the Responder's HI is retrieved from a signed
DNS zone, a certificate, or through some other secure means, the DNS zone, a certificate, or through some other secure means, the
Initiator can use this to validate the R1 HIP packet. Initiator can use this to validate the R1 HIP packet.
Likewise, if the Initiator's HI is in a secure DNS zone, a trusted Likewise, if the Initiator's HI is in a secure DNS zone, a trusted
certificate, or otherwise securely available, the Responder can certificate, or otherwise securely available, the Responder can
skipping to change at page 79, line 7 skipping to change at page 84, line 7
the spoofed IP address does not support HIP. The Responder SHOULD the spoofed IP address does not support HIP. The Responder SHOULD
NOT act on this ICMP message to remove the minimal state from the R1 NOT act on this ICMP message to remove the minimal state from the R1
HIP packet (if it has one), but wait for either a valid I2 HIP packet HIP packet (if it has one), but wait for either a valid I2 HIP packet
or the natural timeout of the R1 HIP packet. This is to allow for a or the natural timeout of the R1 HIP packet. This is to allow for a
sophisticated attacker that is trying to break up the HIP exchange. sophisticated attacker that is trying to break up the HIP exchange.
Likewise, the Initiator should ignore any ICMP message while waiting Likewise, the Initiator should ignore any ICMP message while waiting
for an R2 HIP packet, deleting state only after a natural timeout. for an R2 HIP packet, deleting state only after a natural timeout.
9. IANA Considerations 9. IANA Considerations
This document defines a new IP Protocol number to be used for HIP. This document specifies the IP protocol number 253 to be used with
This protocol has been assigned the number < To Be Assigned by IANA Host Identity Protocol during the experimental phase. This number
-- for testing purposes, the protocol number 99 is currently used >. has been reserved by IANA for experimental use (see [19].
This document defines a new 128-bit value under the CGA Message Type
namespace [20], 0xF0EF F02F BFF4 3D0F E793 0C3C 6E61 74EA.
This document also creates a set of new name spaces. These are This document also creates a set of new name spaces. These are
described below. described below.
Packet Type Packet Type
The 8-bit Packet Type field in a HIP protocol packet describes the The 7-bit Packet Type field in a HIP protocol packet describes the
type of a HIP protocol message. It is defined in Section 5.1. type of a HIP protocol message. It is defined in Section 5.1.
The current values are defined in Section 5.3.1 through The current values are defined in Section 5.3.1 through
Section 5.3.8 and are listed below: Section 5.3.8 and are listed below:
* I1 is 1. * I1 is 1.
* R1 is 2. * R1 is 2.
* I2 is 3. * I2 is 3.
* R2 is 4. * R2 is 4.
* UPDATE is 6. * UPDATE is 16.
* NOTIFY is 7. * NOTIFY is 17.
* CLOSE is 8. * CLOSE is 18.
* CLOSE_ACK is 9. * CLOSE_ACK is 19.
New values are assigned through IETF Consensus [10]. New values are assigned through IETF Consensus [9].
HIP Version HIP Version
The four bit Version field in a HIP protocol packet describes the The four bit Version field in a HIP protocol packet describes the
version of the HIP protocol. It is defined in Section 5.1. The version of the HIP protocol. It is defined in Section 5.1. The
only currently defined value is 1. New values are assigned only currently defined value is 1. New values are assigned
through IETF Consensus. through IETF Consensus.
HIT Type
The three bit HIT Type values appear in the Sender's HIT Type and
Destinations's HIT Type fields the Controls field in a HIP
protocol packet. They are defined in in Section 5.1 and the
currently defined values are listed below:
* Type 1 HIT is 1.
* Type 2 HIT is 2.
* Values 0 and 7 are reserved.
New values either from the unassigned or reserved space are
assigned through IETF Consensus.
Parameter Type Parameter Type
The 16 bit Type field in a HIP parameters describes the type of The 16 bit Type field in a HIP parameters describes the type of
the parameter. It is defined in Section 5.2.1. The current the parameter. It is defined in Section 5.2.1. The current
values are defined in Section 5.2.3 through Section 5.2.18 and are values are defined in Section 5.2.3 through Section 5.2.18 and are
listed below: listed below:
* R1_COUNTER is 128. * R1_COUNTER is 128.
* PUZZLE is 257. * PUZZLE is 257.
skipping to change at page 81, line 22 skipping to change at page 86, line 9
for future base protocol extensions, and are assigned through IETF for future base protocol extensions, and are assigned through IETF
Consensus. Consensus.
The type codes 32768 through 49141 are reserved for The type codes 32768 through 49141 are reserved for
experimentation and private use. Types SHOULD be selected in a experimentation and private use. Types SHOULD be selected in a
random fashion from this range, thereby reducing the probability random fashion from this range, thereby reducing the probability
of collisions. A method employing genuine randomness (such as of collisions. A method employing genuine randomness (such as
flipping a coin) SHOULD be used. flipping a coin) SHOULD be used.
All other type codes are assigned through First Come First Served, All other type codes are assigned through First Come First Served,
with Specification Required [10]. with Specification Required [9].
Group ID Group ID
The eight bit Group ID values appear in the DIFFIE_HELLMAN The eight bit Group ID values appear in the DIFFIE_HELLMAN
parameter, defined in Section 5.2.6. The currently defined values parameter, defined in Section 5.2.6. The currently defined values
are listed below: are listed below:
* 384-bit group is 1. * 384-bit group is 1.
* OAKLEY well known group 1 is 2. * OAKLEY well known group 1 is 2.
skipping to change at page 84, line 22 skipping to change at page 89, line 22
importantly, its design goals are articulated and are different from importantly, its design goals are articulated and are different from
other efforts in this direction. Particular mention goes to the other efforts in this direction. Particular mention goes to the
members of the NameSpace Research Group of the IRTF. Noel Chiappa members of the NameSpace Research Group of the IRTF. Noel Chiappa
provided the framework for LSIs and Keith Moore the impetus to provided the framework for LSIs and Keith Moore the impetus to
provide resolvability. Steve Deering provided encouragement to keep provide resolvability. Steve Deering provided encouragement to keep
working, as a solid proposal can act as a proof of ideas for a working, as a solid proposal can act as a proof of ideas for a
research group. research group.
Many others contributed; extensive security tips were provided by Many others contributed; extensive security tips were provided by
Steve Bellovin. Rob Austein kept the DNS parts on track. Paul Steve Bellovin. Rob Austein kept the DNS parts on track. Paul
Kocher taught Bob Moskowitz how to make the cookie exchange expensive Kocher taught Bob Moskowitz how to make the puzzle exchange expensive
for the Initiator to respond, but easy for the Responder to validate. for the Initiator to respond, but easy for the Responder to validate.
Bill Sommerfeld supplied the Birthday concept, which later evolved Bill Sommerfeld supplied the Birthday concept, which later evolved
into the R1 generation counter, to simplify reboot management. Erik into the R1 generation counter, to simplify reboot management. Erik
Nordmark supplied CLOSE-mechanism for closing connections. Rodney Nordmark supplied CLOSE-mechanism for closing connections. Rodney
Thayer and Hugh Daniels provide extensive feedback. In the early Thayer and Hugh Daniels provide extensive feedback. In the early
times of this draft, John Gilmore kept Bob Moskowitz challenged to times of this draft, John Gilmore kept Bob Moskowitz challenged to
provide something of value. provide something of value.
During the later stages of this document, when the editing baton was During the later stages of this document, when the editing baton was
transfered to Pekka Nikander, the input from the early implementors transfered to Pekka Nikander, the input from the early implementors
skipping to change at page 85, line 7 skipping to change at page 90, line 7
Once the HIP Working Group was founded in early 2004, a number of Once the HIP Working Group was founded in early 2004, a number of
changes were introduced through the working group process. Most changes were introduced through the working group process. Most
notably, the original draft was split in two, one containing the base notably, the original draft was split in two, one containing the base
exchange and the other one defining how to use ESP. Some exchange and the other one defining how to use ESP. Some
modifications to the protocol proposed by Aura et al. [29] were added modifications to the protocol proposed by Aura et al. [29] were added
at a later stage. at a later stage.
11. References 11. References
11.1 Normative References 11.1. Normative References
[1] Postel, J., "User Datagram Protocol", STD 6, RFC 768, [1] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
August 1980. August 1980.
[2] Postel, J., "Internet Control Message Protocol", STD 5, [2] Postel, J., "Internet Control Message Protocol", STD 5,
RFC 792, September 1981. RFC 792, September 1981.
[3] Mockapetris, P., "Domain names - implementation and [3] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, November 1987. specification", STD 13, RFC 1035, November 1987.
[4] Conta, A. and S. Deering, "Internet Control Message Protocol [4] Conta, A. and S. Deering, "Internet Control Message Protocol
(ICMPv6) for the Internet Protocol Version 6 (IPv6)", RFC 1885, (ICMPv6) for the Internet Protocol Version 6 (IPv6)", RFC 1885,
December 1995. December 1995.
[5] Bradner, S., "Key words for use in RFCs to Indicate Requirement [5] Bradner, S., "Key words for use in RFCs to Indicate Requirement
Levels", BCP 14, RFC 2119, March 1997. Levels", BCP 14, RFC 2119, March 1997.
[6] Madson, C. and R. Glenn, "The Use of HMAC-SHA-1-96 within ESP [6] Madson, C. and R. Glenn, "The Use of HMAC-SHA-1-96 within ESP
and AH", RFC 2404, November 1998. and AH", RFC 2404, November 1998.
[7] Maughan, D., Schneider, M., and M. Schertler, "Internet [7] Harkins, D. and D. Carrel, "The Internet Key Exchange (IKE)",
Security Association and Key Management Protocol (ISAKMP)",
RFC 2408, November 1998.
[8] Harkins, D. and D. Carrel, "The Internet Key Exchange (IKE)",
RFC 2409, November 1998. RFC 2409, November 1998.
[9] Orman, H., "The OAKLEY Key Determination Protocol", RFC 2412, [8] Orman, H., "The OAKLEY Key Determination Protocol", RFC 2412,
November 1998. November 1998.
[10] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA [9] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA
Considerations Section in RFCs", BCP 26, RFC 2434, Considerations Section in RFCs", BCP 26, RFC 2434,
October 1998. October 1998.
[10] Pereira, R. and R. Adams, "The ESP CBC-Mode Cipher Algorithms",
RFC 2451, November 1998.
[11] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) [11] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6)
Specification", RFC 2460, December 1998. Specification", RFC 2460, December 1998.
[12] Eastlake, D., "Domain Name System Security Extensions", [12] Eastlake, D., "Domain Name System Security Extensions",
RFC 2535, March 1999. RFC 2535, March 1999.
[13] Eastlake, D., "DSA KEYs and SIGs in the Domain Name System [13] Eastlake, D., "DSA KEYs and SIGs in the Domain Name System
(DNS)", RFC 2536, March 1999. (DNS)", RFC 2536, March 1999.
[14] Kaliski, B., "PKCS #5: Password-Based Cryptography [14] Kaliski, B., "PKCS #5: Password-Based Cryptography
Specification Version 2.0", RFC 2898, September 2000. Specification Version 2.0", RFC 2898, September 2000.
[15] Eastlake, D., "RSA/SHA-1 SIGs and RSA KEYs in the Domain Name [15] Eastlake, D., "RSA/SHA-1 SIGs and RSA KEYs in the Domain Name
System (DNS)", RFC 3110, May 2001. System (DNS)", RFC 3110, May 2001.
[16] Draves, R., "Default Address Selection for Internet Protocol [16] Draves, R., "Default Address Selection for Internet Protocol
version 6 (IPv6)", RFC 3484, February 2003. version 6 (IPv6)", RFC 3484, February 2003.
[17] Hinden, R. and S. Deering, "Internet Protocol Version 6 (IPv6) [17] Kivinen, T. and M. Kojo, "More Modular Exponential (MODP)
Addressing Architecture", RFC 3513, April 2003.
[18] Kivinen, T. and M. Kojo, "More Modular Exponential (MODP)
Diffie-Hellman groups for Internet Key Exchange (IKE)", Diffie-Hellman groups for Internet Key Exchange (IKE)",
RFC 3526, May 2003. RFC 3526, May 2003.
[19] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher [18] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher
Algorithm and Its Use with IPsec", RFC 3602, September 2003. Algorithm and Its Use with IPsec", RFC 3602, September 2003.
[20] Kent, S., "IP Encapsulating Security Payload (ESP)", [19] Narten, T., "Assigning Experimental and Testing Numbers
draft-ietf-ipsec-esp-v3-05 (work in progress), April 2003. Considered Useful", BCP 82, RFC 3692, January 2004.
[21] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", [20] Aura, T., "Cryptographically Generated Addresses (CGA)",
draft-ietf-ipsec-ikev2-07 (work in progress), April 2003. RFC 3972, March 2005.
[22] Aboba, B., "The Network Access Identifier", [21] Schiller, J., "Cryptographic Algorithms for use in the Internet
draft-ietf-radext-rfc2486bis-03 (work in progress), Key Exchange Version 2", draft-ietf-ipsec-ikev2-algorithms-05
December 2004. (work in progress), April 2004.
[23] NIST, "FIPS PUB 180-1: Secure Hash Standard", April 1995. [22] Nikander, P., "A Non-Routable IPv6 Prefix for Keyed Hash
Identifiers (KHI)", draft-laganier-ipv6-khi-00 (work in
progress), September 2005.
[24] Jokela, P., Moskowitz, R., and P. Nikander, "Using ESP [23] Aboba, B., "The Network Access Identifier",
transport format with HIP", draft-jokela-hip-esp-00 (work in draft-ietf-radext-rfc2486bis-06 (work in progress), July 2005.
progress), January 2005.
11.2 Informative References [24] Jokela, P., "Using ESP transport format with HIP",
draft-ietf-hip-esp-00 (work in progress), July 2005.
[25] Moskowitz, R., "Host Identity Protocol Architecture", [25] NIST, "FIPS PUB 180-1: Secure Hash Standard", April 1995.
draft-moskowitz-hip-arch-03 (work in progress), May 2003.
[26] Bellovin, S. and W. Aiello, "Just Fast Keying (JFK)", 11.2. Informative References
draft-ietf-ipsec-jfk-04 (work in progress), July 2002.
[27] Nikander, P. and J. Laganier, "Host Identity Protocol (HIP) [26] Moskowitz, R. and P. Nikander, "Host Identity Protocol
Domain Name System (DNS) Extensions", draft-ietf-hip-dns-00 Architecture", draft-ietf-hip-arch-03 (work in progress),
(work in progress), October 2004. August 2005.
[28] Nikander, P., "SPI assisted NAT traversal (SPINAT) with Host [27] Nordmark, E., "Level 3 multihoming shim protocol",
Identity Protocol (HIP)", draft-nikander-hip-nat-00 (to be draft-ietf-shim6-proto-01 (work in progress), October 2005.
issued) (work in progress), June 2003.
[28] Henderson, T. and P. Nikander, "Using HIP with Legacy
Applications", draft-henderson-hip-applications-01 (work in
progress), July 2005.
[29] Aura, T., Nagarajan, A., and A. Gurtov, "Analysis of the HIP [29] Aura, T., Nagarajan, A., and A. Gurtov, "Analysis of the HIP
Base Exchange Protocol", in Proceedings of 10th Australasian Base Exchange Protocol", in Proceedings of 10th Australasian
Conference on Information Security and Privacy, July 2003. Conference on Information Security and Privacy, July 2003.
[30] Crosby, SA. and DS. Wallach, "Denial of Service via Algorithmic [30] Krawczyk, H., "SIGMA: The 'SIGn-and-MAc' Approach to
Authenticated Diffie-Hellman and Its Use in the IKE-Protocols",
in Proceedings of CRYPTO 2003, pages 400-425, August 2003.
[31] Crosby, SA. and DS. Wallach, "Denial of Service via Algorithmic
Complexity Attacks", in Proceedings of Usenix Security Complexity Attacks", in Proceedings of Usenix Security
Symposium 2003, Washington, DC., August 2003. Symposium 2003, Washington, DC., August 2003.
[31] Nikander, P., "A Bound End-to-End Tunnel (BEET) mode for ESP", [32] NIST, "FIPS PUB 197: Advanced Encryption Standard", Nov 2001.
draft-nikander-esp-beet-mode-00 (expired) (work in progress),
Oct 2003.
[32] Henderson, T., "Using HIP with Legacy Applications",
draft-henderson-hip-applications-00.txt (work in progress),
Feb 2005.
[33] NIST, "FIPS PUB 197: Advanced Encryption Standard", Nov 2001.
Authors' Addresses
Robert Moskowitz
ICSAlabs, a Division of TruSecure Corporation
1000 Bent Creek Blvd, Suite 200
Mechanicsburg, PA
USA
Email: rgm@icsalabs.com
Pekka Nikander
Ericsson Research NomadicLab
JORVAS FIN-02420
FINLAND
Phone: +358 9 299 1
Email: pekka.nikander@nomadiclab.com
Petri Jokela
Ericsson Research NomadicLab
JORVAS FIN-02420
FINLAND
Phone: +358 9 299 1
Email: petri.jokela@nomadiclab.com
Thomas R. Henderson
The Boeing Company
P.O. Box 3707
Seattle, WA
USA
Email: thomas.r.henderson@boeing.com
Appendix A. Probabilities of HIT Collisions
The birthday paradox sets a bound for the expectation of collisions.
It is based on the square root of the number of values. A 64-bit
hash, then, would put the chances of a collision at 50-50 with 2^32
hosts (4 billion). A 1% chance of collision would occur in a
population of 640M and a .001% collision chance in a 20M population.
A 128 bit hash will have the same .001% collision chance in a 9x10^16
population.
Appendix B. Probabilities in the Cookie Calculation
A question: Is it guaranteed that the Initiator is able to solve the
puzzle in this way when the K value is large?
Answer: No, it is not guaranteed. But it is not guaranteed even in
the old mechanism, since the Initiator may start far away from J and
arrive to J after far too many steps. If we wanted to make sure that
the Initiator finds a value, we would need to give some hint of a
suitable J, and I don't think we want to do that.
In general, if we model the hash function with a random function, the
probability that one iteration gives are result with K zero bits is
2^-K. Thus, the probability that one iteration does _not_ give K
zero bits is (1 - 2^-K). Consequently, the probability that 2^K
iterations does not give K zero bits is (1 - 2^-K)^(2^K).
Since my calculus starts to be rusty, I made a small experiment and
found out that
lim (1 - 2^-k)^(2^k) = 0.36788
k->inf
lim (1 - 2^-k)^(2^(k+1)) = 0.13534
k->inf
lim (1 - 2^-k)^(2^(k+2)) = 0.01832
k->inf
lim (1 - 2^-k)^(2^(k+3)) = 0.000335
k->inf
Thus, if hash functions were random functions, we would need about
2^(K+3) iterations to make sure that the probability of a failure is
less than 1% (actually less than 0.04%). Now, since my perhaps
flawed understanding of hash functions is that they are "flatter"
than random functions, 2^(K+3) is probably an overkill. OTOH, the
currently suggested 2^K is clearly too little.
Appendix C. Using Responder Cookies Appendix A. Using Responder Puzzles
As mentioned in Section 4.1.1, the Responder may delay state creation As mentioned in Section 4.1.1, the Responder may delay state creation
and still reject most spoofed I2s by using a number of pre-calculated and still reject most spoofed I2s by using a number of pre-calculated
R1s and a local selection function. This appendix defines one R1s and a local selection function. This appendix defines one
possible implementation in detail. The purpose of this appendix is possible implementation in detail. The purpose of this appendix is
to give the implementors an idea on how to implement the mechanism. to give the implementors an idea on how to implement the mechanism.
If the implementation is based on this appendix, it MAY contain some If the implementation is based on this appendix, it MAY contain some
local modification that makes an attacker's task harder. local modification that makes an attacker's task harder.
The Responder creates a secret value S, that it regenerates The Responder creates a secret value S, that it regenerates
skipping to change at page 91, line 27 skipping to change at page 93, line 27
S. Each time the S is regenerated, R1 generation counter value is S. Each time the S is regenerated, R1 generation counter value is
incremented by one. incremented by one.
The Responder generates a pre-signed R1 packet. The signature for The Responder generates a pre-signed R1 packet. The signature for
pre-generated R1s must be recalculated when the Diffie-Hellman key is pre-generated R1s must be recalculated when the Diffie-Hellman key is
recomputed or when the R1_COUNTER value changes due to S value recomputed or when the R1_COUNTER value changes due to S value
regeneration. regeneration.
When the Initiator sends the I1 packet for initializing a connection, When the Initiator sends the I1 packet for initializing a connection,
the Responder gets the HIT and IP address from the packet, and the Responder gets the HIT and IP address from the packet, and
generates an I-value for the cookie. The I value is set to the pre- generates an I-value for the puzzle. The I value is set to the pre-
signed R1 packet. signed R1 packet.
I value calculation: I value calculation:
I = Ltrunc( SHA-1 ( S | HIT-I | HIT-R | IP-I | IP-R ), 64) I = Ltrunc( PHASH ( S | HIT-I | HIT-R | IP-I | IP-R ), 64)
The PHASH algorithm is the same that is used to generate the
Responder's HIT value.
From an incoming I2 packet, the Responder gets the required From an incoming I2 packet, the Responder gets the required
information to validate the puzzle: HITs, IP addresses, and the information to validate the puzzle: HITs, IP addresses, and the
information of the used S value from the R1_COUNTER. Using these information of the used S value from the R1_COUNTER. Using these
values, the Responder can regenerate the I, and verify it against the values, the Responder can regenerate the I, and verify it against the
I received in the I2 packet. If the I values match, it can verify I received in the I2 packet. If the I values match, it can verify
the solution using I, J, and difficulty K. If the I values do not the solution using I, J, and difficulty K. If the I values do not
match, the I2 is dropped. match, the I2 is dropped.
cookie_check: puzzle_check:
V := Ltrunc( SHA-1( I2.I | I2.hit_i | I2.hit_r | I2.J ), K ) V := Ltrunc( PHASH( I2.I | I2.hit_i | I2.hit_r | I2.J ), K )
if V != 0, drop the packet if V != 0, drop the packet
If the puzzle solution is correct, the I and J values are stored for If the puzzle solution is correct, the I and J values are stored for
later use. They are used as input material when keying material is later use. They are used as input material when keying material is
generated. generated.
The Responder SHOULD NOT keep state about failed puzzle solutions. The Responder SHOULD NOT keep state about failed puzzle solutions.
Appendix D. Generating a HIT from a HI Appendix B. Generating a HIT from a HI
The following pseudo-codes illustrate the process to generate a HIT The following pseudo-codes illustrate the process to generate a
from a HI for both RSA and DSA. public key encoding from a HI for both RSA and DSA.
The symbol := denotes assignment; the symbol += denotes appending. The symbol := denotes assignment; the symbol += denotes appending.
The pseudo-function encode_in_network_byte_order takes two The pseudo-function encode_in_network_byte_order takes two
parameters, an integer (bignum) and a length in bytes, and returns parameters, an integer (bignum) and a length in bytes, and returns
the integer encoded into a byte string of the given length. the integer encoded into a byte string of the given length.
switch ( HI.algorithm ) switch ( HI.algorithm )
{ {
case RSA: case RSA:
skipping to change at page 92, line 38 skipping to change at page 95, line 5
buffer += encode_in_network_byte_order ( HI.DSA.P , 64 + buffer += encode_in_network_byte_order ( HI.DSA.P , 64 +
8 * HI.DSA.T ) 8 * HI.DSA.T )
buffer += encode_in_network_byte_order ( HI.DSA.G , 64 + buffer += encode_in_network_byte_order ( HI.DSA.G , 64 +
8 * HI.DSA.T ) 8 * HI.DSA.T )
buffer += encode_in_network_byte_order ( HI.DSA.Y , 64 + buffer += encode_in_network_byte_order ( HI.DSA.Y , 64 +
8 * HI.DSA.T ) 8 * HI.DSA.T )
break; break;
} }
digest := SHA-1 ( buffer ) Appendix C. Example Checksums for HIP Packets
hit_128 := low_order_bits ( digest, 120 )
hit_haa := concatenate ( HAA, low_order_bits ( digest, 64 ) )
Appendix E. Example Checksums for HIP Packets
The HIP checksum for HIP packets is specified in Section 6.1.2. The HIP checksum for HIP packets is specified in Section 6.1.2.
Checksums for TCP and UDP packets running over HIP-enabled security Checksums for TCP and UDP packets running over HIP-enabled security
associations are specified in Section 3.5. The examples below use IP associations are specified in Section 3.5. The examples below use IP
addresses of 192.168.0.1 and 192.168.0.2 (and their respective IPv4- addresses of 192.168.0.1 and 192.168.0.2 (and their respective IPv4-
compatible IPv6 formats), and type 1 HITs with the first two bits compatible IPv6 formats), and HITs with the first two bits "01"
"01" followed by 124 zeroes followed by a decimal 1 or 2, followed by 124 zeroes followed by a decimal 1 or 2, respectively.
respectively.
E.1 IPv6 HIP Example (I1) C.1. IPv6 HIP Example (I1)
Source Address: ::c0a8:0001 Source Address: ::c0a8:0001
Destination Address: ::c0a8:0002 Destination Address: ::c0a8:0002
Upper-Layer Packet Length: 40 0x28 Upper-Layer Packet Length: 40 0x28
Next Header: 99 0x63 Next Header: 99 0x63
Payload Protocol: 59 0x3b Payload Protocol: 59 0x3b
Header Length: 4 0x04 Header Length: 4 0x04
Packet Type: 1 0x01 Packet Type: 1 0x01
Version: 1 0x1 Version: 1 0x1
Reserved: 0 0x0 Reserved: 0 0x0
Control: 0 0x0000 Control: 0 0x0000
Checksum: 49672 0xc208 Checksum: 49672 0xc208
Sender's HIT: 4000::0001 Sender's HIT: 4000::0001
Receiver's HIT: 4000::0002 Receiver's HIT: 4000::0002
E.2 IPv4 HIP Packet (I1) C.2. IPv4 HIP Packet (I1)
The IPv4 checksum value for the same example I1 packet is the same as The IPv4 checksum value for the same example I1 packet is the same as
the IPv6 checksum (since the checksums due to the IPv4 and IPv6 the IPv6 checksum (since the checksums due to the IPv4 and IPv6
pseudo-header components are the same). pseudo-header components are the same).
E.3 TCP Segment C.3. TCP Segment
Regardless of whether IPv6 or IPv4 is used, the TCP and UDP sockets Regardless of whether IPv6 or IPv4 is used, the TCP and UDP sockets
use the IPv6 pseudo-header format [8], with the HITs used in place of use the IPv6 pseudo-header format [8], with the HITs used in place of
the IPv6 addresses. the IPv6 addresses.
Sender's HIT: 4000::0001 Sender's HIT: 4000::0001
Receiver's HIT: 4000::0002 Receiver's HIT: 4000::0002
Upper-Layer Packet Length: 20 0x14 Upper-Layer Packet Length: 20 0x14
Next Header: 6 0x06 Next Header: 6 0x06
Source port: 32769 0x8001 Source port: 32769 0x8001
Destination port: 22 0x0016 Destination port: 22 0x0016
Sequence number: 1 0x00000001 Sequence number: 1 0x00000001
Acknowledgment number: 0 0x00000000 Acknowledgment number: 0 0x00000000
Header length: 20 0x14 Header length: 20 0x14
Flags: SYN 0x02 Flags: SYN 0x02
Window size: 5840 0x16d0 Window size: 5840 0x16d0
Checksum: 54519 0xd4f7 Checksum: 54519 0xd4f7
Urgent pointer: 0 0x0000 Urgent pointer: 0 0x0000
Appendix F. 384-bit Group Appendix D. 384-bit Group
This 384-bit group is defined only to be used with HIP. NOTE: The This 384-bit group is defined only to be used with HIP. NOTE: The
security level of this group is very low! The encryption may be security level of this group is very low! The encryption may be
broken in a very short time, even real-time. It should be used only broken in a very short time, even real-time. It should be used only
when the host is not powerful enough (e.g. some PDAs) and when when the host is not powerful enough (e.g. some PDAs) and when
security requirements are low (e.g. during normal web surfing). security requirements are low (e.g. during normal web surfing).
This prime is: 2^384 - 2^320 - 1 + 2^64 * { [ 2^254 pi] + 5857 } This prime is: 2^384 - 2^320 - 1 + 2^64 * { [ 2^254 pi] + 5857 }
Its hexadecimal value is: Its hexadecimal value is:
FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
29024E08 8A67CC74 020BBEA6 3B13B202 FFFFFFFF FFFFFFFF 29024E08 8A67CC74 020BBEA6 3B13B202 FFFFFFFF FFFFFFFF
The generator is: 2. The generator is: 2.
Authors' Addresses
Robert Moskowitz
ICSAlabs, a Division of TruSecure Corporation
1000 Bent Creek Blvd, Suite 200
Mechanicsburg, PA
USA
Email: rgm@icsalabs.com
Pekka Nikander
Ericsson Research NomadicLab
JORVAS FIN-02420
FINLAND
Phone: +358 9 299 1
Email: pekka.nikander@nomadiclab.com
Petri Jokela
Ericsson Research NomadicLab
JORVAS FIN-02420
FINLAND
Phone: +358 9 299 1
Email: petri.jokela@nomadiclab.com
Thomas R. Henderson
The Boeing Company
P.O. Box 3707
Seattle, WA
USA
Email: thomas.r.henderson@boeing.com
Intellectual Property Statement Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79. found in BCP 78 and BCP 79.
 End of changes. 320 change blocks. 
1067 lines changed or deleted 1094 lines changed or added

This html diff was produced by rfcdiff 1.27, available from http://www.levkowetz.com/ietf/tools/rfcdiff/