NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent...

91
NAT Traversal in SIP [email protected]

Transcript of NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent...

Page 1: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

NAT Traversal in SIP

[email protected]

Page 2: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

2

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 3: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

3

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 4: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

4

Origin of NATs

§ Created to resolve the IPv4 address exhaustion

problem

§ Designed with the web in mind– Client/server paradigm

LAN Internet

10.0.0.1 192.0.2.1 192.0.2.5

10.0.0.2

10.0.0.3

NAT

S: 10.0.0.2

D: 192.0.2.5

S: 192.0.2.1

D: 192.0.2.5

S: 192.0.2.5

D: 192.0.2.1

S: 192.0.2.5

D: 10.0.0.2

HTTP Server

Page 5: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

5

Side-effects of NATs

§ Hosts behind NATs are not reachable from the public Internet

– Sometimes used to implement security

– Breaks peer-to-peer (as opposed to client/server) applications

§ NATs attempt to be transparent– Troubleshooting becomes more difficult

§ NATs are a single point of failure

§ NATs’ behavior is not deterministic– Difficult to build applications that work through NATs

Page 6: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

6

IETF BEHAVE WG

§ Classification of current NAT behaviors– Existing terminology was confusing

§ Full cone, restricted cone, port restricted cone, and symmetric

– New terminology needed

§ Recommendations for NAT vendors– BEHAVE-compliant NATs are deterministic

– Easier to build applications

Page 7: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

7

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 8: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

8

Mapping Behavior§ For session originated on the same address and port

– Endpoint independent: same mapping to different sessions§ MUST use it

– Address dependent: same mapping to sessions to the same host

– Address and port dependent: a mapping only applies to one session

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.5 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.5 : 80

Endpoint Independent

Page 9: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

9

Mapping Behavior§ For session originated on the same address and port

– Endpoint independent: same mapping to different sessions§ MUST use it

– Address dependent: same mapping to sessions to the same host

– Address and port dependent: a mapping only applies to one session

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.5 : 80

S: 192.0.2.1 : 27000

D: 192.0.2.5 : 80

Address Dependent

Page 10: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

10

Mapping Behavior§ For session originated on the same address and port

– Endpoint independent: same mapping to different sessions§ MUST use it

– Address dependent: same mapping to sessions to the same host

– Address and port dependent: a mapping only applies to one session

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 8080

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 8080

Address Dependent

Page 11: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

11

Mapping Behavior§ For session originated on the same address and port

– Endpoint independent: same mapping to different sessions§ MUST use it

– Address dependent: same mapping to sessions to the same host

– Address and port dependent: a mapping only applies to one session

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 8080

S: 192.0.2.1 : 27000

D: 192.0.2.6 : 8080

Address and Port Dependent

Page 12: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

12

IP Address Pooling Behavior§ NATs with a pool of external IP addresses

– Arbitrary: an endpoint may have simultaneous mappings corresponding to different external IP addresses of the NAT

– Paired: same external IP address of the NAT§ RECOMMENDED

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 23000

D: 192.0.2.6 : 8080

S: 192.0.2.2 : 27000

D: 192.0.2.6 : 8080

Arbitrary

192.0.2.2

Page 13: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

13

IP Address Pooling Behavior§ NATs with a pool of external IP addresses

– Arbitrary: an endpoint may have simultaneous mappings corresponding to different external IP addresses of the NAT

– Paired: same external IP address of the NAT§ RECOMMENDED

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 23000

D: 192.0.2.6 : 8080

S: 192.0.2.1 : 27000

D: 192.0.2.6 : 8080

Paired

192.0.2.2

Page 14: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

14

Port Assignment§ Port preservation: preserves the port as long as there

are available IP addresses in the NAT’s pool

§ No port preservation

§ Port overloading: the port is preserved always, even without available IP addresses in the NAT’s pool

– The NAT relays on the source of the response

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.3 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 20000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.2 : 20000

D: 192.0.2.5 : 80

