Security at The IP Level
Security at The IP Level
• Review of IP
• Security concerns at IP level
• What can be done at IP level
• IP Sec architecture
• How IP Sec works
2
IP Review
3
ISO Layers – TCP/IP Layers
Application
presentation
Session Application
Transport
TCP/UDP
Network
IP
Data Link
4
TCP/IP Example
5
Network Layer
• provides the functional and procedural means of transferring
variable length data sequences from a source to a destination
via one or more networks, while maintaining the quality of
service requested by the Transport layer.
6
IPv4 Header
7
IP header details:
• Version: 4 bits, Identifies the version of IP used to
generate the datagram.
• Internet Header Length (IHL): 4 bits, Specifies the
length of the IP header.
• Type Of Service (TOS): A field designed to carry
information to provide quality of service features, such
as prioritized delivery, for IP datagrams.
• Total Length (TL): Specifies the total length of the IP
datagram, in bytes.
• Identification: This field contains a 16-bit value that is
common to each of the fragments belonging to a
particular message.
• Flags: Three control flags two of which is used to
manage fragmentation and one is reserved
8
IP header details:
• Fragment Offset: When fragmentation of a message occurs, this field
specifies the offset, or position, in the overall message where the data in
this fragment goes.
• Time To Live (TTL): Short version: Specifies how long the datagram is
allowed to “live” on the network, in terms of router hops.
• Protocol: Identifies the higher layer protocol .(Generally Transport layer
Protocol/encapsulated network layer protocol.)
• Header Checksum: A checksum computed over the header to provide
basic protection against corruption in transmission
• Options: One or more of several types of options may be included after
the standard headers in certain IP datagrams.(how IP handles datagrams
)
• Padding: If one or more options are included, and the number of bits
used for them is not a multiple of 32, enough zero bits are added to “pad
out” the header to a multiple of 32 bits (4 bytes).
9
Internet Protocol Version 4 (IPv4) Datagram Format
10
Transport Layer
• It provides transparent transfer of data between end
users, providing reliable data transfer services to
the upper layers.
• This layer controls the reliability of a given link
through flow control, segmentation/de-
segmentation, and error control.
• Some protocols are state and connection oriented.
This means that the transport layer can keep track
of the segments and retransmit those that fail.
• The best known examples are the Transmission
Control Protocol (TCP) and User Datagram Protocol
(UDP).
11
SYN – synchronize request
ISN - Initial sequence number
ACK – acknowledgement for the ISN Handshake in TCP THREE-WAY CONNECTION
CLIENTSYN 1 SERVER
41521 w Segment 1 shows the client sending a SYN segment
in 4096 <mss 102 with an Initial Sequence Number of 141521. The ISN is
Segment 1
4>
randomly generated. This is called an Active Open. The
field win 4096 shows the advertised window size of the
sending station while the field <mss 1024> shows the
0 24>
win 40 96<mss 1 receiving maximum segment size specified by the
15 21 ac k 141522 sender.
SYN 18
Three-way
Segment 2 Segment 2 shows the server responding with a SYN
Open ack 18152 segment of 181521 and ACKknowledging the clients
2 ISN with ISN + 1. This is called a Passive Open..
Segment 3
FOUR-WAY TERMINATION
Segment 4 shows the client sending a FIN segment with
an ACKnowledgement of the server's sequence number +
FIN 1415 1. This is called an Active Close and will start closing
22 ack 1
81522 one-half the connection.
Segment 4
Segment 5 shows an ACKnowledgement of the clients
sequence number + 1 and will complete the closing of this
ack 141523 one-half of the connection.
Four-way
k 141523
Segment 6 shows the server sending a FIN segment with
Segment 5 2 2 ac
Close FIN 1815 an ACKnowledgement of the clients sequence number +
1, This is called a Passive Close and starts the closure
Segment 6 ack 18152 of this one-half of the connection.
3
Segment 7
12
COMMON TCP PORT NUMBERS
13
IP Vulnerabilities and Attacks
• IP Spoofing
– host rename (LAN)
– DNS(Domain Name System )
– source routing
– TCP sequence number guessing / splicing
• Session hijacking
• Denial of service
– ICMP bombing, redirects, unreachable
– TCP SYN flooding
14
IP Vulnerabilities and Attacks
• What kind of attacks can occur ?
• Interruption: Denial of Service ?
• Interception ?
• Replay ?
• Masquerading ?
• MITM?
15
Security at IP layer
16
Reasons
17
1.3 Security Attacks
passive attacks:
18
19
Relatively hard to do in TCP
20
Active attacks:
21
IP source address spoofing –easy to do
22
Address Masquerading attack (e.g)
router
route
r
a.b.c.100 x.y.z.200 - shutdown x.y.x.201 -> x.y.x.200
NSF server For maintenance Authorized NFS client
Masquerading as authorised
client 23
Relatively hard to do in TCP
24
TCP connection hijacking
25
“SYN FLOODING” – easy to do in TCP
26
ICMP ECHO Request Attack (e.g)
27
ICMP ECHO Flooding (e.g)
SMURF Attack
The Hacker sends an ICMP Echo request to the target
network with a destination broadcast address and a spoofed
source address of the target.
The network serves as a "bounce site" and returns an
Echo Reply for each station on the network.
The network serves to multiply the effect of the "ping". The Echo
Request could be sent to multiple networks.
Countermeasures:
Disable IP-directed broadcasts at your router.
Configure the workstation to not respond to an IP broadcast
packet.
28
Why look for security at IP level?
29
What can be done to improve IP security ?
Data Link
Physical
31
IPSec: Security Association (SA)
• SA is a contract between two nodes on
keys, algorithms, etc.
• It forms the basis for IPSec operations
• There are protocols for negotiating about
keys: IKE(Internet Key Exchange ),
ISAKMP(Internet Security Association
and Key Management Protocol )
• ISAKMP typically utilizes IKE for key
exchange
32
Security Associations (SA)
33
IPSec Architecture
37
IP Security Scenario
38
IPSec modes
• Transport mode:
• is typically used in peer-to-peer
communications, especially for internal
networks
• the data packet is encrypted but the IP header is
not.
• Tunnel mode:
• is used for remote access and site-to-site
security
• the entire packet (header & payload) is encrypted
39
Transport Mode Tunnel Mode
SA SA
Authenticates IP Authenticates entire
AH payload and selected inner IP packet plus
portions of IP header selected portions of
and IPv6 extension outer IP header
headers
Encrypts IP payload and Encrypts inner IP
ESP any IPv6 extesion packet – data +
header header
40
IPSec Applications
• Secure branch office connectivity over
the Internet
• Secure remote access over the
Internet
• Establishing extranet and intranet
connectivity with partners
• Enhancing electronic commerce
security
41
IPSec Details
• IPSec can be used with IPv4 or IPv6
• IPSec is a set of protocols
• It provides a set of security
algorithms plus a general framework
that allows parties to use appropriate
algorithms
42
Encryption and Authentication
Algorithms
• Encryption:
• Three-key triple DES
• RC5
• IDEA
• Three-key triple IDEA
• CAST
• Blowfish
• Authentication:
• HMAC-MD5-96
• HMAC-SHA-1-96
43
Authentication with AH
Before applying AH
After applying AH
Transport mode
After applying AH
Tunnel mode
Borrowed from Stallings
46
ESP Encryption and
Authentication
47
ESP Encryption and
Authentication
48
Advantages of IPSec
• IPSec is the most general way to provide
security services to the Internet with less
constraints
• Higher-level security services are less
general and protect some single protocol
(e.g: PGP protects mail)
• Lowever-level services protect single
medium (eg: a pair of encryption chips on
the end of a line)
• IPSec can, in general, protect any medium
used below IP level and any protocol
running above IP level
49
Benefits of IPSec
• Enable business to rely heavily on the Internet and
reduce its need for private networks => saving
costs & network management
• Provide secure network access over the Internet
• An end-user whose system is equipped with
IPSec can make a local call to ISP and gain
secure access to her/his company
• Provide secure communications between
organisations by ensuring authentication and
confidentiality
• IPSec can be used to create secure tunnel through
untrusted (especially the Internet) networks
• Sites connected by these tunnels form Virtual
Private Networks (VPN)
50
Benefits of IPSec
51