When a clear-text packet arrives on a Juniper Networks device that requires tunneling, and no active Phase 2 SA exists for that tunnel, JUNOS software begins IKE negotiations and drops the packet. The source and destination addresses in the IP packet header are those of the local and remote IKE gateways, respectively. In the IP packet payload, there is a UDP segment encapsulating an ISAKMP (IKE) packet. The format for IKE packets is the same for Phase 1 and Phase 2. See Figure 68.
Meanwhile, the source host has resent the dropped packet. Typically, by the time the second packet arrives, IKE negotiations are complete and JUNOS software protects it—and all subsequent packets in the session—with IPsec before forwarding it.
Figure 68: IKE Packet for Phases 1 and 2

The Next Payload field contains a number indicating one of the following payload types:
The IDs are IKE ID types such as FQDN, U-FQDN, IP address, and ASN.1_DN.
Each ISAKMP payload begins with the same generic header, as shown in Figure 69.
Figure 69: Generic ISAKMP Payload Header

There can be multiple ISAKMP payloads chained together, with each subsequent payload type indicated by the value in the Next Header field. A value of 0000 indicates the last ISAKMP payload. See Figure 70 for an example.
Figure 70: ISAKMP Header with Generic ISAKMP Payloads