Port Preservation

192.0.2.2

10.0.0.3

Page 15: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

15

Port Assignment§ Port preservation: preserves the port as long as there

are available IP addresses in the NAT’s pool

§ No port preservation

§ Port overloading: the port is preserved always, even without available IP addresses in the NAT’s pool

– The NAT relays on the source of the response

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.3 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 20000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.5 : 80

No Port Preservation

192.0.2.2

10.0.0.3

Page 16: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

16

Port Assignment§ Port preservation: preserves the port as long as there

are available IP addresses in the NAT’s pool

§ No port preservation

§ Port overloading: the port is preserved always, even without available IP addresses in the NAT’s pool

– The NAT relays on the source of the response

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.3 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 20000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 20000

D: 192.0.2.5 : 80

Port Overloading10.0.0.3

Page 17: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

17

Port Assignment§ Port preservation: preserves the port as long as there

are available IP addresses in the NAT’s pool

§ No port preservation

§ Port overloading: the port is preserved always, even without available IP addresses in the NAT’s pool

– The NAT relays on the source of the response

10.0.0.1 192.0.2.1

10.0.0.2

S: 192.0.2.6 : 80

D: 10.0.3 : 20000

S: 192.0.2.6 : 80

D: 192.0.2.1 : 20000

192.0.2.5

192.0.2.6

S: 192.0.2.5 : 80

D: 10.0.2 : 20000

D: 192.0.2.5 : 80

S: 192.0.2.1 : 20000

Port Overloading10.0.0.3

Page 18: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

18

Port Ranges

§ 1- 1023 Well known

§ 1024 – 49151 Registered

§ 49152 – 65535 Dynamic / Private

§ RECOMMENDED to preserve the following ranges– 1 – 1023

– 1024 – 65535

§ Port overloading MUST NOT be used– Problems when two internal hosts connect to the same external

host

§ It is RECOMMENDED that NATs preserve port parity (even/odd)

§ No requirement for port contiguity

Page 19: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

19

Mapping Timeout

§ A NAT UDP mapping MUST NOT expire in less than 2 minutes

§ NATs can have application-specific timers– Well-known ports

§ It is RECOMMENDED to use more than 5 minutes

Page 20: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

20

Mapping Refresh§ NAT outbound refresh: packets from the internal to the external

interface– MUST be used

§ NAT inbound refresh: packets from the external to the internal interface

– Attackers may keep the mapping from expiring

– MAY be used

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.3 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 20000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 20000

D: 192.0.2.5 : 80

Outbound refresh10.0.0.3

Mappings refreshed

Page 21: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

21

Mapping Refresh§ NAT outbound refresh: packets from the internal to the external

interface– MUST be used

§ NAT inbound refresh: packets from the external to the internal interface

– Attackers may keep the mapping from expiring

– MAY be used

10.0.0.1 192.0.2.1

10.0.0.2

S: 192.0.2.6 : 80

D: 10.0.3 : 20000

S: 192.0.2.6 : 80

D: 192.0.2.1 : 20000

192.0.2.5

192.0.2.6

S: 192.0.2.5 : 80

D: 10.0.2 : 20000

D: 192.0.2.5 : 80

S: 192.0.2.1 : 20000

10.0.0.3Inbound refresh

Mappings refreshed

Page 22: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

22

External Address Spaces

§ NATs MUST be able to handle external address spaces that overlap with the internal address space

– Internal nodes cannot communicate directly with external nodes that have the same address as another internal node

– However, they can use STUN techniques

LAN

WLAN

10.0.0.1 192.0.2.110.0.0.2

WLAN + NAT

10.0.0.310.0.0.1

ADSL + NAT

10.0.0.2

Page 23: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

23

Filtering Behavior§ Endpoint independent: any packets allowed back

§ Address dependent: external hosts can return packets

§ Address and port dependent– Packets sent to an address + port

– Incoming packets allowed only from that address + port

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 192.0.2.5 : 80

