IPsec Packet by Packet
Phase-1 of IPSEC In 1st two message it negotiate proposal  and IKE version  and NAT-T capability  Proposal/transform >> HAGLE - HASH, AUTH, DH Group, Lifetime ,Encryption   1st Message IPSec main mode: SA Payload  Proposal payload Trasform payload SPI/cookie 2nd IPsec Main mode message 3rd Message IPSec main mode: In 3rd and 4th message, it will do  key exchange and  Nonce and  NAT-D (IP & Port hash) DH key exchange :: DH algo used to agree on same shared secret and generate key material DH public value is calculated  (public value is mathematical calculation of private keys) -->>It generate public and private key's --->>It share public key's (x^b) (x^b)==>g^a mod p (MOD(generator of private key=a)) g^ab=>(x^b)^a mod p (large prime no) ==>Each side has their  public key and nonce  ( Ni_b is the Initiator's Nonce, and Nr_B is the Responder's Nonce) ==>It generate   SKEYID  = prf(pre-shared-key, Ni_b | Nr_b) The See...