SlideShare a Scribd company logo
From NAT to NAT Traversal
2014/12/25
Qlync Inc.
YAO, LI-WEI
1
How to access network resource
anytime and anywhere?
2
How to access network resource
anytime and anywhere?
• Locate Resource
• Signal —> Not Today
• Access Resource
• P2P Communication —> Today
3
Agenda
• Network Resource or Service
• Public and Private IP Address
• What is NAT?
• How to access Network Resource behind NAT?
• Port Forwarding
• NAT Traversal
• ICE Protocol
• ICE related projects - WebRTC
4
Network Resource/Service
• Web Page
•
• File Download
•
• Video/Audio Streaming
•
5
Network Resource/Service
• Web Page —> HTTP/HTTPS
•
• File Download —> FTP/SAMBA
•
• Video/Audio Streaming —> RTSP/RTP
•
6
Network Resource/Service
• Web Page —> HTTP/HTTPS
• —> TCP:80/TCP:443
• File Download —> FTP/SAMBA
• —> TCP:21/TCP:445
• Video/Audio Streaming —> RTSP/RTP
• —> TCP:554/UDP:554/UDP:16384-32767
7
Network Resource/Service
• Web Page —> HTTP/HTTPS
• —> TCP:80/TCP:443
• File Download —> FTP/SAMBA
• —> TCP:21/TCP:445
• Video/Audio Streaming —> RTSP/RTP
• —> TCP:554/UDP:554/UDP:16384-32767
+ Server IP Address
8
Public and Private IP Address
http://developer.eyeball.com/faq.php
9
Public and Private IP Address
http://www.ic.ims.hr
10
Public and Private IP Address
http://www.highteck.net/EN/Network/Addressing_the_Network-IPv4.html
11
What is NAT?
• Remapping one IP address
space into another
• Private IP/port mapping to
Public IP/port
• Rewrite the source and/or
destination addresses of IP
packets as they pass the
router or firewall
• Server: IP address
• Resource: Protocol:Port
12
http://www.cisco.com/web/about/ac123/ac147/archived_issues/ipj_7-3/anatomy.html
13
SNAT - Private to Public
http://linux.vbird.org/linux_server/0250simple_firewall.php
14
SNAT - Private to Public
http://linux.vbird.org/linux_server/0250simple_firewall.php
15
How to access Network
Resource behind NAT?
=
Public to Private?
16
DNAT - Public to Private
http://linux.vbird.org/linux_server/0250simple_firewall.php
17
Port Forwarding
http://panasonic.net/pcc/support/netwkcam/technic/port_fwrd.html
18
Router Setting
http://community.linksys.com/t5/Cameras/port-forwarding-questions/td-p/318824
19
With Router or Gateway Control
Port Forwarding
+
Static Public IP/
Dynamic Public IP + DDNS*
*http://www.tp-link.tw/article/?faqid=297
20
With Router or Gateway Control
http://www.quickmeme.com/IM-KING-OF-THE-WORLD
21
Without Router or Gateway
Control
22
Without Router or Gateway Control
https://www.flickr.com/photos/39561139@N05/4488876837/galleries/
23
Nothing is
Impossible!
R&D CAN DO ANYTHING!
http://www.englishbaby.com/findfriends/view_photo/251578
24
Without Router or Gateway
Control
How to access Network
Resource behind NAT?
=
NAT Traversal Solutions
25
NAT Traversal Solutions
• Universal Plug and Play -
Internet Gateway Device:
UPnP-IGD
• SOCKS Proxy
• Application Layer Gateway:
ALG
• Interactive Connection
Establishment: ICE = STUN +
TURN
26
UPnP-IGD
http://blog.chinaaet.com/detail/28455
27
UPnP-IGD
http://blog.chinaaet.com/detail/28455
28
SOCKS Proxy
29
http://stackoverflow.com/questions/18428498/sending-udp-packets-through-socks-proxy
SOCKS Proxy
http://stackoverflow.com/questions/18428498/sending-udp-packets-through-socks-proxy
30
ALG
http://www.h3c.com/portal/Technical_Support___Documents/Technical_Documents/Routers/
H3C_SR6600_Series_Routers/Configuration/Operation_Manual/H3C_SR6600_OM-Release_2315(V1.09)/
07/201212/765251_1285_0.htm
31
ICE
STUN + TURN
UDP Hole
Punching
+
Relay
http://thesalesblog.com/blog/2013/09/01/some-thoughts-on-pricing-power/32
ICE = STUN + TURN
http://blog.schertz.name/2012/10/lync-edge-stun-turn/
33
NAT Types
• Full Cone NAT
• Address Restricted NAT
• Port Restricted NAT
• Symmetric NAT
34
Full Cone
Mapping: 192.168.2.2:4445 <-> 1.1.1.4:10100
Policy: ALLOW ALL TO 1.1.1.4:10100
Full Cone 只是單純的做位址轉換,並未對進出的封包設限。︒
http://www.slideshare.net/dadaista/nat-traversal
35
Address Restricted
Mapping: 192.168.2.2:4445 <-> 1.1.1.4:10100
Policy: ALLOW 1.1.1.5 TO 1.1.1.4:10100
ALLOW 1.1.1.6 TO 1.1.1.4:10100
只有收過NAT 內部送來的封包的地址才能將封包送入 Restrict Cone NAT 內
http://www.slideshare.net/dadaista/nat-traversal
36
Port Restricted
只有收過NAT 內部送來的封包的地址及 Port Number 才能將封包送入 Restrict Cone NAT 內。︒
Mapping: 192.168.2.2:4445 <-> 1.1.1.4:10100
Policy: ALLOW 1.1.1.5:7777 TO 1.1.1.4:10100
*ALLOW 1.1.1.6:7777 TO 1.1.1.4:10100
http://www.slideshare.net/dadaista/nat-traversal
37
Symmetric
Symmetric NAT只允許先由私有網域內的使⽤用者發送封包到網際網路中的使⽤用者 可以回傳封包
Mapping: 192.168.2.2:4445 <-> 1.1.1.4:10100
192.168.2.2:4445 <-> 1.1.1.4:10179
Policy: ALLOW 1.1.1.5:7777 TO 1.1.1.4:10100
ALLOW 1.1.1.6:7777 TO 1.1.1.4:10179
http://www.slideshare.net/dadaista/nat-traversal
38
UDP Hole Punching
Different NAT Type, Different Approach
http://www.drdobbs.com/jvm/punching-holes-with-java-rmi/217400127
39
http://www.brynosaurus.com/pub/net/p2pnat/40
STUN (RFC 5389/3489)
Abstract
Session Traversal Utilities for NAT (STUN) is a protocol that serves as a
tool for other protocols in dealing with Network Address Translator (NAT)
traversal. It can be used by an endpoint to determine the IP address and port
allocated to it by a NAT. It can also be used to check connectivity between
two endpoints, and as a keep-alive protocol to maintain NAT bindings. STUN
works with many existing NATs, and does not require any special behavior
from them.
STUN is not a NAT traversal solution by itself. Rather, it is a tool to be used
in the context of a NAT traversal solution. This is an important change from
the previous version of this specification (RFC 3489), which presented STUN
as a complete solution.
This document obsoletes RFC 3489.
41
http://www.cs.nccu.edu.tw/%7Elien/Writing/NGN/firewall.htm42
http://www.cs.nccu.edu.tw/%7Elien/Writing/NGN/firewall.htm
43
http://speed.cis.nctu.edu.tw/~ydlin/pdf/NAT-Compatibility-Testbed.pdf
44
From NAT to NAT Traversal
TURN (RFC 5766/6062)
Abstract
If a host is located behind a NAT, then in certain situations it can be
impossible for that host to communicate directly with other hosts (peers).
In these situations, it is necessary for the host to use the services of an
intermediate node that acts as a communication relay. This specification
defines a protocol, called TURN (Traversal Using Relays around NAT),
that allows the host to control the operation of the relay and to exchange
packets with its peers using the relay. TURN differs from some other relay
control protocols in that it allows a client to communicate with multiple
peers using a single relay address.
The TURN protocol was designed to be used as part of the ICE
(Interactive Connectivity Establishment) approach to NAT traversal,
though it also can be used without ICE.
46
ICE = STUN + TURN
http://blog.schertz.name/2012/10/lync-edge-stun-turn/
47
ICE (5245/5768)
Abstract
This document describes a protocol for Network Address
Translator (NAT) traversal for UDP-based multimedia sessions
established with the offer/answer model. This protocol is called
Interactive Connectivity Establishment (ICE). ICE makes use of
the Session Traversal Utilities for NAT (STUN) protocol and its
extension, Traversal Using Relay NAT (TURN). ICE can be used
by any protocol utilizing the offer/answer model, such as the
Session Initiation Protocol (SIP).
48
ICE Candidate…
SDP…
…
WebRTC is a free, open
project that provides
browsers and mobile
applications with Real-Time
Communications (RTC)
capabilities via simple APIs.
50
On-demand Live Video and Audio
https://fr.jocly.com/node/339
51
WebRTC Architecture
http://www.html5rocks.com/en/tutorials/webrtc/basics/
52
WebRTC Find Connection Candidates
http://www.html5rocks.com/en/tutorials/webrtc/basics/
53
WebRTC Data Pathways
http://www.html5rocks.com/en/tutorials/webrtc/basics/
54