D: 10.0.0.2 : 20000

S: 192.0.2.5 : 80

D: 192.0.2.1 : 25000

Endpoint Independent

Page 24: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

24

Filtering Behavior§ Endpoint independent: any packets allowed back

§ Address dependent: external hosts can return packets

§ Address and port dependent– Packets sent to an address + port

– Incoming packets allowed only from that address + port

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 192.0.2.5 : 80

D: 192.0.2.1 : 25000

Address Dependent

Packet Dropped

Page 25: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

25

Filtering Behavior§ Endpoint independent: any packets allowed back

§ Address dependent: external hosts can return packets

§ Address and port dependent– Packets sent to an address + port

– Incoming packets allowed only from that address + port

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 192.0.2.6 : 8080

D: 192.0.2.1 : 25000

Address Dependent

S: 192.0.2.6 : 80

D: 10.0.0.2 : 20000

Page 26: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

26

Filtering Behavior§ Endpoint independent: any packets allowed back

§ Address dependent: external hosts can return packets

§ Address and port dependent– Packets sent to an address + port

– Incoming packets allowed only from that address + port

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 80

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 80

192.0.2.5

192.0.2.6

S: 192.0.2.6 : 8080

D: 192.0.2.1 : 25000

Address and Port Dependent

Packet Dropped

Page 27: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

27

Filtering Behavior

§ Endpoint independent filtering is RECOMMENDED– Opens up ports for attackers

§ If a more stringent filtering is required– Address dependent filtering is RECOMMENDED

Page 28: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

28

Hairpinning

§ Internal hosts communicate using external addresses– MUST be supported

10.0.0.1 192.0.2.1

10.0.0.2

S: 10.0.0.3 : 20000

D: 192.0.0.1 : 25000

S: 192.0.2.1 : 23000

D: 10.0.2 : 20000

10.0.0.3

Page 29: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

29

Fragmented Packets

§ Receive fragments ordered– Only able to receive fragments in order

§ Receive fragments out of order– MUST be supported

– As long as DoS attacks do not compromise the NAT’sability to process in order fragments and unfragmentedpackets

§ Receive fragments none

Page 30: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

30

Various

§ ALGs SHOULD be turned off– MAY interfere with UNSAF methods

§ NATs MUST be deterministic– NATs MUST NOT change their mapping or filtering

behavior

Page 31: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

31

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 32: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

32

Connection Establishment§ Three-way handshake

– MUST be supported

§ Simultaneous open– MUST be supported

SYN

Three-way Handshake

SYN ACK

ACK

SYN

SYN ACK

ACK

Page 33: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

33

Connection Establishment§ Three-way handshake

– MUST be supported

§ Simultaneous open– MUST be supported

SYN

Simultaneous Open

SYNSYN

SYN

SYN ACK

SYN ACK

SYN ACK SYN ACK

Page 34: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

34

Filtering External SYNs§ Incoming SYS on the external interface.

– No existing mapping for it

§ If the SYN is an error, the NAT should generate an ICMP error message

§ If it is a simultaneous open, the NAT should silently drop the packet

Error Situation

SYN

ICMP Port Unreachable

Page 35: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

35

Filtering External SYNs§ Incoming SYS on the external interface.

– No existing mapping for it

§ If the SYN is an error, the NAT should generate an ICMP error message

§ If it is a simultaneous open, the NAT should silently drop the packet

Simultaneous Open

SYN

SYNSYN

Page 36: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

36

Filtering External SYNs

§ RECOMMENDED to respond to unsolicited SYNs– With an ICMP error with a delay of at least 6 seconds

– If a matching outbound SYN is received, cancel the sending of the ICMP error

Page 37: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

37

NAT Session Timeout

§ Established connections– MUST NOT be less than 2 hours and 4 minutes

– TCP sends keep alives every 4 hours

§ Partially opened or partially closed connections– MUST NOT be less than 4 minutes

