Test IKEv2.EN.R.1.1.1.1: Sending IKE_SA_INIT response Part A: IKE Header Format (BASIC) Part B: SA Payload Format (BASIC) Part C: KE Payload Format (BASIC) Part D: Nonce Payload Format (BASIC)
To verify an IKEv2 device transmits an IKE_SA_INIT response using properly Header and Payloads format
* [RFC4306] - Section 1.2, 2.10, 3.1, 3.2, 3.3, 3.4 and 3.9 * [RFC 4718] - Sections 7.4
* Network Topology Connect the devices according to the Common Topology. * Configuration In each part, configure the devices according to the Common Configuration. * Pre-Sequence and Cleanup Sequence IKEv2 on the NUT is disabled after each part.
NUT TN1 (End-Node) (End-Node) | | |<-------------------| IKE_SA_INIT request (HDR, SAi1, KEi, Ni) | | (Packet #1) |------------------->| IKE_SA_INIT response (HDR, SAr1, KEr, Nr) | | (Judgement #1) | | V V
Packet #1 See Common Packet #1
Part A: IKE Header Format (BASIC) 1. TN1 starts to negotiate with NUT by sending IKE_SA_INIT request. 2. Observe the messages transmitted on Link A.
Part B: SA Payload Format (BASIC) 3. TN1 starts to negotiate with NUT by sending IKE_SA_INIT request. 4. Observe the messages transmitted on Link A.
Part C: KE Payload Format (BASIC) 5. TN1 starts to negotiate with NUT by sending IKE_SA_INIT request. 6. Observe the messages transmitted on Link A.
Part D: Nonce Payload Format (BASIC) 7. TN1 starts to negotiate with NUT by sending IKE_SA_INIT request. 8. Observe the messages transmitted on Link A.
Part A Step 2: Judgment #1 The NUT transmits an IKE_SA_INIT response including properly formatted IKE Header containing following values:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! IKE_SA Initiator's SPI ! ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! IKE_SA Responder's SPI ! ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Next Payload ! MjVer ! MnVer ! Exchange Type ! Flags ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Message ID ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 51 Header format
* An IKE_SA Initiator's SPI field is set to IKE_SA Initiator's SPI field value supplied in the first IKE_SA_INIT request message. * An IKE_SA Responder's SPI field is set to a 64-bits value chosen by the NUT. It MUST not be zero. * A Next Payload field is set to SA Payload (33). * A Major Version field is set to 2. * A Minor Version field is set to zero. * An Exchange Type field is set to IKE_SA_INIT (34). * A Flags field is set to (00000100)2 = (4)10. * A Message ID field is set to zero. * A Length field is set to the length of the message (header + payloads) in octets.
Part B Step 4: Judgment #1
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------- ! Next 34 !0! 0 ! Length 44 ! | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--- | ! 0 ! 0 ! Length 40 ! | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ! Number 1 ! Prot ID 1 ! SPI Size 0 ! Trans Cnt 4 ! | | --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! 3 ! 0 ! Length 8 ! | | Transform | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! Type 1 (IN) ! 0 ! Transform ID 3 (3DES) ! | | --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! 3 ! 0 ! Length 8 ! | | Transform | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |SA Payload | ! Type 2 (PR) ! 0 ! Transform ID 2 (SHA1) ! | Proposal | --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! 3 ! 0 ! Length 8 ! | | Transform | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! Type 3 (IN) ! 0 ! Transform ID 2 (SHA1) ! | | --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! 0 ! 0 ! Length 8 ! | | Transform | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | ! Type 4 (DH) ! 0 ! Transform ID 2 (1024) ! | | --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
Figure 52 SA Payload contents
The NUT transmits an IKE_SA_INIT response including properly formatted SA Payload containing following values (refer following figures):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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Next Payload !C! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ <Proposals> ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 53 SA Payload format
* A Next Payload field is set to KE Payload (34). * A Critical field is set to zero. * A RESERVED field is set to zero. * A Payload Length field is set to length of the current payload.
The following proposal must be included in Proposals field.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 (last) or 2 ! RESERVED ! Proposal Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Proposal # ! Protocol ID ! SPI Size !# of Transforms! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ SPI (variable) ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ <Transforms> ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 54 Proposal sub-structure format
Proposal #1 * A 0 or 2 field is set to zero if this structure is the last proposal, otherwise set to 2. * A RESREVD field is set to zero. * A Proposal Length field is set to length of this proposal, including all transforms and attributes. It is 40 bytes for this proposal according to Common Configuration. * A Proposal # field is set to 1. * A Protocol ID field is set to IKE (1). * A SPI Size field is set to zero. * A # of Transforms field is set to 4.
A Transform field is set to following (There are 4 Transform Structures).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 (last) or 3 ! RESERVED ! Transform Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ !Transform Type ! RESERVED ! Transform ID ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ Transform Attributes ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 55 Transform sub-structure format
Transform #1 * A 0 or 3 field is set to zero if this structure is the last transform, otherwise set to 3. * A RESERVED field is set to zero. * A Transform Length set to length of the Transform Substructure including Header and Attribute. It is 8 bytes for ENCR_3DES. * A Transform Type field is set to ENCR (1). * A RESERVED field is set to zero. * A Transform ID set to ENCR_3DES (3).
Transform #2 * A 0 or 3 field is set to zero if this structure is the last transform, otherwise set to 3. * A RESERVED field is set to zero. * A Transform Length set to length of the Transform Substructure including Header and Attribute. It is 8 bytes for PRF_HMAC_SHA1. * A Transform Type field is set to PRF (2). * A RESERVED field is set to zero. * A Transform ID set to PRF_HMAC_SHA1 (2).
Transform #3 * A 0 or 3 field is set to zero if this structure is the last transform, otherwise set to 3. * A RESERVED field is set to zero. * A Transform Length set to length of the Transform Substructure including Header and Attribute. It is 8 bytes for AUTH_HMAC_SHA1. * A Transform Type field is set to INTEG (3). * A RESERVED field is set to zero. * A Transform ID set to AUTH_HMAC_SHA1 (2).
Transform #4 * A 0 or 3 field is set to zero if this structure is the last transform, otherwise set to 3. * A RESERVED field is set to zero. * A Transform Length set to length of the Transform Substructure including Header and Attribute. It is 8 bytes for 1024 MODP Group. * A Transform Type field is set to D-H (4). * A RESERVED field is set to zero. * A Transform ID set to Group2 (2).
Part C Step 6: Judgment #1 The NUT transmits an IKE_SA_INIT response including properly formatted KE Payload containing following values:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Next Payload !C! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! DH Group # ! RESERVED ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ Key Exchange Data ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 56 KE Payload format
* A Next Payload field is set to Nonce Payload (40). * A Critical field is set to zero. * A RESERVED field is set to zero. * A Payload Length field is set to length of the current payload. It is 136 bytes for Group 2. * A DH Group field is set to Group2 (2). * A RESERVED field is set to zero. * A Key Exchange Data field is set to Diffie-Hellman public value. The length of the Key Exchange Data field must be equal to 1024bit. * The length of the Key Exchange Data field must be equal to 1024bit.
Part D Step 8: Judgment #4 The NUT transmits an IKE_SA_INIT response including properly formatted Nonce Payload containing following values:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! Next Payload !C! RESERVED ! Payload Length ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ! ! ~ Nonce Data ~ ! ! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 57 Nonce Payload format
* A Next Payload field is set to zero. * A Critical field is set to zero. * A RESERVED field is set to zero. * A Payload Length field is set to length of the current payload. * A Nonce Data field is set to random data generated by the transmitting entity. * The size of the Nonce must between 16 and 256 octets.
* IKE_SA_INIT response has following packet format. It may have additional payloads described below. Additional payloads can be ignored by this test. The order of payload may be different from this sample.
SA, KE, Nr, [N(NAT_DETECTION_SOURCE_IP), N(NAT_DETECTION_DESTINATION_IP)], [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], [V+]
* Each of transforms can be located in the any order.