More Related Content

DOCX
Mikrotik basic configuration
PDF
ICE: The ultimate way of beating NAT in SIP
PPT
NAT Traversal
PDF
Segment Routing Lab
PPTX
5G_NR_Overview_Architecture_and_Operating_Modes
PDF
ISP Load Balancing with Mikrotik ECMP
PDF
Subscriber Traffic & Policy Management (BNG) on the ASR9000 & ASR1000
PDF
SRv6 Mobile User Plane : Initial POC and Implementation
Mikrotik basic configuration
ICE: The ultimate way of beating NAT in SIP
NAT Traversal
Segment Routing Lab
5G_NR_Overview_Architecture_and_Operating_Modes
ISP Load Balancing with Mikrotik ECMP
Subscriber Traffic & Policy Management (BNG) on the ASR9000 & ASR1000
SRv6 Mobile User Plane : Initial POC and Implementation

What's hot (20)

PDF
MPLS L3 VPN Deployment
PDF
DDoS Mitigation using BGP Flowspec
PDF
Beginners: Open RAN Terminology – Virtualization, Disaggregation & Decomposition
PPTX
CCNA ppt Day 1
PDF
Network analysis Using Wireshark Lesson 11: TCP and UDP Analysis
PDF
Cours3 ospf-eigrp
PDF
MPLS Presentation
PDF
Beginners: 5G Terminology
PDF
Ieee nfv-sdn-2020-srv6-tutorial
PDF
Mobile Transport Evolution with Unified MPLS
PDF
IOS Cisco - Cheat sheets
PPTX
SDWAN Introduction presentation & Public Speaking
PPT
JunOS Jumstart 01 - JunOS Overview.ppt
PDF
Ccnp presentation day 4 sd-access vs traditional network architecture
PPTX
IMS Registration Flow
PPT
Wireshark Inroduction Li In
PDF
WiFi – Mobile BNG Offload Deployments
ODP
Expanding Asterisk with Kamailio
PDF
VXLAN BGP EVPN: Technology Building Blocks
PDF
Vpn d’acces avec cisco asa 5500 et client
MPLS L3 VPN Deployment
DDoS Mitigation using BGP Flowspec
Beginners: Open RAN Terminology – Virtualization, Disaggregation & Decomposition
CCNA ppt Day 1
Network analysis Using Wireshark Lesson 11: TCP and UDP Analysis
Cours3 ospf-eigrp
MPLS Presentation
Beginners: 5G Terminology
Ieee nfv-sdn-2020-srv6-tutorial
Mobile Transport Evolution with Unified MPLS
IOS Cisco - Cheat sheets
SDWAN Introduction presentation & Public Speaking
JunOS Jumstart 01 - JunOS Overview.ppt
Ccnp presentation day 4 sd-access vs traditional network architecture
IMS Registration Flow
Wireshark Inroduction Li In
WiFi – Mobile BNG Offload Deployments
Expanding Asterisk with Kamailio
VXLAN BGP EVPN: Technology Building Blocks
Vpn d’acces avec cisco asa 5500 et client
Ad

