IPSec
IPSec provides the capability to
secure communications across a
LAN, across private and public
wide area networks (WANs) and
across the Internet
1
Usability and Security
Determine
where on this
line your
organization
needs lie
Convenience
/ Usability
0 Security 2
Services, Mechanisms,
Algorithms
A typical security protocol provides
one or more services
Services are built from mechanisms
Mechanisms are implemented using
algorithms
3
Security in the Internet
Architecture
Lack of security in the Internet
Architecture
Security was left up to the
applications
With the passage of time it was
realized that universal security at the
IP level will become a need and not a
luxury
4
Security A p p lic a tio n E m a il - S /M IM E A p p lic a tio n
Protocol P r e s e n ta tio n P r e s e n ta tio n
Layers S e s s io n SSL S e s s io n
•The further T ra n s p o rt T ra n s p o rt
down you go, N e tw o rk IP S e c N e tw o rk
the more
transparent it is D a ta lin k PPP - ECP D a ta lin k
P h y s ic a l P h y s ic a l
•The further up
you go, the
E n c r y p tin g E n c r y p tin g
easier it is to N IC
P H Y S IC A L N E T W O R K
N IC
deploy
5
Some Pros of Security at the IP
Level
Can be end to end.
Could be hw/sw supported (hw
support for encryption)
Can shield host apps giving them
crypto/security at the IP level
Can extend security across
insecure areas
6
What is IPSec?
Extensions to the basic Internet
Protocol to provide security functions
at the IP level
Applicable to both IP Version 4 and
IP Version 6
IPSec available in Windows 2000,
Linux, Cisco Routers, etc.
7
What is IPSec?
IPsec is designed to provide interoperable, high
quality, cryptographically-based security for IPv4
and IPv6.
The set of security services offered includes
access control, connectionless integrity, data
origin authentication, protection against replays
(a form of partial sequence integrity),
confidentiality (encryption), and limited traffic
flow confidentiality.
These services are provided at the IP layer,
offering protection for IP and/or upper layer
protocols.
8
How do you know IPSec is
there?
AH/ESP new IP layer protocols (50/51) with
either
• 1. an IP datagram encapsulated in them
(tunnel mode)
• 2. TCP/UDP and the rest above them
(transport mode)
Every packet may have AH/ESP applied to
them:
• AH for authentication;
• ESP for encryption and authentication, this is
bulk/perpacket encryption/authentication
9
IP Security Usage Scenario
10
Applications of IPSec
Secure Branch Office Connectivity
Over the Internet
Secure Remote Access Over the
Internet
Establishing Extranet and Intranet
Connectivity with Business partners
Enhancing Electronic Commerce
Security
11
IP Security Architecture
Defined by IPSec Documents (RFCs)
IP Security Protocol Working Group of IETF
IP Security Evolving with the passage of
time
IPSec provides security services at the IP
layer by enabling a system to select
required security protocols, determine the
algorithms to use for the services, and put
in place any cryptographic keys required.
12
IPSec Documents Overview
Relevant RFCs
RFC 1825: An overview of a
security architecture
RFC 1826: Description of a
packet authentication
extension to IP
RFC 1828: A specific
authentication mechanism
RFC 1827: Description of a
packet encryption extension
to IP
RFC 1829: A specific
encryption mechanism
13
AH and ESP
AH
• The Authentication Header provides support for
data integrity and authentication of IP packets
ESP
• The Encapsulating Security Payload provides
confidentiality services, including confidentiality
of message contents and limited traffic flow
confidentiality. As an optional feature, ESP can
also provide the same authentication service as
AH.
14
IPSec Services
15
Security Policies, Security Associations
and Associated Databases
To manage all of this complexity,
IPSec is equipped with a flexible,
powerful way of specifying how
different types of datagrams should
be handled. To understand how this
works, we must first define two
important logical concepts:
• Security Policies
• Security Associations
16
Security Policies
A security policy is a rule that is programmed into
the IPSec implementation that tells it how to
process different datagrams received by the
device. For example, security policies are used to
decide if a particular packet needs to be
processed by IPSec or not; those that do not
bypass AH and ESP entirely. If security is
required, the security policy provides general
guidelines for how it should be provided, and if
necessary, links to more specific detail.
Security policies for a device are stored in the
device's Security Policy Database(SPD).
17
Security Associations
A Security Association (SA) is a set of
security information that describes a
particular kind of secure connection
between one device and another. You can
consider it a "contract", if you will, that
specifies the particular security
mechanisms that are used for secure
communications between the two.
A device's security associations are
contained in its Security Association
Database (SAD).
18
Difference b/w SPD & SAD
It's often hard to distinguish the SPD and
the SAD, since they are similar in concept.
The main difference between them is that
security policies are general while security
associations are more specific. To
determine what to do with a particular
datagram, a device first checks the SPD.
The security policies in the SPD may
reference a particular security association
in the SAD. If so, the device will look up
that security association and use it for
processing the datagram.
19
SA Selectors
One issue we haven't covered yet is how a device
determines what policies or SAs to use for a
specific datagram. Again here, IPSec defines a
very flexible system that lets each security
association define a set of rules for choosing
datagrams that the SA applies to. Each of these
rule sets is called a selector. For example, a
selector might be defined that says that a
particular range of values in the Source Address
of a datagram, combined with another value in
the Destination Address, means a specific SA
must be used for the datagram.
20
Security Association Triples and the
Security Parameter Index (SPI)
Security associations don't actually have names, however.
They are instead defined by a set of three parameters,
called a triple:
Security Parameter Index (SPI): A 32-bit number that
is chosen to uniquely identify a particular SA for any
connected device. The SPI is placed in AH or ESP
datagrams and thus links each secure datagram to the
security association. It is used by the recipient of a
transmission so it knows what SA governs the datagram.
IP Destination Address: The address of the device for
whom the SA is established.
Security Protocol Identifier: Specifies whether this
association is for AH or ESP. If both are in use with this
device they have separate SAs.
21
Transport and Tunnel Modes
Transport Mode provides a secure connection
between two endpoints as it encapsulates IP's
payload, while Tunnel Mode encapsulates the
entire IP packet to provide a virtual "secure hop"
between two gateways. The latter is used to form
a traditional VPN, where the tunnel generally
creates a secure tunnel across an untrusted
Internet.
Tunnel Mode means that one outgoing IP packet
is encapsulated in another packet with typically a
different IP destination
Tunnels can be
(1) Router to Router (2) Router to host or host to
router (3) host to host
22
Tunnel Mode and Transport
Mode Functionality
23
Authentication Header
24
Authentication Header details
25
26
ESP format
27
28
Services Provided by AH
Anti-Replay Service
Integrity Check Value
29
Anti-Replay Service
Sequence number is used for the anti-replay
service
Relationship of SA and sequence number
A sequence number can cycle upto 232 -1 and
then to zero.
A window mantained of size W with W most
typically being 64
The protocol describes means to determine its
correctness in or above the window.
30
Anti-Replay Service
31
Calculating AH ICV
32
Transport and Tunnel Modes
33
Scope of Authentication Header
34
Scope of Authentication Header
35
Encapsulating Security Payload
- ESP
ESP Services
• Confidentiality
• Authentication Services
ESP Format
• SPI
• SN
• PD
• Padding
• Pad Length
• Next Header
• Authentication Data
36
Transport-level security
37
A virtual private network via
Tunnel Mode
38
Combining Security
Associations
39
Combining Security
Associations
40
Combining Security
Associations
41
Combining Security
Associations
42
Key Management
Involves the determination and
distribution of secret keys
Typically four keys are used between
two applications
Two types of key management
• Manual
• Automated
43
ISAKMP
•The default
automated key
management
protocol from
IPSec is referred to
as
ISAKMP/Oakley
•Oakley is a
refinement of
Diffie Hellman
Key Exchange
Protocol
44
ISAKMP Payload Types
45
Conclusion
IPSec provides Universal IP level security
for all applications
Two choices are available AH and ESP
IPSec can be used in a transport mode for
end to end authentication and encryption or
in tunnel mode for router to router
authentication and encryption
IPSec can be implemented IPV4 as options
and is a required part of the implementation
of IPV6
46