§ TIME_WAIT timeout not specified

Page 38: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

38

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 39: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

39

UNSAF

§ Unilateral self-address fixing

§ An application needs to refer to itself with a valid IP address

§ Problems– Reflectors may be in a different domain than the destination– Solutions may circumvent security– NAT behavior is not deterministic– Midcom has not been successful

§ Solutions need to have an exit strategy and a limited scope

§ Final goal is to get rid of NATs

Page 40: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

40

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 41: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

41

Introduction to STUN

§ Originally a protocol between endpoints and reflectors§ Revised specification defines usages

– Binding discovery– NAT keep-alives– Short-term password– Relay (previously known as TURN)

§ TLV encoded§ Can run on UDP, TCP, or TLS/TCP§ STUN server located using DNS SRV§ Transactions

– Request/response– Indications (not delivered reliably)

§ Can be multiplexed with other protocols– Two first bits are zeros– Magic cookie– FIGERPRINT attribute

Page 42: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

42

Binding Discovery

10.0.0.1 192.0.2.110.0.0.2

STUN Binding Request

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 3478

STUN Binding Request

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 3478

192.0.2.6

STUN Binding Response

S: 192.0.2.6 : 3478

D: 192.0.2.1 : 25000

M: 192.0.2.1 : 25000

STUN Binding Response

S: 192.0.2.6 : 3478

D: 10.0.0.2 : 20000

M: 192.0.2.1 : 25000

Page 43: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

43

XOR-MAPPED-ADDRESS

§ In addition to the MAPPED-ADDRESS attribute

§ Some NATs inspect packets and translate IP

addresses known to them

Page 44: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

44

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 45: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

45

Introduction to STUN Relay Usage

§ Previously known as TURN§ Allocate request / response

– Allocate an external address at the relay– Responses carry a MAPPED-ADDRESS

§ Send indication– Send data to a remote endpoint through the relay

§ Data indication– Data received from remote endpoints through the relay

§ Set Active Destination request / response– Send and receive data to and from a single remote endpoint

without using Send and Data wrappers

§ Connect request / response– Requests the relay to establish a TCP connection with the remote

endpoint

§ Connection Status Indication– The relay informs the endpoint about the status of a TCP

connection with the remote endpoint– LISTEN, ESTABISHED, CLOSED

Page 46: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

46

Transport Protocols

§ STUN relay clients can use UDP, TCP, or TLS/TCP– UDP to TCP is not supported

Page 47: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

47

Relay Operations

10.0.0.1 192.0.2.110.0.0.2

STUN Allocate Request

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 3478

STUN Allocate Request

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 3478

192.0.2.6

STUN Allocate Response

S: 192.0.2.6 : 3478

D: 192.0.2.1 : 25000

M: 192.0.2.1 : 25000

STUN Allocate Response

S: 192.0.2.6 : 3478

D: 10.0.0.2 : 20000

M: 192.0.2.1 : 25000

R: 192.0.2.6 : 30000

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000R: 192.0.2.6 : 30000

Page 48: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

48

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to send data to the

remote endpoint in order to use the

relay

Equivalent to a NAT with:

Address dependent filtering policy

Endpoint independent mapping

S: 192.0.2.4 : 27000

D: 192.0.2.6 : 30000

Packet Dropped

Page 49: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

49

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to send data to the

remote endpoint in order to use the

relay

Equivalent to a NAT with:

Address dependent filtering policy

Endpoint independent mapping

S: 192.0.2.5 : 27000

D: 192.0.2.6 : 30000

Packet Dropped

Page 50: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

50

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to send data to the

remote endpoint in order to use the

relay

Equivalent to a NAT with:

Address dependent filtering policy

Endpoint independent mapping

Send Indication

REMOTE-ADDRESS

192.0.2.4

Send Indication

REMOTE-ADDRESS

192.0.2.4

S: 192.0.2.6 :30000

D: 192.0.2.4

Page 51: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

51

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to send data to the