Viewers also liked (15)

PPT
PPTX
Nat traversal in WebRTC context
PPTX
ICE basic
KEY
SIP 2012:: ICE - NAT traversal for media
ODP
Kranky geekwebrtc demo
PDF
IMANOVMUSALIM_com (1)
PDF
Stun turn poc_pilot
PPT
Webrt integration by altanai bisht
PDF
Introduction to WebRTC
PPTX
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
PPTX
WebRTC presentation
PDF
2016-09-17 03 Василий Полозов. WebRTC
PPTX
WebRTC overview
PPTX
AnyFirewall Engine & Server by Eyeball Networks
PDF
Web rtc 핵심 기술에 대한 이해
Nat traversal in WebRTC context
ICE basic
SIP 2012:: ICE - NAT traversal for media
Kranky geekwebrtc demo
IMANOVMUSALIM_com (1)
Stun turn poc_pilot
Webrt integration by altanai bisht
Introduction to WebRTC
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
WebRTC presentation
2016-09-17 03 Василий Полозов. WebRTC
WebRTC overview
AnyFirewall Engine & Server by Eyeball Networks
Web rtc 핵심 기술에 대한 이해
Ad

Similar to From NAT to NAT Traversal (20)

PDF
WebRTC: Building plugin-free, real-time web applications
PDF
GÉANT TURN pilot
PDF
Spliced NAT2NAT And Other Packet-Level Misadventures.pdf
PPTX
How to tranfer files over router firewall
PPTX
WebRTC Introduction & Basics
PDF
IPv6 required - Karunya University 3 Feb 2012
PDF
NAT and firewall presentation - how setup a nice firewall
PPT
Cullen Jennings’s Presentation at eComm 2009
PDF
Computer network (16)
PPTX
Scaling connections in peer-to-peer applications
PDF
IRJET - Overview of Hole Punching: ICMP Hole Punching, TCP Hole Punching, UDP...
PDF
IRJET- Overview of Hole Punching: ICMP Hole Punching, TCP Hole Punching, UDP ...
PPTX
Network address translation
PPT
PDF
NAT (network address translation) & PAT (port address translation)
PPT
Sinnreich Henry Johnston Alan Pt 3
PDF
Module17 nat v2
PPTX
networkaddresstranslation-160909142440.pptx
PPT
Web-RTC Based Conferencing Application
WebRTC: Building plugin-free, real-time web applications
GÉANT TURN pilot
Spliced NAT2NAT And Other Packet-Level Misadventures.pdf
How to tranfer files over router firewall
WebRTC Introduction & Basics
IPv6 required - Karunya University 3 Feb 2012
NAT and firewall presentation - how setup a nice firewall
Cullen Jennings’s Presentation at eComm 2009
Computer network (16)
Scaling connections in peer-to-peer applications
IRJET - Overview of Hole Punching: ICMP Hole Punching, TCP Hole Punching, UDP...
IRJET- Overview of Hole Punching: ICMP Hole Punching, TCP Hole Punching, UDP ...
Network address translation
NAT (network address translation) & PAT (port address translation)
Sinnreich Henry Johnston Alan Pt 3
Module17 nat v2
networkaddresstranslation-160909142440.pptx
Web-RTC Based Conferencing Application

