<s>
In	O
computing	O
,	O
Internet	B-Protocol
Protocol	I-Protocol
Security	I-Protocol
(	O
IPsec	B-Protocol
)	O
is	O
a	O
secure	O
network	O
protocol	B-Protocol
suite	I-Protocol
that	O
authenticates	O
and	O
encrypts	O
packets	B-Protocol
of	O
data	O
to	O
provide	O
secure	O
encrypted	O
communication	O
between	O
two	O
computers	O
over	O
an	O
Internet	B-Protocol
Protocol	I-Protocol
network	O
.	O
</s>
<s>
It	O
is	O
used	O
in	O
virtual	B-Application
private	I-Application
networks	I-Application
(	O
VPNs	B-Application
)	O
.	O
</s>
<s>
IPsec	B-Protocol
includes	O
protocols	O
for	O
establishing	O
mutual	O
authentication	O
between	O
agents	O
at	O
the	O
beginning	O
of	O
a	O
session	B-Protocol
and	O
negotiation	O
of	O
cryptographic	O
keys	O
to	O
use	O
during	O
the	O
session	B-Protocol
.	O
</s>
<s>
IPsec	B-Protocol
can	O
protect	O
data	O
flows	O
between	O
a	O
pair	O
of	O
hosts	O
(	O
host-to-host	O
)	O
,	O
between	O
a	O
pair	O
of	O
security	O
gateways	O
(	O
network-to-network	O
)	O
,	O
or	O
between	O
a	O
security	O
gateway	O
and	O
a	O
host	O
(	O
network-to-host	O
)	O
.	O
</s>
<s>
IPsec	B-Protocol
uses	O
cryptographic	O
security	O
services	O
to	O
protect	O
communications	O
over	O
Internet	B-Protocol
Protocol	I-Protocol
(	O
IP	O
)	O
networks	O
.	O
</s>
<s>
It	O
supports	O
network-level	O
peer	O
authentication	O
,	O
data	B-Error_Name
origin	I-Error_Name
authentication	I-Error_Name
,	O
data	O
integrity	O
,	O
data	O
confidentiality	O
(	O
encryption	O
)	O
,	O
and	O
replay	O
protection	O
(	O
protection	O
from	O
replay	O
attacks	O
)	O
.	O
</s>
<s>
The	O
initial	O
IPv4	B-Protocol
suite	O
was	O
developed	O
with	O
few	O
security	O
provisions	O
.	O
</s>
<s>
As	O
a	O
part	O
of	O
the	O
IPv4	B-Protocol
enhancement	O
,	O
IPsec	B-Protocol
is	O
a	O
layer	B-Application
3	I-Application
OSI	O
model	O
or	O
internet	B-Protocol
layer	I-Protocol
end-to-end	O
security	O
scheme	O
.	O
</s>
<s>
In	O
contrast	O
,	O
while	O
some	O
other	O
Internet	O
security	O
systems	O
in	O
widespread	O
use	O
operate	O
above	O
the	O
network	B-Application
layer	I-Application
,	O
such	O
as	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
(	O
TLS	O
)	O
that	O
operates	O
above	O
the	O
transport	B-Architecture
layer	I-Architecture
and	O
Secure	B-Protocol
Shell	I-Protocol
(	O
SSH	B-Protocol
)	O
that	O
operates	O
at	O
the	O
application	B-Application
layer	I-Application
,	O
IPsec	B-Protocol
can	O
automatically	O
secure	O
applications	O
at	O
the	O
internet	B-Protocol
layer	I-Protocol
.	O
</s>
<s>
Starting	O
in	O
the	O
early	O
1970s	O
,	O
the	O
Advanced	O
Research	O
Projects	O
Agency	O
sponsored	O
a	O
series	O
of	O
experimental	O
ARPANET	B-Protocol
encryption	I-Protocol
devices	I-Protocol
,	O
at	O
first	O
for	O
native	O
ARPANET	O
packet	B-Protocol
encryption	O
and	O
subsequently	O
for	O
TCP/IP	B-Protocol
packet	B-Protocol
encryption	O
;	O
some	O
of	O
these	O
were	O
certified	O
and	O
fielded	O
.	O
</s>
<s>
The	O
work	O
was	O
openly	O
published	O
from	O
about	O
1988	O
by	O
NIST	O
and	O
,	O
of	O
these	O
,	O
Security	O
Protocol	O
at	O
Layer	B-Application
3	I-Application
(	O
SP3	O
)	O
would	O
eventually	O
morph	O
into	O
the	O
ISO	O
standard	O
Network	B-Application
Layer	I-Application
Security	O
Protocol	O
(	O
NLSP	O
)	O
.	O
</s>
<s>
In	O
1992	O
,	O
the	O
US	O
Naval	O
Research	O
Laboratory	O
(	O
NRL	O
)	O
was	O
funded	O
by	O
DARPA	O
CSTO	O
to	O
implement	O
IPv6	B-Protocol
and	O
to	O
research	O
and	O
implement	O
IP	O
encryption	O
in	O
4.4	O
BSD	B-Operating_System
,	O
supporting	O
both	O
SPARC	O
and	O
x86	O
CPU	O
architectures	O
.	O
</s>
<s>
Under	O
NRL	O
's	O
DARPA-funded	O
research	O
effort	O
,	O
NRL	O
developed	O
the	O
IETF	O
standards-track	O
specifications	O
(	O
RFC	O
1825	O
through	O
RFC	O
1827	O
)	O
for	O
IPsec	B-Protocol
.	O
</s>
<s>
NRL	O
's	O
IPsec	B-Protocol
implementation	O
was	O
described	O
in	O
their	O
paper	O
in	O
the	O
1996	O
USENIX	B-Operating_System
Conference	I-Operating_System
Proceedings	O
.	O
</s>
<s>
NRL	O
's	O
open-source	O
IPsec	B-Protocol
implementation	O
was	O
made	O
available	O
online	O
by	O
MIT	O
and	O
became	O
the	O
basis	O
for	O
most	O
initial	O
commercial	O
implementations	O
.	O
</s>
<s>
The	O
Internet	O
Engineering	O
Task	O
Force	O
(	O
IETF	O
)	O
formed	O
the	O
IP	B-Protocol
Security	I-Protocol
Working	O
Group	O
in	O
1992	O
to	O
standardize	O
openly	O
specified	O
security	O
extensions	O
to	O
IP	O
,	O
called	O
IPsec	B-Protocol
.	O
</s>
<s>
During	O
the	O
IPsec	B-Protocol
workshops	O
,	O
the	O
NRL	O
's	O
standards	O
and	O
Cisco	O
and	O
TIS	O
 '	O