remote endpoint in order to use the

relay

Equivalent to a NAT with:

Address dependent filtering policy

Endpoint independent mapping

S: 192.0.2.4

D: 192.0.2.6 : 30000

Data Indication

REMOTE-ADDRESS

192.0.2.4

Data Indication

REMOTE-ADDRESS

192.0.2.4

Page 52: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

52

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to send data to the

remote endpoint in order to use the

relay

Equivalent to a NAT with:

Address dependent filtering policy

Endpoint independent mapping

S: 192.0.2.5 : 27000

D: 192.0.2.6 : 30000

Packet Dropped

Page 53: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

53

Relay Operations

10.0.0.1 192.0.2.110.0.0.2

Set Active Destination Request

REMOTE-ADDRESS

192.0.2.4

Set Active Destination Request

REMOTE-ADDRESS

192.0.2.4

192.0.2.6

Response Response

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to set a destination as

active in order to receive and send

data to it without using indications.

Data is framed:

Type: end-to-end or STUN

Length

Page 54: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

54

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to set a destination as

active in order to receive and send

data to it without using indications.

Data is framed:

Type: end-to-end or STUN

Length

S: 10.0.0.2 : 20000

D: 192.0.2.6 : 3478

S: 192.0.2.1 : 25000

D: 192.0.2.6 : 3478

S: 192.0.2.6 :30000

D: 192.0.2.4

Page 55: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

55

Relay Operations

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

192.0.2.5192.0.2.4

R: 192.0.2.6 : 30000

The client needs to set a destination as

active in order to receive and send

data to it without using indications.

Data is framed:

Type: end-to-end or STUN

Length

S: 192.0.2.4

D: 192.0.2.6 : 30000

S: 192.0.2.6 : 3478

D: 10.0.0.2 : 20000

S: 192.0.2.6 : 3478

D: 192.0.2.1 : 25000

Page 56: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

56

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 57: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

57

Regular SIP Response Routing

§ Responses are sent to– Request’s source IP address

– Port in the Via entry

§ Responses are sent from– Typically the same IP address as the request was sent to

– Any port

Page 58: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

58

Regular SIP Response Routing

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

S: 10.0.0.2 : 4540

D: 192.0.2.6 : 5060

S: 192.0.2.1 : 20000

D: 192.0.2.6 : 5060

§ Request– Via: SIP/2.0/UDP 10.0.0.2:10000;branch=z9hG4bKkjshdyff

§ Response– Via: SIP/2.0/UDP 10.0.0.2:10000;

received=192.0.2.1;branch=z9hG4bKkjshdyff

S: 192.0.2.6 : 25000

D: 192.0.2.1 : 10000Packet Dropped

Page 59: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

59

Symmetric SIP Response Routing

§ Responses are sent to– Request’s source IP address

– Request’s source port

§ Responses are sent from– IP address the request was sent to

– The port the request was sent to

Page 60: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

60

Symmetric SIP Response Routing

10.0.0.1 192.0.2.110.0.0.2 192.0.2.6

S: 10.0.0.2 : 4540

D: 192.0.2.6 : 5060

S: 192.0.2.1 : 20000

D: 192.0.2.6 : 5060

§ Request– Via: SIP/2.0/UDP 10.0.0.2:4540;

rport;branch=z9hG4bKkjshdyff

§ Response– Via: SIP/2.0/UDP 10.0.0.2:4540;

received=192.0.2.1;rport=20000;branch=z9hG4bKkjshdyff

S: 192.0.2.6 : 5060

D: 192.0.2.1 : 20000

S: 192.0.2.6 : 25000

D: 10.0.0.2 : 4540

Page 61: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

61

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 62: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

62

User Agent Reachability

§ Proxy to user agent connections– Problems with NATs and firewalls

§ User agent always starts the connection

§ Keep alives to keep NAT bindings up– Different alternatives analyzed

– STUN§ Multiplexed with SIP§ New registration if a new binding is discovered

