1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission...

45
1 TCP/IP Protocols • Contains Five Layers • Top three layers contains many protocols • Actual transmission at the physical layer

Transcript of 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission...

Page 1: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

1

TCP/IP Protocols

• Contains Five Layers

• Top three layers contains many protocols

• Actual transmission at the physical layer

Page 2: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

2

TCP/IP LayersApplication

Presentation

Session Applications

SMTP FTP DNS TELNETHTTP

Transport TCP UDP

Network ICMPARP RARP

Data Link

Physical

Protocols specific to the underlying physical media used for data communication at the hardware level

IP

Page 3: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

3

Message Transfer using TCP/IP

Original Message

Original Message

Original MessageTCP header

TCP header

IP header

Original MessageTCP headerIP headerFrame header

Original Message

Original Message

Original MessageTCP header

TCP header

IP header

Original MessageTCP headerIP headerFrame header

Source Destination

Page 4: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

4

TCP

• Reliable transport layer communication

• Establishes a logical connection between the communicating hosts

• Socket-to-socket communication (Socket = Port + IP address)

Page 5: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

5

TCP Segment Format

Source Port number

Destination Port number

Sequence Number Acknowledgement Number

Data

2 bytes 2 bytes 4 bytes 4 bytes20-to-60 bytes header consisting of the following fields

Header Length

4 bits

Reserved

6 bits

Flag

6 bits

Window size

2 bytes

Checksum Urgent pointer

2 bytes 2 bytes

Options

0 to 40 bytes

Page 6: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

6

IP

• Best effort delivery

• Does not guarantee success

• Leaves error checking to higher layers (e.g. to TCP)

Page 7: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

7

IP Datagram FormatVersion HLEN Service Type Total Length(4 bits) (4 bits) (8 bits) (16 bits)

Identification Flags Fragmentation Offset

(16 bits) (3 bits) (13 bits)

Time to live Protocol Header Checksum

(8 bits) (8 bits) (16 bits)

Source IP address(32 bits)

Destination IP address(32 bits)

Data

Options

Page 8: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

8

Network Aspects

• Internal network (e.g. LAN)

• External Network (e.g. Internet)

• Threats from the External Network to the Internal Network

Page 9: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

9

Network Threats

N e t w o r k B a c k

b o n e

RouterTo Internet

Outside dangers can come in from here

Inside information can leak out from here

Corporate network

Page 10: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

10

Firewall

• Special type of router

• Controls transmission between internal and external networks

• Decides what to allow/disallow

Page 11: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

11

NAT Implementation

Internal network with internal IP addresses

192.168.10.1

192.168.10.3

192.168.10.2

192.168.10.10Internet

201.26.7.9

Router’s internal IP address Router’s external IP address

NAT router

Page 12: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

12

NAT Example

Internal network with internal IP addresses

192.168.10.1

192.168.10.10Internet

201.26.7.9

NAT router

Source: 192.168.10.1 Source: 201.26.7.9

Destination: 192.168.10.1 Destination: 201.26.7.9

Page 13: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

13

NAT Translation Table

Source: 192.168.10.1Destination: 210.10.20.20

Source: 201.26.7.9Destination: 210.10.20.20

192.168.10.10 201.26.7.9

192.168.10.1 210.10.20.20

Source: 210.10.20.20Destination: 192.168.10.1

192.168.10.10 201.26.7.9

Source: 210.10.20.20Destination: 201.26.7.9

192.168.10.1 210.10.20.20

Internal

192.168.10.1……

External

210.10.20.20……

Translation table

Page 14: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

14

Firewall Concept

N e t w

o r k B

a c k b o n e

To Internet

Corporate networkFirewall

Page 15: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

15

Firewall Types

Firewalls

Packet Filters Application Gateways

Page 16: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

16

Packet Filter

InternetInternal (Private)

Network

Packet filter

Protected zone

Page 17: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

17

Packet Filter Operation

Outgoing packets Incoming packets

Receive each packet.Apply rules.If no rules, apply default rules.

Page 18: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

18

Packet Filter Defeating IP Spoofing Attack

Incoming packet

178.29.10.89

178.29.10.90178.29.10.91

Internal network and the IP addresses of the hosts

Packet filter

Source address: 178.29.10.91

STOP!

Page 19: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

19

Application Gateway

HTTPSMTPFTP

TELNET

Outside connection

Inside connection

Application gateway

Page 20: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

20

Circuit Gateway

HTTPSMTPFTP

TELNET

Application gateway

IP address = 178.29.10.90