software	O
are	O
standardized	O
as	O
the	O
public	O
references	O
,	O
published	O
as	O
RFC-1825	O
through	O
RFC-1827	O
.	O
</s>
<s>
The	O
IPsec	B-Protocol
is	O
an	O
open	O
standard	O
as	O
a	O
part	O
of	O
the	O
IPv4	B-Protocol
suite	O
.	O
</s>
<s>
IPsec	B-Protocol
uses	O
the	O
following	O
protocols	O
to	O
perform	O
various	O
functions	O
:	O
</s>
<s>
Authentication	O
Headers	O
(	O
AH	O
)	O
provides	O
connectionless	O
data	O
integrity	O
and	O
data	B-Error_Name
origin	I-Error_Name
authentication	I-Error_Name
for	O
IP	O
datagrams	B-Protocol
and	O
provides	O
protection	O
against	O
replay	O
attacks	O
.	O
</s>
<s>
Encapsulating	O
Security	O
Payloads	O
(	O
ESP	O
)	O
provides	O
confidentiality	O
,	O
connectionless	O
data	O
integrity	O
,	O
data	B-Error_Name
origin	I-Error_Name
authentication	I-Error_Name
,	O
an	O
anti-replay	O
service	O
(	O
a	O
form	O
of	O
partial	O
sequence	O
integrity	O
)	O
,	O
and	O
limited	O
traffic-flow	O
confidentiality	O
.	O
</s>
<s>
Internet	B-Protocol
Security	I-Protocol
Association	I-Protocol
and	I-Protocol
Key	I-Protocol
Management	I-Protocol
Protocol	I-Protocol
(	O
ISAKMP	B-Protocol
)	O
provides	O
a	O
framework	O
for	O
authentication	O
and	O
key	O
exchange	O
,	O
with	O
actual	O
authenticated	O
keying	O
material	O
provided	O
either	O
by	O
manual	O
configuration	O
with	O
pre-shared	O
keys	O
,	O
Internet	B-Protocol
Key	I-Protocol
Exchange	I-Protocol
(	O
IKE	B-Protocol
and	O
IKEv2	B-Protocol
)	O
,	O
Kerberized	B-Protocol
Internet	I-Protocol
Negotiation	I-Protocol
of	I-Protocol
Keys	I-Protocol
(	O
KINK	O
)	O
,	O
or	O
IPSECKEY	O
DNS	B-Protocol
records	I-Protocol
.	O
</s>
<s>
The	O
purpose	O
is	O
to	O
generate	O
the	O
security	B-Protocol
associations	I-Protocol
(	O
SA	O
)	O
with	O
the	O
bundle	O
of	O
algorithms	O
and	O
parameters	O
necessary	O
for	O
AH	O
and/or	O
ESP	O
operations	O
.	O
</s>
<s>
The	O
Security	O
Authentication	O
Header	O
(	O
AH	O
)	O
was	O
developed	O
at	O
the	O
US	O
Naval	O
Research	O
Laboratory	O
in	O
the	O
early	O
1990s	O
and	O
is	O
derived	O
in	O
part	O
from	O
previous	O
IETF	O
standards	O
 '	O