§ User agent identification (e.g., for service profiles)– Instance identifier

Page 63: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

63

Reliability and Scalability

§ Different flows identified by their registration IDs

Host1 Host2

REGISTRAR

UA

Edge1 Edge2

UA

REGISTRAR

Page 64: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

64

Outline

§ Introduction to NATs

§ NAT Behavior (actual and recommended) – UDP– TCP

§ IAB UNSAF Considerations

§ STUN

§ STUN Relay Usage

§ NAT Traversal in SIP– SIP Response Routing– User Agent Reachability– ICE

Page 65: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

65

Introduction to ICE

§ Endpoints gather all the addresses they can

§ They run connectivity checks between them

§ They choose the highest priority pair that works

Page 66: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

66

Gathering Addresses

§ Address types

– Host candidates

– Server-reflexive candidates

– Relayed candidates

– Peer-reflexive candidates

§ A candidate’s base: the address used to send data

– The base for a reflexive candidate is a host candidate

§ Duplicated addresses are removed

– Candidates with the same transport address but different base are

considered different

§ Foundation: used to freeze addresses (related to connectivity checks)

– Same type

– Bases with the same IP address

– Same STUN server

Page 67: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

67

Prioritizing Addresses

Priority = 224 (type preference) +

28 (local preference) +

2 (256 – component ID)

§ Type preference [0-126]: preference for the type of

candidate (e.g., server reflexive)

§ Local preference [0-65535]: preference for the interface

the candidate was obtained from (e.g., multihomedhosts)

§ Component ID [1-256]: 1 for RTP and 2 for RTCP

Page 68: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

68

Generation of an offer

§ The candidate with the highest probability to work goes into the m and c lines

– A relayed address initially

§ The rest of the candidates go into ‘candidate’ attributes

a=candidate: found comp-id transp priority conn-address cand-type rel-addr rel-port

a=candidate: 1 1 UDP 2130706178 192.0.2.1 3478 typ srflx raddr 10.0.0.1 rport 20000

§ User name and password for connectivity checks in

‘ice-ufrag’ and ‘ice-pwd’ attributes

Related address: baseOther transports are:• tcp-so

• tcp-act

• tcp-pass

Page 69: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

69

Prioritizing Pairs

§ After the offer/answer exchange

§ O-P: priority in the offer

§ A-P: priority in the answer

Pair Priority = 232 MIN(O-P,A-P) + 2 MIN(O-P,A-P) + (O-P>A-P:1?0)

Page 70: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

70

Connectivity Checks

§ Five states for a pair:– Waiting, in progress, succeeded, failed, frozen

§ Periodic checks and triggered checks– Periodic checks performed in priority order

§ Connectivity is checked with STUN Binding Requests– Carry a concatenation of user names and the remote

password

Page 71: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

71

ICE Roles

§ Controlling agent– Selects which pair to use– USE-CADIDATE attribute

§ Default algorithm: included in every check– Agent that generates the initial offer

§ Passive-only agents– They know they are not behind a NAT

§ E.g., PSTN gateways, conferencing servers– Include ‘a=ice-passive’ in their session descriptions– Respond to checks– Generate triggered checks– Generate keepalives

Page 72: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

72

ICE Example (1)

§ One endpoint is behind a NAT

§ One endpoint has a public IP address

§ Endpoints use STUN servers that support the relay usage

Page 73: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

73

10.0.0.2 192.0.2.23

Allocate

Request

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Allocate

Request

Allocate Response

M: 192.0.2.1 : 25000

R: 192.0.2.2 : 30000

Allocate Response

M: 192.0.2.1 : 25000

R: 192.0.2.2 : 30000

Page 74: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

74

10.0.0.2 192.0.2.23

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Allocate Response

M: 192.0.2.1 : 25000

R: 192.0.2.2 : 30000

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

INVITE (offer)

Page 75: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

75

10.0.0.2 192.0.2.23

Allocate