More from Li-Wei Yao (9)

PDF
SSL Certificate and Code Signing
PDF
Docker Usage
PDF
6.2 Move Creation Knowledge to Factory - Refactoring to Patterns
PDF
6.3 Encapsulate Classes with Factory - Refactoring to Patterns
PDF
6.1 Replace Constructors with Creation Methods - Refactoring to Patterns
PDF
Qlync RD 第三屆讀書會候選清單
PDF
自動測試 - 測試對象的識別/封裝
PDF
Design Pattern - Iterator and Composite Patterns
PDF
Design Pattern - Factory Pattern
SSL Certificate and Code Signing
Docker Usage
6.2 Move Creation Knowledge to Factory - Refactoring to Patterns
6.3 Encapsulate Classes with Factory - Refactoring to Patterns
6.1 Replace Constructors with Creation Methods - Refactoring to Patterns
Qlync RD 第三屆讀書會候選清單
自動測試 - 測試對象的識別/封裝
Design Pattern - Iterator and Composite Patterns
Design Pattern - Factory Pattern

Recently uploaded (20)

PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
assetexplorer- product-overview - presentation
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
history of c programming in notes for students .pptx
PDF
Digital Strategies for Manufacturing Companies
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Understanding Forklifts - TECH EHS Solution
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Introduction to Artificial Intelligence
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Design an Analysis of Algorithms II-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PTS Company Brochure 2025 (1).pdf.......
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
assetexplorer- product-overview - presentation
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
history of c programming in notes for students .pptx
Digital Strategies for Manufacturing Companies
Reimagine Home Health with the Power of Agentic AI​
Understanding Forklifts - TECH EHS Solution
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Introduction to Artificial Intelligence
Odoo Companies in India – Driving Business Transformation.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

From NAT to NAT Traversal