text: whiat is ipsec? how it is working?   short for ip security, a set of protocols developed by the ietf to support secure exchange of packets at the ip layer. ipsec has been deployed widely to implement virtual private networks (vpns).  ipsec supports two encryption modes: transport and tunnel. transport mode encrypts only the data portion (payload) of each packet, but leaves the header untouched. the more secure tunnel mode encrypts both the header and the payload. on the receiving side, an ipsec-compliant device decrypts each packet.   for ipsec to work, the sending and receiving devices must share a public key. this is accomplished through a protocol known as internet security association and key management protocol/oakley (isakmp/oakley), which allows the receiver to obtain a public key and authenticate the sender using digital certificates.    also:  ipsec (ip security) is a standard for securing internet protocol (ip) communications by encrypting and/or authenticating all ip packets. ipsec provides security at the network layer.  ipsec is a set of cryptographic protocols for (1) securing packet flows and (2) key exchange. of the former, there are two: encapsulating security payload (esp) provides authentication, data confidentiality and message integrity; authentication header (ah) provides authentication and message integrity, but does not offer confidentiality. originally ah was only used for integrity and esp was used only for encryption; authentication functionality was added subsequently to esp. currently only one key exchange protocol is defined, the ike (internet key exchange) protocol.  ipsec protocols operate at the network layer, layer 3 of the osi model. other internet security protocols in widespread use, such as ssl and tls, operate from the transport layer up (osi layers 4 - 7). this makes ipsec more flexible, as it can be used for protecting both tcp and udp-based protocols, but increases its complexity and processing overhead, as it cannot rely on tcp (layer 4 osi model) to manage reliability and fragmentation.