Ipsec
Ipsec
Ipsec
IP Security
IPSec
General IP Security mechanisms
Provides
authentication
confidentiality
key management
IPSec Uses
Transparency
Benefits of IPSec
In a firewall/router provides strong security to
all traffic crossing the perimeter
In a firewall/router is resistant to bypass
Is below transport layer, hence transparent to
applications
Can be transparent to end users
Can provide security for individual users
Secures routing architecture
IP Security Architecture
Specification is quite complex
Defined in numerous RFCs
Authentication
Header (AH)
Encapsulating Security Payload (ESP)
Encrypted Tunnel
Gateway 1
pted
y
r
c
n
Une
New IP
Header
Gateway 2
Encrypted
AH or ESP
Header
Orig IP
Header
Unen
crypt
ed
TCP Data
Transport Mode
IP
IP
IPSec
header options header
Real IP
destination
Higher
layer protocol
ESP
AH
Tunnel Mode
Outer IP IPSec Inner IP
Higher
header header header layer protocol
Destination
IPSec
entity
ESP
Real IP destination
AH
Security Association - SA
Defined by 3 parameters:
Security Parameters Index (SPI)
IP Destination Address
Security Protocol Identifier
SA Database - SAD
Discard
Do not let in or out
Bypass
Outbound: do not apply IPSec
Inbound: do not expect IPSec
applied
dynamically
Inbound processing: drop packet
Outbound Processing
Outbound packet (on A)
A
IP Packet
Is it for IPSec?
If so, which policy
entry to select?
SPD
(Policy)
SA
Database
IPSec processing
Determine the SA
and its SPI
Send to B
Inbound Processing
Inbound packet (on B)
From A
SPI & Packet
SA Database
SPD
(Policy)
Use SPI to
index the SAD
Original IP Packet
un-process
Authenticated Header
Data integrity
Entire packet has not been tampered with
Authentication
Can trust IP address source
Use MAC to authenticate
Anti-replay feature
Integrity check value
Reserved
SPI
Sequence Number
ICV
IPSec protocol
original packet
Tunnel Mode
Cover entire
original packet
Original
Transport Mode
Good for host to
host traffic
Tunnel Mode
Good for VPNs,
gateway to gateway
security
Pad as necessary
Encrypt result [payload, padding, pad length,
next header]
Apply authentication (optional)
SPI
Sequence Number
Encrypted
Authentication coverage
Original IP Header
Next
Header
Packet decryption
Decrypt quantity [ESP payload,padding,pad
NATs
Prevalence of NATs
NAT types
All use net-10/8 (10.*.*.*) or 192.168/16
Address translation
Address-and-port translation (NAPT)
NAT Example
IAPs Point of Presence
Backup Slides
bundle
may terminate at different or same
endpoints
combined by
transport adjacency
iterated tunneling
SA Bundle
More than 1 SA can apply to a packet
Example: ESP does not authenticate new IP
header. How to authenticate?
original packet
Use 2nd SA to apply AH
selected
Sequence number should be the first ESP check
on a packet upon looking up an SA
Duplicates are rejected!
reject
0
verify
Anti-replay Feature
Optional
Information to enforce held in SA entry
Sequence number counter - 32 bit for
outgoing IPSec packets
Anti-replay window
32-bit
Bit-map for detecting replayed packets
IPv4
New
IP hdr
ESP
hdr
Orig
IP hdr
ESP ESP
TCP Data
trailer Auth
IPv6
New New ESP Orig Orig
ESP ESP
TCP Data
IP hdr ext hdr hdr IP hdr ext hdr
trailer Auth
Key Management
Handles key generation & distribution
Typically need 2 pairs of keys