Request

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Allocate Response

M: 192.0.2.23 : 35000

R: 192.0.2.22 : 45000

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Page 76: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

76

10.0.0.2 192.0.2.23

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Allocate Response

M: 192.0.2.23 : 35000

R: 192.0.2.22 : 45000

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

192.0.2.23 : 35000

Server reflexive:

192.0.2.23 : 35000

Relayed:

192.0.2.22 : 45000

200 OK (answer)

Host candidate:

192.0.2.23 : 35000

Relayed:

192.0.2.22 : 45000

ACK

Page 77: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

77

10.0.0.2 192.0.2.23

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Binding

Request

Binding Response

M: 192.0.2.1 : 25000

Binding Response

M: 192.0.2.1 : 25000

Binding

Request

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

192.0.2.23 : 35000

Relayed:

192.0.2.22 : 45000

Page 78: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

78

10.0.0.2 192.0.2.23

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Binding

Request

Binding Response

M: 192.0.2.23 : 35000

Binding Response

M: 192.0.2.23 : 35000

Binding

Request

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

192.0.2.23 : 35000

Relayed:

192.0.2.22 : 45000

Page 79: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

79

10.0.0.2 192.0.2.23

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

192.0.2.23 : 35000

Relayed:

192.0.2.22 : 45000

200 OK (answer)

ACK

INVITE (offer)

Page 80: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

80

ICE Example (2)

§ Both endpoint are behind NATs

§ Endpoints use STUN servers that support the relay

usage

Page 81: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

81

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Allocate

Request

Allocate

Request

Allocate Response

M: 192.0.2.1 : 25000

R: 192.0.2.2 : 30000

Allocate Response

M: 192.0.2.1 : 25000

R: 192.0.2.2 : 30000

Page 82: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

82

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1Allocate Response

M: 192.0.2.1 : 25000

R: 192.0.2.2 : 30000

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

INVITE (offer)

Page 83: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

83

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Allocate

Request

Allocate

Request

Allocate Response

M: 192.0.2.21 : 25000

R: 192.0.2.22 : 30000

Allocate Response

M: 192.0.2.21 : 25000

R: 192.0.2.22 : 30000

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Page 84: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

84

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1Allocate Response

M: 192.0.2.21 : 25000

R: 192.0.2.22 : 30000

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

200 OK (answer)

ACK

Page 85: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

85

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Binding

Request

Binding

Request

Packet Dropped

B’s NAT implements

address dependent filtering

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Page 86: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

86

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Send

Indication

Packet Dropped

B’s NAT implements

address dependent filtering

Send

Indication Binding

Request

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Page 87: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

87

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Binding

Request

Data

Indication

Binding

Request

Data

Indication

Send

Indication

Send

IndicationBinding Response

M: 192.0.2.1 : 25000

Binding Response

M: 192.0.2.1 : 25000

A’s NAT implements address dependent

mapping

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Page 88: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

88

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Binding

Request

Send

Indication

Binding

Request

Send

Indication

Data

Indication

Data

IndicationBinding Response

Binding Response

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Page 89: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

89

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

200 OK (answer)

ACK

INVITE (offer)

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Page 90: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

90

10.0.0.2 10.0.1.2

10.0.0.1

192.0.2.1

192.0.2.2 192.0.2.22

192.0.2.21

10.0.1.1

Set Active

Destination

Set Active

DestinationSet Active

Destination Response

Set Active

Destination Response

Host candidate:

10.0.0.2 : 20000

Server reflexive:

192.0.2.1 : 25000

Relayed:

192.0.2.2 : 30000

Host candidate:

10.0.1.2 : 20000

Server reflexive:

192.0.2.21 : 25000

Relayed:

192.0.2.22 : 30000

Page 91: NAT Traversal in SIP - TKK · § NAT Traversal in SIP – SIP Response Routing – User Agent Reachability – ICE. 3 Outline § Introduction to NATs § NAT Behavior (actual and recommended)

91