draft-ietf-hip-rfc5201-bis-20.txt   rfc7401.txt 
Network Working Group R. Moskowitz, Ed. Internet Engineering Task Force (IETF) R. Moskowitz, Ed.
Internet-Draft Verizon Request for Comments: 7401 HTT Consulting
Obsoletes: 5201 (if approved) T. Heer Obsoletes: 5201 T. Heer
Intended status: Standards Track Hirschmann Automation and Control Category: Standards Track Hirschmann Automation and Control
Expires: May 2, 2015 P. Jokela ISSN: 2070-1721 P. Jokela
Ericsson Research NomadicLab Ericsson Research NomadicLab
T. Henderson T. Henderson
University of Washington University of Washington
October 29, 2014 April 2015
Host Identity Protocol Version 2 (HIPv2) Host Identity Protocol Version 2 (HIPv2)
draft-ietf-hip-rfc5201-bis-20
Abstract Abstract
This document specifies the details of the Host Identity Protocol This document specifies the details of the Host Identity Protocol
(HIP). HIP allows consenting hosts to securely establish and (HIP). HIP allows consenting hosts to securely establish and
maintain shared IP-layer state, allowing separation of the identifier maintain shared IP-layer state, allowing separation of the identifier
and locator roles of IP addresses, thereby enabling continuity of and locator roles of IP addresses, thereby enabling continuity of
communications across IP address changes. HIP is based on a Diffie- communications across IP address changes. HIP is based on a Diffie-
Hellman key exchange, using public key identifiers from a new Host Hellman key exchange, using public key identifiers from a new Host
Identity namespace for mutual peer authentication. The protocol is Identity namespace for mutual peer authentication. The protocol is
designed to be resistant to denial-of-service (DoS) and man-in-the- designed to be resistant to denial-of-service (DoS) and man-in-the-
middle (MitM) attacks. When used together with another suitable middle (MitM) attacks. When used together with another suitable
security protocol, such as the Encapsulated Security Payload (ESP), security protocol, such as the Encapsulating Security Payload (ESP),
it provides integrity protection and optional encryption for upper- it provides integrity protection and optional encryption for upper-
layer protocols, such as TCP and UDP. layer protocols, such as TCP and UDP.
This document obsoletes RFC 5201 and addresses the concerns raised by This document obsoletes RFC 5201 and addresses the concerns raised by
the IESG, particularly that of crypto agility. It also incorporates the IESG, particularly that of crypto agility. It also incorporates
lessons learned from the implementations of RFC 5201. lessons learned from the implementations of RFC 5201.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This is an Internet Standards Track document.
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering This document is a product of the Internet Engineering Task Force
Task Force (IETF). Note that other groups may also distribute (IETF). It represents the consensus of the IETF community. It has
working documents as Internet-Drafts. The list of current Internet- received public review and has been approved for publication by the
Drafts is at http://datatracker.ietf.org/drafts/current/. Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
Internet-Drafts are draft documents valid for a maximum of six months Information about the current status of this document, any errata,
and may be updated, replaced, or obsoleted by other documents at any and how to provide feedback on it may be obtained at
time. It is inappropriate to use Internet-Drafts as reference http://www.rfc-editor.org/info/rfc7401.
material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 2, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction ....................................................5
1.1. A New Namespace and Identifiers . . . . . . . . . . . . . 6 1.1. A New Namespace and Identifiers ............................6
1.2. The HIP Base Exchange (BEX) . . . . . . . . . . . . . . . 7 1.2. The HIP Base Exchange (BEX) ................................6
1.3. Memo Structure . . . . . . . . . . . . . . . . . . . . . 7 1.3. Memo Structure .............................................7
2. Terms and Definitions . . . . . . . . . . . . . . . . . . . . 8 2. Terms and Definitions ...........................................7
2.1. Requirements Terminology . . . . . . . . . . . . . . . . 8 2.1. Requirements Terminology ...................................7
2.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2. Notation ...................................................8
2.3. Definitions . . . . . . . . . . . . . . . . . . . . . . . 8 2.3. Definitions ................................................8
3. Host Identity (HI) and its Structure . . . . . . . . . . . . 9 3. Host Identity (HI) and Its Structure ............................9
3.1. Host Identity Tag (HIT) . . . . . . . . . . . . . . . . . 10 3.1. Host Identity Tag (HIT) ...................................10
3.2. Generating a HIT from an HI . . . . . . . . . . . . . . . 11 3.2. Generating a HIT from an HI ...............................11
4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 12 4. Protocol Overview ..............................................12
4.1. Creating a HIP Association . . . . . . . . . . . . . . . 12 4.1. Creating a HIP Association ................................12
4.1.1. HIP Puzzle Mechanism . . . . . . . . . . . . . . . . 14 4.1.1. HIP Puzzle Mechanism ...............................14
4.1.2. Puzzle Exchange . . . . . . . . . . . . . . . . . . . 15 4.1.2. Puzzle Exchange ....................................15
4.1.3. Authenticated Diffie-Hellman Protocol with DH Group 4.1.3. Authenticated Diffie-Hellman Protocol with
Negotiation . . . . . . . . . . . . . . . . . . . . . 16 DH Group Negotiation ...............................17
4.1.4. HIP Replay Protection . . . . . . . . . . . . . . . . 18 4.1.4. HIP Replay Protection ..............................18
4.1.5. Refusing a HIP base exchange . . . . . . . . . . . . 19 4.1.5. Refusing a HIP Base Exchange .......................19
4.1.6. Aborting a HIP base exchange . . . . . . . . . . . . 19 4.1.6. Aborting a HIP Base Exchange .......................20
4.1.7. HIP Downgrade Protection . . . . . . . . . . . . . . 20 4.1.7. HIP Downgrade Protection ...........................20
4.1.8. HIP Opportunistic Mode . . . . . . . . . . . . . . . 21 4.1.8. HIP Opportunistic Mode .............................21
4.2. Updating a HIP Association . . . . . . . . . . . . . . . 23 4.2. Updating a HIP Association ................................24
4.3. Error Processing . . . . . . . . . . . . . . . . . . . . 24 4.3. Error Processing ..........................................24
4.4. HIP State Machine . . . . . . . . . . . . . . . . . . . . 25 4.4. HIP State Machine .........................................25
4.4.1. State Machine Terminology . . . . . . . . . . . . . . 26 4.4.1. State Machine Terminology ..........................26
4.4.2. HIP States . . . . . . . . . . . . . . . . . . . . . 26 4.4.2. HIP States .........................................27
4.4.3. HIP State Processes . . . . . . . . . . . . . . . . . 27 4.4.3. HIP State Processes ................................28
4.4.4. Simplified HIP State Diagram . . . . . . . . . . . . 35 4.4.4. Simplified HIP State Diagram .......................35
4.5. User Data Considerations . . . . . . . . . . . . . . . . 37 4.5. User Data Considerations ..................................37
4.5.1. TCP and UDP Pseudo-Header Computation for User Data . 37 4.5.1. TCP and UDP Pseudo Header Computation for
4.5.2. Sending Data on HIP Packets . . . . . . . . . . . . . 37 User Data ..........................................37
4.5.3. Transport Formats . . . . . . . . . . . . . . . . . . 37 4.5.2. Sending Data on HIP Packets ........................37
4.5.4. Reboot, Timeout, and Restart of HIP . . . . . . . . . 37 4.5.3. Transport Formats ..................................37
4.6. Certificate Distribution . . . . . . . . . . . . . . . . 38 4.5.4. Reboot, Timeout, and Restart of HIP ................37
5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 38 4.6. Certificate Distribution ..................................38
5.1. Payload Format . . . . . . . . . . . . . . . . . . . . . 38 5. Packet Formats .................................................38
5.1.1. Checksum . . . . . . . . . . . . . . . . . . . . . . 40 5.1. Payload Format ............................................38
5.1.2. HIP Controls . . . . . . . . . . . . . . . . . . . . 40 5.1.1. Checksum ...........................................40
5.1.3. HIP Fragmentation Support . . . . . . . . . . . . . . 40 5.1.2. HIP Controls .......................................40
5.2. HIP Parameters . . . . . . . . . . . . . . . . . . . . . 41 5.1.3. HIP Fragmentation Support ..........................40
5.2.1. TLV Format . . . . . . . . . . . . . . . . . . . . . 44 5.2. HIP Parameters ............................................41
5.2.2. Defining New Parameters . . . . . . . . . . . . . . . 46 5.2.1. TLV Format .........................................44
5.2.3. R1_COUNTER . . . . . . . . . . . . . . . . . . . . . 46 5.2.2. Defining New Parameters ............................46
5.2.4. PUZZLE . . . . . . . . . . . . . . . . . . . . . . . 47 5.2.3. R1_COUNTER .........................................47
5.2.5. SOLUTION . . . . . . . . . . . . . . . . . . . . . . 48 5.2.4. PUZZLE .............................................48
5.2.6. DH_GROUP_LIST . . . . . . . . . . . . . . . . . . . . 49 5.2.5. SOLUTION ...........................................49
5.2.7. DIFFIE_HELLMAN . . . . . . . . . . . . . . . . . . . 51 5.2.6. DH_GROUP_LIST ......................................50
5.2.8. HIP_CIPHER . . . . . . . . . . . . . . . . . . . . . 52 5.2.7. DIFFIE_HELLMAN .....................................51
5.2.9. HOST_ID . . . . . . . . . . . . . . . . . . . . . . . 53 5.2.8. HIP_CIPHER .........................................52
5.2.10. HIT_SUITE_LIST . . . . . . . . . . . . . . . . . . . 55 5.2.9. HOST_ID ............................................54
5.2.11. TRANSPORT_FORMAT_LIST . . . . . . . . . . . . . . . . 57 5.2.10. HIT_SUITE_LIST ....................................56
5.2.12. HIP_MAC . . . . . . . . . . . . . . . . . . . . . . . 58 5.2.11. TRANSPORT_FORMAT_LIST .............................58
5.2.13. HIP_MAC_2 . . . . . . . . . . . . . . . . . . . . . . 59 5.2.12. HIP_MAC ...........................................59
5.2.14. HIP_SIGNATURE . . . . . . . . . . . . . . . . . . . . 60 5.2.13. HIP_MAC_2 .........................................59
5.2.15. HIP_SIGNATURE_2 . . . . . . . . . . . . . . . . . . . 61 5.2.14. HIP_SIGNATURE .....................................60
5.2.16. SEQ . . . . . . . . . . . . . . . . . . . . . . . . . 61 5.2.15. HIP_SIGNATURE_2 ...................................61
5.2.17. ACK . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.2.16. SEQ ...............................................61
5.2.18. ENCRYPTED . . . . . . . . . . . . . . . . . . . . . . 62 5.2.17. ACK ...............................................62
5.2.19. NOTIFICATION . . . . . . . . . . . . . . . . . . . . 64 5.2.18. ENCRYPTED .........................................62
5.2.20. ECHO_REQUEST_SIGNED . . . . . . . . . . . . . . . . . 67 5.2.19. NOTIFICATION ......................................64
5.2.21. ECHO_REQUEST_UNSIGNED . . . . . . . . . . . . . . . . 68 5.2.20. ECHO_REQUEST_SIGNED ...............................67
5.2.22. ECHO_RESPONSE_SIGNED . . . . . . . . . . . . . . . . 68 5.2.21. ECHO_REQUEST_UNSIGNED .............................68
5.2.23. ECHO_RESPONSE_UNSIGNED . . . . . . . . . . . . . . . 69 5.2.22. ECHO_RESPONSE_SIGNED ..............................69
5.3. HIP Packets . . . . . . . . . . . . . . . . . . . . . . . 70 5.2.23. ECHO_RESPONSE_UNSIGNED ............................69
5.3.1. I1 - the HIP Initiator Packet . . . . . . . . . . . . 71 5.3. HIP Packets ...............................................70
5.3.2. R1 - the HIP Responder Packet . . . . . . . . . . . . 71 5.3.1. I1 - the HIP Initiator Packet ......................71
5.3.3. I2 - the Second HIP Initiator Packet . . . . . . . . 74 5.3.2. R1 - the HIP Responder Packet ......................72
5.3.4. R2 - the Second HIP Responder Packet . . . . . . . . 76 5.3.3. I2 - the Second HIP Initiator Packet ...............75
5.3.5. UPDATE - the HIP Update Packet . . . . . . . . . . . 76 5.3.4. R2 - the Second HIP Responder Packet ...............76
5.3.6. NOTIFY - the HIP Notify Packet . . . . . . . . . . . 77 5.3.5. UPDATE - the HIP Update Packet .....................77
5.3.7. CLOSE - the HIP Association Closing Packet . . . . . 78 5.3.6. NOTIFY - the HIP Notify Packet .....................78
5.3.8. CLOSE_ACK - the HIP Closing Acknowledgment Packet . . 78 5.3.7. CLOSE - the HIP Association Closing Packet .........78
5.4. ICMP Messages . . . . . . . . . . . . . . . . . . . . . . 79 5.3.8. CLOSE_ACK - the HIP Closing Acknowledgment Packet ..79
5.4.1. Invalid Version . . . . . . . . . . . . . . . . . . . 79
5.4.2. Other Problems with the HIP Header and Packet
Structure . . . . . . . . . . . . . . . . . . . . . . 79
5.4.3. Invalid Puzzle Solution . . . . . . . . . . . . . . . 79 5.4. ICMP Messages .............................................79
5.4.4. Non-Existing HIP Association . . . . . . . . . . . . 80 5.4.1. Invalid Version ....................................79
6. Packet Processing . . . . . . . . . . . . . . . . . . . . . . 80 5.4.2. Other Problems with the HIP Header and
6.1. Processing Outgoing Application Data . . . . . . . . . . 80 Packet Structure ...................................80
6.2. Processing Incoming Application Data . . . . . . . . . . 81 5.4.3. Invalid Puzzle Solution ............................80
6.3. Solving the Puzzle . . . . . . . . . . . . . . . . . . . 82 5.4.4. Non-existing HIP Association .......................80
6.4. HIP_MAC and SIGNATURE Calculation and Verification . . . 84 6. Packet Processing ..............................................80
6.4.1. HMAC Calculation . . . . . . . . . . . . . . . . . . 84 6.1. Processing Outgoing Application Data ......................81
6.4.2. Signature Calculation . . . . . . . . . . . . . . . . 86 6.2. Processing Incoming Application Data ......................82
6.5. HIP KEYMAT Generation . . . . . . . . . . . . . . . . . . 88 6.3. Solving the Puzzle ........................................83
6.6. Initiation of a HIP Base Exchange . . . . . . . . . . . . 90 6.4. HIP_MAC and SIGNATURE Calculation and Verification ........84
6.6.1. Sending Multiple I1 Packets in Parallel . . . . . . . 91 6.4.1. HMAC Calculation ...................................84
6.6.2. Processing Incoming ICMP Protocol Unreachable 6.4.2. Signature Calculation ..............................87
Messages . . . . . . . . . . . . . . . . . . . . . . 91 6.5. HIP KEYMAT Generation .....................................89
6.7. Processing Incoming I1 Packets . . . . . . . . . . . . . 92 6.6. Initiation of a HIP Base Exchange .........................90
6.7.1. R1 Management . . . . . . . . . . . . . . . . . . . . 93 6.6.1. Sending Multiple I1 Packets in Parallel ............91
6.7.2. Handling Malformed Messages . . . . . . . . . . . . . 93 6.6.2. Processing Incoming ICMP Protocol
6.8. Processing Incoming R1 Packets . . . . . . . . . . . . . 94 Unreachable Messages ...............................92
6.8.1. Handling of Malformed Messages . . . . . . . . . . . 96 6.7. Processing of Incoming I1 Packets .........................92
6.9. Processing Incoming I2 Packets . . . . . . . . . . . . . 96 6.7.1. R1 Management ......................................94
6.9.1. Handling of Malformed Messages . . . . . . . . . . . 99 6.7.2. Handling of Malformed Messages .....................94
6.10. Processing of Incoming R2 Packets . . . . . . . . . . . . 100 6.8. Processing of Incoming R1 Packets .........................94
6.11. Sending UPDATE Packets . . . . . . . . . . . . . . . . . 100 6.8.1. Handling of Malformed Messages .....................97
6.12. Receiving UPDATE Packets . . . . . . . . . . . . . . . . 101 6.9. Processing of Incoming I2 Packets .........................97
6.12.1. Handling a SEQ Parameter in a Received UPDATE 6.9.1. Handling of Malformed Messages ....................100
Message . . . . . . . . . . . . . . . . . . . . . . 102 6.10. Processing of Incoming R2 Packets .......................101
6.12.2. Handling an ACK Parameter in a Received UPDATE 6.11. Sending UPDATE Packets ..................................101
Packet . . . . . . . . . . . . . . . . . . . . . . . 103 6.12. Receiving UPDATE Packets ................................102
6.13. Processing of NOTIFY Packets . . . . . . . . . . . . . . 103 6.12.1. Handling a SEQ Parameter in a Received
6.14. Processing CLOSE Packets . . . . . . . . . . . . . . . . 104 UPDATE Message ...................................103
6.15. Processing CLOSE_ACK Packets . . . . . . . . . . . . . . 104 6.12.2. Handling an ACK Parameter in a Received
6.16. Handling State Loss . . . . . . . . . . . . . . . . . . . 104 UPDATE Packet ....................................104
7. HIP Policies . . . . . . . . . . . . . . . . . . . . . . . . 105 6.13. Processing of NOTIFY Packets ............................104
8. Security Considerations . . . . . . . . . . . . . . . . . . . 105 6.14. Processing of CLOSE Packets .............................105
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 108 6.15. Processing of CLOSE_ACK Packets .........................105
10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 112 6.16. Handling State Loss .....................................105
11. Changes from RFC 5201 . . . . . . . . . . . . . . . . . . . . 113 7. HIP Policies ..................................................106
11.1. Changes from draft-ietf-hip-rfc5201-bis-19 . . . . . . . 113 8. Security Considerations .......................................106
11.2. Changes from draft-ietf-hip-rfc5201-bis-18 . . . . . . . 113 9. IANA Considerations ...........................................109
11.3. Changes from draft-ietf-hip-rfc5201-bis-17 . . . . . . . 113 10. Differences from RFC 5201 ....................................113
11.4. Changes from draft-ietf-hip-rfc5201-bis-16 . . . . . . . 114 11. References ...................................................117
11.5. Changes from draft-ietf-hip-rfc5201-bis-15 . . . . . . . 114 11.1. Normative References ....................................117
11.6. Changes from draft-ietf-hip-rfc5201-bis-14 . . . . . . . 114 11.2. Informative References ..................................119
11.7. Changes from draft-ietf-hip-rfc5201-bis-13 . . . . . . . 114 Appendix A. Using Responder Puzzles ..............................122
11.8. Changes from draft-ietf-hip-rfc5201-bis-12 . . . . . . . 114 Appendix B. Generating a Public Key Encoding from an HI ..........123
11.9. Changes from draft-ietf-hip-rfc5201-bis-11 . . . . . . . 114 Appendix C. Example Checksums for HIP Packets ....................123
11.10. Changes from draft-ietf-hip-rfc5201-bis-10 . . . . . . . 114 C.1. IPv6 HIP Example (I1 Packet) ..............................124
11.11. Changes from draft-ietf-hip-rfc5201-bis-09 . . . . . . . 115 C.2. IPv4 HIP Packet (I1 Packet) ...............................124
11.12. Changes from draft-ietf-hip-rfc5201-bis-08 . . . . . . . 115 C.3. TCP Segment ...............................................125
11.13. Changes from draft-ietf-hip-rfc5201-bis-07 . . . . . . . 115 Appendix D. ECDH and ECDSA 160-Bit Groups ........................125
11.14. Changes from draft-ietf-hip-rfc5201-bis-06 . . . . . . . 115 Appendix E. HIT Suites and HIT Generation ........................125
11.15. Changes from draft-ietf-hip-rfc5201-bis-05 . . . . . . . 115 Acknowledgments ..................................................127
11.16. Changes from draft-ietf-hip-rfc5201-bis-04 . . . . . . . 116 Authors' Addresses ...............................................128
11.17. Changes from draft-ietf-hip-rfc5201-bis-03 . . . . . . . 117
11.18. Changes from draft-ietf-hip-rfc5201-bis-02 . . . . . . . 118
11.19. Changes from draft-ietf-hip-rfc5201-bis-01 . . . . . . . 118
11.20. Changes from draft-ietf-hip-rfc5201-bis-00 . . . . . . . 120
11.21. Contents of draft-ietf-hip-rfc5201-bis-00 . . . . . . . 120
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 120
12.1. Normative References . . . . . . . . . . . . . . . . . . 120
12.2. Informative References . . . . . . . . . . . . . . . . . 122
Appendix A. Using Responder Puzzles . . . . . . . . . . . . . . 126
Appendix B. Generating a Public Key Encoding from an HI . . 127
Appendix C. Example Checksums for HIP Packets . . . . . . . . . 127
C.1. IPv6 HIP Example (I1 packet) . . . . . . . . . . . . . . 128
C.2. IPv4 HIP Packet (I1 packet) . . . . . . . . . . . . . . . 128
C.3. TCP Segment . . . . . . . . . . . . . . . . . . . . . . . 129
Appendix D. ECDH and ECDSA 160 Bit Groups . . . . . . . . . . . 129
Appendix E. HIT Suites and HIT Generation . . . . . . . . . . . 129
1. Introduction 1. Introduction
This document specifies the details of the Host Identity Protocol This document specifies the details of the Host Identity Protocol
(HIP). A high-level description of the protocol and the underlying (HIP). 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 [I-D.ietf-hip-rfc4423-bis]. Briefly, the HIP description [HIP-ARCH]. Briefly, the HIP architecture proposes an
architecture proposes an alternative to the dual use of IP addresses alternative to the dual use of IP addresses as "locators" (routing
as "locators" (routing labels) and "identifiers" (endpoint, or host, labels) and "identifiers" (endpoint, or host, identifiers). In HIP,
identifiers). In HIP, public cryptographic keys, of a public/private public cryptographic keys, of a public/private key pair, are used as
key pair, are used as Host Identifiers, to which higher layer host identifiers, to which higher-layer protocols are bound instead
protocols are bound instead of an IP address. By using public keys of an IP address. By using public keys (and their representations)
(and their representations) as host identifiers, dynamic changes to as host identifiers, dynamic changes to IP address sets can be
IP address sets can be directly authenticated between hosts, and if directly authenticated between hosts, and if desired, strong
desired, strong authentication between hosts at the TCP/IP stack authentication between hosts at the TCP/IP stack level can be
level can be obtained. 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 an IP-layer communications context, called between hosts to establish an IP-layer communications context, called
a HIP association, prior to communications. It also defines a packet a HIP association, prior to communications. It also defines a packet
format and procedures for updating and terminating an active HIP format and procedures for updating and terminating an active HIP
association. Other elements of the HIP architecture are specified in association. Other elements of the HIP architecture are specified in
other documents, such as: other documents, such as:
o "Using the Encapsulating Security Payload (ESP) transport format o "Using the Encapsulating Security Payload (ESP) Transport Format
with the Host Identity Protocol (HIP)" [I-D.ietf-hip-rfc5202-bis]: with the Host Identity Protocol (HIP)" [RFC7402]: how to use the
Encapsulating Security Payload (ESP) for integrity protection and
how to use the Encapsulating Security Payload (ESP) for integrity optional encryption
protection and optional encryption
o "Host Mobility with the Host Identity Protocol" o "Host Mobility with the Host Identity Protocol" [HIP-HOST-MOB]:
[I-D.ietf-hip-rfc5206-bis]: how to support host mobility in HIP how to support host mobility in HIP
o "Host Identity Protocol (HIP) Domain Name System (DNS) Extensions" o "Host Identity Protocol (HIP) Domain Name System (DNS) Extension"
[I-D.ietf-hip-rfc5205-bis]: how to extend DNS to contain Host [HIP-DNS-EXT]: how to extend DNS to contain Host Identity
Identity information information
o "Host Identity Protocol (HIP) Rendezvous Extension" o "Host Identity Protocol (HIP) Rendezvous Extension"
[I-D.ietf-hip-rfc5204-bis]: using a rendezvous mechanism to [HIP-REND-EXT]: using a rendezvous mechanism to contact mobile HIP
contact mobile HIP hosts hosts
Since the HIP base exchange was first developed, there have been a Since the HIP base exchange was first developed, there have been a
few advances in cryptography and attacks against cryptographic few advances in cryptography and attacks against cryptographic
systems. As a result, all cryptographic protocols need to be agile. systems. As a result, all cryptographic protocols need to be agile.
That is, it should be a part of the protocol to be able to switch That is, the ability to switch from one cryptographic primitive to
from one cryptographic primitive to another. It is important to another should be a part of such protocols. It is important to
support a reasonable set of mainstream algorithms to cater for support a reasonable set of mainstream algorithms to cater to
different use cases and allow moving away from algorithms that are different use cases and allow moving away from algorithms that are
later discovered to be vulnerable. This update to the base exchange later discovered to be vulnerable. This update to the base exchange
includes this needed cryptographic agility while addressing the includes this needed cryptographic agility while addressing the
downgrade attacks that such flexibility introduces. In particular, downgrade attacks that such flexibility introduces. In addition,
Elliptic Curve support by Elliptic Curve DSA (ECDSA) and Elliptic Elliptic Curve support via Elliptic Curve DSA (ECDSA) and Elliptic
Curve Diffie-Hellman (ECDH) and alternative hash functions have been Curve Diffie-Hellman (ECDH) has been added.
added.
1.1. A New Namespace and Identifiers 1.1. A New Namespace and Identifiers
The Host Identity Protocol introduces a new namespace, the Host The Host Identity Protocol introduces a new namespace, the Host
Identity namespace. Some ramifications of this new namespace are Identity namespace. Some ramifications of this new namespace are
explained in the HIP architecture description explained in the HIP architecture description [HIP-ARCH].
[I-D.ietf-hip-rfc4423-bis].
There are two main representations of the Host Identity, the full There are two main representations of the Host Identity, the full
Host Identity (HI) and the Host Identity Tag (HIT). The HI is a Host Identity (HI) and the Host Identity Tag (HIT). The HI is a
public key and directly represents the Identity of a host. Since public key and directly represents the Identity of a host. Since
there are different public key algorithms that can be used with there are different public key algorithms that can be used with
different key lengths, the HI, as such, is unsuitable for use as a different key lengths, the HI, as such, is unsuitable for use as a
packet identifier, or as an index into the various state-related packet identifier, or as an index into the various state-related
implementation structures needed to support HIP. Consequently, a implementation structures needed to support HIP. Consequently, a
hash of the HI, the Host Identity Tag (HIT), is used as the hash of the HI, the Host Identity Tag (HIT), is used as the
operational representation. The HIT is 128 bits long and is used in operational representation. The HIT is 128 bits long and is used
the HIP headers and to index the corresponding state in the end in the HIP headers and to index the corresponding state in the
hosts. The HIT has an important security property in that it is end hosts. The HIT has an important security property in that it
self-certifying (see Section 3). is self-certifying (see Section 3).
1.2. The HIP Base Exchange (BEX) 1.2. The HIP Base Exchange (BEX)
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 [KRA03] four-packet exchange. The first party is a SIGMA-compliant [KRA03] four-packet exchange. The first party is
called the Initiator and the second party the Responder. The called the Initiator and the second party the Responder. The
protocol exchanges Diffie-Hellman [DIF76] keys in the 2nd and 3rd protocol exchanges Diffie-Hellman [DIF76] keys in the 2nd and 3rd
packets, and authenticates the parties in the 3rd and 4th packets. packets, and authenticates the parties in the 3rd and 4th packets.
The four-packet design helps to make HIP DoS resilient. It allows The four-packet design helps to make HIP resistant to DoS attacks.
the Responder to stay stateless until the IP address and the It allows the Responder to stay stateless until the IP address and
cryptographic puzzle is verified. The Responder starts the puzzle the cryptographic puzzle are verified. The Responder starts the
exchange in the 2nd packet, with the Initiator completing it in the puzzle exchange in the 2nd packet, with the Initiator completing it
3rd packet before the Responder stores any state from the exchange. in the 3rd packet before the Responder stores 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 the 3rd packet (although Aura, et al., Identity of the Initiator in the 3rd packet (although Aura, et al.
[AUR03] notes that such operation may interfere with packet- [AUR05] note that such operation may interfere with packet-inspecting
inspecting middleboxes), or the Host Identity may instead be sent middleboxes), or the Host Identity may instead be sent unencrypted.
unencrypted. The Responder's Host Identity is not protected. It The Responder's Host Identity is not protected. It should be noted,
should be noted, however, that both the Initiator's and the however, that both the Initiator's and the Responder's HITs are
Responder's HITs are transported as such (in cleartext) in the transported as such (in cleartext) in the packets, allowing an
packets, allowing an eavesdropper with a priori knowledge about the eavesdropper with a priori knowledge about the parties to identify
parties to identify them by their HITs. Hence, encrypting the HI of them by their HITs. Hence, encrypting the HI of any party does not
any party does not provide privacy against such attacker. provide privacy against such an attacker.
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 may be defined later. of this may be defined later.
An existing HIP association can be updated using the update mechanism An existing HIP association can be updated using the update mechanism
defined in this document, and when the association is no longer defined in this document, and when the association is no longer
needed, it can be closed using the defined closing mechanism. 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 Encapsulating Security
(ESP) [I-D.ietf-hip-rfc5202-bis] and other end-to-end security Payload (ESP) [RFC7402] and other end-to-end security protocols. The
protocols. The base protocol does not cover all the fine-grained base protocol does not cover all the fine-grained policy control
policy control found in Internet Key Exchange (IKE) [RFC5996] that found in Internet Key Exchange (IKE) [RFC7296] that allows IKE to
allows IKE to support complex gateway policies. Thus, HIP is not a support complex gateway policies. Thus, HIP is not a complete
complete replacement for IKE. replacement for IKE.
1.3. Memo Structure 1.3. Memo Structure
The rest of this memo is structured as follows. Section 2 defines The rest of this memo is structured as follows. Section 2 defines
the central keywords, notation, and terms used throughout the rest of the central keywords, notation, and terms used throughout the rest of
the document. Section 3 defines the structure of the Host Identity the document. Section 3 defines the structure of the Host Identity
and its various representations. Section 4 gives an overview of the and its various representations. Section 4 gives an overview of the
HIP base exchange protocol. Sections 5 and 6 define the detailed HIP base exchange protocol. Sections 5 and 6 define the detailed
packet formats and rules for packet processing. Finally, Sections 7, packet formats and rules for packet processing. Finally, Sections 7,
8, and 9 discuss policy, security, and IANA considerations, 8, and 9 discuss policy, security, and IANA considerations,
skipping to change at page 8, line 18 skipping to change at page 8, line 7
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 RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
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 y is a parameter of X. X(y) indicates that y is a parameter of X.
<x>i indicates that x exists i times. <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 (H(x), K) denotes the lowest order #K bits of the result of Ltrunc (H(x), #K)
the hash function H on the input x. denotes the lowest-order #K bits of the result of the
hash function H on the input x.
2.3. Definitions 2.3. Definitions
HIP base exchange (BEX): the handshake for establishing a new HIP HIP base exchange (BEX): The handshake for establishing a new HIP
association. association.
Host Identity (HI): The public key of the signature algorithm that Host Identity (HI): The public key of the signature algorithm that
represents the identity of the host. In HIP, a host proves its represents the identity of the host. In HIP, a host proves its
identity by creating a signature with the private key belonging to identity by creating a signature with the private key belonging to
its HI (c.f. Section 3). its HI (cf. Section 3).
Host Identity Tag (HIT): A shorthand for the HI in IPv6 format. It Host Identity Tag (HIT): A shorthand for the HI in IPv6 format. It
is generated by hashing the HI (c.f. Section 3.1). is generated by hashing the HI (cf. Section 3.1).
HIT Suite: A HIT Suite groups all cryptographic algorithms that are HIT Suite: A HIT Suite groups all cryptographic algorithms that are
required to generate and use an HI and its HIT. In particular, required to generate and use an HI and its HIT. In particular,
these algorithms are: 1) the public key signature algorithm and 2) these algorithms are 1) the public key signature algorithm, 2) the
the hash function, 3) the truncation (c.f. Appendix E). hash function, and 3) the truncation (cf. Appendix E).
HIP association: The shared state between two peers after HIP association: The shared state between two peers after completion
completion of the BEX. of the BEX.
HIP packet: A control packet carrying a HIP packet header relating HIP packet: A control packet carrying a HIP packet header relating
to the establishment, maintenance, or termination of the HIP to the establishment, maintenance, or termination of the HIP
association. association.
Initiator: The host that initiates the BEX. This role is typically Initiator: The host that initiates the BEX. This role is typically
forgotten once the BEX is completed. forgotten once the BEX is completed.
Responder: The host that responds to the Initiator in the BEX. Responder: The host that responds to the Initiator in the BEX. This
This role is typically forgotten once the BEX is completed. role is typically forgotten once the BEX is completed.
Responder's HIT Hash Algorithm (RHASH): The Hash algorithm used for Responder's HIT hash algorithm (RHASH): The hash algorithm used for
various hash calculations in this document. The algorithm is the various hash calculations in this document. The algorithm is the
same as is used to generate the Responder's HIT. The RHASH is the same as is used to generate the Responder's HIT. The RHASH is the
hash function defined by the HIT Suite of the Responder's HIT hash function defined by the HIT Suite of the Responder's HIT
(c.f. Section 5.2.10). (cf. Section 5.2.10).
Length of the Responder's HIT Hash Algorithm (RHASH_len): The Length of the Responder's HIT hash algorithm (RHASH_len): The
natural output length of RHASH in bits. natural output length of RHASH in bits.
Signed data: Data that is signed is protected by a digital Signed data: Data that is signed is protected by a digital signature
signature that was created by the sender of the data by using the that was created by the sender of the data by using the private
private key of its HI. key of its HI.
KDF: The Key Derivation Function (KDF) is used for deriving the KDF: The Key Derivation Function (KDF) is used for deriving the
symmetric keys from the Diffie-Hellman key exchange. symmetric keys from the Diffie-Hellman key exchange.
KEYMAT: The keying material derived from the Diffie-Hellman key KEYMAT: The keying material derived from the Diffie-Hellman key
exchange by using the KDF. Symmetric keys for encryption and exchange by using the KDF. Symmetric keys for encryption and
integrity protection of HIP packets and encrypted user data integrity protection of HIP packets and encrypted user data
packets are drawn from this keying material. packets are drawn from this keying material.
3. Host Identity (HI) and its Structure 3. Host Identity (HI) and Its Structure
In this section, the properties of the Host Identity and Host In this section, the properties of the Host Identity and Host
Identity Tag are discussed, and the exact format for them is defined. Identity Tag are discussed, and the exact format for them is defined.
In HIP, the public key of an asymmetric key pair is used as the Host In HIP, the public key of an asymmetric key pair is used as the Host
Identity (HI). Correspondingly, the host itself is defined as the Identity (HI). Correspondingly, the host itself is defined as the
entity that holds the private key of the key pair. See the HIP entity that holds the private key of the key pair. See the HIP
architecture specification [I-D.ietf-hip-rfc4423-bis] for more architecture specification [HIP-ARCH] for more details on the
details on the difference between an identity and the corresponding difference between an identity and the corresponding identifier.
identifier.
HIP implementations MUST support the Rivest Shamir Adelman [RSA] HIP implementations MUST support the Rivest Shamir Adleman [RSA]
public key algorithm and the Elliptic Curve Digital Signature public key algorithm and the Elliptic Curve Digital Signature
Algorithm (ECDSA) for generating the HI as defined in Section 5.2.9. Algorithm (ECDSA) for generating the HI as defined in Section 5.2.9.
Additional algorithms MAY be supported. Additional algorithms MAY be supported.
A hashed encoding of the HI, the Host Identity Tag (HIT), is used in A hashed encoding of the HI, the Host Identity Tag (HIT), is used in
protocols to represent the Host Identity. The HIT is 128 bits long protocols to represent the Host Identity. The HIT is 128 bits long
and has the following three key properties: i) it is the same length and has the following three key properties: i) it is the same length
as an IPv6 address and can be used in fixed address-sized fields in as an IPv6 address and can be used in fixed address-sized fields in
APIs and protocols, ii) it is self-certifying (i.e., given a HIT, it APIs 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 is computationally hard to find a Host Identity key that matches the
HIT), and iii) the probability of a HIT collision between two hosts HIT); and iii) the probability of a HIT collision between two hosts
is very low, hence, it is infeasible for an attacker to find a is very low; hence, it is infeasible for an attacker to find a
collision with a HIT that is in use. For details on the security collision with a HIT that is in use. For details on the security
properties of the HIT see [I-D.ietf-hip-rfc4423-bis]. properties of the HIT, see [HIP-ARCH].
The structure of the HIT is defined in [RFC7343]. The HIT is an The structure of the HIT is defined in [RFC7343]. The HIT is an
Overlay Routable Cryptographic Hash Identifier (ORCHID) and consists Overlay Routable Cryptographic Hash Identifier (ORCHID) and consists
of three parts: first, an IANA assigned prefix to distinguish it from of three parts: first, an IANA-assigned prefix to distinguish it from
other IPv6 addresses. Second, a four-bit encoding of the algorithms other IPv6 addresses; second, a four-bit encoding of the algorithms
that were used for generating the HI and the hashed representation of that were used for generating the HI and the hashed representation of
HI. Third, a 96-bit hashed representation of the Host Identity. The HI; third, a 96-bit hashed representation of the Host Identity. The
encoding of the ORCHID generation algorithm and the exact algorithm encoding of the ORCHID generation algorithm and the exact algorithm
for generating the hashed representation is specified in Appendix E for generating the hashed representation are specified in Appendix E
and [RFC7343]. and [RFC7343].
Carrying HIs and HITs in the header of user data packets would Carrying HIs and HITs in the header of user data packets would
increase the overhead of packets. Thus, it is not expected that they increase the overhead of packets. Thus, it is not expected that they
are carried in every packet, but other methods are used to map the are carried in every packet, but other methods are used to map the
data packets to the corresponding HIs. In some cases, this makes it data packets to the corresponding HIs. In some cases, this makes it
possible to use HIP without any additional headers in the user data possible to use HIP without any additional headers in the user data
packets. For example, if ESP is used to protect data traffic, the packets. For example, if ESP is used to protect data traffic, the
Security Parameter Index (SPI) carried in the ESP header can be used Security Parameter Index (SPI) carried in the ESP header can be used
to map the encrypted data packet to the correct HIP association. to map the encrypted data packet to the correct HIP association.
3.1. Host Identity Tag (HIT) 3.1. Host Identity Tag (HIT)
The Host Identity Tag is a 128-bit value -- a hashed encoding of the The Host Identity Tag is a 128-bit value -- a hashed encoding of the
Host Identifier. There are two advantages of using a hashed encoding Host Identifier. There are two advantages of using a hashed encoding
over the actual variable-sized Host Identity public key in protocols. over the actual variable-sized Host Identity public key in protocols.
First, the fixed length of the HIT keeps packet sizes manageable and First, the fixed length of the HIT keeps packet sizes manageable and
eases protocol coding. Second, it presents a consistent format for eases protocol coding. Second, it presents a consistent format for
the protocol, independent of the underlying identity technology in the protocol, independent of the underlying identity technology
use. in use.
RFC 7343 [RFC7343] specifies 128-bit hash-based identifiers, called RFC 7343 [RFC7343] specifies 128-bit hash-based identifiers, called
Overlay Routable Cryptographic Hash Identifiers, ORCHIDs. Their ORCHIDs. Their prefix, allocated from the IPv6 address block, is
prefix, allocated from the IPv6 address block, is defined in defined in [RFC7343]. The Host Identity Tag is one type of ORCHID.
[RFC7343]. The Host Identity Tag is one type of an ORCHID.
This document extends the original, experimental HIP specification This document extends the original, experimental HIP specification
[RFC5201] with measures to support crypto agility. One of these [RFC5201] with measures to support crypto agility. One of these
measures is to allow different hash functions for creating a HIT. measures allows different hash functions for creating a HIT. HIT
HIT Suites group the sets of algorithms that are required to generate Suites group the sets of algorithms that are required to generate and
and use a particular HIT. The Suites are encoded in HIT Suite IDs. use a particular HIT. The Suites are encoded in HIT Suite IDs.
These HIT Suite IDs are transmitted in the ORCHID Generation These HIT Suite IDs are transmitted in the ORCHID Generation
Algorithm (OGA) field in the ORCHID. With the HIT Suite ID in the Algorithm (OGA) field in the ORCHID. With the HIT Suite ID in the
OGA field, a host can tell from another host's HIT, whether it OGA ID field, a host can tell, from another host's HIT, whether it
supports the necessary hash and signature algorithms to establish a supports the necessary hash and signature algorithms to establish a
HIP association with that host. HIP association with that host.
3.2. Generating a HIT from an HI 3.2. Generating a HIT from an HI
The HIT MUST be generated according to the ORCHID generation method The HIT MUST be generated according to the ORCHID generation method
described in [RFC7343] using a context ID value of 0xF0EF F02F BFF4 described in [RFC7343] using a context ID value of 0xF0EF F02F BFF4
3D0F E793 0C3C 6E61 74EA (this tag value has been generated randomly 3D0F E793 0C3C 6E61 74EA (this tag value has been generated randomly
by the editor of this specification), and an input that encodes the by the editor of this specification), and an input that encodes the
Host Identity field (see Section 5.2.9) present in a HIP payload Host Identity field (see Section 5.2.9) present in a HIP payload
packet. The set of hash function, signature algorithm, and the packet. The set of hash function, signature algorithm, and the
algorithm used for generating the HIT from the HI depends on the HIT algorithm used for generating the HIT from the HI depends on the HIT
Suite (see Section 5.2.10) and is indicated by the four bits of the Suite (see Section 5.2.10) and is indicated by the four bits of the
ORCHID Generation Algorithm (OGA) field in the ORCHID. Currently, OGA ID field in the ORCHID. Currently, truncated SHA-1, truncated
truncated SHA-1, truncated SHA-384, and truncated SHA-256 SHA-384, and truncated SHA-256 [FIPS.180-4.2012] are defined as
[FIPS.180-2.2002] are defined as hashes for generating a HIT. hashes for generating a HIT.
For identities that are either RSA, Digital Signature Algorithm (DSA) For identities that are either RSA, Digital Signature Algorithm (DSA)
[FIPS186-3], or Elliptic Curve DSA (ECDSA) public keys, the ORCHID [FIPS.186-4.2013], or Elliptic Curve DSA (ECDSA) public keys, the
input consists of the public key encoding as specified for the Host ORCHID input consists of the public key encoding as specified for the
Identity field of the HOST_ID parameter (see Section 5.2.9). This Host Identity field of the HOST_ID parameter (see Section 5.2.9).
document defines four algorithm profiles: RSA, DSA, ECDSA, and This document defines four algorithm profiles: RSA, DSA, ECDSA, and
ECDSA_LOW. The ECDSA_LOW profile is meant for devices with low ECDSA_LOW. The ECDSA_LOW profile is meant for devices with low
computational capabilities. Hence, one of the following applies: computational capabilities. Hence, one of the following applies:
The RSA public key is encoded as defined in [RFC3110] Section 2, The RSA public key is encoded as defined in [RFC3110], Section 2,
taking the exponent length (e_len), exponent (e), and modulus (n) taking the exponent length (e_len), exponent (e), and modulus (n)
fields concatenated. The length (n_len) of the modulus (n) can be fields concatenated. The length (n_len) of the modulus (n) can be
determined from the total HI Length and the preceding HI fields determined from the total HI Length and the preceding HI fields
including the exponent (e). Thus, the data that serves as input including the exponent (e). Thus, the data that serves as input
for the HIT generation has the same length as the HI. The fields for the HIT generation has the same length as the HI. The fields
MUST be encoded in network byte order, as defined in [RFC3110]. MUST be encoded in network byte order, as defined in [RFC3110].
The DSA public key is encoded as defined in [RFC2536] Section 2, The DSA public key is encoded as defined in [RFC2536], Section 2,
taking the fields T, Q, P, G, and Y, concatenated as input. Thus, taking the fields T, Q, P, G, and Y, concatenated as input. Thus,
the data to be hashed is 1 + 20 + 3 * 64 + 3 * 8 * T octets long, 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]. The size where T is the size parameter as defined in [RFC2536]. The size
parameter T, affecting the field lengths, MUST be selected as the parameter T, affecting the field lengths, MUST be selected as the
minimum value that is long enough to accommodate P, G, and Y. 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 fields MUST be encoded in network byte order, as defined in
[RFC2536]. [RFC2536].
The ECDSA public keys are encoded as defined in [RFC6090] The ECDSA public keys are encoded as defined in Sections 4.2 and 6
Section 4.2 and 6. of [RFC6090].
In Appendix B, the public key encoding process is illustrated using In Appendix B, the public key encoding process is illustrated using
pseudo-code. pseudo-code.
4. Protocol Overview 4. Protocol Overview
This section is a simplified overview of the HIP protocol operation, This section is a simplified overview of the HIP protocol operation,
and does not contain all the details of the packet formats or the and does not contain all the details of the packet formats or the
packet processing steps. Sections 5 and 6 describe in more detail packet processing steps. Sections 5 and 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 protocol number 139 has been assigned by IANA to the Host The protocol number 139 has been assigned by IANA to the Host
Identity Protocol. Identity Protocol.
The HIP payload (Section 5.1) header could be carried in every IP The HIP payload (Section 5.1) header could be carried in every IP
datagram. However, since HIP headers are relatively large (40 datagram. However, since HIP headers are relatively large
bytes), it is desirable to 'compress' the HIP header so that the HIP (40 bytes), it is desirable to 'compress' the HIP header so that the
header only occurs in control packets used to establish or change HIP HIP header only occurs in control packets used to establish or change
association state. The actual method for header 'compression' and HIP association state. The actual method for header 'compression'
for matching data packets with existing HIP associations (if any) is and for matching data packets with existing HIP associations (if any)
defined in separate documents, describing transport formats and is defined in separate documents, describing transport formats and
methods. All HIP implementations MUST implement, at minimum, the ESP methods. All HIP implementations MUST implement, at minimum, the ESP
transport format for HIP [I-D.ietf-hip-rfc5202-bis]. transport format for HIP [RFC7402].
4.1. Creating a HIP Association 4.1. Creating a HIP Association
By definition, the system initiating a HIP base exchange is the By definition, the system initiating a HIP base exchange is the
Initiator, and the peer is the Responder. This distinction is Initiator, and the peer is the Responder. This distinction is
typically forgotten once the base exchange completes, and either typically forgotten once the base exchange completes, and either
party can become the Initiator in future communications. party can become the 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,
skipping to change at page 13, line 13 skipping to change at page 12, line 51
drawn from this keying material by using a Key Derivation Function drawn from this keying material by using a Key Derivation Function
(KDF). If other cryptographic keys are needed, e.g., to be used with (KDF). If other cryptographic keys are needed, e.g., to be used with
ESP, they are expected to be drawn from the same keying material by ESP, they are expected to be drawn from the same keying material by
using the KDF. using the KDF.
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 the HIT of the Initiator and possibly the HIT of The packet contains the HIT of the Initiator and possibly the HIT of
the Responder, if it is known. Moreover, the I1 packet initializes the Responder, if it is known. Moreover, the I1 packet initializes
the negotiation of the Diffie-Hellman group that is used for the negotiation of the Diffie-Hellman group that is used for
generating the keying material. Therefore, the I1 packet contains a generating the keying material. Therefore, the I1 packet contains a
list of Diffie Hellman Group IDs supported by the Initiator. Note list of Diffie-Hellman Group IDs supported by the Initiator. Note
that in some cases it may be possible to replace this trigger packet 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 some other form of a trigger, in which case the protocol starts
with the Responder sending the R1 packet. In such cases, another with the Responder sending the R1 packet. In such cases, another
mechanism to convey the Initiator's supported DH Groups (e.g., by mechanism to convey the Initiator's supported DH groups (e.g., by
using a default group) must be specified. using a default group) must be specified.
The second packet, R1, starts the actual authenticated Diffie-Hellman The second packet, R1, starts the actual authenticated Diffie-Hellman
exchange. It contains a puzzle -- a cryptographic challenge that the exchange. It contains a puzzle -- a cryptographic challenge that the
Initiator must solve before continuing the exchange. The level of Initiator must solve before continuing the exchange. The level of
difficulty of the puzzle can be adjusted based on level of trust with difficulty of the puzzle can be adjusted based on the level of trust
the Initiator, current load, or other factors. In addition, the R1 with the Initiator, the current load, or other factors. In addition,
contains the Responder's Diffie-Hellman parameter and lists of the R1 contains the Responder's Diffie-Hellman parameter and lists of
cryptographic algorithms supported by the Responder. Based on these cryptographic algorithms supported by the Responder. Based on these
lists, the Initiator can continue, abort, or restart the base lists, the Initiator can continue, abort, or restart the base
exchange with a different selection of cryptographic algorithms. exchange with a different selection of cryptographic algorithms.
Also, the R1 packet contains a signature that covers selected parts Also, the R1 packet contains a signature that covers selected parts
of the message. Some fields are left outside the signature to of the message. Some fields are left outside the signature to
support pre-created R1s. support 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 packet also contains a Diffie-Hellman parameter discarded. The I2 packet also contains a Diffie-Hellman parameter
skipping to change at page 14, line 35 skipping to change at page 14, line 40
The purpose of the HIP puzzle 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 the I2 packet. Furthermore, to delay state creation until receiving the I2 packet. Furthermore,
the puzzle allows the Responder to use a fairly cheap calculation to the puzzle allows the Responder to use a fairly cheap calculation to
check that the Initiator is "sincere" in the sense that it has check that the Initiator is "sincere" in the sense that it has
churned enough CPU cycles in solving the puzzle. churned enough CPU cycles in solving the puzzle.
The puzzle allows a Responder implementation to completely delay The puzzle allows a Responder implementation to completely delay
association-specific state creation until a valid I2 packet is association-specific state creation until a valid I2 packet is
received. An I2 packet without valid puzzle solution can be rejected received. An I2 packet without a valid puzzle solution can be
immediately once the Responder has checked the solution by computing rejected immediately once the Responder has checked the solution.
only one hash function before state is created and CPU-intensive The solution can be checked by computing only one hash function, and
public-key signature verification and Diffie-Hellman key generation invalid solutions can be rejected before state is created, and before
are performed. By varying the difficulty of the puzzle, the CPU-intensive public-key signature verification and Diffie-Hellman
Responder can frustrate CPU or memory targeted DoS attacks. key generation are performed. By varying the difficulty of the
puzzle, the Responder can frustrate CPU- or memory-targeted DoS
attacks.
The Responder can remain stateless and drop most spoofed I2 packets The Responder can remain stateless and drop most spoofed I2 packets
because puzzle calculation is based on the Initiator's Host Identity because puzzle calculation is based on the Initiator's Host Identity
Tag. The idea is that the Responder has a (perhaps varying) number of Tag. The idea is that the Responder has a (perhaps varying) number
pre-calculated R1 packets, and it selects one of these based on the of pre-calculated R1 packets, and it selects one of these based on
information carried in the I1 packet. When the Responder then later the information carried in the I1 packet. When the Responder then
receives the I2 packet, it can verify that the puzzle has been solved later receives the I2 packet, it can verify that the puzzle has been
using the Initiator's HIT. This makes it impractical for the solved using the Initiator's HIT. This makes it impractical for the
attacker to first exchange one I1/R1 packet, and then generate a attacker to first exchange one I1/R1 packet, and then generate a
large number of spoofed I2 packets that seemingly come from different large number of spoofed I2 packets that seemingly come from different
HITs. This method does not protect the Responder from an attacker HITs. This method does not protect the Responder from an attacker
that uses fixed HITs, though. Against such an attacker, a viable that uses fixed HITs, though. Against such an attacker, a viable
approach may be to create a piece of local state, and remember that approach may be to create a piece of local state, and remember that
the puzzle check has previously failed. See Appendix A for one the puzzle check has previously failed. See Appendix A for one
possible implementation. Responder implementations SHOULD include possible implementation. Responder implementations SHOULD include
sufficient randomness in the puzzle values so that algorithmic sufficient randomness in the puzzle values so that algorithmic
complexity attacks become impossible [CRO03]. complexity attacks become impossible [CRO03].
The Responder can set the puzzle difficulty for the Initiator, based The Responder can set the puzzle difficulty for the Initiator, based
on its level of trust of the Initiator. Because the puzzle is not on its level of trust of the Initiator. Because the puzzle is not
included in the signature calculation, the Responder can use pre- included in the signature calculation, the Responder can use
calculated R1 packets and include the puzzle just before sending the pre-calculated R1 packets and include the puzzle just before sending
R1 to the Initiator. The Responder SHOULD use heuristics to the R1 to the Initiator. The Responder SHOULD use heuristics to
determine when it is under a denial-of-service attack, and set the determine when it is under a denial-of-service attack, and set the
puzzle difficulty value #K appropriately as explained later. puzzle difficulty value #K appropriately, as explained later.
4.1.2. Puzzle Exchange 4.1.2. Puzzle Exchange
The Responder starts the puzzle exchange when it receives an I1 The Responder starts the puzzle exchange when it receives an I1
packet. The Responder supplies a random number #I, and requires the packet. The Responder supplies a random number #I, and requires the
Initiator to find a number J. To select a proper #J, the Initiator Initiator to find a number #J. To select a proper #J, the Initiator
must create the concatenation of #I, the HITs of the parties, and #J, must create the concatenation of #I, the HITs of the parties, and #J,
and calculate a hash over this concatenation using the RHASH and calculate a hash over this concatenation using the RHASH
algorithm. The lowest order #K bits of the result MUST be zeros. algorithm. The lowest-order #K bits of the result MUST be zeros.
The value #K sets the difficulty of the puzzle. 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 zeros. The number of #Js until one produces the hash target of zeros. The
Initiator SHOULD give up after exceeding the puzzle Lifetime in the Initiator SHOULD give up after exceeding the puzzle Lifetime in the
PUZZLE parameter (as described in Section 5.2.4). The Responder PUZZLE parameter (as described in Section 5.2.4). The Responder
needs to re-create the concatenation of #I, the HITs, and the needs to re-create the concatenation of #I, the HITs, and the
provided #J, and compute the hash once to prove that the Initiator provided #J, and compute the hash once to prove that the Initiator
completed its assigned task. completed its assigned task.
To prevent precomputation attacks, the Responder MUST select the To prevent precomputation 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 #I was indeed selected by it and not by the Initiator. See the value #I was indeed selected by it and not by the Initiator. See
Appendix A for an example on how to implement this. Appendix A for an example on how to implement this.
Using the Opaque data field in the PUZZLE (see Section 5.2.4), in an Using the Opaque data field in the PUZZLE (see Section 5.2.4) in an
ECHO_REQUEST_SIGNED (see Section 5.2.20) or in an ECHO_REQUEST_SIGNED (see Section 5.2.20) or in an
ECHO_REQUEST_UNSIGNED parameter (see Section 5.2.21), the Responder ECHO_REQUEST_UNSIGNED parameter (see Section 5.2.21), the Responder
can include some data in R1 that the Initiator MUST copy unmodified can include some data in R1 that the Initiator MUST copy unmodified
in the corresponding I2 packet. The Responder can use the opaque in the corresponding I2 packet. The Responder can use the opaque
data to transfer a piece of local state information to the Initiator data to transfer a piece of local state information to the Initiator
and back, for example to recognize that the I2 is a response to a and back -- for example, to recognize that the I2 is a response to a
previously sent R1. The Responder can generate the Opaque data in previously sent R1. The Responder can generate the opaque data in
various ways; e.g., using encryption or hashing with some secret, the various ways, e.g., using encryption or hashing with some secret, the
sent #I, and possibly using other related data. With the same sent #I, and possibly using other related data. With the same
secret, the received #I (from the I2 packet), and the other related secret, the received #I (from the I2 packet), and the other related
data (if any), the Responder can verify that it has itself sent the data (if any), the Responder can verify that it has itself sent the
#I to the Initiator. The Responder MUST periodically change such a #I to the Initiator. The Responder MUST periodically change such a
secret. secret.
It is RECOMMENDED that the Responder generates new secrets for the It is RECOMMENDED that the Responder generates new secrets for the
puzzle and new R1s once every few minutes. Furthermore, it is puzzle and new R1s once every few minutes. Furthermore, it is
RECOMMENDED that the Responder is able to verify valid puzzle RECOMMENDED that the Responder is able to verify a valid puzzle
solution at least Lifetime seconds after the puzzle secret has been solution at least Lifetime seconds after the puzzle secret has been
deprecated. This time value guarantees that the puzzle is valid for deprecated. This time value guarantees that the puzzle is valid for
at least Lifetime and at most 2 * Lifetime seconds. This limits the at least Lifetime and at most 2 * Lifetime seconds. This limits the
usability that an old, solved puzzle has to an attacker. Moreover, usability that an old, solved puzzle has to an attacker. Moreover,
it avoids problems with the validity of puzzles if the lifetime is it avoids problems with the validity of puzzles if the lifetime is
relatively short compared to the network delay and the time for relatively short compared to the network delay and the time for
solving the puzzle. solving the puzzle.
The puzzle value #I and the solution #J are inputs for deriving the The puzzle value #I and the solution #J are inputs for deriving the
keying material from the Diffie-Hellman key exchange (see keying material from the Diffie-Hellman key exchange (see
Section 6.5). Therefore, a Responder SHOULD NOT use the same puzzle Section 6.5). Therefore, to ensure that the derived keying material
#I with the same DH keys for the same Initiator twice to ensure that differs, a Responder SHOULD NOT use the same puzzle #I with the same
the derived keying material differs. Such uniqueness can be DH keys for the same Initiator twice. Such uniqueness can be
achieved, for example, by using a counter as an additional input for achieved, for example, by using a counter as an additional input for
generating #I. This counter can be increased for each processed I1 generating #I. This counter can be increased for each processed I1
packet. The state of the counter can be transmitted in the Opaque packet. The state of the counter can be transmitted in the Opaque
data field in the PUZZLE (see Section 5.2.4), in an data field in the PUZZLE (see Section 5.2.4), in an
ECHO_REQUEST_SIGNED (see Section 5.2.20) or in an ECHO_REQUEST_SIGNED parameter (see Section 5.2.20), or in an
ECHO_REQUEST_UNSIGNED parameter (see Section 5.2.21) without the need ECHO_REQUEST_UNSIGNED parameter (see Section 5.2.21) without the need
to establish state. to establish state.
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 to avoid attacks. The decision was to NOT include a timestamp, to avoid
problems with global time synchronization. problems with global time synchronization.
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. function. The decision was to not use memory-bound functions.
4.1.3. Authenticated Diffie-Hellman Protocol with DH Group Negotiation 4.1.3. Authenticated Diffie-Hellman Protocol with DH Group Negotiation
The packets R1, I2, and R2 implement a standard authenticated Diffie- The packets R1, I2, and R2 implement a standard authenticated
Hellman exchange. The Responder sends one of its public Diffie- Diffie-Hellman exchange. The Responder sends one of its public
Hellman keys and its public authentication key, i.e., its Host Diffie-Hellman keys and its public authentication key, i.e., its Host
Identity, in R1. The signature in the R1 packet allows the Initiator Identity, in R1. The signature in the R1 packet allows the Initiator
to verify that the R1 has been once generated by the Responder. to verify that the R1 has been once generated by the Responder.
However, since the R1 is precomputed and therefore does not cover However, since the R1 is precomputed and therefore does not cover
association-specific information in the I1 packet, it does not association-specific information in the I1 packet, it does not
protect from replay attacks. protect against replay attacks.
Before the actual authenticated Diffie-Hellman exchange, the Before the actual authenticated Diffie-Hellman exchange, the
Initiator expresses its preference regarding its choice of the DH Initiator expresses its preference regarding its choice of the DH
groups in the I1 packet. The preference is expressed as a sorted groups in the I1 packet. The preference is expressed as a sorted
list of DH Group IDs. The I1 packet is not protected by a signature. list of DH Group IDs. The I1 packet is not protected by a signature.
Therefore, this list is sent in an unauthenticated way to avoid Therefore, this list is sent in an unauthenticated way to avoid
costly computations for processing the I1 packet at the Responder costly computations for processing the I1 packet at the Responder
side. Based on the preferences of the Initiator, the Responder sends side. Based on the preferences of the Initiator, the Responder sends
an R1 packet containing its most suitable public DH value. The an R1 packet containing its most suitable public DH value. The
Responder also attaches a list of its own preferences to the R1 to Responder also attaches a list of its own preferences to the R1 to
convey the basis for the DH group selection to the Initiator. This convey the basis for the DH group selection to the Initiator. This
list is carried in the signed part of the R1 packet. If the choice list is carried in the signed part of the R1 packet. If the choice
of the DH group value in the R1 does not match the preferences of the of the DH group value in the R1 does not match the preferences of the
Initiator and the Responder, the Initiator can detect that the list Initiator and the Responder, the Initiator can detect that the list
of DH Group IDs in the I1 was manipulated (see below for details). of DH Group IDs in the I1 was manipulated (see below for details).
If none of the DH Group IDs in the I1 packet is supported by the If none of the DH Group IDs in the I1 packet are supported by the
Responder, the Responder selects the DH Group most suitable for it Responder, the Responder selects the DH group most suitable for it,
regardless of the Initiator's preference. It then sends the R1 regardless of the Initiator's preference. It then sends the R1
containing this DH Group and its list of supported DH Group IDs to containing this DH group and its list of supported DH Group IDs to
the Initiator. the Initiator.
When the Initiator receives an R1, it receives one of the Responder's When the Initiator receives an R1, it receives one of the Responder's
public Diffie-Hellman values and the list of DH Group IDs supported public Diffie-Hellman values and the list of DH Group IDs supported
by the Responder. This list is covered by the signature in the R1 by the Responder. This list is covered by the signature in the R1
packet to avoid forgery. The Initiator compares the Group ID of the packet to avoid forgery. The Initiator compares the Group ID of the
public DH value in the R1 packet to the list of supported DH Group public DH value in the R1 packet to the list of supported DH Group
IDs in the R1 packets and to its own preferences expressed in the IDs in the R1 packets and to its own preferences expressed in the
list of supported DH Group IDs. The Initiator continues the BEX only list of supported DH Group IDs. The Initiator continues the BEX only
if the Group ID of the public DH value of the Responder is the most if the Group ID of the public DH value of the Responder is the most
preferred of the IDs supported by both the Initiator and Responder. preferred of the IDs supported by both the Initiator and Responder.
Otherwise, the communication is subject of a downgrade attack and the Otherwise, the communication is subject to a downgrade attack, and
Initiator MUST either restart the base exchange with a new I1 packet the Initiator MUST either restart the base exchange with a new I1
or abort the base exchange. If the Responder's choice of the DH packet or abort the base exchange. If the Responder's choice of the
Group is not supported by the Initiator, the Initiator MAY abort the DH group is not supported by the Initiator, the Initiator MAY abort
handshake or send a new I1 packet with a different list of supported the handshake or send a new I1 packet with a different list of
DH Groups. However, the Initiator MUST verify the signature of the supported DH groups. However, the Initiator MUST verify the
R1 packet before restarting or aborting the handshake. It MUST signature of the R1 packet before restarting or aborting the
silently ignore the R1 packet if the signature is not valid. handshake. It MUST silently ignore the R1 packet if the signature is
not valid.
If the preferences regarding the DH Group ID match, the Initiator If the preferences regarding the DH Group ID match, the Initiator
computes the Diffie-Hellman session key (Kij). The Initiator creates computes the Diffie-Hellman session key (Kij). The Initiator creates
a HIP association using keying material from the session key (see a HIP association using keying material from the session key (see
Section 6.5), and may use the HIP association to encrypt its public Section 6.5) and may use the HIP association to encrypt its public
authentication key, i.e., the Host Identity. The resulting I2 packet authentication key, i.e., the Host Identity. The resulting I2 packet
contains the Initiator's Diffie-Hellman key and its (optionally contains the Initiator's Diffie-Hellman key and its (optionally
encrypted) public authentication key. The signature of the I2 encrypted) public authentication key. The signature of the I2
message covers all parameters of the signed parameter ranges (see message covers all parameters of the signed parameter ranges (see
Section 5.2) in the packet without exceptions as in the R1. Section 5.2) in the packet without exceptions, as in the R1.
The Responder extracts the Initiator's Diffie-Hellman public key from The Responder extracts the Initiator's Diffie-Hellman public key from
the I2 packet, computes the Diffie-Hellman session key, creates a the I2 packet, 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, completes the BEX and protects the Initiator The final message, R2, completes the BEX and protects the Initiator
against replay attacks because the Responder uses the shared key from against replay attacks, because the Responder uses the shared key
the Diffie-Hellman exchange to create an HMAC as well as uses the from the Diffie-Hellman exchange to create a Hashed Message
private key of its Host Identity to sign the packet contents. Authentication Code (HMAC) and also uses the private key of its Host
Identity to sign the packet contents.
4.1.4. HIP Replay Protection 4.1.4. HIP Replay Protection
The HIP protocol includes the following mechanisms to protect against HIP includes the following mechanisms to protect against malicious
malicious packet replays. Responders are protected against replays packet replays. Responders are protected against replays of I1
of I1 packets by virtue of the stateless response to I1 packets with packets by virtue of the stateless response to I1 packets with
pre-signed R1 messages. Initiators are protected against R1 replays pre-signed R1 messages. Initiators are protected against R1 replays
by a monotonically increasing "R1 generation counter" included in the by a monotonically increasing "R1 generation counter" included in
R1. Responders are protected against replays of forged I2 packets by the R1. Responders are protected against replays of forged I2
the puzzle mechanism (see Section 4.1.1 above), and optional use of packets by the puzzle mechanism (see Section 4.1.1 above), and
opaque data. Hosts are protected against replays of R2 packets and optional use of opaque data. Hosts are protected against replays of
UPDATEs by use of a less expensive HMAC verification preceding the R2 packets and UPDATEs by use of a less expensive HMAC verification
HIP signature verification. preceding the HIP signature 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 there SHOULD be a separate counter for counter MAY be system-wide, but there SHOULD be a separate counter
each Host Identity, if there is more than one local host identity. for each Host Identity, if there is more than one local Host
The value of this counter SHOULD be preserved across system reboots Identity. The value of this counter SHOULD be preserved across
and invocations of the HIP base exchange. This counter indicates the system reboots and invocations of the HIP base exchange. This
current generation of puzzles. Implementations MUST accept puzzles counter indicates the current generation of puzzles. Implementations
from the current generation and MAY accept puzzles from earlier MUST accept puzzles from the current generation and MAY accept
generations. A system's local counter MUST be incremented at least puzzles from earlier generations. A system's local counter MUST be
as often as every time old R1s cease to be valid. The local counter incremented at least as often as every time old R1s cease to be
SHOULD never be decremented, otherwise the host exposes its peers to valid. The local counter SHOULD never be decremented; otherwise, the
the replay of previously generated, higher numbered R1s. host exposes its peers to the replay of previously generated, higher-
numbered R1s.
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
I1 packets (see Section 6.6.1) or due to a replay of an old R1. When I1 packets (see Section 6.6.1) or due to a replay of an old R1. When
sending multiple I1 packets to the same host, an Initiator SHOULD sending multiple I1 packets to the same host, an Initiator SHOULD
wait for a small amount of time (a reasonable time may be 2 * wait for a small amount of time (a reasonable time may be
expected RTT) after the first R1 reception to allow possibly multiple 2 * expected RTT) after the first R1 reception to allow possibly
R1s to arrive, and it SHOULD respond to an R1 among the set with the multiple R1s to arrive, and it SHOULD respond to an R1 among the set
largest R1 generation counter. If an Initiator is processing an R1 with the largest R1 generation counter. If an Initiator is
or has already sent an I2 packet (still waiting for the R2 packet) processing an R1 or has already sent an I2 packet (still waiting for
and it receives another R1 with a larger R1 generation counter, it the R2 packet) and it receives another R1 with a larger R1 generation
MAY elect to restart R1 processing with the fresher R1, as if it were counter, it MAY elect to restart R1 processing with the fresher R1,
the first R1 to arrive. as if it were the first R1 to arrive.
The R1 generation counter may roll over or may become reset. It is The R1 generation counter may roll over or may become reset. It is
important for an Initiator to be robust to the loss of state about important for an Initiator to be robust to the loss of state about
the R1 generation counter of a peer, or to a reset of the peer's the R1 generation counter of a peer or to a reset of the peer's
counter. It is recommended that, when choosing between multiple R1s, counter. It is recommended that, when choosing between multiple R1s,
the Initiator prefer to use the R1 that corresponds to the current R1 the Initiator prefer to use the R1 that corresponds to the current R1
generation counter, but that if it is unable to make progress with generation counter, but that if it is unable to make progress with
that R1, the Initiator may try the other R1s beginning with the R1 that R1, the Initiator may try the other R1s, beginning with the R1
packet with the highest counter. packet with the highest counter.
4.1.5. Refusing a HIP base exchange 4.1.5. Refusing a HIP Base Exchange
A HIP-aware host may choose not to accept a HIP base exchange. If A HIP-aware host may choose not to accept a HIP base exchange. If
the host's policy is to only be an Initiator, and policy allows the the host's policy is to only be an Initiator and policy allows the
establishment of a HIP association with the original Initiator, it establishment of a HIP association with the original Initiator, it
should begin its own HIP base exchange. A host MAY choose to have should begin its own HIP base exchange. A host MAY choose to have
such a policy since only the privacy of the Initiator's HI is such a policy since only the privacy of the Initiator's HI is
protected in the exchange. It should be noted that such behavior can protected in the exchange. It should be noted that such behavior can
introduce the risk of a race condition if each host's policy is to introduce the risk of a race condition if each host's policy is to
only be an Initiator, at which point the HIP base exchange will fail. only be an Initiator, at which point the HIP base 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 HIP NOTIFY message is not used because no a simple ICMP message. A HIP NOTIFY message is not used because no
HIP association exists between the two hosts at that time. HIP association exists between the two hosts at that time.
4.1.6. Aborting a HIP base exchange 4.1.6. Aborting a HIP Base Exchange
Two HIP hosts may encounter situations in which they cannot complete Two HIP hosts may encounter situations in which they cannot complete
a HIP base exchange because of insufficient support for cryptographic a HIP base exchange because of insufficient support for cryptographic
algorithms, in particular the HIT Suites and DH Groups. After algorithms, in particular the HIT Suites and DH groups. After
receiving the R1 packet, the Initiator can determine whether the receiving the R1 packet, the Initiator can determine whether the
Responder supports the required cryptographic operations to Responder supports the required cryptographic operations to
successfully establish a HIP association. The Initiator can abort successfully establish a HIP association. The Initiator can abort
the BEX silently after receiving an R1 packet that indicates an the BEX silently after receiving an R1 packet that indicates an
unsupported set of algorithms. The specific conditions are described unsupported set of algorithms. The specific conditions are described
below. below.
The R1 packet contains a signed list of HIT Suite IDs as supported by The R1 packet contains a signed list of HIT Suite IDs as supported by
the Responder. Therefore, the Initiator can determine whether its the Responder. Therefore, the Initiator can determine whether its
source HIT is supported by the Responder. If the HIT Suite ID of the source HIT is supported by the Responder. If the HIT Suite ID of the
Initiator's HIT is not contained in the list of HIT Suites in the R1, Initiator's HIT is not contained in the list of HIT Suites in the R1,
the Initiator MAY abort the handshake silently or MAY restart the the Initiator MAY abort the handshake silently or MAY restart the
handshake with a new I1 packet that contains a source HIT supported handshake with a new I1 packet that contains a source HIT supported
by the Responder. by the Responder.
During the Handshake, the Initiator and the Responder agree on a During the handshake, the Initiator and the Responder agree on a
single DH Group. The Responder selects the DH Group and its DH single DH group. The Responder selects the DH group and its DH
public value in the R1 based on the list of DH Suite IDs in the I1 public value in the R1 based on the list of DH Group IDs in the I1
packet. If the responder supports none of the DH Groups requested by packet. If the Responder supports none of the DH groups requested by
the Initiator, the Responder selects an arbitrary DH and replies with the Initiator, the Responder selects an arbitrary DH and replies with
an R1 containing its list of supported DH Group IDs. In such case, an R1 containing its list of supported DH Group IDs. In such a case,
the Initiator receives an R1 packet containing the DH public value the Initiator receives an R1 packet containing the DH public value
for an unrequested DH Group and also the Responder's DH Group list in for an unrequested DH group and also the Responder's DH group list in
the signed part of the R1 packet. At this point, the Initiator MAY the signed part of the R1 packet. At this point, the Initiator MAY
abort the handshake or MAY restart the handshake by sending a new I1 abort the handshake or MAY restart the handshake by sending a new I1
packet containing a selection of DH Group IDs that is supported by packet containing a selection of DH Group IDs that is supported by
the Responder. the Responder.
4.1.7. HIP Downgrade Protection 4.1.7. HIP Downgrade Protection
In a downgrade attack, an attacker attempts to unnoticeably In a downgrade attack, an attacker attempts to unnoticeably
manipulate the packets of an Initiator and/or a Responder to manipulate the packets of an Initiator and/or a Responder to
influence the result of the cryptographic negotiations in the BEX to influence the result of the cryptographic negotiations in the BEX in
its favor. As a result, the victims select weaker cryptographic its favor. As a result, the victims select weaker cryptographic
algorithms than they would otherwise have selected without the algorithms than they would otherwise have selected without the
attacker's interference. Downgrade attacks can only be successful if attacker's interference. Downgrade attacks can only be successful if
they remain un-detected by the victims and the victims falsely assume they remain undetected by the victims and the victims falsely assume
a secure communication channel. a secure communication channel.
In HIP, almost all packet parameters related to cryptographic In HIP, almost all packet parameters related to cryptographic
negotiations are covered by signatures. These parameters cannot be negotiations are covered by signatures. These parameters cannot be
directly manipulated in a downgrade attack without invalidating the directly manipulated in a downgrade attack without invalidating the
signature. However, signed packets can be subject to replay attacks. signature. However, signed packets can be subject to replay attacks.
In such a replay attack, the attacker could use an old BEX packet In such a replay attack, the attacker could use an old BEX packet
with an outdated and weak selection of cryptographic algorithms and with an outdated and weak selection of cryptographic algorithms and
replay it instead of a more recent packet with a collection of replay it instead of a more recent packet with a collection of
stronger cryptographic algorithms. Signed packets that could be stronger cryptographic algorithms. Signed packets that could be
subject to this replay attack are the R1 and I2 packet. However, subject to this replay attack are the R1 and I2 packet. However,
replayed R1 and I2 packets cannot be used to successfully establish a replayed R1 and I2 packets cannot be used to successfully establish a
HIP BEX because these packets also contain the public DH values of HIP BEX because these packets also contain the public DH values of
the Initiator and the Responder. Old DH values from replayed packets the Initiator and the Responder. Old DH values from replayed packets
lead to invalid keying material and mismatching shared secrets lead to invalid keying material and mismatching shared secrets
because the attacker is unable to derive valid keying material from because the attacker is unable to derive valid keying material from
skipping to change at page 20, line 49 skipping to change at page 21, line 18
stronger cryptographic algorithms. Signed packets that could be stronger cryptographic algorithms. Signed packets that could be
subject to this replay attack are the R1 and I2 packet. However, subject to this replay attack are the R1 and I2 packet. However,
replayed R1 and I2 packets cannot be used to successfully establish a replayed R1 and I2 packets cannot be used to successfully establish a
HIP BEX because these packets also contain the public DH values of HIP BEX because these packets also contain the public DH values of
the Initiator and the Responder. Old DH values from replayed packets the Initiator and the Responder. Old DH values from replayed packets
lead to invalid keying material and mismatching shared secrets lead to invalid keying material and mismatching shared secrets
because the attacker is unable to derive valid keying material from because the attacker is unable to derive valid keying material from
the DH public keys in the R1 and cannot generate a valid HMAC and the DH public keys in the R1 and cannot generate a valid HMAC and
signature for a replayed I2. signature for a replayed I2.
In contrast to the first version of HIP [RFC5201],the version 2 of In contrast to the first version of HIP [RFC5201], version 2 of HIP
HIP defined in this document begins the negotiation of the DH Groups as defined in this document begins the negotiation of the DH groups
already in the first BEX packet, the I1. The I1 packet is, by already in the first BEX packet, the I1. The I1 packet is, by
intention, not protected by a signature to avoid CPU-intensive intention, not protected by a signature, to avoid CPU-intensive
cryptographic operations for processing floods of I1 packets targeted cryptographic operations processing floods of I1 packets targeted at
at the Responder. Hence, the list of DH Group IDs in the I1 packet the Responder. Hence, the list of DH Group IDs in the I1 packet is
is vulnerable to forgery and manipulation. To thwart an unnoticed vulnerable to forgery and manipulation. To thwart an unnoticed
manipulation of the I1 packet, the Responder chooses the DH Group manipulation of the I1 packet, the Responder chooses the DH group
deterministically and includes its own list of DH Group IDs in the deterministically and includes its own list of DH Group IDs in the
signed part of the R1 packet. The Initiator can detect an attempted signed part of the R1 packet. The Initiator can detect an attempted
downgrade attack by comparing the list of DH Group IDs in the R1 downgrade attack by comparing the list of DH Group IDs in the R1
packet to its own preferences in the I1 packet. If the choice of the packet to its own preferences in the I1 packet. If the choice of the
DH Group in the R1 packet does not equal to the best match of the two DH group in the R1 packet does not equal the best match of the two
lists (the highest priority DH ID of the Responder that is present in lists (the highest-priority DH ID of the Responder that is present in
the Initiator's DH list), the Initiator can conclude that its list in the Initiator's DH list), the Initiator can conclude that its list in
the I1 packet was altered by an attacker. In this case, the the I1 packet was altered by an attacker. In this case, the
Initiator can restart or abort the BEX. As mentioned before, the Initiator can restart or abort the BEX. As mentioned before, the
detection of the downgrade attack is sufficient to prevent it. detection of the downgrade attack is sufficient to prevent it.
4.1.8. HIP Opportunistic Mode 4.1.8. HIP Opportunistic Mode
It is possible to initiate a HIP BEX even if the Responder's HI (and It is possible to initiate a HIP BEX even if the Responder's HI (and
HIT) is unknown. In this case, the initial I1 packet contains all HIT) is unknown. In this case, the initial I1 packet contains all
zeros as the destination HIT. This kind of connection setup is zeros as the destination HIT. This kind of connection setup is
called opportunistic mode. called opportunistic mode.
The Responder may have multiple HITs due to multiple supported HIT The Responder may have multiple HITs due to multiple supported HIT
Suites. Since the Responder's HIT Suite in the opportunistic mode is Suites. Since the Responder's HIT Suite in the opportunistic mode is
not determined by the destination HIT of the I1 packet, the Responder not determined by the destination HIT of the I1 packet, the Responder
can freely select a HIT of any HIT Suite. The complete set of HIT can freely select a HIT of any HIT Suite. The complete set of HIT
Suites supported by the Initiator is not known to the Responder. Suites supported by the Initiator is not known to the Responder.
Therefore, the Responder SHOULD select its HIT from the same HIT Therefore, the Responder SHOULD select its HIT from the same HIT
Suite as the Initiator's HIT (indicated by the HIT suite information Suite as the Initiator's HIT (indicated by the HIT Suite information
in the OGA field of the Initiator's HIT) because this HIT Suite is in the OGA ID field of the Initiator's HIT) because this HIT Suite is
obviously supported by the Initiator. If the Responder selects a obviously supported by the Initiator. If the Responder selects a
different HIT that is not supported by the Initiator, the Initiator different HIT that is not supported by the Initiator, the Initiator
MAY restart the BEX with an I1 packet with a source HIT that is MAY restart the BEX with an I1 packet with a source HIT that is
contained in the list of the Responder's HIT Suites in the R1 packet. contained in the list of the Responder's HIT Suites in the R1 packet.
Note that the Initiator cannot verify the signature of the R1 packet Note that the Initiator cannot verify the signature of the R1 packet
if the Responder's HIT Suite is not supported. Therefore, the if the Responder's HIT Suite is not supported. Therefore, the
Initiator MUST treat R1 packets with unsupported Responder HITs as Initiator MUST treat R1 packets with unsupported Responder HITs as
potentially forged and MUST NOT use any parameters from the potentially forged and MUST NOT use any parameters from the
unverified R1 besides the HIT Suite List. Moreover, an Initiator unverified R1 besides the HIT_SUITE_LIST. Moreover, an Initiator
that uses an unverified HIT Suite List from an R1 packet to determine that uses an unverified HIT_SUITE_LIST from an R1 packet to determine
a possible source HIT MUST verify that the HIT_SUITE_LIST in the a possible source HIT MUST verify that the HIT_SUITE_LIST in the
first unverified R1 packet matches the HIT_SUITE_LIST in the second first unverified R1 packet matches the HIT_SUITE_LIST in the second
R1 packet for which the Initiator supports the signature algorithm. R1 packet for which the Initiator supports the signature algorithm.
The Initiator MUST restart the BEX with a new I1 packet for which the The Initiator MUST restart the BEX with a new I1 packet for which the
algorithm was mentioned in the verifiable R1 if the two lists do not algorithm was mentioned in the verifiable R1 if the two lists do not
match. This procedure is necessary to mitigate downgrade attacks. match. This procedure is necessary to mitigate downgrade attacks.
There are both security and API issues involved with the There are both security and API issues involved with the
opportunistic mode. These issues are described in the reminder of opportunistic mode. These issues are described in the remainder of
this section. this section.
Given that the Responder's HI is not known by the Initiator, there Given that the Responder's HI is not known by the Initiator, there
must be suitable API calls that allow the Initiator to request, must be suitable API calls that allow the Initiator to request,
directly or indirectly, that the underlying system initiates the HIP directly or indirectly, that the underlying system initiates the HIP
base exchange solely based on locators. The Responder's HI will be base exchange solely based on locators. The Responder's HI will be
tentatively available in the R1 packet, and in an authenticated form tentatively available in the R1 packet, and in an authenticated form
once the R2 packet has been received and verified. Hence, the once the R2 packet has been received and verified. Hence, the
Responder's HIT could be communicated to the application via new API Responder's HIT could be communicated to the application via new API
mechanisms. However, with a backwards-compatible API the application mechanisms. However, with a backwards-compatible API the application
sees only the locators used for the initial contact. Depending on sees only the locators used for the initial contact. Depending on
the desired semantics of the API, this can raise the following the desired semantics of the API, this can raise the following
issues: issues:
o The actual locators may later change if an UPDATE message is used, o The actual locators may later change if an UPDATE message is used,
even if from the API perspective the association still appears to even if from the API perspective the association still appears to
be between two specific locators. However, the locator update is be between two specific locators. However, the locator update is
still secure and the association is still between the same nodes. still secure, and the association is still between the same nodes.
o Different associations between the same two locators may result in o Different associations between the same two locators may result in
connections to different nodes, if the implementation no longer connections to different nodes, if the implementation no longer
remembers which identifier the peer had in an earlier association. remembers which identifier the peer had in an earlier association.
This is possible when the peer's locator has changed for This is possible when the peer's locator has changed for
legitimate reasons or when an attacker pretends to be a node that legitimate reasons or when an attacker pretends to be a node that
has the peer's locator. Therefore, when using opportunistic mode, has the peer's locator. Therefore, when using opportunistic mode,
HIP implementations MUST NOT place any expectation that the peer's HIP implementations MUST NOT place any expectation that the peer's
HI returned in the R1 message matches any HI previously seen from HI returned in the R1 message matches any HI previously seen from
that address. that address.
If the HIP implementation and application do not have the same If the HIP implementation and application do not have the same
understanding of what constitutes an association, this may even understanding of what constitutes an association, this may even
happen within the same association. For instance, an happen within the same association. For instance, an
implementation may not know when HIP state can be purged for UDP- implementation may not know when HIP state can be purged for
based applications. UDP-based applications.
In addition, the following security considerations apply. The In addition, the following security considerations apply. The
generation counter mechanism will be less efficient in protecting generation counter mechanism will be less efficient in protecting
against replays of the R1 packet, given that the Responder can choose against replays of the R1 packet, given that the Responder can choose
a replay that uses an arbitrary HI, not just the one given in the I1 a replay that uses an arbitrary HI, not just the one given in the I1
packet. packet.
More importantly, the opportunistic exchange is vulnerable to man-in- More importantly, the opportunistic exchange is vulnerable to
the-middle attacks, because the Initiator does not have any public man-in-the-middle attacks, because the Initiator does not have any
key information about the peer. To assess the impacts of this public key information about the peer. To assess the impacts of this
vulnerability, we compare it to vulnerabilities in current, non-HIP- vulnerability, we compare it to vulnerabilities in current,
capable communications. non-HIP-capable communications.
An attacker on the path between the two peers can insert itself as a An attacker on the path between the two peers can insert itself as a
man-in-the-middle by providing its own identifier to the Initiator man-in-the-middle by providing its own identifier to the Initiator
and then initiating another HIP association towards the Responder. and then initiating another HIP association towards the Responder.
For this to be possible, the Initiator must employ opportunistic For this to be possible, the Initiator must employ opportunistic
mode, and the Responder must be configured to accept a connection mode, and the Responder must be configured to accept a connection
from any HIP-enabled node. from any HIP-enabled node.
An attacker outside the path will be unable to do so, given that it An attacker outside the path will be unable to do so, given that it
cannot respond to the messages in the base exchange. cannot respond to the messages in the base exchange.
skipping to change at page 23, line 35 skipping to change at page 24, line 4
However, once the opportunistic exchange has successfully completed, However, once the opportunistic exchange has successfully completed,
HIP provides confidentiality and integrity protection for the HIP provides confidentiality and integrity protection for the
communications, and can securely change the locators of the communications, and can securely change the locators of the
endpoints. endpoints.
As a result, opportunistic mode in HIP offers a "better than nothing" As a result, opportunistic mode in HIP offers a "better than nothing"
security model. Initially, a base exchange authenticated in the security model. Initially, a base exchange authenticated in the
opportunistic mode involves a leap of faith subject to man-in-the- opportunistic mode involves a leap of faith subject to man-in-the-
middle attacks, but subsequent datagrams related to the same HIP middle attacks, but subsequent datagrams related to the same HIP
association cannot be compromised by a new man-in-the-middle attack, association cannot be compromised by a new man-in-the-middle attack.
and further, if the man-in-the-middle moves away from the path of the Further, if the man-in-the-middle moves away from the path of the
active association, the attack would be exposed after the fact. active association, the attack would be exposed after the fact.
Thus, it can be stated that opportunistic mode in HIP is at least as Thus, it can be stated that opportunistic mode in HIP is at least as
secure as unprotected IP-based communications. secure as unprotected IP-based communications.
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 security associations, Examples include the need to rekey expiring security associations,
add new security associations, or change IP addresses associated with add new security associations, or change IP addresses associated with
hosts. The UPDATE packet is used for those and other similar hosts. The UPDATE packet is used for those and other similar
purposes. This document only specifies the UPDATE packet format and purposes. This document only specifies the UPDATE packet format and
basic processing rules, with mandatory parameters. The actual usage basic processing rules, with mandatory parameters. The actual usage
is defined in separate specifications. 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 under certain circumstances. UPDATE messages may be outstanding under certain circumstances.
UPDATE is protected by both HIP_MAC and HIP_SIGNATURE parameters, UPDATE is protected by both HIP_MAC and HIP_SIGNATURE parameters,
since processing UPDATE signatures alone is a potential DoS attack since processing UPDATE signatures alone is a potential DoS attack
skipping to change at page 25, line 28 skipping to change at page 25, line 45
initiate a new HIP BEX. However, responding with these initiate a new HIP BEX. However, responding with these
optional mechanisms is implementation or policy dependent. If optional mechanisms is implementation or policy dependent. If
the sending application doesn't expect a response, the system the sending application doesn't expect a response, the system
could possibly send a large number of packets in this state, so could possibly send a large number of packets in this state, so
for this reason, the sending of one or more ICMP packets is for this reason, the sending of one or more ICMP packets is
RECOMMENDED. However, any such responses MUST be rate-limited RECOMMENDED. However, any such responses MUST be rate-limited
to prevent abuse (see Section 5.4). to prevent abuse (see Section 5.4).
4.4. HIP State Machine 4.4. HIP State Machine
The HIP protocol itself has little state. In the HIP base exchange, HIP itself has little state. In the HIP base exchange, there is an
there is an Initiator and a Responder. Once the security Initiator and a Responder. Once the security associations (SAs) are
associations (SAs) are established, this distinction is lost. If the established, this distinction is lost. If the HIP state needs to be
HIP state needs to be re-established, the controlling parameters are re-established, the controlling parameters are which peer still has
which peer still has state and which has a datagram to send to its state and which has a datagram to send to its peer. The following
peer. The following state machine attempts to capture these state machine attempts to capture these processes.
processes.
The state machine is symmetric and is presented in a single system The state machine is symmetric and is presented in a single system
view, representing either an Initiator or a Responder. The state view, representing either an Initiator or a Responder. The state
machine is not a full representation of the processing logic. machine is not a full representation of the processing logic.
Additional processing rules are presented in the packet definitions. Additional processing rules are presented in the packet definitions.
Hence, both are needed to completely implement HIP. Hence, both are needed to completely implement HIP.
This document extends the state machine as defined in [RFC5201] and This document extends the state machine as defined in [RFC5201] and
introduces a restart option to allow for the negotiation of introduces a restart option to allow for the negotiation of
cryptographic algorithms. The extension to the previous state cryptographic algorithms. The extension to the previous state
machine in [RFC5201] is a transition from state I1-SENT to I1-SENT - machine in [RFC5201] is a transition from state I1-SENT back again to
the restart option. An Initiator is required to restart the HIP base I1-SENT; namely, the restart option. An Initiator is required to
exchange if the Responder does not support the HIT Suite of the restart the HIP base exchange if the Responder does not support the
Initiator. In this case, the Initiator restarts the HIP base HIT Suite of the Initiator. In this case, the Initiator restarts the
exchange by sending a new I1 packet with a source HIT supported by HIP base exchange by sending a new I1 packet with a source HIT
the Responder. supported by the Responder.
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 processing logic differently. Section 6 implement the actual processing logic differently. Section 6
describes the packet processing rules in more detail. This state describes the packet processing rules in more detail. This state
machine focuses on the HIP I1, R1, I2, and R2 packets only. New machine focuses on the HIP I1, R1, I2, and R2 packets only. New
states and state transitions may be introduced by mechanisms in other states and state transitions may be introduced by mechanisms in other
specifications (such as mobility and multihoming). specifications (such as mobility and multihoming).
4.4.1. State Machine Terminology 4.4.1. State Machine Terminology
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 HIP association. host MAY begin to tear down an active HIP association.
Maximum Segment Lifetime (MSL): Maximum time that a HIP packet is Maximum Segment Lifetime (MSL): Maximum time that a HIP packet is
expected to spend in the network. A default value of 2 minutes expected to spend in the network. A default value of 2 minutes
has been borrowed from [RFC0793] because it is a prevailing has been borrowed from [RFC0793] because it is a prevailing
assumption for packet lifetimes. assumption for packet lifetimes.
Exchange Complete (EC): Time that the host spends at the R2-SENT Exchange Complete (EC): Time that the host spends at the R2-SENT
state before it moves to the ESTABLISHED state. The time is n * state before it moves to the ESTABLISHED state. The time is n *
I2 retransmission timeout, where n is about I2_RETRIES_MAX. I2 retransmission timeout, where n is about I2_RETRIES_MAX.
Receive ANYOTHER: Any received packet for which no state Receive ANYOTHER: Any received packet for which no state transitions
transitions or processing rules are defined for a given state. or processing rules are defined for a given state.
4.4.2. HIP States 4.4.2. HIP States
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| State | Explanation | | State | Explanation |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| UNASSOCIATED | State machine start | | UNASSOCIATED | State machine start |
| | | | | |
| I1-SENT | Initiating base exchange | | I1-SENT | Initiating base exchange |
| | | | | |
| I2-SENT | Waiting to complete base exchange | | I2-SENT | Waiting to complete base exchange |
| | | | | |
| R2-SENT | Waiting to complete base exchange | | R2-SENT | Waiting to complete base exchange |
skipping to change at page 28, line 29 skipping to change at page 28, line 32
| | | | | |
| Receive user data for an | Optionally send ICMP as defined in | | Receive user data for an | Optionally send ICMP as defined in |
| unknown HIP association | Section 5.4 and stay at UNASSOCIATED | | unknown HIP association | Section 5.4 and stay at UNASSOCIATED |
| | | | | |
| Receive CLOSE | Optionally send ICMP Parameter | | Receive CLOSE | Optionally send ICMP Parameter |
| | Problem and stay at UNASSOCIATED | | | Problem and stay at UNASSOCIATED |
| | | | | |
| Receive ANYOTHER | Drop and stay at UNASSOCIATED | | Receive ANYOTHER | Drop and stay at UNASSOCIATED |
+----------------------------+--------------------------------------+ +----------------------------+--------------------------------------+
Table 2: UNASSOCIATED - Start state Table 2: UNASSOCIATED - Start State
System behavior in state I1-SENT, Table 3. System behavior in state I1-SENT, Table 3.
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| Trigger | Action | | Trigger | Action |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| Receive I1 from | If the local HIT is smaller than the peer | | Receive I1 from | If the local HIT is smaller than the peer |
| Responder | HIT, drop I1 and stay at I1-SENT (see | | Responder | HIT, drop I1 and stay at I1-SENT (see |
| | Section 6.5 for HIT comparison) | | | Section 6.5 for HIT comparison) |
| | | | | |
| | If the local HIT is greater than the peer | | | If the local HIT is greater than the peer |
| | HIT, send R1 and stay at I1-SENT | | | HIT, send R1 and stay at I1-SENT |
| | | | | |
| Receive I2, process | If successful, send R2 and go to R2-SENT | | Receive I2, process | If successful, send R2 and go to R2-SENT |
| | | | | |
| | If fail, stay at I1-SENT | | | If fail, stay at I1-SENT |
| | | | | |
| Receive R1, process | If the HIT Suite of the local HIT is not | | Receive R1, process | If the HIT Suite of the local HIT is not |
| | supported by the peer, select supported | | | supported by the peer, select supported |
| | local HIT, send I1 and stay at I1-SENT | | | local HIT, send I1, and stay at I1-SENT |
| | | | | |
| | If successful, send I2 and go to I2-SENT | | | If successful, send I2 and go to I2-SENT |
| | | | | |
| | If fail, stay at I1-SENT | | | If fail, stay at I1-SENT |
| | | | | |
| Receive ANYOTHER | Drop and stay at I1-SENT | | Receive ANYOTHER | Drop and stay at I1-SENT |
| | | | | |
| Timeout | Increment trial counter | | Timeout | Increment trial counter |
| | | | | |
| | If counter is less than I1_RETRIES_MAX, | | | If counter is less than I1_RETRIES_MAX, |
| | send I1 and stay at I1-SENT | | | send I1 and stay at I1-SENT |
| | | | | |
| | If counter is greater than I1_RETRIES_MAX, | | | If counter is greater than I1_RETRIES_MAX, |
| | go to E-FAILED | | | go to E-FAILED |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
Table 3: I1-SENT - Initiating the HIP base exchange Table 3: I1-SENT - Initiating the HIP Base Exchange
System behavior in state I2-SENT, Table 4. System behavior in state I2-SENT, Table 4.
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| Trigger | Action | | Trigger | Action |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| Receive I1 | Send R1 and stay at I2-SENT | | Receive I1 | Send R1 and stay at I2-SENT |
| | | | | |
| Receive R1, process | If successful, send I2 and stay at I2-SENT | | Receive R1, process | If successful, send I2 and stay at I2-SENT |
| | | | | |
skipping to change at page 30, line 44 skipping to change at page 30, line 44
| | | | | |
| Timeout | Increment trial counter | | Timeout | Increment trial counter |
| | | | | |
| | If counter is less than I2_RETRIES_MAX, | | | If counter is less than I2_RETRIES_MAX, |
| | send I2 and stay at I2-SENT | | | send I2 and stay at I2-SENT |
| | | | | |
| | If counter is greater than I2_RETRIES_MAX, | | | If counter is greater than I2_RETRIES_MAX, |
| | go to E-FAILED | | | go to E-FAILED |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
Table 4: I2-SENT - Waiting to finish the HIP base exchange Table 4: I2-SENT - Waiting to Finish the HIP Base Exchange
System behavior in state R2-SENT, Table 5. System behavior in state R2-SENT, Table 5.
+------------------------+------------------------------------------+ +------------------------+------------------------------------------+
| Trigger | Action | | Trigger | Action |
+------------------------+------------------------------------------+ +------------------------+------------------------------------------+
| Receive I1 | Send R1 and stay at R2-SENT | | Receive I1 | Send R1 and stay at R2-SENT |
| | | | | |
| Receive I2, process | If successful, send R2 and stay at | | Receive I2, process | If successful, send R2 and stay at |
| | R2-SENT | | | R2-SENT |
skipping to change at page 31, line 36 skipping to change at page 31, line 36
| Receive CLOSE, process | If successful, send CLOSE_ACK and go to | | Receive CLOSE, process | If successful, send CLOSE_ACK and go to |
| | CLOSED | | | CLOSED |
| | | | | |
| | If fail, stay at ESTABLISHED | | | If fail, stay at ESTABLISHED |
| | | | | |
| Receive CLOSE_ACK | Drop and stay at R2-SENT | | Receive CLOSE_ACK | Drop and stay at R2-SENT |
| | | | | |
| Receive NOTIFY | Process and stay at R2-SENT | | Receive NOTIFY | Process and stay at R2-SENT |
+------------------------+------------------------------------------+ +------------------------+------------------------------------------+
Table 5: R2-SENT - Waiting to finish HIP Table 5: R2-SENT - Waiting to Finish HIP
System behavior in state ESTABLISHED, Table 6. System behavior in state ESTABLISHED, Table 6.
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| Trigger | Action | | Trigger | Action |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
| Receive I1 | Send R1 and stay at ESTABLISHED | | Receive I1 | Send R1 and stay at ESTABLISHED |
| | | | | |
| Receive I2 | Process with puzzle and possible Opaque | | Receive I2 | Process with puzzle and possible Opaque |
| | data verification | | | data verification |
| | | | | |
| | If successful, send R2, drop old HIP | | | If successful, send R2, drop old HIP |
| | association, establish a new HIP | | | association, establish a new HIP |
| | association and go to R2-SENT | | | association, and go to R2-SENT |
| | | | | |
| | If fail, stay at ESTABLISHED | | | If fail, stay at ESTABLISHED |
| | | | | |
| Receive R1 | Drop and stay at ESTABLISHED | | Receive R1 | Drop and stay at ESTABLISHED |
| | | | | |
| Receive R2 | Drop and stay at ESTABLISHED | | Receive R2 | Drop and stay at ESTABLISHED |
| | | | | |
| Receive user data | Process and stay at ESTABLISHED | | Receive user data | Process and stay at ESTABLISHED |
| for HIP association | | | for HIP association | |
| | | | | |
skipping to change at page 32, line 44 skipping to change at page 32, line 44
| Receive CLOSE, | If successful, send CLOSE_ACK and go to | | Receive CLOSE, | If successful, send CLOSE_ACK and go to |
| process | CLOSED | | process | CLOSED |
| | | | | |
| | If fail, stay at ESTABLISHED | | | If fail, stay at ESTABLISHED |
| | | | | |
| Receive CLOSE_ACK | Drop and stay at ESTABLISHED | | Receive CLOSE_ACK | Drop and stay at ESTABLISHED |
| | | | | |
| Receive NOTIFY | Process and stay at ESTABLISHED | | Receive NOTIFY | Process and stay at ESTABLISHED |
+---------------------+---------------------------------------------+ +---------------------+---------------------------------------------+
Table 6: ESTABLISHED - HIP association established Table 6: ESTABLISHED - HIP Association Established
System behavior in state CLOSING, Table 7. System behavior in state CLOSING, Table 7.
+----------------------------+--------------------------------------+ +----------------------------+--------------------------------------+
| Trigger | Action | | Trigger | Action |
+----------------------------+--------------------------------------+ +----------------------------+--------------------------------------+
| User data to send, | Send I1 and go to I1-SENT | | User data to send, | Send I1 and go to I1-SENT |
| requires the creation of | | | requires the creation of | |
| another incarnation of the | | | another incarnation of the | |
| HIP association | | | HIP association | |
skipping to change at page 33, line 28 skipping to change at page 33, line 28
| | R2-SENT | | | R2-SENT |
| | | | | |
| | If fail, stay at CLOSING | | | If fail, stay at CLOSING |
| | | | | |
| Receive R1, process | If successful, send I2 and go to | | Receive R1, process | If successful, send I2 and go to |
| | I2-SENT | | | I2-SENT |
| | | | | |
| | If fail, stay at CLOSING | | | If fail, stay at CLOSING |
| | | | | |
| Receive CLOSE, process | If successful, send CLOSE_ACK, | | Receive CLOSE, process | If successful, send CLOSE_ACK, |
| | discard state and go to CLOSED | | | discard state, and go to CLOSED |
| | | | | |
| | If fail, stay at CLOSING | | | If fail, stay at CLOSING |
| | | | | |
| Receive CLOSE_ACK, process | If successful, discard state and go | | Receive CLOSE_ACK, process | If successful, discard state and go |
| | to UNASSOCIATED | | | to UNASSOCIATED |
| | | | | |
| | If fail, stay at CLOSING | | | If fail, stay at CLOSING |
| | | | | |
| Receive ANYOTHER | Drop and stay at CLOSING | | Receive ANYOTHER | Drop and stay at CLOSING |
| | | | | |
| Timeout | Increment timeout sum and reset | | Timeout | Increment timeout sum and reset |
| | timer. If timeout sum is less than | | | timer. If timeout sum is less than |
| | UAL+MSL minutes, retransmit CLOSE | | | UAL+MSL minutes, retransmit CLOSE |
| | and stay at CLOSING | | | and stay at CLOSING. |
| | | | | |
| | If timeout sum is greater than | | | If timeout sum is greater than |
| | UAL+MSL minutes, go to UNASSOCIATED | | | UAL+MSL minutes, go to UNASSOCIATED |
+----------------------------+--------------------------------------+ +----------------------------+--------------------------------------+
Table 7: CLOSING - HIP association has not been used for UAL minutes Table 7: CLOSING - HIP Association Has Not Been Used for UAL Minutes
System behavior in state CLOSED, Table 8. System behavior in state CLOSED, Table 8.
+----------------------------------------+--------------------------+ +----------------------------------------+--------------------------+
| Trigger | Action | | Trigger | Action |
+----------------------------------------+--------------------------+ +----------------------------------------+--------------------------+
| Datagram to send, requires the | Send I1, and stay at | | Datagram to send, requires the | Send I1 and stay at |
| creation of another incarnation of the | CLOSED | | creation of another incarnation of the | CLOSED |
| HIP association | | | HIP association | |
| | | | | |
| Receive I1 | Send R1 and stay at | | Receive I1 | Send R1 and stay at |
| | CLOSED | | | CLOSED |
| | | | | |
| Receive I2, process | If successful, send R2 | | Receive I2, process | If successful, send R2 |
| | and go to R2-SENT | | | and go to R2-SENT |
| | | | | |
| | If fail, stay at CLOSED | | | If fail, stay at CLOSED |
| | | | | |
| Receive R1, process | If successful, send I2 | | Receive R1, process | If successful, send I2 |
| | and go to I2-SENT | | | and go to I2-SENT |
| | | | | |
| | If fail, stay at CLOSED | | | If fail, stay at CLOSED |
| | | | | |
| Receive CLOSE, process | If successful, send | | Receive CLOSE, process | If successful, send |
| | CLOSE_ACK, stay at | | | CLOSE_ACK and stay at |
| | CLOSED | | | CLOSED |
| | | | | |
| | If fail, stay at CLOSED | | | If fail, stay at CLOSED |
| | | | | |
| Receive CLOSE_ACK, process | If successful, discard | | Receive CLOSE_ACK, process | If successful, discard |
| | state and go to | | | state and go to |
| | UNASSOCIATED | | | UNASSOCIATED |
| | | | | |
| | If fail, stay at CLOSED | | | If fail, stay at CLOSED |
| | | | | |
| Receive ANYOTHER | Drop and stay at CLOSED | | Receive ANYOTHER | Drop and stay at CLOSED |
| | | | | |
| Timeout (UAL+2MSL) | Discard state, and go to | | Timeout (UAL+2MSL) | Discard state and go to |
| | UNASSOCIATED | | | UNASSOCIATED |
+----------------------------------------+--------------------------+ +----------------------------------------+--------------------------+
Table 8: CLOSED - CLOSE_ACK sent, resending CLOSE_ACK if necessary Table 8: CLOSED - CLOSE_ACK Sent, Resending CLOSE_ACK if Necessary
System behavior in state E-FAILED, Table 9. System behavior in state E-FAILED, Table 9.
+-------------------------+-----------------------------------------+ +-------------------------+-----------------------------------------+
| Trigger | Action | | Trigger | Action |
+-------------------------+-----------------------------------------+ +-------------------------+-----------------------------------------+
| Wait for | Go to UNASSOCIATED. Re-negotiation is | | Wait for | Go to UNASSOCIATED. Renegotiation is |
| implementation-specific | possible after moving to UNASSOCIATED | | implementation-specific | possible after moving to UNASSOCIATED |
| time | state. | | time | state. |
+-------------------------+-----------------------------------------+ +-------------------------+-----------------------------------------+
Table 9: E-FAILED - HIP failed to establish association with peer Table 9: E-FAILED - HIP Failed to Establish Association with Peer
4.4.4. Simplified HIP State Diagram 4.4.4. Simplified HIP State Diagram
The following diagram (Figure 2) shows the major state transitions. The following diagram (Figure 2) shows the major state transitions.
Transitions based on received packets implicitly assume that the Transitions based on received packets implicitly assume that the
packets are successfully authenticated or processed. packets are successfully authenticated or processed.
+--+ +----------------------------+ +--+ +----------------------------+
recv I1, send R1 | | | | recv I1, send R1 | | | |
| v v | | v v |
skipping to change at page 37, line 7 skipping to change at page 37, line 7
+---------------------| CLOSED |------------------------------+ | +---------------------| CLOSED |------------------------------+ |
+--------+ | +--------+ |
^ | | | ^ | | |
recv CLOSE, send CLOSE_ACK| | | timeout (UAL+2MSL) | recv CLOSE, send CLOSE_ACK| | | timeout (UAL+2MSL) |
+-+ +------------------------------------+ +-+ +------------------------------------+
Figure 2 Figure 2
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 through sockets bound to HITs, the IPv6 pseudo header format
[RFC2460] MUST be used, even if the actual addresses in the header of [RFC2460] MUST be used, even if the actual addresses in the header of
the packet are IPv4 addresses. Additionally, the HITs MUST be used the packet are IPv4 addresses. Additionally, the HITs MUST be used
in place of the IPv6 addresses in the IPv6 pseudo-header. Note that in place of the IPv6 addresses in the IPv6 pseudo header. Note that
the pseudo-header for actual HIP payloads is computed differently; the pseudo header for actual HIP payloads is computed differently;
see Section 5.1.1. see Section 5.1.1.
4.5.2. Sending Data on HIP Packets 4.5.2. Sending Data on HIP Packets
Other documents may define how to include user data in various HIP Other documents may define how to include user data in various HIP
packets. However, currently the HIP header is a terminal header, and packets. However, currently the HIP header is a terminal header, and
not followed by any other headers. 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 [I-D.ietf-hip-rfc5202-bis]. The transport format to format for HIP [RFC7402]. The transport format to be chosen is
be chosen is negotiated in the base exchange. The Responder negotiated in the base exchange. The Responder expresses its
expresses its preference of the transport format in the preference regarding the transport format in the
TRANSPORT_FORMAT_LIST in the R1 packet and the Initiator selects one TRANSPORT_FORMAT_LIST in the R1 packet, and the Initiator selects one
transport format and adds the respective HIP parameter to the I2 transport format and adds the respective HIP parameter to the I2
packet. packet.
4.5.4. Reboot, Timeout, and Restart of HIP 4.5.4. Reboot, Timeout, and 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 the HIP association times out, it has lost its If a host reboots or the HIP association times out, it has lost its
HIP state. If the host that lost state has a datagram to send to the HIP state. If the host that lost state has a datagram to send to the
peer, it simply restarts the HIP base exchange. After the base peer, it simply restarts the HIP base exchange. After the base
exchange has completed, the Initiator can create a new payload exchange has completed, the Initiator can create a new payload
association and start sending data. The peer does not reset its association and start sending data. The peer does not reset its
state until it receives a valid I2 packet. state until it receives a valid I2 packet.
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, and with the pointer pointing to the referred HIP- Problem type, and with the Pointer pointing to the referred
related association information. Reacting to such traffic depends on HIP-related association information. Reacting to such traffic
the implementation and the environment where the implementation is depends on the implementation and the environment where the
used. implementation is used.
If the host, that apparently has lost its state, decides to restart If the host that apparently has lost its state decides to restart the
the HIP base exchange, it sends an I1 packet to the peer. After the HIP base exchange, it sends an I1 packet to the peer. After the base
base exchange has been completed successfully, the Initiator can exchange has been completed successfully, the Initiator can create a
create a new HIP association and the peer drops its old payload new HIP association, and the peer drops its old payload associations
associations and creates a new one. and creates a new one.
4.6. Certificate Distribution 4.6. Certificate Distribution
This document does not define how to use certificates or how to This document does not define how to use certificates or how to
transfer them between hosts. These functions are expected to be transfer them between hosts. These functions are expected to be
defined in a future specification as for HIP Version 1 [RFC6253]. A defined in a future specification, as was done for HIP version 1 (see
parameter type value, meant to be used for carrying certificates, is [RFC6253]). A parameter type value, meant to be used for carrying
reserved, though: CERT, Type 768; see Section 5.2. 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 |0| Packet Type |Version| RES.|1| | Next Header | Header Length |0| Packet Type |Version| RES.|1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Controls | | Checksum | Controls |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sender's Host Identity Tag (HIT) | | Sender's Host Identity Tag (HIT) |
| | | |
| | | |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 39, line 7 skipping to change at page 39, line 7
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
/ 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. than decimal 59, IPPROTO_NONE, the IPv6 'no next header' value.
Future documents MAY define behavior for also other values. However, Future documents MAY define behavior for other values. However,
current implementations MUST ignore trailing data if an unimplemented current implementations MUST ignore trailing data if an unimplemented
Next Header value is received. Next Header value is received.
The Header Length field contains the combined length of the HIP The Header Length field contains the combined length of the HIP
Header and HIP parameters in 8-byte units, excluding the first 8 Header and HIP parameters in 8-byte units, excluding the first
bytes. Since all HIP headers MUST contain the sender's and 8 bytes. Since all HIP headers MUST contain the sender's and
receiver's HIT fields, the minimum value for this field is 4, and receiver's HIT fields, the minimum value for this field is 4, and
conversely, the maximum length of the HIP Parameters field is conversely, the maximum length of the HIP Parameters field is
(255*8)-32 = 2008 bytes (see Section 5.1.3 regarding HIP (255 * 8) - 32 = 2008 bytes (see Section 5.1.3 regarding HIP
fragmentation). Note: this sets an additional limit for sizes of fragmentation). Note: this sets an additional limit for sizes of
parameters included in the Parameters field, independent of the parameters included in the Parameters field, independent of the
individual parameter maximum lengths. 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 unrecognized packet type, it MUST drop HIP packet that contains an unrecognized packet type, it MUST drop
the packet. the packet.
The HIP Version field is four bits. The version defined in this The HIP Version field is four bits. The version defined in this
document is 2. The version number is expected to be incremented only document is 2. The version number is expected to be incremented only
if there are incompatible changes to the protocol. Most extensions if there are incompatible changes to the protocol. Most extensions
can be handled by defining new packet types, new parameter types, or can be handled by defining new packet types, new parameter types, or
new Controls (see Section 5.1.2) . new Controls (see Section 5.1.2).
The following three 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 MUST be ignored when handling a received zero when sent, and they MUST be ignored when handling a received
packet. packet.
The two fixed bits in the header are reserved for SHIM6 compatibility The two fixed bits in the header are reserved for SHIM6 compatibility
[RFC5533], Section 5.3. For implementations adhering (only) to this [RFC5533], Section 5.3. For implementations adhering (only) to this
specification, they MUST be set as shown when sending and MUST be specification, they MUST be set as shown when sending and MUST be
ignored when receiving. This is to ensure optimal forward ignored when receiving. This is to ensure optimal forward
compatibility. Note that for implementations that implement other compatibility. Note that for implementations that implement other
skipping to change at page 40, line 10 skipping to change at page 40, line 10
protocol may need to check these bits in order to determine how to protocol may need to check these bits in order to determine how to
handle the packet. 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. Checksum 5.1.1. Checksum
Since the checksum covers the source and destination addresses in the Since the checksum covers the source and destination addresses in the
IP header, it MUST be recomputed on HIP-aware NAT devices. IP header, it MUST be recomputed on HIP-aware NAT devices.
If IPv6 is used to carry the HIP packet, the pseudo-header [RFC2460] If IPv6 is used to carry the HIP packet, the pseudo header [RFC2460]
contains the source and destination IPv6 addresses, HIP packet length contains the source and destination IPv6 addresses, HIP packet length
in the pseudo-header length field, a zero field, and the HIP protocol in the pseudo header Length field, a zero field, and the HIP protocol
number (see Section 5.1) in the Next Header field. The length field number (see Section 5.1) in the Next Header field. The Length field
is in bytes and can be calculated from the HIP header length field: is in bytes and can be calculated from the HIP Header Length field:
(HIP Header Length + 1) * 8. (HIP Header Length + 1) * 8.
In case of using IPv4, the IPv4 UDP pseudo-header format [RFC0768] is In case of using IPv4, the IPv4 UDP pseudo header format [RFC0768] is
used. In the pseudo-header, the source and destination addresses are used. In the pseudo header, the source and destination addresses are
those used in the IP header, the zero field is obviously zero, the 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 protocol is the HIP protocol number (see Section 4), and the length
is calculated as in the IPv6 case. is calculated as in the IPv6 case.
5.1.2. HIP Controls 5.1.2. HIP Controls
The HIP Controls field conveys information about the structure of the The HIP Controls field conveys information about the structure of the
packet and capabilities of the host. packet and capabilities of the host.
The following fields have been defined: The following fields have been defined:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | | | | | | | | | | | | |A| | | | | | | | | | | | | | | | |A|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 using SHOULD NOT be stored. This control is set in packets using
anonymous sender HIs. The peer receiving an anonymous HI in an R1 anonymous sender HIs. The peer receiving an anonymous HI in an R1
or I2 may choose to refuse it. or I2 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
zero in sent packets and MUST be ignored in received packets. to zero in sent packets and MUST be ignored in received packets.
5.1.3. HIP Fragmentation Support 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 is REQUIRED to be implemented in IPv4 (IPv4 fragment generation is REQUIRED to be implemented in IPv4 (IPv4
stacks and networks will usually do this by default) and RECOMMENDED stacks and networks will usually do this by default) and RECOMMENDED
to be implemented in IPv6. In IPv6 networks, the minimum MTU is to be implemented in IPv6. In IPv6 networks, the minimum MTU is
larger, 1280 bytes, than in IPv4 networks. The larger MTU size is larger, 1280 bytes, than in IPv4 networks. The larger MTU size is
usually sufficient for most HIP packets, and therefore fragment usually sufficient for most HIP packets, and therefore fragment
skipping to change at page 41, line 19 skipping to change at page 41, line 19
routed path. Since basic HIP, as defined in this document, does not routed path. Since basic HIP, as defined in this document, does not
provide a mechanism to use multiple IP datagrams for a single HIP provide a mechanism to use multiple IP datagrams for a single HIP
packet, support for path MTU discovery does not bring any value to packet, support for path MTU discovery does not bring any value to
HIP in IPv4 networks. HIP-aware NAT devices SHOULD perform IPv4 HIP in IPv4 networks. HIP-aware NAT devices SHOULD perform IPv4
reassembly/fragmentation for HIP packets. reassembly/fragmentation for HIP packets.
All HIP implementations have to be careful while employing a All HIP implementations have to be careful while employing a
reassembly algorithm so that the algorithm is sufficiently resistant reassembly algorithm so that the algorithm is sufficiently resistant
to DoS attacks. to DoS attacks.
Certificate chains can cause the packet to be fragmented and Certificate chains can cause the packet to be fragmented, and
fragmentation can open implementations to denial-of-service attacks fragmentation can open implementations to denial-of-service attacks
[KAU03]. "Hash and URL" schemes as defined in [RFC6253] for HIP [KAU03]. "Hash and URL" schemes as defined in [RFC6253] for HIP
version 1 may be used to avoid fragmentation and mitigate resulting version 1 may be used to avoid fragmentation and mitigate resulting
DoS attacks. DoS attacks.
5.2. HIP Parameters 5.2. HIP Parameters
The HIP parameters carry information that is necessary for The HIP parameters carry information that is necessary for
establishing and maintaining a HIP association. For example, the establishing and maintaining a HIP association. For example, the
peer's public keys as well as the signaling for negotiating ciphers peer's public keys as well as the signaling for negotiating ciphers
and payload handling are encapsulated in HIP parameters. Additional and payload handling are encapsulated in HIP parameters. Additional
information, meaningful for end-hosts or middleboxes, may also be information, meaningful for end hosts or middleboxes, may also be
included in HIP parameters. The specification of the HIP parameters included in HIP parameters. The specification of the HIP parameters
and their mapping to HIP packets and packet types is flexible to and their mapping to HIP packets and packet types is flexible to
allow HIP extensions to define new parameters and new protocol allow HIP extensions to define new parameters and new protocol
behavior. behavior.
In HIP packets, HIP parameters are ordered according to their numeric In HIP packets, HIP parameters are ordered according to their numeric
type number and encoded in TLV format. type number and encoded in TLV 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 | 129 | 12 | Puzzle generation | | R1_COUNTER | 129 | 12 | Puzzle generation |
| | | | counter | | | | | counter |
| | | | | | | | | |
| PUZZLE | 257 | 12 | K and Random #I | | PUZZLE | 257 | 12 | #K and Random #I |
| | | | | | | | | |
| SOLUTION | 321 | 20 | K, Random #I and | | SOLUTION | 321 | 20 | #K, Random #I and |
| | | | puzzle solution J | | | | | puzzle solution #J |
| | | | | | | | | |
| SEQ | 385 | 4 | UPDATE packet ID | | SEQ | 385 | 4 | UPDATE packet ID |
| | | | number | | | | | number |
| | | | | | | | | |
| ACK | 449 | variable | UPDATE packet ID | | ACK | 449 | variable | UPDATE packet ID |
| | | | number | | | | | number |
| | | | | | | | | |
| DH_GROUP_LIST | 511 | variable | Ordered list of DH | | DH_GROUP_LIST | 511 | variable | Ordered list of DH |
| | | | Group IDs supported | | | | | Group IDs supported |
| | | | by a host | | | | | by a host |
skipping to change at page 42, line 25 skipping to change at page 42, line 38
| DIFFIE_HELLMAN | 513 | variable | public key | | DIFFIE_HELLMAN | 513 | variable | public key |
| | | | | | | | | |
| HIP_CIPHER | 579 | variable | List of HIP | | HIP_CIPHER | 579 | variable | List of HIP |
| | | | encryption | | | | | encryption |
| | | | algorithms | | | | | algorithms |
| | | | | | | | | |
| ENCRYPTED | 641 | variable | Encrypted part of a | | ENCRYPTED | 641 | variable | Encrypted part of a |
| | | | HIP packet | | | | | HIP packet |
| | | | | | | | | |
| HOST_ID | 705 | variable | Host Identity with | | HOST_ID | 705 | variable | Host Identity with |
| | | | Fully-Qualified | | | | | Fully Qualified |
| | | | Domain FQDN (Name) | | | | | Domain Name (FQDN) |
| | | | or Network Access | | | | | or Network Access |
| | | | Identifier (NAI) | | | | | Identifier (NAI) |
| | | | | | | | | |
| HIT_SUITE_LIST | 715 | variable | Ordered list of the | | HIT_SUITE_LIST | 715 | variable | Ordered list of the |
| | | | HIT suites supported | | | | | HIT Suites supported |
| | | | by the Responder | | | | | by the Responder |
| | | | | | | | | |
| CERT | 768 | variable | HI Certificate; used | | CERT | 768 | variable | HI Certificate; used |
| | | | to transfer | | | | | to transfer |
| | | | certificates. | | | | | certificates. |
| | | | Specified in a | | | | | Specified in a |
| | | | separate docment. | | | | | separate document. |
| | | | | | | | | |
| NOTIFICATION | 832 | variable | Informational data | | NOTIFICATION | 832 | variable | Informational data |
| | | | | | | | | |
| ECHO_REQUEST_SIGNED | 897 | variable | Opaque data to be | | ECHO_REQUEST_SIGNED | 897 | variable | Opaque data to be |
| | | | echoed back; signed | | | | | echoed back; signed |
| | | | | | | | | |
| ECHO_RESPONSE_SIGNED | 961 | variable | Opaque data echoed | | ECHO_RESPONSE_SIGNED | 961 | variable | Opaque data echoed |
| | | | back by request; | | | | | back by request; |
| | | | signed | | | | | signed |
| | | | | | | | | |
skipping to change at page 43, line 14 skipping to change at page 43, line 26
| | | HIP | | | | | HIP | |
| | | transport | | | | | transport | |
| | | type | | | | | type | |
| | | numbers | | | | | numbers | |
| | | | | | | | | |
| HIP_MAC | 61505 | variable | HMAC-based message | | HIP_MAC | 61505 | variable | HMAC-based message |
| | | | authentication code, | | | | | authentication code, |
| | | | with key material | | | | | with key material |
| | | | from KEYMAT | | | | | from KEYMAT |
| | | | | | | | | |
| HIP_MAC_2 | 61569 | variable | HMAC based message | | HIP_MAC_2 | 61569 | variable | HMAC-based message |
| | | | authentication code, | | | | | authentication code, |
| | | | with key material | | | | | with key material |
| | | | from KEYMAT. Unlike | | | | | from KEYMAT. Unlike |
| | | | HIP_MAC, the HOST_ID | | | | | HIP_MAC, the HOST_ID |
| | | | parameter is | | | | | parameter is |
| | | | included in | | | | | included in |
| | | | HIP_MAC_2 | | | | | HIP_MAC_2 |
| | | | calculation. | | | | | calculation. |
| | | | | | | | | |
| HIP_SIGNATURE_2 | 61633 | variable | Signature used in R1 | | HIP_SIGNATURE_2 | 61633 | variable | Signature used in R1 |
skipping to change at page 44, line 17 skipping to change at page 44, line 23
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
| 0 - 1023 | Handshake | | 0 - 1023 | Handshake |
| | | | | |
| 1024 - 2047 | Reserved | | 1024 - 2047 | Reserved |
| | | | | |
| 2048 - 4095 | Parameters related to HIP transport formats | | 2048 - 4095 | Parameters related to HIP transport formats |
| | | | | |
| 4096 - 8191 | Signed parameters allocated through specification | | 4096 - 8191 | Signed parameters allocated through specification |
| | documents | | | documents |
| | | | | |
| 8192 - 32767 | Reserved | | 8192 - 32767 | Reserved |
| | | | | |
| 32768 - 49151 | Free for experimentation. Signed parameters. | | 32768 - 49151 | Reserved for Private Use. Signed parameters. |
| | | | | |
| 49152 - 61439 | Reserved | | 49152 - 61439 | Reserved |
| | | | | |
| 61440 - 62463 | Signatures and (signed) MACs | | 61440 - 62463 | Signatures and (signed) MACs |
| | | | | |
| 62464 - 63487 | Parameters that are neither signed nor MACed | | 62464 - 63487 | Parameters that are neither signed nor MACed |
| | | | | |
| 63488 - 64511 | Rendezvous and relaying | | 63488 - 64511 | Rendezvous and relaying |
| | | | | |
| 64512 - 65023 | Parameters that are neither signed nor MACed | | 64512 - 65023 | Parameters that are neither signed nor MACed |
| | | | | |
| 65024 - 65535 | Reserved | | 65024 - 65535 | Reserved |
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
The process for defining new parameters is described in Section 5.2.2 The process for defining new parameters is described in Section 5.2.2
of this document. of this document.
The range between 32768 (2^15) and 49151 (2^15 + 2^14) are free for The range between 32768 (2^15) and 49151 (2^15 + 2^14) is Reserved
experimentation. Types from this range SHOULD be selected in a for Private Use. Types from this range SHOULD be selected in a
random fashion to reduce the probability of collisions. random fashion to reduce the probability of collisions.
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. The parameters MUST be included in the packet fields in the packet. The parameters MUST be included in the packet
so that their types form an increasing order. If multiple parameters so that their types form an increasing order. If multiple parameters
with the same type number are in one packet, the parameters with the with the same type number are in one packet, the parameters with the
same type MUST be consecutive in the packet. If the order does not same type MUST be consecutive in the packet. If the order does not
follow this rule, the packet is considered to be malformed and it follow this rule, the packet is considered to be malformed and it
MUST be discarded. MUST be discarded.
Parameters using type values from 2048 up to 4095 are related to Parameters using type values from 2048 up to 4095 are related to
transport formats. Currently, one transport format is defined: the transport formats. Currently, one transport format is defined: the
ESP transport format [I-D.ietf-hip-rfc5202-bis]. ESP transport format [RFC7402].
All of the encoded TLV parameters have a length (that includes the All of the encoded TLV parameters have a length (that includes the
Type and Length fields), which is a multiple of 8 bytes. When Type and Length fields), which is a multiple of 8 bytes. When
needed, padding MUST be added to the end of the parameter so that the needed, padding MUST be added to the end of the parameter so that the
total length is a multiple of 8 bytes. This rule ensures proper total length is a multiple of 8 bytes. This rule ensures proper
alignment of data. Any added padding bytes MUST be zeroed by the alignment of data. Any added padding bytes MUST be zeroed by the
sender, and their values SHOULD NOT be checked by the receiver. sender, and their values SHOULD NOT be checked by the receiver.
The Length field indicates the length of the Contents field (in The Length field indicates the length of the Contents field (in
bytes). Consequently, the total length of the TLV parameter bytes). Consequently, the total length of the TLV parameter
(including Type, Length, Contents, and Padding) is related to the (including Type, Length, Contents, and Padding) is related to the
Length field according to the following formula: Length field according to the following formula:
Total Length = 11 + Length - (Length + 3) % 8; Total Length = 11 + Length - (Length + 3) % 8;
where % is the modulo operator where % is the modulo operator.
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 |C| Length | | Type |C| Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
/ Contents / / Contents /
/ +-+-+-+-+-+-+-+-+ / +-+-+-+-+-+-+-+-+
| | Padding | | | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type Type code for the parameter. 16 bits long, C-bit Type Type code for the parameter. 16 bits long, C-bit
being part of the Type code. being part of the Type code.
C Critical. One if this parameter is critical, and C Critical. One if this parameter is critical and
MUST be recognized by the recipient, zero otherwise. MUST be recognized by the recipient, zero otherwise.
The C bit is considered to be a part of the Type The C-bit is considered to be a part of the Type
field. Consequently, critical parameters are always field. Consequently, critical parameters are always
odd and non-critical ones have an even value. odd, and non-critical ones have an even value.
Length Length of the Contents, in bytes excluding Type, Length Length of the Contents, in bytes, excluding Type,
Length, and Padding. Length, and Padding
Contents Parameter specific, defined by Type Contents Parameter specific, defined by Type
Padding Padding, 0-7 bytes, added if needed Padding Padding, 0-7 bytes, added if needed
Critical parameters (indicated by the odd type number) MUST be Critical parameters (indicated by the odd type number value) MUST be
recognized by the recipient. If a recipient encounters a critical recognized by the recipient. If a recipient encounters a critical
parameter that it does not recognize, it MUST NOT process the packet parameter that it does not recognize, it MUST NOT process the packet
any further. It MAY send an ICMP or NOTIFY, as defined in any further. It MAY send an ICMP or NOTIFY, as defined in
Section 4.3. 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.
skipping to change at page 47, line 4 skipping to change at page 47, line 6
MUST be well documented. Implementations operating in a mode MUST be well documented. Implementations operating in a mode
adhering to this specification MUST disable the sending of new adhering to this specification MUST disable the sending of new
critical parameters by default. In other words, the management critical parameters by default. In other words, the management
interface MUST allow vanilla standards-only mode as a default interface MUST allow vanilla standards-only mode as a default
configuration setting, and MAY allow new critical payloads to be configuration setting, and MAY allow new critical payloads to be
configured on (and off). configured on (and off).
4. See Section 9 for allocation rules regarding Type codes. 4. See 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 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
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 |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 129 Type 129
Length 12 Length 12
R1 generation R1 generation
counter The current generation of valid puzzles counter The current generation of valid puzzles
The R1_COUNTER parameter contains a 64-bit unsigned integer in The R1_COUNTER parameter contains a 64-bit unsigned integer in
network-byte order, indicating the current generation of valid network byte order, indicating the current generation of valid
puzzles. The sender SHOULD increment this counter periodically. It puzzles. The sender SHOULD increment this counter periodically. It
is RECOMMENDED that the counter value is incremented at least as is RECOMMENDED that the counter value is incremented at least as
often as old PUZZLE values are deprecated so that SOLUTIONs to them often as old PUZZLE values are deprecated so that SOLUTIONs to them
are no longer accepted. are no longer accepted.
Support for the R1_COUNTER parameter is mandatory although its Support for the R1_COUNTER parameter is mandatory, although its
inclusion in the R1 packet is optional. It SHOULD be included in the inclusion in the R1 packet 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 MUST be echoed (including the Reserved field verbatim) by the R1, it MUST be echoed (including the Reserved field verbatim) by
the Initiator in the I2 packet. the Initiator in the I2 packet.
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, RHASH_len/8 bytes | | Random #I, RHASH_len / 8 bytes |
/ / / /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 257 Type 257
Length 4 + RHASH_len / 8 Length 4 + RHASH_len / 8
#K #K is the number of verified bits #K #K is the number of verified bits
Lifetime puzzle lifetime 2^(value-32) seconds Lifetime puzzle lifetime 2^(value - 32) seconds
Opaque data set by the Responder, indexing the puzzle Opaque data set by the Responder, indexing the puzzle
Random #I random number of size RHASH_len bits Random #I random number of size RHASH_len bits
Random #I is represented as a n-bit integer (where n is RHASH_len), Random #I is represented as an n-bit integer (where n is RHASH_len),
#K and Lifetime as 8-bit integers, all in network byte order. and #K and Lifetime as 8-bit integers, all in network byte order.
The PUZZLE parameter contains the puzzle difficulty #K and a n-bit The PUZZLE parameter contains the puzzle difficulty #K and an n-bit
random integer #I. The Puzzle Lifetime indicates the time during random integer #I. The Puzzle Lifetime indicates the time during
which the puzzle solution is valid, and sets a time limit that should which the puzzle solution is valid, and sets a time limit that should
not be exceeded by the Initiator while it attempts to solve the not be exceeded by the Initiator while it attempts to solve the
puzzle. The lifetime is indicated as a power of 2 using the formula puzzle. The lifetime is indicated as a power of 2 using the formula
2^(Lifetime-32) seconds. A puzzle MAY be augmented with an 2^(Lifetime - 32) seconds. A puzzle MAY be augmented with an
ECHO_REQUEST_SIGNED or an ECHO_REQUEST_UNSIGNED parameter included in ECHO_REQUEST_SIGNED or an ECHO_REQUEST_UNSIGNED parameter included in
the R1; the contents of the echo request are then echoed back in the the R1; the contents of the echo request are then echoed back in the
ECHO_RESPONSE_SIGNED or in the ECHO_RESPONSE_UNSIGNED parameter, ECHO_RESPONSE_SIGNED or in the ECHO_RESPONSE_UNSIGNED parameter,
allowing the Responder to use the included information as a part of allowing the Responder to use the included information as a part of
its puzzle processing. its puzzle processing.
The Opaque and Random #I field are not covered by the HIP_SIGNATURE_2 The Opaque and Random #I fields are not covered by the
parameter. HIP_SIGNATURE_2 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, n bytes | | Random #I, n bytes |
/ / / /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 49, line 14 skipping to change at page 49, line 17
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, n bytes | | Random #I, n bytes |
/ / / /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Puzzle solution #J, RHASH_len/8 bytes | | Puzzle solution #J, RHASH_len / 8 bytes |
/ / / /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 321 Type 321
Length 4 + RHASH_len /4 Length 4 + RHASH_len / 4
#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 Opaque copied unmodified from the received PUZZLE
parameter parameter
Random #I random number of size RHASH_len bits Random #I random number of size RHASH_len bits
Puzzle solution #J random number of size RHASH_len bits Puzzle solution #J random number of size RHASH_len bits
Random #I and Random #J are represented as n-bit unsigned integers Random #I and Random #J are represented as n-bit unsigned integers
(where n is RHASH_len), #K as an 8-bit unsigned integer, all in (where n is RHASH_len), and #K as an 8-bit unsigned integer, all in
network byte order. 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 echoes back the random difficulty #K, the Opaque field, and the
puzzle integer #I. puzzle integer #I.
5.2.6. DH_GROUP_LIST 5.2.6. DH_GROUP_LIST
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DH GROUP ID #1| DH GROUP ID #2| DH GROUP ID #3| DH GROUP ID #4| | DH GROUP ID #1| DH GROUP ID #2| DH GROUP ID #3| DH GROUP ID #4|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DH GROUP ID #n| Padding | | DH GROUP ID #n| Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 50, line 18 skipping to change at page 50, line 21
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DH GROUP ID #1| DH GROUP ID #2| DH GROUP ID #3| DH GROUP ID #4| | DH GROUP ID #1| DH GROUP ID #2| DH GROUP ID #3| DH GROUP ID #4|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DH GROUP ID #n| Padding | | DH GROUP ID #n| Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 511 Type 511
Length number of DH Group IDs Length number of DH Group IDs
DH GROUP ID identifies a DH GROUP ID supported by the host. DH GROUP ID identifies a DH GROUP ID supported by the host.
The list of IDs is ordered by preference of the The list of IDs is ordered by preference of the
host. The possible DH Group IDs are defined host. The possible DH Group IDs are defined
in the DIFFIE_HELLMAN parameter. Each DH Group ID in the DIFFIE_HELLMAN parameter. Each DH
is one octet long. Group ID is one octet long.
The DH_GROUP_LIST parameter contains the list of supported DH Group The DH_GROUP_LIST parameter contains the list of supported DH Group
IDs of a host. The Initiator sends the DH_GROUP_LIST in the I1 IDs of a host. The Initiator sends the DH_GROUP_LIST in the I1
packet, the Responder sends its own list in the signed part of the R1 packet, and the Responder sends its own list in the signed part of
packet. The DH Group IDs in the DH_GROUP_LIST are listed in the the R1 packet. The DH Group IDs in the DH_GROUP_LIST are listed in
order of their preference of the host sending the list. DH Group IDs the order of their preference of the host sending the list. DH Group
that are listed first are preferred over the DH Group IDs listed IDs that are listed first are preferred over the DH Group IDs listed
later. The information in the DH_GROUP_LIST allows the Responder to later. The information in the DH_GROUP_LIST allows the Responder to
select the DH group preferred by itself and supported by the select the DH group preferred by itself and supported by the
Initiator. Based on the DH_GROUP_LIST in the R1 packet, the Initiator. Based on the DH_GROUP_LIST in the R1 packet, the
Initiator can determine if the Responder has selected the best Initiator can determine if the Responder has selected the best
possible choice based on the Initiator's and Responder's preferences. possible choice based on the Initiator's and Responder's preferences.
If the Responder's choice differs from the best choice, the Initiator If the Responder's choice differs from the best choice, the Initiator
can conclude that there was an attempted downgrade attack (see can conclude that there was an attempted downgrade attack (see
Section 4.1.7). Section 4.1.7).
When selecting the DH group for the DIFFIE_HELLMAN parameter in the When selecting the DH group for the DIFFIE_HELLMAN parameter in the
R1 packet, the Responder MUST select the first DH Group ID in its R1 packet, the Responder MUST select the first DH Group ID in its
DH_GROUP_LIST in the R1 packet that is compatible with one of the DH_GROUP_LIST in the R1 packet that is compatible with one of the
Suite IDs in the Initiator's DH_GROUP_LIST in the I1 packet. The Suite IDs in the Initiator's DH_GROUP_LIST in the I1 packet. The
Responder MUST NOT select any other DH Group ID that is contained in Responder MUST NOT select any other DH Group ID that is contained in
both lists because a downgrade attack cannot be detected then. both lists, because then a downgrade attack cannot be detected.
In general, hosts SHOULD prefer stronger groups over weaker ones if In general, hosts SHOULD prefer stronger groups over weaker ones if
the computation overhead is not prohibitively high for the intended the computation overhead is not prohibitively high for the intended
application. application.
5.2.7. DIFFIE_HELLMAN 5.2.7. 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 51, line 29 skipping to change at page 51, line 29
Type 513 Type 513
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
Group ID identifies values for p and g as well as the KDF Group ID identifies values for p and g as well as the KDF
Public Value length of the following Public Value in octets Public Value length of the following Public Value in octets
Length Length
Public Value the sender's public Diffie-Hellman key Public Value the sender's public Diffie-Hellman key
A single DIFFIE_HELLMAN parameter may be included in selected HIP A single DIFFIE_HELLMAN parameter may be included in selected HIP
packets based on the DH Group ID selected (Section 5.2.6). The packets based on the DH Group ID selected (Section 5.2.6). The
following Group IDs have been defined: following Group IDs have been defined; values are assigned by this
document:
Group KDF Value Group KDF Value
Reserved 0 Reserved 0
DEPRECATED 1 DEPRECATED 1
DEPRECATED 2 DEPRECATED 2
1536-bit MODP group [RFC3526] HKDF [RFC5869] 3 1536-bit MODP group [RFC3526] HKDF [RFC5869] 3
3072-bit MODP group [RFC3526] HKDF [RFC5869] 4 3072-bit MODP group [RFC3526] HKDF [RFC5869] 4
DEPRECATED 5 DEPRECATED 5
DEPRECATED 6 DEPRECATED 6
NIST P-256 [RFC5903] HKDF [RFC5869] 7 NIST P-256 [RFC5903] HKDF [RFC5869] 7
NIST P-384 [RFC5903] HKDF [RFC5869] 8 NIST P-384 [RFC5903] HKDF [RFC5869] 8
NIST P-521 [RFC5903] HKDF [RFC5869] 9 NIST P-521 [RFC5903] HKDF [RFC5869] 9
skipping to change at page 51, line 45 skipping to change at page 51, line 47
1536-bit MODP group [RFC3526] HKDF [RFC5869] 3 1536-bit MODP group [RFC3526] HKDF [RFC5869] 3
3072-bit MODP group [RFC3526] HKDF [RFC5869] 4 3072-bit MODP group [RFC3526] HKDF [RFC5869] 4
DEPRECATED 5 DEPRECATED 5
DEPRECATED 6 DEPRECATED 6
NIST P-256 [RFC5903] HKDF [RFC5869] 7 NIST P-256 [RFC5903] HKDF [RFC5869] 7
NIST P-384 [RFC5903] HKDF [RFC5869] 8 NIST P-384 [RFC5903] HKDF [RFC5869] 8
NIST P-521 [RFC5903] HKDF [RFC5869] 9 NIST P-521 [RFC5903] HKDF [RFC5869] 9
SECP160R1 [SECG] HKDF [RFC5869] 10 SECP160R1 [SECG] HKDF [RFC5869] 10
2048-bit MODP group [RFC3526] HKDF [RFC5869] 11 2048-bit MODP group [RFC3526] HKDF [RFC5869] 11
The MODP Diffie-Hellman groups are defined in [RFC3526]. The ECDH The MODP Diffie-Hellman groups are defined in [RFC3526]. ECDH
groups 7 - 9 are defined in [RFC5903] and [RFC6090]. ECDH group 10 groups 7-9 are defined in [RFC5903] and [RFC6090]. ECDH group 10
is covered in Appendix D. Any ECDH used with HIP MUST have a co- is covered in Appendix D. Any ECDH used with HIP MUST have a
factor of 1. co-factor of 1.
The Group ID also defines the key derivation function that is to be The Group ID also defines the key derivation function that is to be
used for deriving the symmetric keys for the HMAC and symmetric used for deriving the symmetric keys for the HMAC and symmetric
encryption from the keying material from the Diffie Hellman key encryption from the keying material from the Diffie-Hellman key
exchange (see Section 6.5). exchange (see Section 6.5).
A HIP implementation MUST implement Group ID 3. The 160-bit A HIP implementation MUST implement Group ID 3. The 160-bit
SECP160R1 group can be used when lower security is enough (e.g., web SECP160R1 group can be used when lower security is enough (e.g., web
surfing) and when the equipment is not powerful enough (e.g., some surfing) and when the equipment is not powerful enough (e.g., some
PDAs). Implementations SHOULD implement Group IDs 4 and 8. PDAs). Implementations SHOULD implement Group IDs 4 and 8.
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.
skipping to change at page 53, line 13 skipping to change at page 53, line 32
default configuration, the HIP_CIPHER parameter MUST contain at least default configuration, the HIP_CIPHER parameter MUST contain at least
one of the mandatory Cipher IDs. There MAY be a configuration option one of the mandatory Cipher IDs. There MAY be a configuration option
that allows the administrator to override this default. that allows the administrator to override this default.
The Responder lists supported and desired Cipher IDs in order of The Responder lists supported and desired Cipher IDs in order of
preference in the R1, up to the maximum of six Cipher IDs. The preference in the R1, up to the maximum of six Cipher IDs. The
Initiator MUST choose only one of the corresponding Cipher IDs. This Initiator MUST choose only one of the corresponding Cipher IDs. This
Cipher ID will be used for generating the ENCRYPTED parameter. Cipher ID will be used for generating the ENCRYPTED parameter.
Mandatory implementation: AES-128-CBC. Implementors SHOULD support Mandatory implementation: AES-128-CBC. Implementors SHOULD support
NULL-ENCRYPT for testing/debugging purposes, but MUST NOT offer or NULL-ENCRYPT for testing/debugging purposes but MUST NOT offer or
accept this value unless explicitly configured for testing/debugging accept this value unless explicitly configured for testing/debugging
of the HIP protocol. of HIP.
5.2.9. HOST_ID 5.2.9. 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Algorithm | Host Identity / | Algorithm | Host Identity /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ | Domain Identifier / / | Domain Identifier /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ | Padding | / | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 705 Type 705
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
HI Length length of the Host Identity in octets HI Length length of the Host Identity in octets
DI-type type of the following Domain Identifier field DI-Type type of the following Domain Identifier field
DI Length length of the Domain Identifier field in octets DI Length length of the Domain Identifier field in octets
Algorithm index to the employed algorithm Algorithm index to the employed algorithm
Host Identity actual Host Identity Host Identity actual Host Identity
Domain Identifier the identifier of the sender Domain Identifier the identifier of the sender
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
The format for the FQDN is defined in RFC 1035 [RFC1035] Section 3.1. The format for the FQDN is defined in RFC 1035 [RFC1035],
The format for the NAI is defined in [RFC4282] Section 3.1. The format for the NAI is defined in [RFC4282].
A host MAY optionally associate the Host Identity with a single A host MAY optionally associate the Host Identity with a single
Domain Identifier in the HOST_ID parameter. If there is no Domain Domain Identifier in the HOST_ID parameter. If there is no Domain
Identifier, i.e., the DI-type field is zero, the DI Length field is Identifier, i.e., the DI-Type field is zero, the DI Length field is
set to zero as well. set to zero as well.
The following HI Algorithms have been defined: The following HI Algorithms have been defined:
Algorithm Algorithm profiles Values
profiles Values
RESERVED 0 RESERVED 0
DSA 3 [FIPS186-3] (RECOMMENDED) DSA 3 [FIPS.186-4.2013] (RECOMMENDED)
RSA 5 [RFC3447] (REQUIRED) RSA 5 [RFC3447] (REQUIRED)
ECDSA 7 [RFC4754] (REQUIRED) ECDSA 7 [RFC4754] (REQUIRED)
ECDSA_LOW 9 [SECG] (RECOMMENDED) ECDSA_LOW 9 [SECG] (RECOMMENDED)
For DSA, RSA, and ECDSA key types, profiles containing at least 112 For DSA, RSA, and ECDSA key types, profiles containing at least
bits of security strength (as defined by [NIST.800-131A.2011]) should 112 bits of security strength (as defined by [NIST.800-131A.2011])
be used. For RSA signature padding, the PSS method of padding should be used. For RSA signature padding, the Probabilistic
[RFC3447] MUST be used. Signature Scheme (PSS) method of padding [RFC3447] MUST be used.
The Host Identity is derived from the DNSKEY format for RSA and DSA. The Host Identity is derived from the DNSKEY format for RSA and DSA.
For these, the Public Key field of the RDATA part from RFC 4034 For these, the Public Key field of the RDATA part from RFC 4034
[RFC4034] is used. For ECC we distinguish two different profiles: [RFC4034] is used. For Elliptic Curve Cryptography (ECC), we
ECDSA and ECDSA_LOW. ECC contains curves approved by NIST and distinguish two different profiles: ECDSA and ECDSA_LOW. ECC
defined in RFC 4754 [RFC4754]. ECDSA_LOW is defined for devices with contains curves approved by NIST and defined in RFC 4754 [RFC4754].
low computational capabilities and uses shorter curves from SECG ECDSA_LOW is defined for devices with low computational capabilities
[SECG]. Any ECDSA used with HIP MUST have a co-factor of 1. and uses shorter curves from the Standards for Efficient Cryptography
Group [SECG]. Any ECDSA used with HIP MUST have a co-factor of 1.
For ECDSA and ECDSA_LOW Host Identities are represented by the For ECDSA and ECDSA_LOW, Host Identities are represented by the
following fields: following fields:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ECC Curve | / | ECC Curve | /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Public Key | / Public Key |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
ECC Curve Curve label ECC Curve Curve label
Public Key Represented in Octet-string format Public Key Represented in octet-string format [RFC6090]
[RFC6090]
For hosts that implement ECDSA as algorithm the following ECC curves For hosts that implement ECDSA as the algorithm, the following ECC
are required: curves are required:
Algorithm Curve Values Algorithm Curve Values
ECDSA RESERVED 0 ECDSA RESERVED 0
ECDSA NIST P-256 1 [RFC4754] ECDSA NIST P-256 1 [RFC4754]
ECDSA NIST P-384 2 [RFC4754] ECDSA NIST P-384 2 [RFC4754]
For hosts that implement the ECDSA_LOW algorithm profile, the For hosts that implement the ECDSA_LOW algorithm profile, the
following curve is required: following curve is required:
skipping to change at page 56, line 19 skipping to change at page 56, line 35
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ID #1 | ID #2 | ID #3 | ID #4 | | ID #1 | ID #2 | ID #3 | ID #4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ID #n | Padding | | ID #n | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 715 Type 715
Length number of HIT Suite IDs Length number of HIT Suite IDs
ID identifies a HIT Suite ID supported by the host. ID identifies a HIT Suite ID supported by the host.
The list of IDs is ordered by preference of the The list of IDs is ordered by preference of the
host. Each HIT Suite ID is one octet long. The four host. Each HIT Suite ID is one octet long. The
higher-order bits of the ID field correspond to the four higher-order bits of the ID field correspond
HIT Suite ID in the ORCHID OGA field. The four to the HIT Suite ID in the ORCHID OGA ID field. The
lower-order bits are reserved and set to 0 by four lower-order bits are reserved and set to 0
the sender. The reception of an ID with the by the sender. The reception of an ID with the
four lower-order bits not set to 0 SHOULD be four lower-order bits not set to 0 SHOULD be
considered as an error that MAY result in a considered as an error that MAY result in a
NOTIFICATION of type UNSUPPORTED_HIT_SUITE. NOTIFICATION of type UNSUPPORTED_HIT_SUITE.
The HIT Suite ID indexes a HIT Suite. HIT Suites are composed of The HIT Suite ID indexes a HIT Suite. HIT Suites are composed of
signature algorithms as defined in Section 5.2.9 and hash functions. signature algorithms as defined in Section 5.2.9, and hash functions.
The ID field in the HIT_SUITE_LIST is defined as eight-bit field as The ID field in the HIT_SUITE_LIST is defined as an eight-bit field,
opposed to the four-bit HIT Suite ID and OGA field in the ORCHID. as opposed to the four-bit HIT Suite ID and OGA ID field in the
This difference is a measure to accommodate larger HIT Suite IDs if ORCHID. This difference is a measure to accommodate larger HIT Suite
the 16 available values prove insufficient. In that case, one of the IDs if the 16 available values prove insufficient. In that case, one
16 values, zero, will be used to indicate that four additional bits of the 16 values, zero, will be used to indicate that four additional
of the ORCHID will be used to encode the HIT Suite ID. Hence, the bits of the ORCHID will be used to encode the HIT Suite ID. Hence,
current four-bit HIT Suite-IDs only use the four higher order bits in the current four-bit HIT Suite IDs only use the four higher-order
the ID field. Future documents may define the use of the four lower- bits in the ID field. Future documents may define the use of the
order bits in the ID field. four lower-order bits in the ID field.
The following HIT Suites ID are defined, and the relationship between The following HIT Suite IDs are defined, and the relationship between
the four-bit ID value used in the OGA ID field, and the eight-bit the four-bit ID value used in the OGA ID field and the eight-bit
encoding within the HIT_SUITE_LIST ID field, is clarified: encoding within the HIT_SUITE_LIST ID field is clarified:
HIT Suite Four-bit ID Eight-bit encoding HIT Suite Four-bit ID Eight-bit encoding
RESERVED 0 0x00 RESERVED 0 0x00
RSA,DSA/SHA-256 1 0x10 (REQUIRED) RSA,DSA/SHA-256 1 0x10 (REQUIRED)
ECDSA/SHA-384 2 0x20 (RECOMMENDED) ECDSA/SHA-384 2 0x20 (RECOMMENDED)
ECDSA_LOW/SHA-1 3 0x30 (RECOMMENDED) ECDSA_LOW/SHA-1 3 0x30 (RECOMMENDED)
The following table provides more detail on the above HIT Suite The following table provides more detail on the above HIT Suite
combinations. The input for each generation algorithm is the combinations. The input for each generation algorithm is the
encoding of the HI as defined in Section 3.2. The output is 96 bits encoding of the HI as defined in Section 3.2. The output is 96 bits
long and is directly used in the ORCHID. long and is directly used in the ORCHID.
skipping to change at page 57, line 13 skipping to change at page 57, line 30
combinations. The input for each generation algorithm is the combinations. The input for each generation algorithm is the
encoding of the HI as defined in Section 3.2. The output is 96 bits encoding of the HI as defined in Section 3.2. The output is 96 bits
long and is directly used in the ORCHID. long and is directly used in the ORCHID.
+-------+----------+--------------+------------+--------------------+ +-------+----------+--------------+------------+--------------------+
| Index | Hash | HMAC | Signature | Description | | Index | Hash | HMAC | Signature | Description |
| | function | | algorithm | | | | function | | algorithm | |
| | | | family | | | | | | family | |
+-------+----------+--------------+------------+--------------------+ +-------+----------+--------------+------------+--------------------+
| 0 | | | | Reserved | | 0 | | | | Reserved |
| | | | | |
| 1 | SHA-256 | HMAC-SHA-256 | RSA, DSA | RSA or DSA HI | | 1 | SHA-256 | HMAC-SHA-256 | RSA, DSA | RSA or DSA HI |
| | | | | hashed with | | | | | | hashed with |
| | | | | SHA-256, truncated | | | | | | SHA-256, truncated |
| | | | | to 96 bits | | | | | | to 96 bits |
| | | | | |
| 2 | SHA-384 | HMAC-SHA-384 | ECDSA | ECDSA HI hashed | | 2 | SHA-384 | HMAC-SHA-384 | ECDSA | ECDSA HI hashed |
| | | | | with SHA-384, | | | | | | with SHA-384, |
| | | | | truncated to 96 | | | | | | truncated to 96 |
| | | | | bits | | | | | | bits |
| | | | | |
| 3 | SHA-1 | HMAC-SHA-1 | ECDSA_LOW | ECDSA_LOW HI | | 3 | SHA-1 | HMAC-SHA-1 | ECDSA_LOW | ECDSA_LOW HI |
| | | | | hashed with SHA-1, | | | | | | hashed with SHA-1, |
| | | | | truncated to 96 | | | | | | truncated to 96 |
| | | | | bits | | | | | | bits |
+-------+----------+--------------+------------+--------------------+ +-------+----------+--------------+------------+--------------------+
Table 10: HIT Suites Table 10: HIT Suites
The hash of the responder as defined in the HIT Suite determines the The hash of the Responder as defined in the HIT Suite determines the
HMAC to be used for the RHASH function. The HMACs currently defined HMAC to be used for the RHASH function. The HMACs currently defined
here are HMAC-SHA-256 [RFC4868], HMAC-SHA-384 [RFC4868], and HMAC- here are HMAC-SHA-256 [RFC4868], HMAC-SHA-384 [RFC4868], and
SHA-1 [RFC2404]. HMAC-SHA-1 [RFC2404].
5.2.11. TRANSPORT_FORMAT_LIST 5.2.11. TRANSPORT_FORMAT_LIST
The TRANSPORT_FORMAT_LIST parameter contains a list of the supported The TRANSPORT_FORMAT_LIST parameter contains a list of the supported
HIP transport formats (TFs) of the Responder. The Responder sends HIP transport formats (TFs) of the Responder. The Responder sends
the TRANSPORT_FORMAT_LIST in the signed part of the R1 packet. Based the TRANSPORT_FORMAT_LIST in the signed part of the R1 packet. Based
on the TRANSPORT_FORMAT_LIST, the Initiator chooses one suitable on the TRANSPORT_FORMAT_LIST, the Initiator chooses one suitable
transport format and includes the respective HIP transport format transport format and includes the respective HIP transport format
parameter in its response packet. parameter in its response packet.
skipping to change at page 58, line 17 skipping to change at page 58, line 31
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TF type #1 | TF type #2 / | TF type #1 | TF type #2 /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ TF type #n | Padding | / TF type #n | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 2049 Type 2049
Length 2x number of TF types Length 2x number of TF types
TF Type identifies a transport format (TF) type supported by TF Type identifies a transport format (TF) type supported
the host. The TF type numbers correspond to the HIP by the host. The TF type numbers correspond to
parameter type numbers of the respective transport the HIP parameter type numbers of the respective
format transport format parameters. The list of TF types
parameters. The list of TF types is ordered by is ordered by preference of the sender.
preference of the sender
The TF type numbers index the respective HIP parameters for the The TF type numbers index the respective HIP parameters for the
transport formats in the type number range between 2050 to 4095. The transport formats in the type number range between 2050 and 4095.
parameters and their use are defined in separate documents. The parameters and their use are defined in separate documents.
Currently, the only transport format defined is IPsec ESP Currently, the only transport format defined is IPsec ESP [RFC7402].
[I-D.ietf-hip-rfc5202-bis].
For each listed TF type, the sender of the TRANSPORT_FORMAT_LIST For each listed TF type, the sender of the TRANSPORT_FORMAT_LIST
parameter MUST include the respective transport format parameter in parameter MUST include the respective transport format parameter in
the HIP packet. The receiver MUST ignore the TF type in the the HIP packet. The receiver MUST ignore the TF type in the
TRANSPORT_FORMAT_LIST if no matching transport format parameter is TRANSPORT_FORMAT_LIST if no matching transport format parameter is
present in the packet. present in the packet.
5.2.12. HIP_MAC 5.2.12. HIP_MAC
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 |
/ / / /
/ +-------------------------------+ / +-------------------------------+
| | Padding | | | Padding |
skipping to change at page 59, line 20 skipping to change at page 59, line 23
| HMAC | | HMAC |
/ / / /
/ +-------------------------------+ / +-------------------------------+
| | Padding | | | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 61505 Type 61505
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
HMAC HMAC computed over the HIP packet, excluding the HMAC HMAC computed over the HIP packet, excluding the
HIP_MAC parameter and any following parameters, such HIP_MAC parameter and any following parameters,
as HIP_SIGNATURE, HIP_SIGNATURE_2, such as HIP_SIGNATURE, HIP_SIGNATURE_2,
ECHO_REQUEST_UNSIGNED, or ECHO_RESPONSE_UNSIGNED. ECHO_REQUEST_UNSIGNED, or ECHO_RESPONSE_UNSIGNED.
The checksum field MUST be set to zero and the HIP The Checksum field MUST be set to zero, and the
header length in the HIP common header MUST be HIP 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. The size of the when the HMAC is calculated. The size of the
HMAC is the natural size of the hash computation HMAC is the natural size of the hash computation
output depending on the used hash function. output depending on the used hash function.
The HMAC uses RHASH as hash algorithm. The calculation and The HMAC uses RHASH as the hash algorithm. The calculation and
verification process is presented in Section 6.4.1. verification process is presented in Section 6.4.1.
5.2.13. HIP_MAC_2 5.2.13. HIP_MAC_2
The HIP_MAC_2 is a MAC of the packet and the HI of the sender in the HIP_MAC_2 is a MAC of the packet and the HI of the sender in the form
form of a HOST_ID parameter when that parameter is not actually of a HOST_ID parameter when that parameter is not actually included
included in the packet. The parameter structure is the same as in in the packet. The parameter structure is the same as the structure
Section 5.2.12. The fields are: shown in Section 5.2.12. The fields are as follows:
Type 61569 Type 61569
Length length in octets, excluding Type, Length, and Length length in octets, excluding Type, Length, and
Padding Padding
HMAC HMAC computed over the HIP packet, excluding the HMAC HMAC computed over the HIP packet, excluding the
HIP_MAC_2 parameter and any following parameters HIP_MAC_2 parameter and any following parameters
such as HIP_SIGNATURE, HIP_SIGNATURE_2, such as HIP_SIGNATURE, HIP_SIGNATURE_2,
ECHO_REQUEST_UNSIGNED, or ECHO_RESPONSE_UNSIGNED, ECHO_REQUEST_UNSIGNED, or ECHO_RESPONSE_UNSIGNED,
and including an additional sender's HOST_ID and including an additional sender's HOST_ID
parameter during the HMAC calculation. The checksum parameter during the HMAC calculation. The
field MUST be set to zero and the HIP header length Checksum field MUST be set to zero, and the HIP
in the HIP common header MUST be calculated not to header length in the HIP common header MUST be
cover any excluded parameters when the HMAC is calculated not to cover any excluded parameters
calculated. The size of the HMAC is the natural when the HMAC is calculated. The size of the
size of the hash computation output depending on the HMAC is the natural size of the hash computation
used hash function. output depending on the used hash function.
The HMAC uses RHASH as hash algorithm. The calculation and The HMAC uses RHASH as the hash algorithm. The calculation and
verification process is presented in Section 6.4.1. verification process is presented in Section 6.4.1.
5.2.14. HIP_SIGNATURE 5.2.14. 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 parameter. parameters that follow the HIP_SIGNATURE
When the signature is calculated the checksum field parameter. When the signature is calculated, the
MUST be set to zero, and the HIP header length in Checksum field MUST be set to zero, and the HIP
the HIP common header MUST be calculated only up to header length in the HIP common header MUST be
the beginning of the HIP_SIGNATURE parameter. calculated only up to the beginning of the
HIP_SIGNATURE parameter.
The signature algorithms are defined in Section 5.2.9. The signature The signature algorithms are defined in Section 5.2.9. The signature
in the Signature field is encoded using the method depending on the in the Signature field is encoded using the method depending on the
signature algorithm (e.g., according to [RFC3110] in case of RSA/SHA- signature algorithm (e.g., according to [RFC3110] in the case of RSA/
1, according to [RFC5702] in case of RSA/SHA-256, according to SHA-1, [RFC5702] in the case of RSA/SHA-256, [RFC2536] in the case of
DSA, or [RFC6090] in the case of ECDSA).
[RFC2536] in case of DSA, or according to [RFC6090] in case of
ECDSA).
The HIP_SIGNATURE calculation and verification process are presented HIP_SIGNATURE calculation and verification follow the process defined
in Section 6.4.2. in Section 6.4.2.
5.2.15. HIP_SIGNATURE_2 5.2.15. HIP_SIGNATURE_2
The HIP_SIGNATURE_2 excludes the variable parameters in the R1 packet HIP_SIGNATURE_2 excludes the variable parameters in the R1 packet to
to allow R1 pre-creation. The parameter structure is the same as in allow R1 pre-creation. The parameter structure is the same as the
Section 5.2.14. The fields are: structure shown in Section 5.2.14. The fields are as follows:
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 Within the R1 packet that contains the Signature Within the R1 packet that contains the
HIP_SIGNATURE_2 parameter, the Initiator's HIT, the HIP_SIGNATURE_2 parameter, the Initiator's HIT, the
checksum field, and the Opaque and Random #I fields Checksum field, and the Opaque and Random #I fields
in the PUZZLE parameter MUST be set to zero while in the PUZZLE parameter MUST be set to zero while
computing the HIP_SIGNATURE_2 signature. Further, computing the HIP_SIGNATURE_2 signature. Further,
the HIP packet length in the HIP header MUST be the HIP packet length in the HIP header MUST be
adjusted as if the HIP_SIGNATURE_2 was not in the adjusted as if the HIP_SIGNATURE_2 was not in the
packet during the signature calculation, i.e., the packet during the signature calculation, i.e., the
HIP packet length points to the beginning of HIP packet length points to the beginning of
the HIP_SIGNATURE_2 parameter during signing and the HIP_SIGNATURE_2 parameter during signing and
verification. verification.
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 Random #I and Opaque fields within the PUZZLE parameter allows the Random #I and Opaque fields within the PUZZLE parameter allows
these fields to be populated dynamically on precomputed R1s. these fields to be populated dynamically on precomputed R1s.
Signature calculation and verification follows the process defined in Signature calculation and verification follow the process defined in
Section 6.4.2. Section 6.4.2.
5.2.16. SEQ 5.2.16. 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 |
skipping to change at page 61, line 50 skipping to change at page 61, line 44
5.2.16. SEQ 5.2.16. 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 8 Length 4
Update ID 32-bit sequence number Update ID 32-bit sequence number
The Update ID is an unsigned number in network byte order, The Update ID is an unsigned number in network byte order,
initialized by a host to zero upon moving to ESTABLISHED state. The initialized by a host to zero upon moving to ESTABLISHED state. The
Update ID has scope within a single HIP association, and not across Update ID has scope within a single HIP association, and not across
multiple associations or multiple hosts. The Update ID is multiple associations or multiple hosts. The Update ID is
incremented by one before each new UPDATE that is sent by the host; incremented by one before each new UPDATE that is sent by the host;
the first UPDATE packet originated by a host has an Update ID of 0. the first UPDATE packet originated by a host has an Update ID of 0.
5.2.17. ACK 5.2.17. ACK
skipping to change at page 62, line 24 skipping to change at page 62, line 20
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 1 | | peer Update ID 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ peer Update ID n | / peer Update ID n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 449 Type 449
Length length in octets, excluding Type and Length Length length in octets, excluding Type and Length
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 number of peer Update IDs can be received from the peer. The number of peer Update IDs can be
inferred from the length by dividing it by 4. inferred from the length by dividing it by 4.
5.2.18. ENCRYPTED 5.2.18. 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 64, line 4 skipping to change at page 63, line 31
parameters. As a result, the concatenated parameters will be a block parameters. As a result, the concatenated parameters will be a block
of data that is 8-byte aligned. of data that is 8-byte aligned.
Some encryption algorithms require that the data to be encrypted must Some encryption algorithms require that the data to be encrypted must
be a multiple of the cipher algorithm block size. In this case, the be a multiple of the cipher algorithm block size. In this case, the
above block of data MUST include additional padding, as specified by above block of data MUST include additional padding, as specified by
the encryption algorithm. The size of the extra padding is selected the encryption algorithm. The size of the extra padding is selected
so that the length of the unencrypted data block is a multiple of the so that the length of the unencrypted data block is a multiple of the
cipher block size. The encryption algorithm may specify padding cipher block size. The encryption algorithm may specify padding
bytes other than zero; for example, AES [FIPS.197.2001] uses the bytes other than zero; for example, AES [FIPS.197.2001] uses the
PKCS5 padding scheme (see section 6.1.1 of [RFC2898]) where the PKCS5 padding scheme (see Section 6.1.1 of [RFC2898]) where the
remaining n bytes to fill the block each have the value of n. This remaining n bytes to fill the block each have the value of n. This
yields an "unencrypted data" block that is transformed to an yields an "unencrypted data" block that is transformed to an
"encrypted data" block by the cipher suite. This extra padding added "encrypted data" block by the cipher suite. This extra padding added
to the set of parameters to satisfy the cipher block alignment rules to the set of parameters to satisfy the cipher block alignment rules
is not counted in HIP TLV length fields, and this extra padding is not counted in HIP TLV Length fields, and this extra padding
should be removed by the cipher suite upon decryption. should be removed by the cipher suite upon decryption.
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 set of parameters to be encrypted, larger than the length of the set of parameters to be encrypted,
since the encryption process may compress the data or add additional since the encryption process may compress the data or add additional
padding to the data. padding to the data.
Once this encryption process is completed, the Encrypted data field Once this encryption process is completed, the Encrypted data field
is ready for inclusion in the parameter. If necessary, additional is ready for inclusion in the parameter. If necessary, additional
Padding for 8-byte alignment is then added according to the rules of Padding for 8-byte alignment is then added according to the rules of
skipping to change at page 64, line 42 skipping to change at page 64, line 25
| Type | Length | | Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | Notify Message Type | | Reserved | Notify Message Type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| / | /
/ Notification Data / / Notification Data /
/ +---------------+ / +---------------+
/ | Padding | / | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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
Data to the Notify Message Type. Values for this field Data addition to the Notify Message Type. Values
are type specific (see below). for this field are type specific (see below).
multiple of 8 bytes.
Notification information can be error messages specifying why an HIP Notification information can be error messages specifying why a HIP
Security Association could not be established. It can also be status Security Association could not be established. It can also be status
data that a HIP implementation wishes to communicate with a peer data that a HIP implementation wishes to communicate with a peer
process. The table below lists the notification messages and their process. The table below lists the notification messages and their
Notification Message Types. HIP packets MAY contain multiple Notify Message Types. HIP packets MAY contain multiple NOTIFICATION
NOTIFICATION parameters if several problems exist or several parameters if several problems exist or several independent pieces of
independent pieces of information must be transmitted. information must be transmitted.
To avoid certain types of attacks, a Responder SHOULD avoid sending a To avoid certain types of attacks, a Responder SHOULD avoid sending a
NOTIFICATION to any host with which it has not successfully verified NOTIFICATION to any host with which it has not successfully verified
a puzzle solution. a puzzle solution.
Notify Message Types in the range 0-16383 are intended for reporting Notify Message Types in the range 0-16383 are intended for reporting
errors and in the range 16384-65535 for other status information. An errors, and those in the range 16384-65535 are for other status
implementation that receives a NOTIFY packet with a Notify Message information. An implementation that receives a NOTIFY packet with a
Type that indicates an error in response to a request packet (e.g., Notify Message Type that indicates an error in response to a request
I1, I2, UPDATE) SHOULD assume that the corresponding request has packet (e.g., I1, I2, UPDATE) SHOULD assume that the corresponding
failed entirely. Unrecognized error types MUST be ignored except request has failed entirely. Unrecognized error types MUST be
that they SHOULD be logged. ignored, except that they SHOULD be logged.
As currently defined, Notify Message Type values 1-10 are used for As currently defined, Notify Message Type values 1-10 are used for
informing about errors in packet structures, values 11-20 for informing about errors in packet structures, and values 11-20 for
informing about problems in parameters. informing about problems in parameters.
Notification Data in NOTIFICATION parameters where the Notify Message Notification Data in NOTIFICATION parameters where the Notify Message
Type is in the status range MUST be ignored if not recognized. Type is in the status range MUST be ignored if not recognized.
Notify Message Types - Errors Value Notify Message Types - Errors Value
----------------------------- ----- ----------------------------- -----
UNSUPPORTED_CRITICAL_PARAMETER_TYPE 1 UNSUPPORTED_CRITICAL_PARAMETER_TYPE 1
skipping to change at page 65, line 49 skipping to change at page 65, line 32
two-octet parameter type. two-octet parameter type.
INVALID_SYNTAX 7 INVALID_SYNTAX 7
Indicates that the HIP message received was invalid because some Indicates that the HIP message received was invalid because some
type, length, or value was out of range or because the request type, length, or value was out of range or because the request
was otherwise malformed. To avoid a denial-of-service was otherwise malformed. To avoid a denial-of-service
attack using forged messages, this status may only be returned attack using forged messages, this status may only be returned
for packets whose HIP_MAC (if present) and SIGNATURE have been for packets whose HIP_MAC (if present) and SIGNATURE have been
verified. This status MUST be sent in response to any error not verified. This status MUST be sent in response to any error not
covered by one of the other status types, and SHOULD NOT contain covered by one of the other status types and SHOULD NOT contain
details to avoid leaking information to someone probing a node. details, to avoid leaking information to someone probing a node.
To aid debugging, more detailed error information SHOULD be To aid debugging, more detailed error information SHOULD be
written to a console or log. 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 were acceptable.
INVALID_DH_CHOSEN 15 INVALID_DH_CHOSEN 15
The DH Group ID field does not correspond to one offered The DH Group ID field does not correspond to one offered
by the Responder. by the Responder.
NO_HIP_PROPOSAL_CHOSEN 16 NO_HIP_PROPOSAL_CHOSEN 16
None of the proposed HIT Suites or HIP Encryption Algorithms was None of the proposed HIT Suites or HIP Encryption Algorithms were
acceptable. acceptable.
INVALID_HIP_CIPHER_CHOSEN 17 INVALID_HIP_CIPHER_CHOSEN 17
The HIP_CIPHER Crypto ID does not correspond to one offered by The HIP_CIPHER Crypto ID does not correspond to one offered by
the Responder. the Responder.
UNSUPPORTED_HIT_SUITE 20 UNSUPPORTED_HIT_SUITE 20
Sent in response to an I1 or R1 packet for which the HIT suite Sent in response to an I1 or R1 packet for which the HIT Suite
is not supported. is not supported.
AUTHENTICATION_FAILED 24 AUTHENTICATION_FAILED 24
Sent in response to a HIP signature failure, except when Sent in response to a HIP signature failure, except when
the signature verification fails in a NOTIFY message. 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.
skipping to change at page 67, line 4 skipping to change at page 66, line 39
The Responder could not successfully decrypt the The Responder could not successfully decrypt the
ENCRYPTED parameter. 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., the received HIT is NULL
and policy does not allow opportunistic mode). and the policy does not allow opportunistic mode).
RESPONDER_BUSY_PLEASE_RETRY 44 RESPONDER_BUSY_PLEASE_RETRY 44
The Responder is unwilling to set up an association as it is The Responder is unwilling to set up an association, as it is
suffering under some kind of overload and has chosen to shed load suffering under some kind of overload and has chosen to shed load
by rejecting the Initiator's request. The Initiator may retry; by rejecting the Initiator's request. The Initiator may retry;
however, the Initiator MUST find another (different) puzzle however, the Initiator MUST find another (different) puzzle
solution for any such retries. Note that the Initiator may need solution for any such retries. Note that the Initiator may need
to obtain a new puzzle with a new I1/R1 exchange. to obtain a new puzzle with a new I1/R1 exchange.
Notify Message Types - Status Value Notify Message Types - Status Value
----------------------------- ----- ----------------------------- -----
I2_ACKNOWLEDGEMENT 16384 I2_ACKNOWLEDGEMENT 16384
The Responder has an I2 packet from the Initiator but had to The Responder has an I2 packet from the Initiator but had to
queue the I2 packet for processing. The puzzle was correctly queue the I2 packet for processing. The puzzle was correctly
solved and the Responder is willing to set up an association but solved, and the Responder is willing to set up an association but
currently has a number of I2 packets in the processing queue. currently has a number of I2 packets in the processing queue.
The R2 packet is sent after the I2 packet was processed. The R2 packet is sent after the I2 packet was processed.
5.2.20. ECHO_REQUEST_SIGNED 5.2.20. ECHO_REQUEST_SIGNED
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 897 Type 897
Length length of the opaque data in octets Length length of the opaque data in octets
Opaque data opaque data, supposed to be meaningful only to the Opaque data opaque data, supposed to be meaningful only to
node that sends ECHO_REQUEST_SIGNED and receives a the node that sends ECHO_REQUEST_SIGNED and
corresponding ECHO_RESPONSE_SIGNED or receives a corresponding ECHO_RESPONSE_SIGNED or
ECHO_RESPONSE_UNSIGNED. ECHO_RESPONSE_UNSIGNED
The ECHO_REQUEST_SIGNED parameter contains an opaque blob of data The ECHO_REQUEST_SIGNED parameter contains an opaque blob of data
that the sender wants to get echoed back in the corresponding reply that the sender wants to get echoed back in the corresponding reply
packet. packet.
The ECHO_REQUEST_SIGNED and corresponding echo response parameters The ECHO_REQUEST_SIGNED and corresponding echo response parameters
MAY be used for any purpose where a node wants to carry some state in MAY be used for any purpose where a node wants to carry some state in
a request packet and get it back in a response packet. The a request packet and get it back in a response packet. The
ECHO_REQUEST_SIGNED is covered by the HIP_MAC and SIGNATURE. A HIP ECHO_REQUEST_SIGNED is covered by the HIP_MAC and SIGNATURE. A HIP
packet can contain only one ECHO_REQUEST_SIGNED parameter and MAY packet can contain only one ECHO_REQUEST_SIGNED parameter and MAY
skipping to change at page 68, line 20 skipping to change at page 68, line 15
5.2.21. ECHO_REQUEST_UNSIGNED 5.2.21. ECHO_REQUEST_UNSIGNED
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 Type 63661
Length length of the opaque data in octets Length length of the opaque data in octets
Opaque data opaque data, supposed to be meaningful only to the Opaque data opaque data, supposed to be meaningful only to
node that sends ECHO_REQUEST_UNSIGNED and receives a the node that sends ECHO_REQUEST_UNSIGNED and
corresponding ECHO_RESPONSE_UNSIGNED. receives a corresponding ECHO_RESPONSE_UNSIGNED
The ECHO_REQUEST_UNSIGNED parameter contains an opaque blob of data The ECHO_REQUEST_UNSIGNED parameter contains an opaque blob of data
that the sender wants to get echoed back in the corresponding reply that the sender wants to get echoed back in the corresponding reply
packet. packet.
The ECHO_REQUEST_UNSIGNED and corresponding echo response parameters The ECHO_REQUEST_UNSIGNED and corresponding echo response parameters
MAY be used for any purpose where a node wants to carry some state in MAY be used for any purpose where a node wants to carry some state in
a request packet and get it back in a response packet. The a request packet and get it back in a response packet. The
ECHO_REQUEST_UNSIGNED is not covered by the HIP_MAC and SIGNATURE. A ECHO_REQUEST_UNSIGNED is not covered by the HIP_MAC and SIGNATURE. A
HIP packet can contain one or more ECHO_REQUEST_UNSIGNED parameters. HIP packet can contain one or more ECHO_REQUEST_UNSIGNED parameters.
It is possible that middleboxes add ECHO_REQUEST_UNSIGNED parameters It is possible that middleboxes add ECHO_REQUEST_UNSIGNED parameters
in HIP packets passing by. The creator of the ECHO_REQUEST_UNSIGNED in HIP packets passing by. The creator of the ECHO_REQUEST_UNSIGNED
(end-host or middlebox) has to create the Opaque field so that it can (end host or middlebox) has to create the Opaque field so that it can
later identify and remove the corresponding ECHO_RESPONSE_UNSIGNED later identify and remove the corresponding ECHO_RESPONSE_UNSIGNED
parameter. parameter.
The ECHO_REQUEST_UNSIGNED parameter MUST be responded to with an The ECHO_REQUEST_UNSIGNED parameter MUST be responded to with an
ECHO_RESPONSE_UNSIGNED parameter. ECHO_RESPONSE_UNSIGNED parameter.
5.2.22. ECHO_RESPONSE_SIGNED 5.2.22. ECHO_RESPONSE_SIGNED
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 961 Type 961
Length length of the opaque data in octets Length length of the opaque data in octets
Opaque data opaque data, copied unmodified from the Opaque data opaque data, copied unmodified from the
ECHO_REQUEST_SIGNED or ECHO_REQUEST_UNSIGNED ECHO_REQUEST_SIGNED or ECHO_REQUEST_UNSIGNED
parameter that triggered this response. parameter that triggered this response
The ECHO_RESPONSE_SIGNED parameter contains an opaque blob of data The ECHO_RESPONSE_SIGNED parameter contains an opaque blob of data
that the sender of the ECHO_REQUEST_SIGNED wants to get echoed back. that the sender of the ECHO_REQUEST_SIGNED wants to get echoed back.
The opaque data is copied unmodified from the ECHO_REQUEST_SIGNED The opaque data is copied unmodified from the ECHO_REQUEST_SIGNED
parameter. parameter.
The ECHO_REQUEST_SIGNED and ECHO_RESPONSE_SIGNED parameters MAY be The ECHO_REQUEST_SIGNED and ECHO_RESPONSE_SIGNED parameters MAY be
used for any purpose where a node wants to carry some state in a used for any purpose where a node wants to carry some state in a
request packet and get it back in a response packet. The request packet and get it back in a response packet. The
ECHO_RESPONSE_SIGNED is covered by the HIP_MAC and SIGNATURE. ECHO_RESPONSE_SIGNED is covered by the HIP_MAC and SIGNATURE.
skipping to change at page 69, line 38 skipping to change at page 69, line 41
5.2.23. ECHO_RESPONSE_UNSIGNED 5.2.23. ECHO_RESPONSE_UNSIGNED
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 Type 63425
Length length of the opaque data in octets Length length of the opaque data in octets
Opaque data opaque data, copied unmodified from the Opaque data opaque data, copied unmodified from the
ECHO_REQUEST_SIGNED or ECHO_REQUEST_UNSIGNED ECHO_REQUEST_SIGNED or ECHO_REQUEST_UNSIGNED
parameter that triggered this response. parameter that triggered this response
The ECHO_RESPONSE_UNSIGNED parameter contains an opaque blob of data The ECHO_RESPONSE_UNSIGNED parameter contains an opaque blob of data
that the sender of the ECHO_REQUEST_SIGNED or ECHO_REQUEST_UNSIGNED that the sender of the ECHO_REQUEST_SIGNED or ECHO_REQUEST_UNSIGNED
wants to get echoed back. The opaque data is copied unmodified from wants to get echoed back. The opaque data is copied unmodified from
the corresponding echo request parameter. the corresponding echo request parameter.
The echo request and ECHO_RESPONSE_UNSIGNED parameters MAY be used The echo request and ECHO_RESPONSE_UNSIGNED parameters MAY be used
for any purpose where a node wants to carry some state in a request for any purpose where a node wants to carry some state in a request
packet and get it back in a response packet. The packet and get it back in a response packet. The
ECHO_RESPONSE_UNSIGNED is not covered by the HIP_MAC and SIGNATURE. ECHO_RESPONSE_UNSIGNED is not covered by the HIP_MAC and SIGNATURE.
5.3. HIP Packets 5.3. HIP Packets
There are eight basic HIP packets (see Table 11). Four are for the There are eight basic HIP packets (see Table 11). Four are for the
HIP base exchange, one is for updating, one is for sending HIP base exchange, one is for updating, one is for sending
notifications, and two are for closing a HIP association. Support notifications, and two are for closing a HIP association. Support
for NOTIFY packet type is optional, but support for all other HIP for the NOTIFY packet type is optional, but support for all other HIP
packet types listed below is mandatory. packet types listed below is mandatory.
+------------------+------------------------------------------------+ +------------------+------------------------------------------------+
| Packet type | Packet name | | Packet type | Packet name |
+------------------+------------------------------------------------+ +------------------+------------------------------------------------+
| 1 | I1 - the HIP Initiator Packet | | 1 | I1 - the HIP Initiator Packet |
| | | | | |
| 2 | R1 - the HIP Responder Packet | | 2 | R1 - the HIP Responder Packet |
| | | | | |
| 3 | I2 - the Second HIP Initiator Packet | | 3 | I2 - the Second HIP Initiator Packet |
skipping to change at page 70, line 36 skipping to change at page 70, line 39
| 16 | UPDATE - the HIP Update Packet | | 16 | UPDATE - the HIP Update Packet |
| | | | | |
| 17 | NOTIFY - the HIP Notify Packet | | 17 | NOTIFY - the HIP Notify Packet |
| | | | | |
| 18 | CLOSE - the HIP Association Closing Packet | | 18 | CLOSE - the HIP Association Closing Packet |
| | | | | |
| 19 | CLOSE_ACK - the HIP Closing Acknowledgment | | 19 | CLOSE_ACK - the HIP Closing Acknowledgment |
| | Packet | | | Packet |
+------------------+------------------------------------------------+ +------------------+------------------------------------------------+
Table 11: HIP packets and packet type values Table 11: HIP Packets and Packet Type Values
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 TLV-coded parameters.
In addition to the base packets, other packet types may be defined In addition to the base packets, other packet types may 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 multihoming is not included in this specification.
See Notation (Section 2.2) for the notation used in the operations. See "Notation" (Section 2.2) for the notation used in the operations.
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 into multiple extension headers by setting the MUST NOT be fragmented into multiple extension headers by setting the
Next Header field in a HIP header to the HIP protocol number. This Next Header field in a HIP header to the HIP protocol number. This
limits the size of the possible additional data in the packet. limits the size of the possible additional data in the packet.
5.3.1. I1 - the HIP Initiator Packet 5.3.1. I1 - the HIP Initiator Packet
skipping to change at page 71, line 21 skipping to change at page 71, line 26
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 ( DH_GROUP_LIST ) ) IP ( HIP ( DH_GROUP_LIST ) )
The I1 packet contains the fixed HIP header and the Initiator's The I1 packet contains the fixed HIP header and the Initiator's
DH_GROUP_LIST. DH_GROUP_LIST.
Valid control bits: none Valid control bits: None
The Initiator receives the Responder's HIT either from a DNS lookup The Initiator receives the Responder's HIT from either a DNS lookup
of the Responder's FQDN (see 5205-bis), from some other repository, of the Responder's FQDN (see [HIP-DNS-EXT]), some other repository,
or from a local table. If the Initiator does not know the or a local table. If the Initiator does not know the Responder's
Responder's HIT, it may attempt to use opportunistic mode by using HIT, it may attempt to use opportunistic mode by using NULL (all
NULL (all zeros) as the Responder's HIT. See also "HIP Opportunistic zeros) as the Responder's HIT. See also "HIP Opportunistic Mode"
Mode" (Section 4.1.8). (Section 4.1.8).
Since the I1 packet is so easy to spoof even if it were signed, no Since the I1 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.
The Initiator includes a DH_GROUP_LIST parameter in the I1 packet to The Initiator includes a DH_GROUP_LIST parameter in the I1 packet to
inform the Responder of its preferred DH Group IDs. Note that the inform the Responder of its preferred DH Group IDs. Note that the
DH_GROUP_LIST in the I1 packet is not protected by a signature. DH_GROUP_LIST in the I1 packet is not protected by a signature.
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
skipping to change at page 72, line 28 skipping to change at page 72, line 32
TRANSPORT_FORMAT_LIST, TRANSPORT_FORMAT_LIST,
HIP_SIGNATURE_2 ) HIP_SIGNATURE_2 )
<, ECHO_REQUEST_UNSIGNED >i) <, ECHO_REQUEST_UNSIGNED >i)
Valid control bits: A Valid control bits: A
If the Responder's HI is an anonymous one, the A control MUST be set. If the Responder's HI is an anonymous one, the A control MUST be set.
The Initiator's HIT MUST match the one received in the I1 packet if The Initiator's HIT MUST match the one received in the I1 packet if
the R1 is a response to an I1. If the Responder has multiple HIs, the R1 is a response to an I1. If the Responder has multiple HIs,
the Responder's HIT used MUST match Initiator's request. If the the Responder's HIT used MUST match the Initiator's request. If the
Initiator used opportunistic mode, the Responder may select freely Initiator used opportunistic mode, the Responder may select freely
among its HIs. See also "HIP Opportunistic Mode" (Section 4.1.8). among its HIs. See also "HIP Opportunistic Mode" (Section 4.1.8).
The R1 packet generation counter is used to determine the currently The R1 packet generation counter is used to determine the currently
valid generation of puzzles. The value is increased periodically, valid generation of puzzles. The value is increased periodically,
and it is RECOMMENDED that it is increased at least as often as and it is RECOMMENDED that it is increased at least as often as
solutions to old puzzles are no longer accepted. solutions to old puzzles are no longer accepted.
The Puzzle contains a Random #I and the difficulty #K. The The puzzle contains a Random #I and the difficulty #K. The
difficulty #K indicates the number of lower-order bits, in the puzzle difficulty #K indicates the number of lower-order bits, in the puzzle
hash result, that must be zeros; see Section 4.1.2. The Random #I is hash result, that must be zeros; see Section 4.1.2. The Random #I is
not covered by the signature and must be zeroed during the signature not covered by the signature and must be zeroed during the signature
calculation, allowing the sender to select and set the #I into a calculation, allowing the sender to select and set the #I into a
precomputed R1 packet just prior sending it to the peer. precomputed R1 packet just prior to sending it to the peer.
The Responder selects the Diffie-Hellman public value based on the The Responder selects the DIFFIE_HELLMAN Group ID and Public Value
Initiator's preference expressed in the DH_GROUP_LIST parameter in based on the Initiator's preference expressed in the DH_GROUP_LIST
the I1 packet. The Responder sends back its own preference based on parameter in the I1 packet. The Responder sends back its own
which it chose the DH public value as DH_GROUP_LIST. This allows the preference based on which it chose the DH public value as
Initiator to determine whether its own DH_GROUP_LIST in the sent I1 DH_GROUP_LIST. This allows the Initiator to determine whether its
packet was manipulated by an attacker. own DH_GROUP_LIST in the sent I1 packet was manipulated by an
attacker.
The Diffie-Hellman public value is ephemeral, and values SHOULD NOT The Diffie-Hellman public value is ephemeral, and values SHOULD NOT
be reused across different HIP associations. Once the Responder has be reused across different HIP associations. Once the Responder has
received a valid response to an R1 packet, that Diffie-Hellman value received a valid response to an R1 packet, that Diffie-Hellman value
SHOULD be deprecated. It is possible that the Responder has sent the SHOULD be deprecated. It is possible that the Responder has sent the
same Diffie-Hellman value to different hosts simultaneously in same Diffie-Hellman value to different hosts simultaneously in
corresponding R1 packets and those responses should also be accepted. corresponding R1 packets, and those responses should also be
However, as a defense against I1 packet storms, an implementation MAY accepted. However, as a defense against I1 packet storms, an
propose, and re-use unless avoidable, the same Diffie-Hellman value implementation MAY propose, and reuse unless avoidable, the same
for a period of time, for example, 15 minutes. By using a small Diffie-Hellman value for a period of time -- for example, 15 minutes.
number of different puzzles for a given Diffie-Hellman value, the R1 By using a small number of different puzzles for a given
packets can be precomputed and delivered as quickly as I1 packets Diffie-Hellman value, the R1 packets can be precomputed and delivered
arrive. A scavenger process should clean up unused Diffie-Hellman as quickly as I1 packets arrive. A scavenger process should clean up
values and puzzles. unused Diffie-Hellman values and puzzles.
Re-using Diffie-Hellman public values opens up the potential security Reusing Diffie-Hellman public values opens up the potential security
risk of more than one Initiator ending up with the same keying risk of more than one Initiator ending up with the same keying
material (due to faulty random number generators). Also, more than material (due to faulty random number generators). Also, more than
one Initiator using the same Responder public key half may lead to one Initiator using the same Responder public key half may lead to
potentially easier cryptographic attacks and to imperfect forward potentially easier cryptographic attacks and to imperfect forward
security. security.
However, these risks involved in re-using the same public value are However, these risks involved in reusing the same public value are
statistical; that is, the authors are not aware of any mechanism that statistical; that is, the authors are not aware of any mechanism that
would allow manipulation of the protocol so that the risk of the re- would allow manipulation of the protocol so that the risk of the
use of any given Responder Diffie-Hellman public key would differ reuse of any given Responder Diffie-Hellman public key would differ
from the base probability. Consequently, it is RECOMMENDED that from the base probability. Consequently, it is RECOMMENDED that
Responders avoid re-using the same DH key with multiple Initiators, Responders avoid reusing the same DH key with multiple Initiators,
but because the risk is considered statistical and not known to be but because the risk is considered statistical and not known to be
manipulable, the implementations MAY re-use a key in order to ease manipulable, the implementations MAY reuse a key in order to ease
resource-constrained implementations and to increase the probability resource-constrained implementations and to increase the probability
of successful communication with legitimate clients even under an I1 of successful communication with legitimate clients even under an I1
packet storm. In particular, when it is too expensive to generate packet storm. In particular, when it is too expensive to generate
enough precomputed R1 packets to supply each potential Initiator with enough precomputed R1 packets to supply each potential Initiator with
a different DH key, the Responder MAY send the same DH key to several a different DH key, the Responder MAY send the same DH key to several
Initiators, thereby creating the possibility of multiple legitimate Initiators, thereby creating the possibility of multiple legitimate
Initiators ending up using the same Responder-side public key. Initiators ending up using the same Responder-side public key.
However, as soon as the Responder knows that it will use a particular However, as soon as the Responder knows that it will use a particular
DH key, it SHOULD stop offering it. This design is aimed to allow DH key, it SHOULD stop offering it. This design is aimed to allow
resource-constrained Responders to offer services under I1 packet resource-constrained Responders to offer services under I1 packet
storms and to simultaneously make the probability of DH key re-use storms and to simultaneously make the probability of DH key reuse
both statistical and as low as possible. both statistical and as low as possible.
If the Responder uses the same DH keypair for multiple handshakes, it If the Responder uses the same DH key pair for multiple handshakes,
must take care to avoid small subgroup attacks [RFC2785]. To avoid it must take care to avoid small subgroup attacks [RFC2785]. To
these attacks, when receiving the I2 message, the Responder SHOULD avoid these attacks, when receiving the I2 message, the Responder
validate the Initiators DH public key as described in [RFC2785] SHOULD validate the Initiator's DH public key as described in
Section 3.1. In case the validation fails, the Responder MUST NOT [RFC2785], Section 3.1. If the validation fails, the Responder MUST
generate a DH shared key and MUST silently abort the HIP BEX. NOT generate a DH shared key and MUST silently abort the HIP BEX.
The HIP_CIPHER contains the encryption algorithms supported by the The HIP_CIPHER parameter contains the encryption algorithms supported
Responder to encrypt the contents of the ENCRYPTED parameter, in the by the Responder to encrypt the contents of the ENCRYPTED parameter,
order of preference. All implementations MUST support AES [RFC3602]. in the order of preference. All implementations MUST support AES
[RFC3602].
The HIT_SUITE_LIST parameter is an ordered list of the Responder's The HIT_SUITE_LIST parameter is an ordered list of the Responder's
preferred and supported HIT Suites. The list allows the Initiator to preferred and supported HIT Suites. The list allows the Initiator to
determine whether its own source HIT matches any suite supported by determine whether its own source HIT matches any suite supported by
the Responder. the Responder.
The ECHO_REQUEST_SIGNED and ECHO_REQUEST_UNSIGNED parameters contain The ECHO_REQUEST_SIGNED and ECHO_REQUEST_UNSIGNED parameters contain
data that the sender wants to receive unmodified in the corresponding data that the sender wants to receive unmodified in the corresponding
response packet in the ECHO_RESPONSE_SIGNED or ECHO_RESPONSE_UNSIGNED response packet in the ECHO_RESPONSE_SIGNED or ECHO_RESPONSE_UNSIGNED
parameter. The R1 packet may contain zero or more parameter. The R1 packet may contain zero or more
ECHO_REQUEST_UNSIGNED parameters as described in ECHO_REQUEST_UNSIGNED parameters as described in Section 5.2.21.
Section Section 5.2.21.
The TRANSPORT_FORMAT_LIST parameter is an ordered list of the The TRANSPORT_FORMAT_LIST parameter is an ordered list of the
Responder's preferred and supported transport format types. The list Responder's preferred and supported transport format types. The list
allows the Initiator and the Responder to agree on a common type for allows the Initiator and the Responder to agree on a common type for
payload protection. This parameter is described in Section 5.2.11. payload protection. This parameter is described in Section 5.2.11.
The signature is calculated over the whole HIP packet as described in The signature is calculated over the whole HIP packet as described in
Section 5.2.15. This allows the Responder to use precomputed R1s. Section 5.2.15. This allows the Responder to use precomputed R1s.
The Initiator SHOULD validate this signature. It MUST check that the The Initiator SHOULD validate this signature. It MUST check that the
Responder's HI matches with the one expected, if any. Responder's HI 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 Packet 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_CIPHER, HIP_CIPHER,
ENCRYPTED { HOST_ID } or HOST_ID, ENCRYPTED { HOST_ID } or HOST_ID,
[ ECHO_RESPONSE_SIGNED ,] [ ECHO_RESPONSE_SIGNED, ]
TRANSPORT_FORMAT_LIST, TRANSPORT_FORMAT_LIST,
HIP_MAC, HIP_MAC,
HIP_SIGNATURE HIP_SIGNATURE
<, ECHO_RESPONSE_UNSIGNED>i ) ) <, ECHO_RESPONSE_UNSIGNED>i ) )
Valid control bits: A Valid control bits: A
The HITs used MUST match the ones used in the R1. The HITs used MUST match the ones used in the R1.
If the Initiator's HI is an anonymous one, the A control bit MUST be If the Initiator's HI is an anonymous one, the A control bit MUST
set. be set.
If present in the I1 packet, the Initiator MUST include an unmodified If present in the I1 packet, the Initiator MUST include an unmodified
copy of the R1_COUNTER parameter received in the corresponding R1 copy of the R1_COUNTER parameter received in the corresponding R1
packet into the I2 packet. packet into the I2 packet.
The Solution contains the Random #I from R1 and the computed #J. The The Solution contains the Random #I from R1 and the computed #J. The
low-order #K bits of the RHASH(I | ... | J) MUST be zero. low-order #K bits of the RHASH( #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 Diffie-Hellman values. The Responder process should clean up unused Diffie-Hellman values. The Responder
MAY re-use Diffie-Hellman values under some conditions as specified MAY reuse Diffie-Hellman values under some conditions as specified in
in Section 5.3.2. Section 5.3.2.
The HIP_CIPHER contains the single encryption suite selected by the The HIP_CIPHER contains the single encryption suite selected by the
Initiator, that it uses to encrypt the ENCRYPTED parameters. The Initiator, that it uses to encrypt the ENCRYPTED parameters. The
chosen cipher MUST correspond to one of the ciphers offered by the chosen cipher MUST correspond to one of the ciphers offered by the
Responder in the R1. All implementations MUST support AES [RFC3602]. Responder in the R1. All implementations MUST support AES [RFC3602].
The Initiator's HI MAY be encrypted using the HIP_CIPHER encryption The Initiator's HI MAY be encrypted using the HIP_CIPHER encryption
algorithm. The keying material is derived from the Diffie-Hellman algorithm. The keying material is derived from the Diffie-Hellman
exchanged as defined in Section 6.5. exchange as defined in Section 6.5.
The ECHO_RESPONSE_SIGNED and ECHO_RESPONSE_UNSIGNED contain the The ECHO_RESPONSE_SIGNED and ECHO_RESPONSE_UNSIGNED contain the
unmodified Opaque data copied from the corresponding echo request unmodified opaque data copied from the corresponding echo request
parameter(s). parameter(s).
The TRANSPORT_FORMAT_LIST contains the single transport format type The TRANSPORT_FORMAT_LIST contains the single transport format type
selected by the Initiator. The chosen type MUST correspond to one of selected by the Initiator. The chosen type MUST correspond to one of
the types offered by the Responder in the R1. Currently, the only the types offered by the Responder in the R1. Currently, the only
transport format defined is the ESP transport format transport format defined is the ESP transport format ([RFC7402]).
([I-D.ietf-hip-rfc5202-bis]).
The HMAC value in the HIP_MAC parameter is calculated over the whole The HMAC value in the HIP_MAC parameter is calculated over the whole
HIP packet, excluding any parameters after the HIP_MAC, as described HIP packet, excluding any parameters after the HIP_MAC, as described
in Section 6.4.1. The Responder MUST validate the HIP_MAC. in Section 6.4.1. The Responder MUST validate the HIP_MAC.
The signature is calculated over the whole HIP packet, excluding any The signature is calculated over the whole HIP packet, excluding any
parameters after the HIP_SIGNATURE, as described in Section 5.2.14. parameters after the HIP_SIGNATURE, as described in Section 5.2.14.
The Responder MUST validate this signature. The Responder uses the The Responder MUST validate this signature. The Responder uses the
HI in the packet or a HI acquired by some other means for verifying HI in the packet or an HI acquired by some other means for verifying
the signature. the signature.
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 ( HIP_MAC_2, HIP_SIGNATURE ) ) IP ( HIP ( HIP_MAC_2, HIP_SIGNATURE ) )
Valid control bits: none Valid control bits: None
The HIP_MAC_2 is calculated over the whole HIP packet, with The HIP_MAC_2 is calculated over the whole HIP packet, with the
Responder's HOST_ID parameter concatenated with the HIP packet. The Responder's HOST_ID parameter concatenated with the HIP packet. The
HOST_ID parameter is removed after the HMAC calculation. The HOST_ID parameter is removed after the HMAC calculation. The
procedure is described in Section 6.4.1. procedure is described in Section 6.4.1.
The signature is calculated over the whole HIP packet. The signature is calculated over the whole HIP packet.
The Initiator MUST validate both the HIP_MAC and the signature. The Initiator MUST validate both the HIP_MAC and the signature.
5.3.5. UPDATE - the HIP Update Packet 5.3.5. UPDATE - the HIP Update Packet
skipping to change at page 76, line 45 skipping to change at page 77, line 23
IP ( HIP ( [SEQ, ACK, ] HIP_MAC, HIP_SIGNATURE ) ) IP ( HIP ( [SEQ, ACK, ] HIP_MAC, HIP_SIGNATURE ) )
Valid control bits: None Valid control bits: None
The UPDATE packet contains mandatory HIP_MAC and HIP_SIGNATURE The UPDATE packet contains mandatory HIP_MAC and HIP_SIGNATURE
parameters, and other optional parameters. parameters, and other optional parameters.
The UPDATE packet contains zero or one SEQ parameter. The presence The UPDATE packet contains zero or one SEQ parameter. The presence
of a SEQ parameter indicates that the receiver MUST acknowledge the of a SEQ parameter indicates that the receiver MUST acknowledge the
the UPDATE. An UPDATE that does not contain a SEQ but only an ACK UPDATE. An UPDATE that does not contain a SEQ but only an ACK
parameter is simply an acknowledgment of a previous UPDATE and itself parameter is simply an acknowledgment of a previous UPDATE and itself
MUST NOT be acknowledged by a separate ACK parameter. Such UPDATE MUST NOT be acknowledged by a separate ACK parameter. Such UPDATE
packets containing only an ACK parameter do not require processing in packets containing only an ACK parameter do not require processing in
relative order to other UPDATE packets. An UPDATE packet without relative order to other UPDATE packets. An UPDATE packet without
either a SEQ or an ACK parameter is invalid; such unacknowledged either a SEQ or an ACK parameter is invalid; such unacknowledged
updates MUST instead use a NOTIFY packet. updates MUST instead use a NOTIFY packet.
An UPDATE packet contains zero or one ACK parameters. The ACK An UPDATE packet contains zero or one ACK parameter. The ACK
parameter echoes the SEQ sequence number of the UPDATE packet being parameter echoes the SEQ sequence number of the UPDATE packet being
ACKed. A host MAY choose to acknowledge more than one UPDATE packet ACKed. A host MAY choose to acknowledge more than one UPDATE packet
at a time; e.g., the ACK parameter may contain the last two SEQ at a time; e.g., the ACK parameter may contain the last two SEQ
values received, for resilience against packet loss. ACK values are values received, for resilience against packet loss. ACK values are
not cumulative; each received unique SEQ value requires at least one not cumulative; each received unique SEQ value requires at least one
corresponding ACK value in reply. Received ACK parameters that are corresponding ACK value in reply. Received ACK parameters that are
redundant are ignored. Hosts MUST implement the processing of ACK redundant are ignored. Hosts MUST implement the processing of ACK
parameters with multiple SEQ numbers even if they do not implement parameters with multiple SEQ sequence numbers even if they do not
sending ACK parameters with multiple SEQ numbers. implement sending ACK parameters with multiple SEQ sequence numbers.
The UPDATE packet may contain both a SEQ and an ACK parameter. In The UPDATE packet may contain both a SEQ and an ACK parameter. In
this case, the ACK parameter is being piggybacked on an outgoing this case, the ACK parameter is being piggybacked on an outgoing
UPDATE. In general, UPDATEs carrying SEQ SHOULD be ACKed upon UPDATE. In general, UPDATEs carrying SEQ SHOULD be ACKed upon
completion of the processing of the UPDATE. A host MAY choose to completion of the processing of the UPDATE. A host MAY choose to
hold the UPDATE carrying an ACK parameter for a short period of time hold the UPDATE carrying an ACK parameter for a short period of time
to allow for the possibility of piggybacking the ACK parameter, in a to allow for the possibility of piggybacking the ACK parameter, in a
manner similar to TCP delayed acknowledgments. manner similar to TCP delayed acknowledgments.
A sender MAY choose to forego reliable transmission of a particular A sender MAY choose to forego reliable transmission of a particular
skipping to change at page 78, line 18 skipping to change at page 78, line 49
The HIP header values for the CLOSE packet: The HIP header values for the CLOSE packet:
Header: Header:
Packet Type = 18 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_SIGNED, HIP_MAC, HIP_SIGNATURE ) ) IP ( HIP ( ECHO_REQUEST_SIGNED, HIP_MAC, HIP_SIGNATURE ) )
Valid control bits: none Valid control bits: None
The sender MUST include an ECHO_REQUEST_SIGNED used to validate The sender MUST include an ECHO_REQUEST_SIGNED used to validate
CLOSE_ACK received in response, and both a HIP_MAC and a signature CLOSE_ACK received in response, and both a HIP_MAC and a signature
(calculated over the whole HIP packet). (calculated over the whole HIP packet).
The receiver peer MUST reply with a CLOSE_ACK containing an The receiver peer MUST reply with a CLOSE_ACK containing an
ECHO_RESPONSE_SIGNED corresponding to the received ECHO_RESPONSE_SIGNED corresponding to the received
ECHO_REQUEST_SIGNED. ECHO_REQUEST_SIGNED.
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 = 19 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_RESPONSE_SIGNED, HIP_MAC, HIP_SIGNATURE ) ) IP ( HIP ( ECHO_RESPONSE_SIGNED, HIP_MAC, 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 packet). the whole HIP packet).
The receiver peer MUST validate the ECHO_RESPONSE_SIGNED and validate The receiver peer MUST validate the ECHO_RESPONSE_SIGNED and validate
both the HIP_MAC and the signature if the receiver has state for a both the HIP_MAC and the signature if the receiver has state for a
HIP association. HIP association.
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 [RFC4443]. In most cases, the MUST be rate-limited as described in [RFC4443]. In most cases, the
ICMP packet has the Parameter Problem type (12 for ICMPv4, 4 for ICMP packet has 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 pointing to the field that caused the ICMP
ICMP message to be generated. 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, with the Pointer with an ICMP packet with type Parameter Problem, with the Pointer
pointing to the Version/RES. byte in the HIP header. pointing to the Version/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, with the Pointer pointing to the field that failed to pass
format checks. However, an implementation MUST NOT send an ICMP the 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 Puzzle 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
puzzle 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, with 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 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 with 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 message exceeds the typical ICMPv4 message size as defined in
[RFC0792]. [RFC0792].
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 of the ICMP Parameter Problem packet is set pointing to the Pointer of the ICMP Parameter Problem packet is set pointing to the
beginning of the first HIT that does not match. beginning of the first HIT that does not 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
following messages: I1, R2, I2, R2, and NOTIFY packet. When following messages: I1, R2, I2, R2, and NOTIFY packet. When
introducing new packet types, a specification SHOULD define the introducing new packet types, a specification SHOULD define the
appropriate rules for sending or not sending this kind of ICMP reply. appropriate rules for sending or not sending this kind of ICMP reply.
6. Packet Processing 6. Packet Processing
Each host is assumed to have a single HIP protocol implementation Each host is assumed to have a single HIP implementation that manages
that manages the host's HIP associations and handles requests for new the host's HIP associations and handles requests for new ones. Each
ones. Each HIP association is governed by a conceptual state HIP association is governed by a conceptual state machine, with
machine, with states defined above in Section 4.4. The HIP states defined above in Section 4.4. The HIP implementation can
implementation can simultaneously maintain HIP associations with more simultaneously maintain HIP associations with more than one host.
than one host. Furthermore, the HIP implementation may have more Furthermore, the HIP implementation may have more than one active HIP
than one active HIP association with another host; in this case, HIP association with another host; in this case, HIP associations are
associations are distinguished by their respective HITs. It is not distinguished by their respective HITs. It is not possible to have
possible to have more than one HIP association between any given pair more than one HIP association between any given pair of HITs.
of HITs. Consequently, the only way for two hosts to have more than Consequently, the only way for two hosts to have more than one
one parallel association is to use different HITs, at least at one parallel association is to use different HITs, at least at one 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
an identifier specified via the underlying API. The API can be a an identifier specified via the underlying API. The API can be a
backwards-compatible API (see [RFC5338]), using identifiers that look backwards-compatible API (see [RFC5338]), using identifiers that look
similar to IP addresses, or a completely new API, providing enhanced similar to IP addresses, or a completely new API, providing enhanced
services related to Host Identities. Depending on the HIP services related to Host Identities. Depending on the HIP
implementation, the identifier provided to the application may be implementation, the identifier provided to the application may be
different; for example, it can be a HIT or an IP address. different; for example, it can be a HIT or an IP address.
The exact format and method for transferring the user data from the The exact format and method for transferring the user data from the
source HIP host to the destination HIP host is defined in the source HIP host to the destination HIP host are defined in the
corresponding transport format document. The actual data is corresponding transport format document. The actual data is
transferred in the network using the appropriate source and transferred in the network using the appropriate source and
destination IP addresses. destination IP addresses.
In this document, conceptual processing rules are defined only for In this document, conceptual processing rules are defined only for
the base case where both hosts have only single usable IP addresses; the base case where both hosts have only single usable IP addresses;
the multi-address multi-homing case is specified separately. the multi-address multihoming case is specified separately.
The following conceptual algorithm describes the steps that are The following conceptual algorithm describes the steps that are
required for handling outgoing datagrams destined to a HIT. 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
skipping to change at page 82, line 14 skipping to change at page 82, line 42
such mapping may be based on the ESP Security Parameter Index such mapping may be based on the ESP Security Parameter Index
(SPI). (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.
Depending on the used transport mode, the verification method can Depending on the used transport mode, the verification method can
vary. While the HI (as well as HIT) is used as the higher-layer vary. While the HI (as well as the HIT) is used as the higher-
identifier, the verification method has to verify that the data layer identifier, the verification method has to verify that the
packet was sent by the correct node identity and that the actual data packet was sent by the correct node identity and that the
identity maps to this particular HIT. When using ESP transport actual identity maps to this particular HIT. When using the ESP
format [I-D.ietf-hip-rfc5202-bis], the verification is done using transport format [RFC7402], the verification is done using the
the SPI value in the data packet to find the corresponding SA SPI value in the data packet to find the corresponding SA with
with associated HIT and key, and decrypting the packet with that associated HIT and key, and decrypting the packet with that
associated key. associated key.
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 (e.g., UDP or TCP). 4. The datagram is delivered to the upper layer (e.g., UDP or TCP).
When demultiplexing the datagram, the right upper-layer socket is When demultiplexing the datagram, the right upper-layer socket is
selected based on the HITs. selected based on the HITs.
skipping to change at page 83, line 13 skipping to change at page 83, line 41
the HIP Payload in the R1 and I2 packets. the HIP Payload in the R1 and I2 packets.
n-bit random value #J (where n is RHASH_len), in network byte n-bit random value #J (where n is RHASH_len), in network byte
order, as appearing in the I2 packet. order, as appearing in the I2 packet.
In a valid response puzzle, the #K low-order bits of the resulting In a valid response puzzle, the #K low-order bits of the resulting
RHASH digest MUST be zero. RHASH digest MUST be zero.
Notes: Notes:
i) The length of the data to be hashed is variable depending on i) The length of the data to be hashed is variable, depending on
the output length of the Responder's hash function RHASH. the output length of the Responder's hash function RHASH.
ii) All the data in the hash input MUST be in network byte order. ii) All the data in the hash input MUST be in network byte order.
iii) The order of the Initiator's and Responder's HITs are iii) The orderings of the Initiator's and Responder's HITs are
different in the R1 and I2 packets; see Section 5.1. Care must be different in the R1 and I2 packets; see Section 5.1. Care
taken to copy the values in the right order to the hash input. must be taken to copy the values in the right order to the
hash input.
iv) For a puzzle #I, there may exist multiple valid puzzle iv) For a puzzle #I, there may exist multiple valid puzzle
solutions #J. solutions #J.
The following procedure describes the processing steps involved, The following procedure describes the processing steps involved,
assuming that the Responder chooses to precompute the R1 packets: assuming that the Responder chooses to precompute the R1 packets:
Precomputation by the Responder: Precomputation by the Responder:
Sets up the puzzle difficulty #K. Sets up the puzzle difficulty #K.
Creates a signed R1 and caches it. Creates a signed R1 and caches it.
Responder: Responder:
Selects a suitable cached R1. Selects a suitable cached R1.
Generates a random number #I. Generates a random number #I.
Sends #I and #K in an R1. Sends #I and #K in an R1.
Saves #I and #K for a Delta time. Saves #I and #K for a delta time.
Initiator: Initiator:
Generates repeated attempts to solve the puzzle until a matching Generates repeated attempts to solve the puzzle until a matching
#J is found: #J is found:
Ltrunc( RHASH( #I | HIT-I | HIT-R | #J ), #K ) == 0 Ltrunc( RHASH( #I | HIT-I | HIT-R | #J ), #K ) == 0
Sends #I and #J in an I2. Sends #I and #J in an I2.
Responder: Responder:
Verifies that the received #I is a saved one. Verifies that the received #I is a saved one.
Finds the right #K based on #I. Finds the right #K based on #I.
Computes V := Ltrunc( RHASH( #I | HIT-I | HIT-R | #J ), #K ) Computes V := Ltrunc( RHASH( #I | HIT-I | HIT-R | #J ), #K )
Rejects if V != 0 Rejects if V != 0
Accept if V == 0 Accepts if V == 0
6.4. HIP_MAC and SIGNATURE Calculation and Verification 6.4. HIP_MAC and SIGNATURE Calculation and Verification
The following subsections define the actions for processing HIP_MAC, The following subsections define the actions for processing HIP_MAC,
HIP_MAC_2, HIP_SIGNATURE and HIP_SIGNATURE_2 parameters. The HIP_MAC_2, HIP_SIGNATURE, and HIP_SIGNATURE_2 parameters. The
HIP_MAC_2 parameter is contained in the R2 packet. The HIP_MAC_2 parameter is contained in the R2 packet. The
HIP_SIGNATURE_2 parameter is contained in the R1 packet. The HIP_SIGNATURE_2 parameter is contained in the R1 packet. The
HIP_SIGNATURE and HIP_MAC parameter are contained in other HIP HIP_SIGNATURE and HIP_MAC parameters are contained in other HIP
packets. packets.
6.4.1. HMAC Calculation 6.4.1. HMAC Calculation
The HMAC uses RHASH as underlying hash function. The type of RHASH The HMAC uses RHASH as the underlying hash function. The type of
depends on the HIT Suite of the Responder. Hence, HMAC-SHA-256 RHASH depends on the HIT Suite of the Responder. Hence, HMAC-SHA-256
[RFC4868] is used for HIT Suite RSA/DSA/SHA-256, HMAC-SHA-1 [RFC2404] [RFC4868] is used for HIT Suite RSA/DSA/SHA-256, HMAC-SHA-1 [RFC2404]
is used for HIT Suite ECDSA_LOW/SHA-1, and HMAC-SHA-384 [RFC4868] for is used for HIT Suite ECDSA_LOW/SHA-1, and HMAC-SHA-384 [RFC4868] is
HIT Suite ECDSA/SHA-384. used for HIT Suite ECDSA/SHA-384.
The following process applies both to the HIP_MAC and HIP_MAC_2 The following process applies both to the HIP_MAC and HIP_MAC_2
parameters. When processing HIP_MAC_2, the difference is that the parameters. When processing HIP_MAC_2, the difference is that the
HIP_MAC calculation includes a pseudo HOST_ID field containing the HIP_MAC calculation includes a pseudo HOST_ID field containing the
Responder's information as sent in the R1 packet earlier. Responder's 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 HIP_MAC_2. Specifically, the Initiator verifying or calculating the HIP_MAC_2. Specifically, the Initiator
has to preserve the HOST_ID exactly as it was received in the R1 has to preserve the HOST_ID exactly as it was received in the R1
packet until it receives the HIP_MAC_2 in the R2 packet. packet until it receives the HIP_MAC_2 in the R2 packet.
The scope of the calculation for HIP_MAC is: The scope of the calculation for HIP_MAC is as follows:
HMAC: { HIP header | [ Parameters ] } HMAC: { HIP header | [ Parameters ] }
where Parameters include all HIP parameters of the packet that is where Parameters include all of the packet's HIP parameters with type
being calculated with Type values ranging from 1 to (HIP_MAC's Type values ranging from 1 to (HIP_MAC's type value - 1), and excluding
value - 1) and exclude parameters with Type values greater or equal those parameters with type values greater than or equal to HIP_MAC's
to HIP_MAC's Type value. type value.
During HIP_MAC calculation, the following applies: During HIP_MAC calculation, the following apply:
o In the HIP header, the Checksum field is set to zero. o In the HIP header, the Checksum field is set to zero.
o In the HIP header, the Header Length field value is calculated to o In the HIP header, the Header Length field value is calculated to
the beginning of the HIP_MAC parameter. the beginning of the HIP_MAC parameter.
Parameter order is described in Section 5.2.1. Parameter order is described in Section 5.2.1.
The scope of the calculation for HIP_MAC_2 is: The scope of the calculation for HIP_MAC_2 is as follows:
HIP_MAC_2: { HIP header | [ Parameters ] | HOST_ID } HIP_MAC_2: { HIP header | [ Parameters ] | HOST_ID }
where Parameters include all HIP parameters for the packet that is where Parameters include all of the packet's HIP parameters with type
being calculated with Type values from 1 to (HIP_MAC_2's Type value - values from 1 to (HIP_MAC_2's type value - 1), and excluding those
1) and exclude parameters with Type values greater or equal to parameters with type values greater than or equal to HIP_MAC_2's type
HIP_MAC_2's Type value. value.
During HIP_MAC_2 calculation, the following applies: During HIP_MAC_2 calculation, the following apply:
o In the HIP header, the Checksum field is set to zero. o In the HIP header, the Checksum field is set to zero.
o In the HIP header, the Header Length field value is calculated to o In the HIP header, the Header Length field value is calculated to
the beginning of the HIP_MAC_2 parameter and increased by the the beginning of the HIP_MAC_2 parameter and increased by the
length of the concatenated HOST_ID parameter length (including length of the concatenated HOST_ID parameter length (including the
type and length fields). Type and Length fields).
o HOST_ID parameter is exactly in the form it was received in the R1 o The HOST_ID parameter is exactly in the form it was received in
packet from the Responder. the R1 packet from the Responder.
Parameter order is described in Section 5.2.1, except that the Parameter order is described in Section 5.2.1, except that the
HOST_ID parameter in this calculation is added to the end. HOST_ID parameter in this calculation is added to the end.
The HIP_MAC parameter is defined in Section 5.2.12 and the HIP_MAC_2 The HIP_MAC parameter is defined in Section 5.2.12 and the HIP_MAC_2
parameter in Section 5.2.13. The HMAC calculation and verification parameter in Section 5.2.13. The HMAC calculation and verification
process (the process applies both to HIP_MAC and HIP_MAC_2 except process (the process applies both to HIP_MAC and HIP_MAC_2, except
where HIP_MAC_2 is mentioned separately) is as follows: where HIP_MAC_2 is mentioned separately) is as follows:
Packet sender: Packet sender:
1. Create the HIP packet, without the HIP_MAC, HIP_SIGNATURE, 1. Create the HIP packet, without the HIP_MAC, HIP_SIGNATURE,
HIP_SIGNATURE_2, or any other parameter with greater Type value HIP_SIGNATURE_2, or any other parameter with greater type value
than the HIP_MAC parameter has. than the HIP_MAC parameter has.
2. In case of HIP_MAC_2 calculation, add a HOST_ID (Responder) 2. In case of HIP_MAC_2 calculation, add a HOST_ID (Responder)
parameter to the end of the packet. parameter to the end of the packet.
3. Calculate the Header Length field in the HIP header including the 3. Calculate the Header Length field in the HIP header, including
added HOST_ID parameter in case of HIP_MAC_2. the added HOST_ID parameter in case of HIP_MAC_2.
4. Compute the HMAC using either HIP-gl or HIP-lg integrity key 4. Compute the HMAC using either the HIP-gl or HIP-lg integrity key
retrieved from KEYMAT as defined in Section 6.5. retrieved from KEYMAT as defined in Section 6.5.
5. In case of HIP_MAC_2, remove the HOST_ID parameter from the 5. In case of HIP_MAC_2, remove the HOST_ID parameter from the
packet. packet.
6. Add the HIP_MAC parameter to the packet and any parameter with 6. Add the HIP_MAC parameter to the packet and any parameter with
greater Type value than the HIP_MAC's (HIP_MAC_2's) that may greater type value than the HIP_MAC's (HIP_MAC_2's) that may
follow, including possible HIP_SIGNATURE or HIP_SIGNATURE_2 follow, including possible HIP_SIGNATURE or HIP_SIGNATURE_2
parameters parameters.
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 HIP_MAC or HIP_MAC_2 parameter, as well as all other 2. Remove the HIP_MAC or HIP_MAC_2 parameter, as well as all other
parameters that follow it with greater Type value including parameters that follow it with greater type value including
possible HIP_SIGNATURE or HIP_SIGNATURE_2 fields, saving the possible HIP_SIGNATURE or HIP_SIGNATURE_2 fields, saving the
contents if they are needed later. contents if they are needed later.
3. In case of HIP_MAC_2, build and add a HOST_ID parameter (with 3. In case of HIP_MAC_2, build and add a HOST_ID parameter (with
Responder information) to the packet. The HOST_ID parameter Responder information) to the packet. The HOST_ID parameter
should be identical to the one previously received from the should be identical to the one previously received from the
Responder. 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). In case of HIP_MAC_2, the Checksum field (set it to all zeros). In case of HIP_MAC_2, the
length is calculated with the added HOST_ID parameter. length is calculated with the added HOST_ID parameter.
5. Compute the HMAC using either HIP-gl or HIP-lg integrity key as 5. Compute the HMAC using either the HIP-gl or HIP-lg integrity key
defined in Section 6.5 and verify it against the received HMAC. as defined in Section 6.5 and verify it against the received
HMAC.
6. Set Checksum and Header Length field in the HIP header to 6. Set the Checksum and Header Length fields in the HIP header to
original values. Note that the checksum and length fields original values. Note that the Checksum and Length fields
contain incorrect values after this step. contain incorrect values after this step.
7. In case of HIP_MAC_2, remove the HOST_ID parameter from the 7. In case of HIP_MAC_2, remove the HOST_ID parameter from the
packet before further processing. packet before further processing.
6.4.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 parameters. When processing the HIP_SIGNATURE_2, the HIP_SIGNATURE_2 parameters. When processing the HIP_SIGNATURE_2
only difference is that instead of the HIP_SIGNATURE parameter, the parameter, the only difference is that instead of the HIP_SIGNATURE
HIP_SIGNATURE_2 parameter is used, and the Initiator's HIT and PUZZLE parameter, the HIP_SIGNATURE_2 parameter is used, and the Initiator's
Opaque and Random #I fields are cleared (set to all zeros) before HIT and PUZZLE Opaque and Random #I fields are cleared (set to all
computing the signature. The HIP_SIGNATURE parameter is defined in zeros) before computing the signature. The HIP_SIGNATURE parameter
Section 5.2.14 and the HIP_SIGNATURE_2 parameter in Section 5.2.15. is defined in Section 5.2.14 and the HIP_SIGNATURE_2 parameter in
Section 5.2.15.
The scope of the calculation for HIP_SIGNATURE and HIP_SIGNATURE_2 The scope of the calculation for HIP_SIGNATURE and HIP_SIGNATURE_2 is
is: as follows:
HIP_SIGNATURE: { HIP header | [ Parameters ] } HIP_SIGNATURE: { HIP header | [ Parameters ] }
where Parameters include all HIP parameters for the packet that is where Parameters include all of the packet's HIP parameters with type
being calculated with Type values from 1 to (HIP_SIGNATURE's Type values from 1 to (HIP_SIGNATURE's type value - 1).
value - 1).
During signature calculation, the following applies: During signature calculation, the following apply:
o In the HIP header, the Checksum field is set to zero. o In the HIP header, the Checksum field is set to zero.
o In the HIP header, the Header Length field value is calculated to o In the HIP header, the Header Length field value is calculated to
the beginning of the HIP_SIGNATURE parameter. the beginning of the HIP_SIGNATURE parameter.
The parameter order is described in Section 5.2.1. Parameter order is described in Section 5.2.1.
HIP_SIGNATURE_2: { HIP header | [ Parameters ] } HIP_SIGNATURE_2: { HIP header | [ Parameters ] }
where Parameters include all HIP parameters for the packet that is where Parameters include all of the packet's HIP parameters with type
being calculated with Type values ranging from 1 to values ranging from 1 to (HIP_SIGNATURE_2's type value - 1).
(HIP_SIGNATURE_2's Type value - 1).
During signature calculation, the following apply: During signature calculation, the following apply:
o In the HIP header, the Initiator's HIT field and Checksum fields o In the HIP header, both the Checksum and the Receiver's HIT fields
are set to zero. are set to zero.
o In the HIP header, the Header Length field value is calculated to o In the HIP header, the Header Length field value is calculated to
the beginning of the HIP_SIGNATURE_2 parameter. the beginning of the HIP_SIGNATURE_2 parameter.
o PUZZLE parameter's Opaque and Random #I fields are set to zero. o The PUZZLE parameter's Opaque and Random #I fields are set to
zero.
Parameter order is described in Section 5.2.1. Parameter order is described in Section 5.2.1.
The signature calculation and verification process (the process The signature calculation and verification process (the process
applies both to HIP_SIGNATURE and HIP_SIGNATURE_2 except in the case applies both to HIP_SIGNATURE and HIP_SIGNATURE_2, except in the case
where HIP_SIGNATURE_2 is separately mentioned) is as follows: where HIP_SIGNATURE_2 is separately mentioned) is as follows:
Packet sender: Packet sender:
1. Create the HIP packet without the HIP_SIGNATURE parameter or any 1. Create the HIP packet without the HIP_SIGNATURE parameter or any
other parameters that follow the HIP_SIGNATURE parameter. other 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. In case of HIP_SIGNATURE_2, set Initiator's HIT field in header. In case of HIP_SIGNATURE_2, set the Initiator's HIT
the HIP header as well as PUZZLE parameter's Opaque and Random #I field in the HIP header as well as the PUZZLE parameter's Opaque
fields to zero. and Random #I fields to zero.
3. Compute the signature using the private key corresponding to the 3. Compute the signature using the private key corresponding to the
Host Identifier (public key). Host Identifier (public key).
4. Add the HIP_SIGNATURE parameter to the packet. 4. Add the HIP_SIGNATURE parameter to the packet.
5. Add any parameters that follow the HIP_SIGNATURE parameter. 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 and checksum. 1. Verify the HIP Header Length field and checksum.
2. Save the contents of the HIP_SIGNATURE parameter and any other 2. Save the contents of the HIP_SIGNATURE parameter and any other
parameters following the HIP_SIGNATURE parameter and remove them parameters following the HIP_SIGNATURE parameter, and remove them
from the packet. 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). In case of Checksum field (set it to all zeros). In case of
HIP_SIGNATURE_2, set Initiator's HIT field in the HIP header as HIP_SIGNATURE_2, set the Initiator's HIT field in the HIP header
well as PUZZLE parameter's Opaque and Random #I fields to zero. as well as the PUZZLE parameter's Opaque and Random #I fields
to zero.
4. Compute the signature and verify it against the received 4. Compute the signature and verify it against the received
signature using the packet sender's Host Identity (public key). signature using the packet sender's Host Identity (public key).
5. Restore the original packet by adding removed parameters (in step 5. Restore the original packet by adding removed parameters (in
2) and resetting the values that were set to zero (in step 3). step 2) and resetting the values that were set to zero (in
step 3).
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 retrieved from a DNS query, if the FQDN has been received in
packet or one received by some other means. the HOST_ID parameter; or an HI received by some other means.
6.5. HIP KEYMAT Generation 6.5. HIP KEYMAT Generation
HIP keying material is derived from the Diffie-Hellman session key, HIP keying material is derived from the Diffie-Hellman session key,
Kij, produced during the HIP base exchange (see Section 4.1.3). The Kij, produced during the HIP base exchange (see Section 4.1.3). The
Initiator has Kij during the creation of the I2 packet, and the Initiator has Kij during the creation of the I2 packet, and the
Responder has Kij once it receives the I2 packet. This is why I2 can Responder has Kij once it receives the I2 packet. This is why I2 can
already contain encrypted information. already contain encrypted information.
The KEYMAT is derived by feeding Kij into the key derivation function The KEYMAT is derived by feeding Kij into the key derivation function
defined by the DH Group ID. Currently the only key derivation defined by the DH Group ID. Currently, the only key derivation
function defined in this document is the Hash-based Key Derivation function defined in this document is the Hash-based Key Derivation
Function (HKDF) [RFC5869] using the RHASH hash function. Other Function (HKDF) [RFC5869] using the RHASH hash function. Other
documents may define new DH Group IDs and corresponding key documents may define new DH Group IDs and corresponding key
distribution functions. distribution functions.
In the following we provide the details for deriving the keying In the following, we provide the details for deriving the keying
material using HKDF. material using HKDF.
where where
info = sort(HIT-I | HIT-R) info = sort(HIT-I | HIT-R)
salt = #I | #J salt = #I | #J
Sort(HIT-I | HIT-R) is defined as the network byte order Sort(HIT-I | HIT-R) is defined as the network byte order
concatenation of the two HITs, with the smaller HIT preceding the concatenation of the two HITs, with the smaller HIT preceding the
larger HIT, resulting from the numeric comparison of the two HITs larger HIT, resulting from the numeric comparison of the two HITs
interpreted as positive (unsigned) 128-bit integers in network byte interpreted as positive (unsigned) 128-bit integers in network byte
order. The #I and #J values are from the puzzle and its solution order. The #I and #J values are from the puzzle and its solution
that were exchanged in R1 and I2 messages when this HIP association that were exchanged in R1 and I2 messages when this HIP association
was set up. Both hosts have to store #I and #J values for the HIP was set up. Both hosts have to store #I and #J values for the HIP
association for future use. association for future use.
The initial keys are drawn sequentially in the order that is The initial keys are drawn sequentially in the order that is
determined by the numeric comparison of the two HITs, with comparison determined by the numeric comparison of the two HITs, with the
method described in the previous paragraph. HOST_g denotes the host comparison method described in the previous paragraph. HOST_g
with the greater HIT value, and HOST_l the host with the lower HIT denotes the host with the greater HIT value, and HOST_l the host with
value. the lower HIT value.
The drawing order for the four initial keys is as follows: The drawing order for the four initial keys is as follows:
HIP-gl encryption key for HOST_g's ENCRYPTED parameter HIP-gl encryption key for HOST_g's ENCRYPTED parameter
HIP-gl integrity (HMAC) key for HOST_g's outgoing HIP packets HIP-gl integrity (HMAC) key for HOST_g's outgoing HIP packets
HIP-lg encryption key for HOST_l's ENCRYPTED parameter HIP-lg encryption key for HOST_l's ENCRYPTED parameter
HIP-lg integrity (HMAC) key for HOST_l's outgoing HIP packets HIP-lg integrity (HMAC) key for HOST_l's outgoing HIP packets
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 or 256 bits AES 128 or 256 bits
SHA-1 160 bits SHA-1 160 bits
SHA-256 256 bits SHA-256 256 bits
SHA-384 384 bits SHA-384 384 bits
NULL 0 bits
NULL 0 bits
If other key sizes are used, they MUST be treated as different If other key sizes are used, they MUST be treated as different
encryption algorithms and defined separately. encryption algorithms and defined separately.
6.6. Initiation of a HIP Base Exchange 6.6. Initiation of a HIP Base Exchange
An implementation may originate a HIP base exchange to another host An implementation may originate a HIP base exchange to another host
based on a local policy decision, usually triggered by an application based 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
peer host may be obtained via conventional mechanisms, such as DNS peer host may be obtained via conventional mechanisms, such as DNS
lookup. The I1 packet contents are specified in Section 5.3.1. The lookup. The I1 packet contents are specified in Section 5.3.1. The
selection of which source or destination Host Identity to use, if a selection of which source or destination Host Identity to use, if an
Initiator or Responder has more than one to choose from, is typically Initiator or Responder has more than one to choose from, is typically
a policy decision. a policy decision.
The following steps define the conceptual processing rules for The following steps define the conceptual processing rules for
initiating a HIP base exchange: initiating a HIP base exchange:
1. The Initiator receives one or more of the Responder's HITs and 1. The Initiator receives one or more of the Responder's HITs and
one or more addresses either from a DNS lookup of the Responder's one or more addresses from either a DNS lookup of the Responder's
FQDN, from some other repository, or from a local database. If FQDN, some other repository, or a local database. If the
the Initiator does not know the Responder's HIT, it may attempt Initiator does not know the Responder's HIT, it may attempt
opportunistic mode by using NULL (all zeros) as the Responder's opportunistic mode by using NULL (all zeros) as the Responder's
HIT (see also "HIP Opportunistic Mode" (Section 4.1.8)). If the HIT (see also "HIP Opportunistic Mode" (Section 4.1.8)). If the
Initiator can choose from multiple Responder HITs, it selects a Initiator can choose from multiple Responder HITs, it selects a
HIT for which the Initiator supports the HIT Suite. HIT for which the Initiator supports the HIT Suite.
2. The Initiator sends an I1 packet to one of the Responder's 2. The Initiator sends an I1 packet to one of the Responder's
addresses. The selection of which address to use is a local addresses. The selection of which address to use is a local
policy decision. policy decision.
3. The Initiator includes the DH_GROUP_LIST in the I1 packet. The 3. The Initiator includes the DH_GROUP_LIST in the I1 packet. The
selection and order of DH Group IDs in the DH_GROUP_LIST MUST be selection and order of DH Group IDs in the DH_GROUP_LIST MUST be
stored by the Initiator because this list is needed for later R1 stored by the Initiator, because this list is needed for later R1
processing. In most cases, the preferences regarding the DH processing. In most cases, the preferences regarding the DH
Groups will be static, so no per-association storage is groups will be static, so no per-association storage is
necessary. necessary.
4. Upon sending an I1 packet, the sender transitions to state 4. Upon sending an I1 packet, the sender transitions to state
I1-SENT, starts a timer for which the timeout value SHOULD be I1-SENT and starts a timer for which the timeout value SHOULD be
larger than the worst-case anticipated RTT. The sender SHOULD larger than the worst-case anticipated RTT. The sender SHOULD
also increment the trial counter associated with the I1. also increment the trial counter associated with the I1.
5. Upon timeout, the sender SHOULD retransmit the I1 packet and 5. Upon timeout, the sender SHOULD retransmit the I1 packet and
restart the timer, up to a maximum of I1_RETRIES_MAX tries. restart the timer, up to a maximum of I1_RETRIES_MAX tries.
6.6.1. Sending Multiple I1 Packets in Parallel 6.6.1. Sending Multiple I1 Packets in Parallel
For the sake of minimizing the association establishment latency, an For the sake of minimizing the association establishment latency, an
implementation MAY send the same I1 packet to more than one of the implementation MAY send the same I1 packet to more than one of the
skipping to change at page 92, line 5 skipping to change at page 92, line 35
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 packet, it MUST NOT terminate message while it is waiting for an R1 packet, it MUST NOT terminate
waiting. It MAY continue as if it had not received the ICMP message, waiting. It MAY continue as if it had not received the ICMP message,
and send a few more I1 packets. Alternatively, it MAY take the ICMP and send a few more I1 packets. Alternatively, it MAY take the ICMP
message as a hint that the peer most probably does not support HIP, message as a hint that the peer most probably does not support HIP,
and return to state UNASSOCIATED earlier than otherwise. However, at and return to state UNASSOCIATED earlier than otherwise. However, at
minimum, it MUST continue waiting for an R1 packet for a reasonable minimum, it MUST continue waiting for an R1 packet for a reasonable
time before returning to UNASSOCIATED. time before returning to UNASSOCIATED.
6.7. Processing Incoming I1 Packets 6.7. Processing of 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 set up a HIP association. implementation is unable or unwilling to set up a HIP association.
If the implementation is unable to set up a HIP association, the host If the implementation is unable to set up 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 packet source IP Administratively Prohibited' message to the I1 packet source IP
address. If the implementation is unwilling to set up a HIP address. If the implementation is unwilling to set up a HIP
association, the host MAY ignore the I1 packet. This latter case may association, the host MAY ignore the I1 packet. This latter case may
occur during a DoS attack such as an I1 packet flood. occur during a DoS attack such as an I1 packet flood.
The implementation SHOULD be able to handle a storm of received I1 The implementation SHOULD 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.
A spoofed I1 packet can result in an R1 attack on a system. An R1 A spoofed I1 packet can result in an R1 attack on a system. An R1
packet sender MUST have a mechanism to rate-limit R1 packets sent to packet sender MUST have a mechanism to rate-limit R1 packets sent to
an address. an address.
It is RECOMMENDED that the HIP state machine does not transition upon It is RECOMMENDED that the HIP state machine does not transition upon
sending an R1 packet. sending an R1 packet.
The following steps define the conceptual processing rules for The following steps define the conceptual processing rules for
responding to an I1 packet: responding to an I1 packet:
1. The Responder MUST check that the Responder's HIT in the received 1. The Responder MUST check that the Responder's HIT in the received
I1 packet is either one of its own HITs or NULL. Otherwise it I1 packet is either one of its own HITs or NULL. Otherwise, it
must drop the packet. must drop the packet.
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 an existing respond to this with an R1 packet, prepare to drop an existing
HIP security association with the peer, and stay at ESTABLISHED HIP security association with the peer, and stay at ESTABLISHED
state. 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 (i.e., the receiver's) HIT. between the sender's HIT and its own (i.e., the receiver's) HIT.
If the sender's HIT is greater than its own HIT, it should drop If the sender's HIT is greater than its own HIT, it should drop
skipping to change at page 93, line 8 skipping to change at page 93, line 41
4. If the implementation chooses to respond to the I1 packet with an 4. If the implementation chooses to respond to the I1 packet with an
R1 packet, it creates a new R1 or selects a precomputed R1 R1 packet, it creates a new R1 or selects a precomputed R1
according to the format described in Section 5.3.2. It creates according to the format described in Section 5.3.2. It creates
or chooses an R1 that contains its most preferred DH public value or chooses an R1 that contains its most preferred DH public value
that is also contained in the DH_GROUP_LIST in the I1 packet. If that is also contained in the DH_GROUP_LIST in the I1 packet. If
no suitable DH Group ID was contained in the DH_GROUP_LIST in the no suitable DH Group ID was contained in the DH_GROUP_LIST in the
I1 packet, it sends an R1 with any suitable DH public key. I1 packet, it sends an R1 with any suitable DH public key.
5. If the received Responder's HIT in the I1 is NULL, the Responder 5. If the received Responder's HIT in the I1 is NULL, the Responder
selects a HIT with a the same HIT Suite as the Initiator's HIT. selects a HIT with the same HIT Suite as the Initiator's HIT. If
If this HIT Suite is not supported by the Responder, it SHOULD this HIT Suite is not supported by the Responder, it SHOULD
select a REQUIRED HIT Suite from Section 5.2.10, which is select a REQUIRED HIT Suite from Section 5.2.10, which is
currently RSA/DSA/SHA-256. Other than that, selecting the HIT is currently RSA/DSA/SHA-256. Other than that, selecting the HIT is
a local policy matter. a local policy matter.
6. The responder expresses its supported HIP transport formats in 6. The Responder expresses its supported HIP transport formats in
the TRANSPORT_FORMAT_LIST as described in Section 5.2.11. The the TRANSPORT_FORMAT_LIST as described in Section 5.2.11. The
Responder MUST at least provide one payload transport format Responder MUST provide at least one payload transport format
type. type.
7. The Responder sends the R1 packet to the source IP address of the 7. The Responder sends the R1 packet to the source IP address of the
I1 packet. I1 packet.
6.7.1. R1 Management 6.7.1. R1 Management
All compliant implementations MUST be able to produce R1 packets; All compliant implementations MUST be able to produce R1 packets;
even if a device is configured by policy to only initiate even if a device is configured by policy to only initiate
associations, it must be able to process I1s in case of recovery from associations, it must be able to process I1s in cases of recovery
loss of state or key exhaustion. An R1 packet MAY be precomputed. from loss of state or key exhaustion. An R1 packet MAY be
An R1 packet MAY be reused for time Delta T, which is implementation precomputed. An R1 packet MAY be reused for a short time period,
dependent, and SHOULD be deprecated and not used once a valid denoted here as "Delta T", which is implementation dependent, and
response I2 packet has been received from an Initiator. During an I1 SHOULD be deprecated and not used once a valid response I2 packet has
message storm, an R1 packet MAY be re-used beyond this limit. R1 been received from an Initiator. During an I1 message storm, an R1
information MUST NOT be discarded until Delta S after T. Time S is packet MAY be reused beyond the normal Delta T. R1 information MUST
the delay needed for the last I2 packet to arrive back to the NOT be discarded until a time period "Delta S" (again, implementation
Responder. dependent) after the R1 packet is no longer being offered. Delta S
is the assumed maximum time needed for the last I2 packet in response
to the R1 packet to arrive back at the Responder.
Implementations that support multiple DH groups MAY pre-compute R1 Implementations that support multiple DH groups MAY precompute R1
packets for each supported group so that incoming I1 packets with packets for each supported group so that incoming I1 packets with
different DH Group IDs in the DH_GROUP_LIST can be served quickly. different DH Group IDs in the DH_GROUP_LIST can be served quickly.
An implementation MAY keep state about received I1 packets and match An implementation MAY keep state about received I1 packets and match
the received I2 packets against the state, as discussed in the received I2 packets against the state, as discussed in
Section 4.1.1. Section 4.1.1.
6.7.2. Handling Malformed Messages 6.7.2. Handling of Malformed Messages
If an implementation receives a malformed I1 packet, it SHOULD NOT If an implementation receives a malformed I1 packet, it SHOULD NOT
respond with a NOTIFY message, as such practice could open up a respond with a NOTIFY message, as such a practice could open up a
potential denial-of-service threat. Instead, it MAY respond with an potential denial-of-service threat. Instead, it MAY respond with an
ICMP packet, as defined in Section 5.4. ICMP packet, as defined in Section 5.4.
6.8. Processing Incoming R1 Packets 6.8. Processing of Incoming R1 Packets
A system receiving an R1 packet MUST first check to see if it has A system receiving an R1 packet MUST first check to see if it has
sent an I1 packet to the originator of the R1 packet (i.e., it is in sent an I1 packet to the originator of the R1 packet (i.e., it is in
state I1-SENT). If so, it SHOULD process the R1 as described below, state I1-SENT). If so, it SHOULD process the R1 as described below,
send an I2 packet, and transition to state I2-SENT, setting a timer send an I2 packet, and transition to state I2-SENT, setting a timer
to protect the I2 packet. If the system is in state I2-SENT, it MAY to protect the I2 packet. If the system is in state I2-SENT, it MAY
respond to the R1 packet if the R1 packet has a larger R1 generation respond to the R1 packet if the R1 packet has a larger R1 generation
counter; if so, it should drop its state due to processing the counter; if so, it should drop its state due to processing the
previous R1 packet and start over from state I1-SENT. If the system previous R1 packet and start over from state I1-SENT. If the system
is in any other state with respect to that host, the system SHOULD is in any other state with respect to that host, the system SHOULD
skipping to change at page 94, line 37 skipping to change at page 95, line 27
an I1 packet to the originator of the R1 packet (i.e., it has a an I1 packet to the originator of the R1 packet (i.e., it has a
HIP association that is in state I1-SENT and that is associated HIP association that is in state I1-SENT and that is associated
with the HITs in the R1). Unless the I1 packet was sent in with the HITs in the R1). Unless the I1 packet was sent in
opportunistic mode (see Section 4.1.8), the IP addresses in the opportunistic mode (see Section 4.1.8), the IP addresses in the
received R1 packet SHOULD be ignored by the R1 processing and, received R1 packet SHOULD be ignored by the R1 processing and,
when looking up the right HIP association, the received R1 when looking up the right HIP association, the received R1
packet SHOULD be matched against the associations using only the packet SHOULD be matched against the associations using only the
HITs. If a match exists, the system should process the R1 HITs. If a match exists, the system should process the R1
packet as described below. packet as described below.
2. Otherwise, if the system is in any other state than I1-SENT or 2. Otherwise, if the system is in any state other than I1-SENT or
I2-SENT with respect to the HITs included in the R1 packet, it I2-SENT with respect to the HITs included in the R1 packet, it
SHOULD silently drop the R1 packet and remain in the current SHOULD silently drop the R1 packet and remain in the current
state. 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. Also, the Responder's HIT MUST correspond to the one used I1. Also, the Responder's HIT MUST correspond to the one used
in the I1, unless the I1 packet contained a NULL HIT. in the I1, unless the I1 packet contained a NULL HIT.
4. The system SHOULD validate the R1 signature before applying 4. The system SHOULD validate the R1 signature before applying
further packet processing, according to Section 5.2.15. further packet processing, according to Section 5.2.15.
5. If the HIP association state is I1-SENT, and multiple valid R1 5. If the HIP association state is I1-SENT, and multiple valid R1
packets are present, the system MUST select from among the R1 packets are present, the system MUST select from among the R1
packets with the largest R1 generation counter. packets with the largest R1 generation counter.
6. The system MUST check that the Initiator HIT Suite is contained 6. The system MUST check that the Initiator's HIT Suite is
in the HIT_SUITE_LIST parameter in the R1 packet (i.e., the contained in the HIT_SUITE_LIST parameter in the R1 packet
Initiator's HIT Suite is supported by the Responder). If the (i.e., the Initiator's HIT Suite is supported by the Responder).
HIT Suite is supported by the Responder, the system proceeds If the HIT Suite is supported by the Responder, the system
normally. Otherwise, the system MAY stay in state I1-sent and proceeds normally. Otherwise, the system MAY stay in state
restart the BEX by sending a new I1 packet with an Initiator HIT I1-SENT and restart the BEX by sending a new I1 packet with an
that is supported by the Responder and hence is contained in the Initiator HIT that is supported by the Responder and hence is
HIT_SUITE_LIST in the R1 packet. The system MAY abort the BEX contained in the HIT_SUITE_LIST in the R1 packet. The system
if no suitable source HIT is available. The system SHOULD wait MAY abort the BEX if no suitable source HIT is available. The
for an acceptable time span to allow further R1 packets with system SHOULD wait for an acceptable time span to allow further
higher R1 generation counters or different HIT and HIT Suites to R1 packets with higher R1 generation counters or different HIT
arrive before restarting or aborting the BEX. and HIT Suites to arrive before restarting or aborting the BEX.
7. The system MUST check that the DH Group ID in the DIFFIE_HELLMAN 7. The system MUST check that the DH Group ID in the DIFFIE_HELLMAN
parameter in the R1 matches the first DH Suite ID in the parameter in the R1 matches the first DH Group ID in the
Responder's DH_GROUP_LIST in the R1 packet that was also Responder's DH_GROUP_LIST in the R1 packet, and also that this
contained in the Initiator's DH_GROUP_LIST in the I1 packet. If Group ID corresponds to a value that was included in the
the DH Group ID of the DIFFIE_HELLMAN parameter does not express Initiator's DH_GROUP_LIST in the I1 packet. If the DH Group ID
the Responder's best choice, the Initiator can conclude that the of the DIFFIE_HELLMAN parameter does not express the Responder's
DH_GROUP_LIST in the I1 packet was adversely modified. In such best choice, the Initiator can conclude that the DH_GROUP_LIST
case, the Initiator MAY send a new I1 packet, however, it SHOULD in the I1 packet was adversely modified. In such a case, the
NOT change its preference in the DH_GROUP_LIST in the new I1 Initiator MAY send a new I1 packet; however, it SHOULD NOT
packet. Alternatively, the Initiator MAY abort the HIP base change its preference in the DH_GROUP_LIST in the new I1 packet.
exchange. Alternatively, the Initiator MAY abort the HIP base exchange.
8. If the HIP association state is I2-SENT, the system MAY re-enter 8. If the HIP association state is I2-SENT, the system MAY re-enter
state I1-SENT and process the received R1 packet if it has a state I1-SENT and process the received R1 packet if it has a
larger R1 generation counter than the R1 packet responded to larger R1 generation counter than the R1 packet responded to
previously. previously.
9. The R1 packet may have the A bit set -- in this case, the system 9. The R1 packet may have the A-bit set -- in this case, the system
MAY choose to refuse it by dropping the R1 packet and returning MAY choose to refuse it by dropping the R1 packet and returning
to state UNASSOCIATED. The system SHOULD consider dropping the to state UNASSOCIATED. The system SHOULD consider dropping the
R1 packet only if it used a NULL HIT in I1 packet. If the A bit R1 packet only if it used a NULL HIT in the I1 packet. If the
is set, the Responder's HIT is anonymous and SHOULD NOT be A-bit is set, the Responder's HIT is anonymous and SHOULD NOT be
stored permanently. stored permanently.
10. The system SHOULD attempt to validate the HIT against the 10. The system SHOULD attempt to validate the HIT against the
received Host Identity by using the received Host Identity to received Host Identity by using the received Host Identity to
construct a HIT and verify that it matches the Sender's HIT. construct a HIT and verify that it matches the Sender's HIT.
11. The system MUST store the received R1 generation counter for 11. The system MUST store the received R1 generation counter for
future reference. future reference.
12. The system attempts to solve the puzzle in the R1 packet. The 12. The system attempts to solve the puzzle in the R1 packet. The
skipping to change at page 96, line 47 skipping to change at page 97, line 40
current state. current state.
6.8.1. Handling of Malformed Messages 6.8.1. Handling of 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 packet typically doesn't have any state. An as the sender of the R1 packet typically doesn't have any state. An
implementation SHOULD wait for some more time for a possibly well- implementation SHOULD wait for some more time for a possibly well-
formed R1, after which it MAY try again by sending a new I1 packet. formed R1, after which it MAY try again by sending a new I1 packet.
6.9. Processing Incoming I2 Packets 6.9. Processing of Incoming I2 Packets
Upon receipt of an I2 packet, the system MAY perform initial checks Upon receipt of an I2 packet, the system MAY perform initial checks
to determine whether the I2 packet corresponds to a recent R1 packet to determine whether the I2 packet corresponds to a recent R1 packet
that has been sent out, if the Responder keeps such state. For that has been sent out, if the Responder keeps such state. For
example, the sender could check whether the I2 packet is from an example, the sender could check whether the I2 packet is from an
address or HIT for which the Responder has recently received an I1. address or HIT for which the Responder has recently received an I1.
The R1 packet may have had Opaque data included that was echoed back The R1 packet may have had opaque data included that was echoed back
in the I2 packet. If the I2 packet is considered to be suspect, it in the I2 packet. If the I2 packet is considered to be suspect, it
MAY be silently discarded by the system. MAY be silently discarded by the system.
Otherwise, the HIP implementation SHOULD process the I2 packet. This Otherwise, the HIP implementation SHOULD process the I2 packet. This
includes validation of the puzzle solution, generating the Diffie- includes validation of the puzzle solution, generating the
Hellman key, possibly decrypting the Initiator's Host Identity, Diffie-Hellman key, possibly decrypting the Initiator's Host
verifying the signature, creating state, and finally sending an R2 Identity, verifying the signature, creating state, and finally
packet. sending an R2 packet.
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 packet 1. The system MAY perform checks to verify that the I2 packet
corresponds to a recently sent R1 packet. Such checks are corresponds to a recently sent R1 packet. Such checks are
implementation dependent. See Appendix A for a description of implementation dependent. See Appendix A for a description of
an example implementation. an example 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 and MUST drop the packet otherwise. one of its own HITs and MUST drop the packet otherwise.
3. The system MUST further check that the Initiator's HIT Suite is 3. The system MUST further check that the Initiator's HIT Suite is
supported. The Responder SHOULD silently drop I2 packets with supported. The Responder SHOULD silently drop I2 packets with
unsupported Initiator HITs. unsupported Initiator HITs.
4. If the system's state machine is in the R2-SENT state, the 4. If the system's state machine is in the R2-SENT state, the
system MAY check if the newly received I2 packet is similar to system MAY check to see if the newly received I2 packet is
the one that triggered moving to R2-SENT. If so, it MAY similar to the one that triggered moving to R2-SENT. If so, it
retransmit a previously sent R2 packet, reset the R2-SENT timer, MAY retransmit a previously sent R2 packet and reset the R2-SENT
and the state machine stays in R2-SENT. timer, and the state machine stays in R2-SENT.
5. If the system's state machine is in the I2-SENT state, the 5. If the system's state machine is in the I2-SENT state, the
system MUST make a comparison between its local and sender's system MUST make a comparison between its local and sender's
HITs (similarly as in Section 6.5). If the local HIT is smaller HITs (similar to the comparison method described in
than the sender's HIT, it should drop the I2 packet, use the Section 6.5). If the local HIT is smaller than the sender's
peer Diffie-Hellman key and nonce #I from the R1 packet received HIT, it should drop the I2 packet, use the peer Diffie-Hellman
earlier, and get the local Diffie-Hellman key and nonce #J from key and nonce #I from the R1 packet received earlier, and get
the I2 packet sent to the peer earlier. Otherwise, the system the local Diffie-Hellman key and nonce #J from the I2 packet
should process the received I2 packet and drop any previously sent to the peer earlier. Otherwise, the system should process
derived Diffie-Hellman keying material Kij it might have formed the received I2 packet and drop any previously derived
upon sending the I2 packet previously. The peer Diffie-Hellman Diffie-Hellman keying material Kij it might have formed upon
key and the nonce #J are taken from the just arrived I2 packet. sending the I2 packet previously. The peer Diffie-Hellman key
The local Diffie-Hellman key and the nonce I are the ones that and the nonce #J are taken from the I2 packet that just arrived.
The local Diffie-Hellman key and the nonce #I are the ones that
were sent earlier in the R1 packet. were sent earlier in the R1 packet.
6. If the system's state machine is in the I1-SENT state, and the 6. If the system's state machine is in the I1-SENT state, and the
HITs in the I2 packet match those used in the previously sent I1 HITs in the I2 packet match those used in the previously sent I1
packet, the system uses this received I2 packet as the basis for packet, the system uses this received I2 packet as the basis for
the HIP association it was trying to form, and stops the HIP association it was trying to form, and stops
retransmitting I1 packets (provided that the I2 packet passes retransmitting I1 packets (provided that the I2 packet passes
the additional checks below). the additional checks below).
7. If the system's state machine is in any other state than 7. If the system's state machine is in any state other than
R2-SENT, the system SHOULD check that the echoed R1 generation R2-SENT, the system SHOULD check that the echoed R1 generation
counter in the I2 packet is within the acceptable range if the counter in the I2 packet is within the acceptable range if the
counter is included. Implementations MUST accept puzzles from counter is included. Implementations MUST accept puzzles from
the current generation and MAY accept puzzles from earlier the current generation and MAY accept puzzles from earlier
generations. If the generation counter in the newly received I2 generations. If the generation counter in the newly received I2
packet is outside the accepted range, the I2 packet is stale packet is outside the accepted range, the I2 packet is stale
(and perhaps replayed) and SHOULD be dropped. (and perhaps replayed) and SHOULD be dropped.
8. The system MUST validate the solution to the puzzle by computing 8. The system MUST validate the solution to the puzzle by computing
the hash described in Section 5.3.3 using the same RHASH the hash described in Section 5.3.3 using the same RHASH
skipping to change at page 98, line 41 skipping to change at page 99, line 34
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.5. 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.
11. The encrypted HOST_ID is decrypted by the Initiator's encryption 11. The encrypted HOST_ID is decrypted by the Initiator's encryption
key defined in Section 6.5. If the decrypted data is not a key defined in Section 6.5. If the decrypted data is not a
HOST_ID parameter, the I2 packet is silently dropped. HOST_ID parameter, the I2 packet is silently dropped.
12. The implementation SHOULD also verify that the Initiator's HIT 12. The implementation SHOULD also verify that the Initiator's HIT
in the I2 packet corresponds to the Host Identity sent in the I2 in the I2 packet corresponds to the Host Identity sent in the I2
packet. (Note: some middleboxes may not able to make this packet. (Note: some middleboxes may not be able to make this
verification.) verification.)
13. The system MUST process the TRANSPORT_FORMAT_LIST parameter. 13. The system MUST process the TRANSPORT_FORMAT_LIST parameter.
Other documents specifying transport formats (e.g. Other documents specifying transport formats (e.g., [RFC7402])
[I-D.ietf-hip-rfc5202-bis]) contain specifications for handling contain specifications for handling any specific transport
any specific transport selected. selected.
14. The system MUST verify the HIP_MAC according to the procedures 14. The system MUST verify the HIP_MAC according to the procedures
in Section 5.2.12. in Section 5.2.12.
15. The system MUST verify the HIP_SIGNATURE according to 15. The system MUST verify the HIP_SIGNATURE according to
Section 5.2.14 and Section 5.3.3. Sections 5.2.14 and 5.3.3.
16. If the checks above are valid, then the system proceeds with 16. If the checks above are valid, then the system proceeds with
further I2 processing; otherwise, it discards the I2 and its further I2 processing; otherwise, it discards the I2 and its
state machine remains in the same state. state machine remains in the same state.
17. The I2 packet may have the A bit set -- in this case, the system 17. The I2 packet may have the A-bit set -- in this case, the system
MAY choose to refuse it by dropping the I2 and the state machine MAY choose to refuse it by dropping the I2 and the state machine
returns to state UNASSOCIATED. If the A bit is set, the returns to state UNASSOCIATED. If the A-bit is set, the
Initiator's HIT is anonymous and should not be stored Initiator's HIT is anonymous and should not be stored
permanently. permanently.
18. The system initializes the remaining variables in the associated 18. The system initializes the remaining variables in the associated
state, including Update ID counters. state, including Update ID counters.
19. Upon successful processing of an I2 message when the system's 19. Upon successful processing of an I2 message when the system's
state machine is in state UNASSOCIATED, I1-SENT, I2-SENT, or state machine is in state UNASSOCIATED, I1-SENT, I2-SENT, or
R2-SENT, an R2 packet is sent and the system's state machine R2-SENT, an R2 packet is sent and the system's state machine
transitions to state R2-SENT. transitions to state R2-SENT.
skipping to change at page 99, line 36 skipping to change at page 100, line 29
20. Upon successful processing of an I2 packet when the system's 20. Upon successful processing of an I2 packet when the system's
state machine is in state ESTABLISHED, the old HIP association state machine is in state ESTABLISHED, the old HIP association
is dropped and a new one is installed, an R2 packet is sent, and is dropped and a new one is installed, an R2 packet is sent, and
the system's state machine transitions to R2-SENT. the system's state machine transitions to R2-SENT.
21. Upon the system's state machine transitioning to R2-SENT, the 21. Upon the system's state machine transitioning to R2-SENT, the
system starts a timer. The state machine transitions to system starts a timer. The state machine transitions 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 system's state machine other packet that indicates that the peer system's state machine
has moved to ESTABLISHED). If the timer expires (allowing for has moved to ESTABLISHED). If the timer expires (allowing for a
maximal amount of retransmissions of I2 packets), the state maximal amount of retransmissions of I2 packets), the state
machine transitions to ESTABLISHED. machine transitions to ESTABLISHED.
6.9.1. Handling of Malformed Messages 6.9.1. Handling of 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 many checks the message has already passed. If SHOULD depend on how many 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.10. Processing of Incoming R2 Packets 6.10. Processing of Incoming R2 Packets
An R2 packet received in states UNASSOCIATED, I1-SENT, or ESTABLISHED An R2 packet received in state UNASSOCIATED, I1-SENT, or ESTABLISHED
results in the R2 packet being dropped and the state machine staying results in the R2 packet being dropped and the state machine staying
in the same state. If an R2 packet is received in state I2-SENT, it in the same state. If an R2 packet is received in state I2-SENT, it
MUST be processed. MUST be processed.
The following steps define the conceptual processing rules for an The following steps define the conceptual processing rules for an
incoming R2 packet: incoming R2 packet:
1. If the system is in any other state than I2-SENT, the R2 packet 1. If the system is in any state other than I2-SENT, the R2 packet
is silently dropped. is silently dropped.
2. The system MUST verify that the HITs in use correspond to the 2. The system MUST verify that the HITs in use correspond to the
HITs that were received in the R1 packet that caused the HITs that were received in the R1 packet that caused the
transition to the I1-SENT state. transition to the I1-SENT state.
3. The system MUST verify the HIP_MAC_2 according to the procedures 3. The system MUST verify the HIP_MAC_2 according to the procedures
in Section 5.2.13. in Section 5.2.13.
4. The system MUST verify the HIP signature according to the 4. The system MUST verify the HIP signature according to the
skipping to change at page 101, line 10 skipping to change at page 102, line 10
outstanding (not yet acknowledged), the sender must assume that such outstanding (not yet acknowledged), the sender must assume that such
UPDATEs may be processed in an arbitrary order by the receiver. UPDATEs may be processed in an arbitrary order by the receiver.
Therefore, any new UPDATEs that depend on a previous outstanding Therefore, any new UPDATEs that depend on a previous outstanding
UPDATE being successfully received and acknowledged MUST be postponed UPDATE being successfully received and acknowledged MUST be postponed
until reception of the necessary ACK(s) occurs. One way to prevent until reception of the necessary ACK(s) occurs. One way to prevent
any conflicts is to only allow one outstanding UPDATE at a time. any conflicts is to only a