IP address = 178.29.10.70

Source address = 178.29.10.90

Source address = 178.29.10.70

IP packet IP packet

Inside host Outside host

Page 21: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

21

Application Gateway - Illusion

HTTPSMTPFTP

TELNET

External hostInternal host

Application gateway

User’s illusion

Real connection Real connection

Page 22: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

22

Firewall Configurations

Firewall Configurations

Screened host firewall,

Single-homed bastion

Screened host firewall,

Dual-homed bastion

Screened subnet firewall

Page 23: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

23

Screened Host Firewall, Single-homed Bastion

Packet filter

HTTPSMTPFTP

TELNET

Internet

Application gateway

Internal network

Page 24: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

24

Screened Host Firewall, Dual-homed Bastion

Packet filter

HTTPSMTPFTP

TELNET

Internet

Application gateway

Internal network

Page 25: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

25

Screened Subnet Firewall

Packet filter

HTTPSMTPFTP

TELNET

Internet

Application gateway

Internal network

Packet filter

Page 26: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

26

Demilitarized Zone (DMZ)

Internet

Internal private network

Demilitarized Zone (DMZ)

Firewall

Page 27: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

27

Security at multiple Layers

Application Layer

Transport Layer

Internet Layer

Data Link Layer

Physical Layer

First level of security

Second level of security

Page 28: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

28

IPSec

• Not concerned with application layer security

• Applies security at the Internet layer

• More effective in IPv6

Page 29: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

29

IPSec Processing Result

Actual data (Encrypted)

Transport header (Encrypted)

Internet header (Not encrypted)

Page 30: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

30

IPSec in TCP/IP

Original message

Transmission medium

Application

TransportIPSec

Internet

Data link

Original message

Application

TransportIPSec

Internet

Data link

Sender Receiver

Page 31: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

31

IPSec Protocols

IPSec

Authentication Header (AH) Encapsulating Security Payload (ESP)

Page 32: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

32

AH and ESP Operation Modes

AH and ESP modes of operation

Tunnel mode Transport mode

Page 33: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

33

Tunnel Mode

X

P1

Proxy

P2

Proxy

Y

Network 1 Network 2

Tunnel

Page 34: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

34

Tunnel Mode Implementation

A <---> BP1 <---> P2 …

Internal IP header and data (encrypted)External IP header

(not encrypted)

Page 35: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

35

IPSec steps

Step 1Algorithm and Key negotiations using IKE

Step 2Actual AH and ESP operations

Page 36: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

36

AH Format

Bit 0 8 16 31

Next header Payload length Reserved

Security Parameter Index (SPI)

Sequence number

Authentication data (Variable size)

Page 37: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

37

Receiver’s Sliding Window

Receiver’s sliding window (W = 8)

N – W

Marked if a valid packet is received

Unmarked if a valid packet is not yet received

N

Page 38: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

38

AH Transport Mode

IP header TCP headerOriginal data

(a) Before applying AH

IP header TCP header Original data

(b) After applying AH

AH

Page 39: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

39

AH Tunnel Mode

IP header TCP headerOriginal data

(a) Before applying AH

Original IP header

TCP header Original data

(b) After applying AH

AHNew IP header

Page 40: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

40

ESP Format

Bit 0 16 24 31

Security Parameter Index (SPI)

Sequence Number

Padding (0-255 bytes)

Payload data (Variable size)

Padding length Next header

Authentication data (Variable size)

Page 41: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

41

ESP Transport Mode

IP header TCP headerOriginal data

(a) Before applying ESP

TCP header Original data

(b) After applying ESP

ESP header

Original IP header

ESP trailer

ESP auth

Encrypted

Authenticated

Page 42: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

42

ESP Tunnel Mode

IP header TCP headerOriginal data

(a) Before applying ESP

TCP header Original data

(b) After applying ESP

ESP header

Original IP header

ESP trailer

ESP auth

Encrypted

Authenticated

New IP header

Page 43: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

43

ISAKMP Header Format

Bit 0 8 16 24 31

Initiator cookie

Responder cookie

Next payload

Major version

Minor version

Exchange type

Flags

Message ID

Length

Page 44: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

44

Virtual Private Network (VPN)

• Uses the Internet as if it is a private network

• Far less expensive than a leased line

• Uses IPSec protocol

Page 45: 1 TCP/IP Protocols Contains Five Layers Top three layers contains many protocols Actual transmission at the physical layer.

45

VPN Between Two Networks

X

Network 1

Y

Network 2

Firewall 1 Firewall 2

VPN tunnel

Internet