work	O
for	O
authentication	O
of	O
the	O
Simple	B-Protocol
Network	I-Protocol
Management	I-Protocol
Protocol	I-Protocol
(	O
SNMP	B-Protocol
)	O
version	O
2	O
.	O
</s>
<s>
Authentication	O
Header	O
(	O
AH	O
)	O
is	O
a	O
member	O
of	O
the	O
IPsec	B-Protocol
protocol	B-Protocol
suite	I-Protocol
.	O
</s>
<s>
AH	O
ensures	O
connectionless	O
integrity	O
by	O
using	O
a	O
hash	B-Error_Name
function	I-Error_Name
and	O
a	O
secret	O
shared	B-Algorithm
key	I-Algorithm
in	O
the	O
AH	O
algorithm	O
.	O
</s>
<s>
AH	O
also	O
guarantees	O
the	O
data	O
origin	O
by	O
authenticating	O
IP	O
packets	B-Protocol
.	O
</s>
<s>
Optionally	O
a	O
sequence	O
number	O
can	O
protect	O
the	O
IPsec	B-Protocol
packet	B-Protocol
's	O
contents	O
against	O
replay	O
attacks	O
,	O
using	O
the	O
sliding	O
window	O
technique	O
and	O
discarding	O
old	O
packets	B-Protocol
.	O
</s>
<s>
In	O
IPv4	B-Protocol
,	O
AH	O
prevents	O
option-insertion	O
attacks	O
.	O
</s>
<s>
In	O
IPv6	B-Protocol
,	O
AH	O
protects	O
both	O
against	O
header	O
insertion	O
attacks	O
and	O
option	O
insertion	O
attacks	O
.	O
</s>
<s>
In	O
IPv4	B-Protocol
,	O
the	O
AH	O
protects	O
the	O
IP	O
payload	O
and	O
all	O
header	O
fields	O
of	O
an	O
IP	O
datagram	B-Protocol
except	O
for	O
mutable	O
fields	O
(	O
i.e.	O
</s>
<s>
those	O
that	O
might	O
be	O
altered	O
in	O
transit	O
)	O
,	O
and	O
also	O
IP	O
options	O
such	O
as	O
the	O
IP	B-Protocol
Security	I-Protocol
Option	O
(	O
RFC	O
1108	O
)	O
.	O
</s>
<s>
Mutable	O
(	O
and	O
therefore	O
unauthenticated	O
)	O
IPv4	B-Protocol
header	O
fields	O
are	O
DSCP/ToS	O
,	O
ECN	O
,	O
Flags	O
,	O
Fragment	B-Protocol
Offset	B-General_Concept
,	O
TTL	B-Protocol
and	O
Header	B-Protocol
Checksum	I-Protocol
.	O
</s>
<s>
In	O
IPv6	B-Protocol
,	O
the	O
AH	O
protects	O
most	O
of	O
the	O
IPv6	B-Protocol
base	O
header	O
,	O
AH	O
itself	O
,	O
non-mutable	O
extension	O
headers	O
after	O
the	O
AH	O
,	O
and	O
the	O
IP	O
payload	O
.	O
</s>
<s>
Protection	O
for	O
the	O
IPv6	B-Protocol
header	O
excludes	O
the	O
mutable	O
fields	O
:	O
DSCP	O
,	O
ECN	O
,	O
Flow	O
Label	O
,	O
and	O
Hop	B-Protocol
Limit	I-Protocol
.	O
</s>
<s>
AH	O
operates	O
directly	O
on	O
top	O
of	O
IP	O
,	O
using	O
IP	B-Protocol
protocol	I-Protocol
number	I-Protocol
51	I-Protocol
.	O
</s>
<s>
The	O
following	O
AH	O
packet	B-Protocol
diagram	O
shows	O
how	O
an	O
AH	O
packet	B-Protocol
is	O
constructed	O
and	O
interpreted	O
:	O
</s>
<s>
Authentication	O
Header	O
format	O
Offsets	B-General_Concept
Octet16	O
0	O
1	O
2	O
3	O
Octet16	O
Bit10	O
0	O
1	O
2	O
3	O
4	O
5	O
6	O
7	O
8	O
9	O
10	O
11	O
12	O
13	O
14	O
15	O
16	O
17	O
18	O
19	O
20	O
21	O
22	O
23	O
24	O
25	O
26	O
27	O
28	O
29	O
30	O
31	O
0	O
0Next	O
HeaderPayload	O
LenReserved	O
4	O
32Security	O
Parameters	O
Index	O
(	O
SPI	O
)	O
8	O
64Sequence	O
Number	O
C	O
96Integrity	O
Check	O
Value	O
(	O
ICV	O
)	O
...	O
...	O
...	O
</s>
<s>
The	O
value	O
is	O
taken	O
from	O
the	O
list	B-Protocol
of	I-Protocol
IP	I-Protocol
protocol	I-Protocol
numbers	I-Protocol
.	O
</s>
<s>
Although	O
the	O
size	O
is	O
measured	O
in	O
4-octet	O
units	O
,	O
the	O
length	O
of	O
this	O
header	O
needs	O
to	O
be	O
a	O
multiple	O
of	O
8	O
octets	O
if	O
carried	O
in	O
an	O
IPv6	B-Protocol
packet	B-Protocol
.	O
</s>
<s>
This	O
restriction	O
does	O
not	O
apply	O
to	O
an	O
Authentication	O
Header	O
carried	O
in	O
an	O
IPv4	B-Protocol
packet	B-Protocol
.	O
</s>
<s>
Security	O
Parameters	O
Index	O
(	O
32	O
bits	O
)	O
Arbitrary	O
value	O
which	O
is	O
used	O
(	O
together	O
with	O
the	O
destination	O
IP	O
address	O
)	O
to	O
identify	O
the	O
security	B-Protocol
association	I-Protocol
of	O
the	O
receiving	O
party	O
.	O
</s>
<s>
Sequence	O
Number	O
(	O
32	O
bits	O
)	O
A	O
monotonic	O
strictly	O
increasing	O
sequence	O
number	O
(	O
incremented	O
by	O
1	O
for	O
every	O
packet	B-Protocol
sent	O
)	O
to	O
prevent	O
replay	O
attacks	O
.	O
</s>
<s>
When	O
replay	O
detection	O
is	O
enabled	O
,	O
sequence	O
numbers	O
are	O
never	O
reused	O
,	O
because	O
a	O
new	O
security	B-Protocol
association	I-Protocol
must	O
be	O
renegotiated	O
before	O
an	O
attempt	O
to	O
increment	O
the	O
sequence	O
number	O
beyond	O
its	O
maximum	O
value	O
.	O
</s>
<s>
It	O
may	O
contain	O
padding	O
to	O
align	O
the	O
field	O
to	O
an	O
8-octet	O
boundary	O
for	O
IPv6	B-Protocol
,	O
or	O
a	O
4-octet	O
boundary	O
for	O
IPv4	B-Protocol
.	O
</s>
<s>
This	O
ESP	O
was	O
originally	O
derived	O
from	O
the	O
US	O
Department	O
of	O
Defense	O
SP3D	O
protocol	O
,	O
rather	O
than	O
being	O
derived	O
from	O
the	O
ISO	O
Network-Layer	B-Application
Security	O
Protocol	O
(	O
NLSP	O
)	O
.	O
</s>
<s>
Encapsulating	O
Security	O
Payload	O
(	O
ESP	O
)	O
is	O
a	O
member	O
of	O
the	O
IPsec	B-Protocol
protocol	B-Protocol
suite	I-Protocol
.	O
</s>
<s>
It	O
provides	O
origin	O
authenticity	B-Error_Name
through	O
source	O
authentication	O
,	O
data	O
integrity	O
through	O
hash	B-Error_Name
functions	I-Error_Name
and	O
confidentiality	O
through	O
encryption	O
protection	O
for	O
IP	O
packets	B-Protocol
.	O
</s>
<s>
Unlike	O
Authentication	O
Header	O
(	O
AH	O
)	O
,	O
ESP	O
in	O
transport	B-Architecture
mode	O
does	O
not	O
provide	O
integrity	O
and	O
authentication	O
for	O
the	O
entire	O
IP	O
packet	B-Protocol
.	O
</s>
<s>
However	O
,	O
in	O
tunnel	B-Protocol
mode	I-Protocol
,	O
where	O
the	O
entire	O
original	O
IP	O
packet	B-Protocol
is	O
encapsulated	B-Application
with	O
a	O
new	O
packet	B-Protocol
header	O
added	O
,	O
ESP	O
protection	O
is	O
afforded	O
to	O
the	O
whole	O
inner	O
IP	O
packet	B-Protocol
(	O
including	O
the	O
inner	O
header	O
)	O
while	O
the	O
outer	O
header	O
(	O
including	O
any	O
outer	O
IPv4	B-Protocol
options	O
or	O
IPv6	B-Protocol
extension	O
headers	O
)	O
remains	O
unprotected	O
.	O
</s>
<s>
ESP	O
operates	O
directly	O
on	O
top	O
of	O
IP	O
,	O
using	O
IP	B-Protocol
protocol	I-Protocol
number	I-Protocol
50	O
.	O
</s>
<s>
The	O
following	O
ESP	O
packet	B-Protocol
diagram	O
shows	O
how	O
an	O
ESP	O
packet	B-Protocol
is	O
constructed	O
and	O
interpreted	O
:	O
</s>
<s>
Encapsulating	O
Security	O
Payload	O
format	O
Offsets	B-General_Concept
Octet16	O
0	O
1	O
2	O
3	O
Octet16	O
Bit10	O
0	O
1	O
2	O
3	O
4	O
5	O
6	O
7	O
8	O
9	O
10	O
11	O
12	O
13	O
14	O
15	O
16	O
17	O
18	O
19	O
20	O
21	O
22	O
23	O
24	O
25	O
26	O
27	O
28	O
29	O
30	O
31	O
0	O
0Security	O
Parameters	O
Index	O
(	O
SPI	O
)	O
4	O
32Sequence	O
Number	O
8	O
64Payload	O
data	O
...	O
...	O
...	O
...	O
...	O
...	O
</s>
<s>
Security	O
Parameters	O
Index	O
(	O
32	O
bits	O
)	O
Arbitrary	O
value	O
used	O
(	O
together	O
with	O
the	O
destination	O
IP	O
address	O
)	O
to	O
identify	O
the	O
security	B-Protocol
association	I-Protocol
of	O
the	O
receiving	O
party	O
.	O
</s>
<s>
Sequence	O
Number	O
(	O
32	O
bits	O
)	O
A	O
monotonically	O
increasing	O
sequence	O
number	O
(	O
incremented	O
by	O
1	O
for	O
every	O
packet	B-Protocol
sent	O
)	O
to	O
protect	O
against	O
replay	O
attacks	O
.	O
</s>
<s>
There	O
is	O
a	O
separate	O
counter	O
kept	O
for	O
every	O
security	B-Protocol
association	I-Protocol
.	O
</s>
<s>
Payload	O
data	O
(	O
variable	O
)	O
The	O
protected	O
contents	O
of	O
the	O
original	O
IP	O
packet	B-Protocol
,	O
including	O
any	O
data	O
used	O
to	O
protect	O
the	O
contents	O
(	O
e.g.	O
</s>
<s>
The	O
value	O
is	O
taken	O
from	O
the	O
list	B-Protocol
of	I-Protocol
IP	I-Protocol
protocol	I-Protocol
numbers	I-Protocol
.	O
</s>
<s>
It	O
may	O
contain	O
padding	O
to	O
align	O
the	O
field	O
to	O
an	O
8-octet	O
boundary	O
for	O
IPv6	B-Protocol
,	O
or	O
a	O
4-octet	O
boundary	O
for	O
IPv4	B-Protocol
.	O
</s>
<s>
The	O
IPsec	B-Protocol
protocols	O
use	O
a	O
security	B-Protocol
association	I-Protocol
,	O
where	O
the	O
communicating	O
parties	O
establish	O
shared	O
security	O
attributes	O
such	O
as	O
algorithms	O
and	O
keys	O
.	O
</s>
<s>
As	O
such	O
,	O
IPsec	B-Protocol
provides	O
a	O
range	O
of	O
options	O
once	O
it	O
has	O
been	O
determined	O
whether	O
AH	O
or	O
ESP	O
is	O
used	O
.	O
</s>
<s>
Before	O
exchanging	O
data	O
,	O
the	O
two	O
hosts	O
agree	O
on	O
which	O
symmetric	B-Algorithm
encryption	I-Algorithm
algorithm	I-Algorithm
is	O
used	O
to	O
encrypt	O
the	O
IP	O
packet	B-Protocol
,	O
for	O
example	O
AES	B-Algorithm
or	O
ChaCha20	O
,	O
and	O
which	O
hash	B-Error_Name
function	I-Error_Name
is	O
used	O
to	O
ensure	O
the	O
integrity	O
of	O
the	O
data	O
,	O
such	O
as	O
BLAKE2	B-Algorithm
or	O
SHA256	B-Algorithm
.	O
</s>
<s>
These	O
parameters	O
are	O
agreed	O
for	O
the	O
particular	O
session	B-Protocol
,	O
for	O
which	O
a	O
lifetime	O
must	O
be	O
agreed	O
and	O
a	O
session	B-Protocol
key	O
.	O
</s>
<s>
The	O
algorithm	O
for	O
authentication	O
is	O
also	O
agreed	O
before	O
the	O
data	O
transfer	O
takes	O
place	O
and	O
IPsec	B-Protocol
supports	O
a	O
range	O
of	O
methods	O
.	O
</s>
<s>
Authentication	O
is	O
possible	O
through	O
pre-shared	O
key	O
,	O
where	O
a	O
symmetric	B-Algorithm
key	I-Algorithm
is	O
already	O
in	O
the	O
possession	O
of	O
both	O
hosts	O
,	O
and	O
the	O
hosts	O
send	O
each	O
other	O
hashes	B-Error_Name
of	O
the	O
shared	B-Algorithm
key	I-Algorithm
to	O
prove	O
that	O
they	O
are	O
in	O
possession	O
of	O
the	O
same	O
key	O
.	O
</s>
<s>
IPsec	B-Protocol
also	O
supports	O
public	B-Application
key	I-Application
encryption	I-Application
,	O
where	O
each	O
host	O
has	O
a	O
public	O
and	O
a	O
private	B-Application
key	I-Application
,	O
they	O
exchange	O
their	O
public	B-Application
keys	I-Application
and	O
each	O
host	O
sends	O
the	O
other	O
a	O
nonce	O
encrypted	O
with	O
the	O
other	O
host	O
's	O
public	B-Application
key	I-Application
.	O
</s>
<s>
Alternatively	O
if	O
both	O
hosts	O
hold	O
a	O
public	B-Application
key	I-Application
certificate	O
from	O
a	O
certificate	B-Architecture
authority	I-Architecture
,	O
this	O
can	O
be	O
used	O
for	O
IPsec	B-Protocol
authentication	O
.	O
</s>
<s>
The	O
security	B-Protocol
associations	I-Protocol
of	O
IPsec	B-Protocol
are	O
established	O
using	O
the	O
Internet	B-Protocol
Security	I-Protocol
Association	I-Protocol
and	I-Protocol
Key	I-Protocol
Management	I-Protocol
Protocol	I-Protocol
(	O
ISAKMP	B-Protocol
)	O
.	O
</s>
<s>
ISAKMP	B-Protocol
is	O
implemented	O
by	O
manual	O
configuration	O
with	O
pre-shared	O
secrets	O
,	O
Internet	B-Protocol
Key	I-Protocol
Exchange	I-Protocol
(	O
IKE	B-Protocol
and	O
IKEv2	B-Protocol
)	O
,	O
Kerberized	B-Protocol
Internet	I-Protocol
Negotiation	I-Protocol
of	I-Protocol
Keys	I-Protocol
(	O
KINK	O
)	O
,	O
and	O
the	O
use	O
of	O
IPSECKEY	O
DNS	B-Protocol
records	I-Protocol
.	O
</s>
<s>
RFC	O
5386	O
defines	O
Better-Than-Nothing	O
Security	O
(	O
BTNS	O
)	O
as	O
an	O
unauthenticated	O
mode	O
of	O
IPsec	B-Protocol
using	O
an	O
extended	O
IKE	B-Protocol
protocol	O
.	O
</s>
<s>
C	O
.	O
Meadows	O
,	O
C	O
.	O
Cremers	O
,	O
and	O
others	O
have	O
used	O
formal	B-Architecture
methods	I-Architecture
to	O
identify	O
various	O
anomalies	O
which	O
exist	O
in	O
IKEv1	B-Protocol
and	O
also	O
in	O
IKEv2	B-Protocol
.	O
</s>
<s>
In	O
order	O
to	O
decide	O
what	O
protection	O
is	O
to	O
be	O
provided	O
for	O
an	O
outgoing	O
packet	B-Protocol
,	O
IPsec	B-Protocol
uses	O
the	O
Security	B-Protocol
Parameter	I-Protocol
Index	I-Protocol
(	O
SPI	O
)	O
,	O
an	O
index	O
to	O
the	O
security	B-Protocol
association	I-Protocol
database	O
(	O
SADB	O
)	O
,	O
along	O
with	O
the	O
destination	O
address	O
in	O
a	O
packet	B-Protocol
header	O
,	O
which	O
together	O
uniquely	O
identifies	O
a	O
security	B-Protocol
association	I-Protocol
for	O
that	O
packet	B-Protocol
.	O
</s>
<s>
A	O
similar	O
procedure	O
is	O
performed	O
for	O
an	O
incoming	O
packet	B-Protocol
,	O
where	O
IPsec	B-Protocol
gathers	O
decryption	O
and	O
verification	O
keys	O
from	O
the	O
security	B-Protocol
association	I-Protocol
database	O
.	O
</s>
<s>
For	O
IP	B-Protocol
multicast	I-Protocol
a	O
security	B-Protocol
association	I-Protocol
is	O
provided	O
for	O
the	O
group	O
,	O
and	O
is	O
duplicated	O
across	O
all	O
authorized	O
receivers	O
of	O
the	O
group	O
.	O
</s>
<s>
There	O
may	O
be	O
more	O
than	O
one	O
security	B-Protocol
association	I-Protocol
for	O
a	O
group	O
,	O
using	O
different	O
SPIs	O
,	O
thereby	O
allowing	O
multiple	O
levels	O
and	O
sets	O
of	O
security	O
within	O
a	O
group	O
.	O
</s>
<s>
Indeed	O
,	O
each	O
sender	O
can	O
have	O
multiple	O
security	B-Protocol
associations	I-Protocol
,	O
allowing	O
authentication	O
,	O
since	O
a	O
receiver	O
can	O
only	O
know	O
that	O
someone	O
knowing	O
the	O
keys	O
sent	O
the	O
data	O
.	O
</s>
<s>
The	O
IPsec	B-Protocol
protocols	O
AH	O
and	O
ESP	O
can	O
be	O
implemented	O
in	O
a	O
host-to-host	O
transport	B-Architecture
mode	O
,	O
as	O
well	O
as	O
in	O
a	O
network	O
tunneling	O
mode	O
.	O
</s>
<s>
In	O
transport	B-Architecture
mode	O
,	O
only	O
the	O
payload	O
of	O
the	O
IP	O
packet	B-Protocol
is	O
usually	O
encrypted	O
or	O
authenticated	O
.	O
</s>
<s>
The	O
routing	O
is	O
intact	O
,	O
since	O
the	O
IP	O
header	O
is	O
neither	O
modified	O
nor	O
encrypted	O
;	O
however	O
,	O
when	O
the	O
authentication	O
header	O
is	O
used	O
,	O
the	O
IP	O
addresses	O
cannot	O
be	O
modified	O
by	O
network	B-Protocol
address	I-Protocol
translation	I-Protocol
,	O
as	O
this	O
always	O
invalidates	O
the	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
The	O
transport	B-Architecture
and	O
application	B-Application
layers	I-Application
are	O
always	O
secured	O
by	O
a	O
hash	B-Error_Name
,	O
so	O
they	O
cannot	O
be	O
modified	O
in	O
any	O
way	O
,	O
for	O
example	O
by	O
translating	O
the	O
port	B-Protocol
numbers	I-Protocol
.	O
</s>
<s>
A	O
means	O
to	O
encapsulate	O
IPsec	B-Protocol
messages	O
for	O
NAT	B-Protocol
traversal	I-Protocol
has	O
been	O
defined	O
by	O
RFC	O
documents	O
describing	O
the	O
NAT-T	B-Protocol
mechanism	O
.	O
</s>
<s>
In	O
tunnel	B-Protocol
mode	I-Protocol
,	O
the	O
entire	O
IP	O
packet	B-Protocol
is	O
encrypted	O
and	O
authenticated	O
.	O
</s>
<s>
It	O
is	O
then	O
encapsulated	B-Application
into	O
a	O
new	O
IP	O
packet	B-Protocol
with	O
a	O
new	O
IP	O
header	O
.	O
</s>
<s>
Tunnel	B-Protocol
mode	I-Protocol
is	O
used	O
to	O
create	O
virtual	B-Application
private	I-Application
networks	I-Application
for	O
network-to-network	O
communications	O
(	O
e.g.	O
</s>
<s>
Tunnel	B-Protocol
mode	I-Protocol
supports	O
NAT	B-Protocol
traversal	I-Protocol
.	O
</s>
<s>
Cryptographic	O
algorithms	O
defined	O
for	O
use	O
with	O
IPsec	B-Protocol
include	O
:	O
</s>
<s>
HMAC-SHA1/SHA2	O
for	O
integrity	O
protection	O
and	O
authenticity	B-Error_Name
.	O
</s>
<s>
AES-CBC	O
and	O
AES-CTR	O
for	O
confidentiality	O
.	O
</s>
<s>
AES-GCM	B-Algorithm
and	O
ChaCha20-Poly1305	B-Algorithm
providing	O
confidentiality	O
and	O
authentication	O
together	O
efficiently	O
.	O
</s>
<s>
The	O
IPsec	B-Protocol
can	O
be	O
implemented	O
in	O
the	O
IP	B-Protocol
stack	I-Protocol
of	O
an	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
Various	O
IPsec	B-Protocol
capable	O
IP	B-Protocol
stacks	I-Protocol
are	O
available	O
from	O
companies	O
,	O
such	O
as	O
HP	O
or	O
IBM	O
.	O
</s>
<s>
An	O
alternative	O
is	O
so	O
called	O
bump-in-the-stack	B-Protocol
(	O
BITS	O
)	O
implementation	O
,	O
where	O
the	O
operating	B-General_Concept
system	I-General_Concept
source	O
code	O
does	O
not	O
have	O
to	O
be	O
modified	O
.	O
</s>
<s>
Here	O
IPsec	B-Protocol
is	O
installed	O
between	O
the	O
IP	B-Protocol
stack	I-Protocol
and	O
the	O
network	O
drivers	B-Application
.	O
</s>
<s>
This	O
way	O
operating	B-General_Concept
systems	I-General_Concept
can	O
be	O
retrofitted	O
with	O
IPsec	B-Protocol
.	O
</s>
<s>
However	O
,	O
when	O
retrofitting	O
IPsec	B-Protocol
the	O
encapsulation	O
of	O
IP	O
packets	B-Protocol
may	O
cause	O
problems	O
for	O
the	O
automatic	O
path	B-Protocol
MTU	I-Protocol
discovery	I-Protocol
,	O
where	O
the	O
maximum	B-Protocol
transmission	I-Protocol
unit	I-Protocol
(	O
MTU	B-Protocol
)	O
size	O
on	O
the	O
network	O
path	O
between	O
two	O
IP	O
hosts	O
is	O
established	O
.	O
</s>
<s>
If	O
a	O
host	O
or	O
gateway	O
has	O
a	O
separate	O
cryptoprocessor	O
,	O
which	O
is	O
common	O
in	O
the	O
military	O
and	O
can	O
also	O
be	O
found	O
in	O
commercial	O
systems	O
,	O
a	O
so-called	O
bump-in-the-wire	O
(	O
BITW	O
)	O
implementation	O
of	O
IPsec	B-Protocol
is	O
possible	O
.	O
</s>
<s>
When	O
IPsec	B-Protocol
is	O
implemented	O
in	O
the	O
kernel	B-Operating_System
,	O
the	O
key	O
management	O
and	O
ISAKMP/IKE	O
negotiation	O
is	O
carried	O
out	O
from	O
user	O
space	O
.	O
</s>
<s>
The	O
NRL-developed	O
and	O
openly	O
specified	O
"	O
PF_KEY	O
Key	O
Management	O
API	O
,	O
Version	O
2	O
"	O
is	O
often	O
used	O
to	O
enable	O
the	O
application-space	O
key	O
management	O
application	B-Application
to	O
update	O
the	O
IPsec	B-Protocol
security	B-Protocol
associations	I-Protocol
stored	O
within	O
the	O
kernel-space	O
IPsec	B-Protocol
implementation	O
.	O
</s>
<s>
Existing	O
IPsec	B-Protocol
implementations	I-Protocol
usually	O
include	O
ESP	O
,	O
AH	O
,	O
and	O
IKE	B-Protocol
version	O
2	O
.	O
</s>
<s>
Existing	O
IPsec	B-Protocol
implementations	I-Protocol
on	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
for	O
example	O
,	O
Solaris	B-Application
or	O
Linux	B-Application
,	O
usually	O
include	O
PF_KEY	O
version	O
2	O
.	O
</s>
<s>
Embedded	B-Architecture
IPsec	B-Protocol
can	O
be	O
used	O
to	O
ensure	O
the	O
secure	O
communication	O
among	O
applications	O
running	O
over	O
constrained	O
resource	O
systems	O
with	O
a	O
small	O
overhead	O
.	O
</s>
<s>
IPsec	B-Protocol
was	O
developed	O
in	O
conjunction	O
with	O
IPv6	B-Protocol
and	O
was	O
originally	O
required	O
to	O
be	O
supported	O
by	O
all	O
standards-compliant	O
implementations	O
of	O
IPv6	B-Protocol
before	O
RFC	O
6434	O
made	O
it	O
only	O
a	O
recommendation	O
.	O
</s>
<s>
IPsec	B-Protocol
is	O
also	O
optional	O
for	O
IPv4	B-Protocol
implementations	O
.	O
</s>
<s>
IPsec	B-Protocol
is	O
most	O
commonly	O
used	O
to	O
secure	O
IPv4	B-Protocol
traffic	O
.	O
</s>
<s>
IPsec	B-Protocol
protocols	O
were	O
originally	O
defined	O
in	O
RFC	O
1825	O
through	O
RFC	O
1829	O
,	O
which	O
were	O
published	O
in	O
1995	O
.	O
</s>
<s>
In	O
addition	O
,	O
a	O
mutual	O
authentication	O
and	O
key	O
exchange	O
protocol	O
Internet	B-Protocol
Key	I-Protocol
Exchange	I-Protocol
(	O
IKE	B-Protocol
)	O
was	O
defined	O
to	O
create	O
and	O
manage	O
security	B-Protocol
associations	I-Protocol
.	O
</s>
<s>
In	O
December	O
2005	O
,	O
new	O
standards	O
were	O
defined	O
in	O
RFC	O
4301	O
and	O
RFC	O
4309	O
which	O
are	O
largely	O
a	O
superset	O
of	O
the	O
previous	O
editions	O
with	O
a	O
second	O
version	O
of	O
the	O
Internet	B-Protocol
Key	I-Protocol
Exchange	I-Protocol
standard	O
IKEv2	B-Protocol
.	O
</s>
<s>
These	O
third-generation	O
documents	O
standardized	O
the	O
abbreviation	O
of	O
IPsec	B-Protocol
to	O
uppercase	O
“	O
IP	O
”	O
and	O
lowercase	O
“	O
sec	O
”	O
.	O
</s>
<s>
Since	O
mid-2008	O
,	O
an	O
IPsec	B-Protocol
Maintenance	O
and	O
Extensions	O
(	O
ipsecme	B-Protocol
)	O
working	O
group	O
is	O
active	O
at	O
the	O
IETF	O
.	O
</s>
<s>
There	O
are	O
allegations	O
that	O
IPsec	B-Protocol
was	O
a	O
targeted	O
encryption	O
system	O
.	O
</s>
<s>
The	O
OpenBSD	B-Operating_System
IPsec	B-Protocol
stack	O
came	O
later	O
on	O
and	O
also	O
was	O
widely	O
copied	O
.	O
</s>
<s>
In	O
a	O
letter	O
which	O
OpenBSD	B-Operating_System
lead	O
developer	O
Theo	O
de	O
Raadt	O
received	O
on	O
11	O
Dec	O
2010	O
from	O
Gregory	O
Perry	O
,	O
it	O
is	O
alleged	O
that	O
Jason	O
Wright	O
and	O
others	O
,	O
working	O
for	O
the	O
FBI	O
,	O
inserted	O
"	O
a	O
number	O
of	O
backdoors	O
and	O
side	O
channel	O
key	O
leaking	O
mechanisms	O
"	O
into	O
the	O
OpenBSD	B-Operating_System
crypto	O
code	O
.	O
</s>
<s>
…	O
I	O
will	O
state	O
clearly	O
that	O
I	O
did	O
not	O
add	O
backdoors	O
to	O
the	O
OpenBSD	B-Operating_System
operating	B-General_Concept
system	I-General_Concept
or	O
the	O
OpenBSD	B-Operating_System
Cryptographic	O
Framework	O
(	O
OCF	O
)	O
.	O
"	O
</s>
<s>
An	O
alternative	O
explanation	O
put	O
forward	O
by	O
the	O
authors	O
of	O
the	O
Logjam	B-Protocol
attack	I-Protocol
suggests	O
that	O
the	O
NSA	O
compromised	O
IPsec	B-Protocol
VPNs	B-Application
by	O
undermining	O
the	O
Diffie-Hellman	B-Protocol
algorithm	O
used	O
in	O
the	O
key	O
exchange	O
.	O
</s>
<s>
As	O
of	O
May	O
2015	O
,	O
90%	O
of	O
addressable	O
IPsec	B-Protocol
VPNs	B-Application
supported	O
the	O
second	O
Oakley	O
group	O
as	O
part	O
of	O
IKE	B-Protocol
.	O
</s>
<s>
A	O
second	O
alternative	O
explanation	O
that	O
was	O
put	O
forward	O
was	O
that	O
the	O
Equation	O
Group	O
used	O
zero-day	O
exploits	O
against	O
several	O
manufacturers	O
 '	O
VPN	B-Application
equipment	O
which	O
were	O
validated	O
by	O
Kaspersky	O
Lab	O
as	O
being	O
tied	O
to	O
the	O
Equation	O
Group	O
and	O
validated	O
by	O
those	O
manufacturers	O
as	O
being	O
real	O
exploits	O
,	O
some	O
of	O
which	O
were	O
zero-day	O
exploits	O
at	O
the	O
time	O
of	O
their	O
exposure	O
.	O
</s>
<s>
Furthermore	O
,	O
IPsec	B-Protocol
VPNs	B-Application
using	O
"	O
Aggressive	O
Mode	O
"	O
settings	O
send	O
a	O
hash	B-Error_Name
of	O
the	O
PSK	O
in	O
the	O
clear	O
.	O
</s>
