UDP Hole Punching

Download Report

Transcript UDP Hole Punching

大規模NATを越えるための
UDP Multi Hole Punchingの拡張
コンピュータ・ネットワーク工学科 4年
後藤滋樹研究室
戸部 和洋 (1G06R140-0)
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
1
研究の背景 (1)
Network Address Translator (NAT) の問題
UDP Hole Punching
NATの問題点
• NATは外側から接続できない
• NATの内側のホストのアドレス
は外側からわからない
• インバウンドの開始パケット
(initiation packet) を破棄する NAT
private
address
realm
global address
realm
the
Internet
越え
host-A
NAT-B
host-B
(1)host-Aの外部IP,
外部portがわかる
(2)host-Bの外部IP,
外部portがわかる
(3)host-Bと通信したいな
(5)戻りパケットを
期待して穴が空く
NATは外側から
接続できない
rendezvous
server
NAT-A
(8)戻りパケットと
して転送される
(4) host-Bは(A, P)にいます
host-Bにもお知らせしますね
(6)知らない相手
のパケットは破棄
(7)戻りパケットを
期待して穴が空く
(9)戻りパケットと
して転送される
UDP Hole Punchingによって、NATを越えて相手と直接通信(NAT越え)できる。
Kazuhiro TOBE, GOTO Laboratory,
Dept.
卒業論文審査会
February
1, 2010 NATに限る。
of Computer
Science andNATは(普通には)越えられない。
Engineering
※ただし、Cone
i.e. Symmetric
2
既存手法
UDP Multi Hole Punching
• UDP Hole Punching
の改良版
NAT-A
server-A server-B
host-A (Cone NAT)
• 2台のサーバとの通信
によるポート予測
• 低いTTLに設定した
UDPパケットを大量送信
• Symmetric NATをリレー
サーバなしで越えられる
• サーバに低負荷・低遅延
• cf. TURN, ICE, Teredo
(Symmetric NAT) host-B
(7)
Time
Exceeded
(8)
(9)
当時はこれでよかったが・・・
卒業論文審査会
February 1, 2010
NAT-B
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
(10)
(11)
3
研究の背景 (2)
大規模NAT (Large Scale NAT)
[Huston] G. Huston, “IPv4 Address Report”,
http://www.potaroo.net/tools/ipv4/index.html
• IPv4アドレスの在庫枯渇が迫る (IANA:2011, RIR:2012) [Huston]
• ISPは大規模NAT (Large Scale NAT/
the
Carrier Grade NAT) の配置を計画
global
Internet
• NATの多段接続
• NAT越えが難しくなる
Large Scale
NAT
address
realm
e.g. UPnPは機能しない
• ポート番号の制限
• 同時セッション数の制限
e.g. Google Maps
UDP Multi Hole
Punching
の改良が必要
private
address
realm
home
network
ISP
network
home
NAT
home
network
ISP shared
address
realm
ISP
network
home NAT
home
network
home
network
ポート数の制限
• NATで使えるポート数
にはかぎりがある
• 約60000個 (=216-1024) の
ポート番号を複数のユーザで
共有するため
「虫食い」のGoogle Maps
•
大規模NATにポート数が制限されて、
虫食い状態になったGoogle Maps
• 高速化のため、大量の
セッションを同時に張る
アプリケーションがある
• iTunes (230~270)
• Amazon (90)
• ニコニコ動画 (50~80)
卒業論文審査会
February 1, 2010
このページの図と測定値はすべて以下の文献から引用しています。
[Miyakawa] 宮川 晋, “インターネット10分講座:大規模NAT
(Large Scale NAT:LSN) あるいはキャリアグレードNAT(CGN)”,
http://www.nic.ad.jp/ja/newsletter/No41/0800.html
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
5
背景のまとめと研究の目的
• 大規模NATや集合団地におけるNATの配置
• NATの多段接続
• 利用可能ポート番号の制限
⇒ UDP Multi Hole Punching(既存のNAT越え手法)による
Symmetric NAT越えの可能性が低下
• 大規模NAT環境においても、UDP Multi Hole Punchingが
効率的に利用できるように技術を拡張
• ポート予測 (Port Prediction)
• Low TTL Value Determination
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
6
Mapping Behavior
• Address and Port-Dependent Mapping (Symmetric NAT)
internal
network
Host-L
Addr: AL
Local
Global
Remote
<AL, PL> <AN, PN> <AR, PR>
<AL, PL> <AN, PN’> <AX, PR’>
<AL, PL> <AN, PN’’> <AX, PR’’>
PN
external network
PR
PN’ NAT
PN’’ Addr: Na
mapped a new port (PN’)
mapped a new port (PN’’)
PL
Hole Punching must predict this new port (PN’’).
PR’
PX
Host-R
Addr: AR
Host-X
Addr: AX (≠AR)
NAT maps a new endpoint when a local host (Host-L) sends a packet to any
external endpoints which Host-L hasn’t sent a packet, if the NAT behaves as
“Endpoint-Independent Mapping”. This NAT was once called “Symmetric NAT”.
ポート予測 (Port Prediction)
• NATが割り当てるポートの規則性を調べ、
次に割り当てられるポートを予測する技術
• これが成功すれば、Hole PunchingでSymmetric NATを越えられる
+1
+1
+1
規則性あり
(Predictable)
Randomの場合
手当たり次第に
大量のパケットを送
信するしかない(最
後の手段)
-4
-4
- 61 !?
規則性なし
(Random)
既存手法の問題点1
ポート予測 (Port Prediction) における問題
問題点1. 同じNATに他のホストがいる場合、
ポート予測が正しく行えない可能性がある
• 自分以外のホストの通信によっても、Symmetric
NATが新しいポートのマッピングを生成するため
• Predictable (e.g. Incremental) にもかかわらず、
Randomと誤判定してしまう可能性がある
「最後の手段」として大量のポートをオープン
⇒ 大規模NATのポートを食い尽くしてしまう
提案手法1
Port Predictionの拡張
解決策1-a. キャプチャ法
• ポート予測中にLAN内のパケットをキャプチャ
• NATの外側の新しいあて先へパケットが流れて
いた場合、その数をポート予測で考慮する
• Predictableであるにもかかわらず、Randomと誤判定
してしまう可能性を減らすことができる
解決策1-b. スキャン法
• 所属するネットワーク上の全IPアドレスを確認
• 応答のあったノード数をポート予測で考慮する
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
10
キャプチャ法 vs. スキャン法
キャプチャ法
利点
利点
• ポート予測に追加時間
がほとんどかからない
欠点
• ユーザモードでも動作
(実装による)
欠点
• 管理者権限 (Windows) /
root権限 (Linux) が必要
• ハブでつながっている
マシンのトラヒックしか
キャプチャできない
卒業論文審査会
February 1, 2010
スキャン法
• 確率的な予測のみ
• スキャンのための時間
がかかる
• 攻撃として検知される
可能性あり (e.g. IDS)
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
11
Low TTL Value Determination
• UDP Multi Hole PunchingはパケットのTTLを低く
設定1) して送信することで、自分側のNATを越えて、
相手側のNATに到達する前にパケットを破棄する
• Low TTL Value Determination:1) の値を決めるアルゴリズム
• UDP Multi Hole Punching : 「決めうち」
• NATBLASTER :「traceroute の方法」(提案のみ、未実装)
• e.g.) TTL = 2の場合
Time Exceeded
TTL => 0
TTL => 1
NAT router
(1st hop)
TTLの値は次の条件を満たしていればよい
TTL > 1 ∧ TTL – 5 < 0 ∴ 1 < TTL < 5
router
(4th hop)
router
(2nd hop)
router
(3rd hop)
NAT router
(5th hop)
12
既存手法の問題点 (2)
Low TTL Value Determination における問題
• NATが多段の場合、自分側の一番外側のNATを越
えて相手側の一番外側のNATに到達する前にTTL
が0になればよいが・・・
• TTL > 2 ∧ TTL – 4 < 0
∴ 2 < TTL < 4
問題点2. NATがいくつ連なっているか判断できない
• Tracerouteで得られたルーターのIPアドレスから、NATか
どうか判断できることがあるが、ICMPを返さないルータがある
NAT router
(4th hop)
NAT router
(2nd hop)
NAT router
(1st hop)
router
(3rd hop)
NAT router
(5th hop)
13
提案手法2
Low TTL Value Determinationの方法
解決策2. tracerouteやtracertでhop数を求め、
それを2で割った値をTTLとする
[仮定] NATは経路の両端に存在し、中央にはない(はず)
• 本手法は途中のルーターのIPアドレスを知る(NATか判
定する)必要がないためICMPが返されなくても問題ない
$ tracert 208.77.188.166
Tracing route to www.example.com [208.77.188.166]
over a maximum of 30 hops:
1
2
*
*
*
*
11
12
*
144 ms
*
147 ms
Trace complete.
*
Request timed out.
*
Request timed out.
(省略)
*
Request timed out.
146 ms www.example.com [208.77.188.166]
e.g.) hop数=12 ⇒ TTL := 12/2 = 6
14
実装
Javaで実装
• 一部、Rubyで実装し、java.lang.Runtime#exec()で実行
• Javaでは、ユニキャストUDPパケットのTTLを設定できないため
• キャプチャ法
• Jpcapを利用
• libpcap / WinPcap のJavaラッパー
• スキャン法
• java.net.InetAddress#isReachable()
• (権限があれば)ICMP ECHO REQUEST
• (なければ)ポート 7 (Echo) で TCP 接続
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
15
実験用ネットワーク
(VMware ESXiによる仮想環境)
home NAT-2
home NAT-1
LSN-1
LSN-2
(flexNES) private
private (flexNES)
(flexNES) global realm (flexNES)
Linux
realm-2
realm-1.1
.2
.1
.2 Sym .1
.2 vs .1
.66
vs
router
.1
.65
(10.0.1.0/24)
(10.0.0.0/24)
vs
vs
virtual switch
virtual switch
(promiscuous mode)
ISP-1 (192.0.2.0 .129 (192.0.2.64/26) ISP-2
shared
.2
shared /26) virtual switch (vs)
.2
.3
address
address
.130
.131
realm
realm
internal host-1,2
internall host-3
(192.168.0.0/24)
(192.168.1.0/24)
external server-1, 2
(192.0.2.128/26)
※Sym = Symmetric NAT
※flexible NAT Emulation Server (flexNES)
= RFC4787に準拠したNATエミュレータ
実験用ネットワーク(論理図)
home NAT-1
private (flexNES)
realm-1.1
.2
LSN-1
LSN-2
(flexNES) global realm (flexNES)
Linux
.2
.1
.1
router .66
.1
.65
(10.0.1.0/24)
(10.0.0.0/24)
.2
.3
home NAT-2
(flexNES) private
realm-2
.2 Sym .1
ISP-1 (192.0.2.0 .129 (192.0.2.64/26) ISP-2
shared
shared /26)
address
address
.130
.131
realm
realm
.2
internal host-1,2
internall host-3
(192.168.0.0/24)
(192.168.1.0/24)
external server-1, 2
(192.0.2.128/26)
※Sym = Symmetric NAT
※flexible NAT Emulation Server (flexNES)
= RFC4787に準拠したNATエミュレータ
まとめと今後の課題
まとめ
UDP Multi Hole Punchingの拡張
• 必要以上のポートをオープンしてしまう問題の解決
• 通信経路上でNATが多段になっていても適応可能
今後の課題
Low TTL Value Determinationにおける仮定の妥当性の検討
• 「NATはエンドホストの近くに集中」
• 「経路の中央付近には存在しない」
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
18
ご清聴ありがとうございました
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
19
Network Address Translator (NAT)
• NATの内側にあるホストの
<IP Address, port>と、NATの
外側の<IP Address, port> を
変換する装置
• たいていの家庭用BBルータ
に実装されている
• 複数のホストが同じグロー
バルIPアドレスを使用して
インターネットにアクセス可
• NAT内部ではプライベートIP
アドレスを使うことが多い
• e.g. 192.168.xxx.yyy
NATの問題点
• NATの内側のホストのアドレス
は外側からわからない
• NATは、知らない相手からの
パケット (unsolicited packet)
を破棄する
private
address
realm
Internet
global
address
realm
NAT
NATは外側から
接続できない
※IPアドレスだけでなくポート番号も変換する装置は、厳密にはNetwork Address and Port Translator
(NAPT) であるが、現在はほとんどがNAPTであるため、これらを区別せずにNATと呼ぶことが多い。
NAT越え手法の比較
×:UPnP
○:Relaying
利点 Windows APIにある [15]
欠点
利点 どんなNAT環境でも機能
欠点
• ローカルネットワークにある
NATルータしか操作できない
• 転送による遅延が発生
• リレーサーバの負荷大
• ISPのNATに届かない
• 認証機構が存在しない
• ISPのNATがUPnPを
許可してしまうと・・・
• 「全部俺のポート!」
• 極一部のユーザが、大量の
ポートフォワーディング生成
卒業論文審査会
February 1, 2010
◎:UDP Hole Punching
利点 NATが多段でも機能
欠点
• UDPのみ(TCPは難しい)
• Symmetric NATは難しい
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
21
Hole Punchingのセキュリティ
• Hole Punchingで「穴を開ける」と言われると、
セキュリティを気にされる方が多いですが・・・
• NAT≠ファイアウォール
• Filtering Behavior (cf. RFC4787) のおかげで、
ファイアウォール的にふるまうように見えるだけ
• 家庭用ルータには多くの機能が実装されている
• どの機能のおかげなのかわかりづらい
• NATとパケットフィルタ型ファイアウォールが混在
• セキュリティ対策はアプリケーションで行う
• 受信パケットの送信元チェックなどをアプリで行う
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
22
Javaの場合
• java.net.DatagramSocket.connect(InetAddress
host, int port)
• 指定されたリモートホストの指定されたポートだけにパ
ケットを送信(あるいはそのポートからだけパケットを受信
する)ようにDatagramSocketに指示する。
• 指定された以外のホストまたはポートにパケットを送信し
ようとすると、IlligalArgumentExceptionが発生する。
• 指定された以外のホストまたはポートから受信したパケッ
トは、黙って破棄され、例外やその他の通知はない。
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
23
TCP Hole Punching
※同時オープン (simultaneous open) の詳細は、
「詳解TCP/IP Vol.1 プロトコル」を参照して下さい。
• UDP Hole Punching
• 同時オープンする方法
NAT-B
host-B
のようにはいかない・・・ host-A SYNNAT-A rendezvous
server
SYN
SYN/ACK SYN/ACK
host-A
rendezvous
server
NAT-A
NAT-B
host-B
SYN
(1)戻りパケットを
期待して穴が空く
• TTLを低くして送る手法
(2)知らない相手
のパケットは破棄
(3)TCP RSTを
返してしまう
開いた穴が
閉じない
RST
(4)開いた穴が
閉じてしまう
SYN
RST
(6)穴が閉じてい
るので通らない
卒業論文審査会
February 1, 2010
host-A
(5)戻りパケットを
期待して穴が空く
NAT-A
rendezvous
server
NAT-B
host-B
ICMP Time
Exceeded
SYN
(low TTL)
SYN
SYN/ACK
(7)開いた穴が
閉じてしまう
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
ACK
24
UDP Multi Hole Punching
Phase I
server-A
NAT-A
host-A (Cone NAT)
(1)
(2)
(3)
server-B
NAT-B
(Symmetric NAT) host-B
(1) Host-A sends a UDP packet to server-A.
Then, server-A gets host-A’s external endpoint <AA1, PA1> mapped by NAT-A.
(2) Server-A informs host-A
of the endpoint <AA1, PA1>.
(3) Host-A sends a UDP packet, which contains <AA1, PA1>
in the payload, to server-B. Then, server-B gets <AA1, PA1>
第1回論文ゼミ tobe
and the external endpoint <AA2, PA2> (usually AA1= AA2, PA1= PA2 if
NAT-A is Cone NAT). Server-B analyzes these endpoints.
UDP Multi Hole Punching
Phase II
NAT-A
server-A
host-A (Cone NAT)
server-B
NAT-B
(Symmetric NAT) host-B
(4) Host-B sends a UDP packet to server-B.
Then, server-B gets host-B’s external endpoint <AB1, PB1> mapped by NAT-B.
(4)
(5) Server-B informs host-B
of the endpoint <AB1, PB1>.
(6)
(5)
(6) Host-B sends a UDP packet, which contains <AB1, PB1>
in the payload, to server-B. Then, server-B gets <AB1, PB1>
第1回論文ゼミ tobe
and the external endpoint <AB2, PB2> (usually AB1= AB2, PB1≠PB2 if
NAT-B is Symmetric NAT). Server-B analyzes these endpoints.
UDP Multi Hole Punching
Phase III
NAT-A
server-A server-B
host-A (Cone NAT)
NAT-B
(Symmetric NAT) host-B
(7)
(7) Server-B predicts the next
external endpoint <AA3, PA3> or
the range NAT-A will map. and
then informs host-B of the info.
(9)
Time
Exceeded
(8)
(9) Server-B informs host-A of the
info for UDP Multi Hole Punching.
(10) Host-A sends a lot of packets
to holes, opened at (9), of NAT-B.
(10)
第1回論文ゼミ tobe
(11)
(8) Host-B sends a lot
of packets whose TTL
is set so low that they’ll
be dropped between
NAT-B and NAT-A.
(11) UDP session is established.
Interactive Connectivity Establishment (ICE)
• offer/answerモデルのプロ
トコル (e.g. SIP/SDP) が、
NATを越えてUDPベースの
マルチメディアセッションを
確立することをサポート
• STUNやTURNで通信可能
なエンドポイント <IP, port>
(candidate) を調べ、最適
なエンドポイントを選択して
通信する
• Symmetric NATはTURN
によるリレーで越えられる
卒業論文審査会
February 1, 2010
TURN
server
Relayed Candidate
the Internet
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
Server-reflexive
Candidate
NAT router
Host
Candidate
28
NATの分類 (RFC 3489)
• Cone NAT
• Full Cone NAT
• Restricted Cone NAT
• Port Restricted Cone NAT
• Symmetric NAT
• あて先ごとに異なるマッピングを生成する
• cf. Address-Dependent Filtering/Address and PortDependent Filtering (RFC 4787)
• UDP Hole Punchingでは越えられない
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
29
NATの特性 (RFC 4787) (1/2)
• Address and Mapping Behavior
• Endpoint-Independent Mapping (Cone)
• Address-Dependent Mapping (Symmetric)
• Address and Port-Dependent Mapping (Symmetric)
• Port Assignment Behavior
• Port Preservation
• Port Overloading
• No Port Preservation
• Port Parity
• Port Contiguity
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
30
NATの特性 (RFC 4787) (2/2)
• Mapping Refresh
• Filtering Behavior
• Endpoint-Independent Filtering (Full Cone)
• Address-Dependent Filtering (Restricted Cone)
• Address and Port-Dependent Filtering
(Port Restricted Cone)
• Hairpinning Behavior
• ICMP Destination Unreachable Behavior
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
31
Mapping Behavior (1)
• Endpoint-Independent Mapping (Cone NAT)
internal network
external network
Local
Global
Remote
<AL, PL> <AN, PN> <any, any>
Host-L
Addr: AL
PR
PR’
PL
Host-R
Addr: AR
PN
NAT
Addr: AN
PX
Host-X
Addr: AX (≠AR)
NAT maps the same endpoint whenever a local host (Host-L) sends a packet to
any external endpoints (Addr : any, Port : any), if the NAT behaves as
Kazuhiro
TOBE,This
GOTONAT
Laboratory,
卒業論文審査会
“Endpoint-Independent
Mapping”.
was onceDept.
called “Cone NAT”. 32
February 1, 2010
of Computer Science and Engineering
Mapping Behavior (2)
• Address-Dependent Mapping (Symmetric NAT)
internal network
external network
Local
Global
Remote
<AL, PL> <AN, PN> <AR, any>
<AL, PL> <AN, PN’> <AX, any>
Host-L
Addr: AL
PL
PN
PR
NAT
PN’ Addr: AN
PR’
mapped a new port (PN’)
PX
Host-R
Addr: AR
Host-X
Addr: AX (≠AR)
Hole Punching must predict this new port (PN’).
NAT maps a new endpoint when a local host (Host-L) sends a packet to any
external hosts (≠R) which Host-L hasn’t sent a packet, if the NAT behaves as
Kazuhiro
TOBE,This
GOTONAT
Laboratory,
卒業論文審査会
“Endpoint-Independent
Mapping”.
was onceDept.
called “Symmetric NAT”.
33
February 1, 2010
of Computer Science and Engineering
Mapping Behavior (3)
• Address and Port-Dependent Mapping (Symmetric NAT)
internal
network
Host-L
Addr: AL
Local
Global
Remote
<AL, PL> <AN, PN> <AR, PR>
<AL, PL> <AN, PN’> <AX, PR’>
<AL, PL> <AN, PN’’> <AX, PR’’>
PN
external network
PR
PN’ NAT
PN’’ Addr: Na
mapped a new port (PN’)
mapped a new port (PN’’)
PL
Hole Punching must predict this new port (PN’’).
PR’
PX
Host-R
Addr: AR
Host-X
Addr: AX (≠AR)
NAT maps a new endpoint when a local host (Host-L) sends a packet to any
external endpoints which Host-L hasn’t sent a packet, if the NAT behaves as
Kazuhiro
TOBE,This
GOTONAT
Laboratory,
卒業論文審査会
“Endpoint-Independent
Mapping”.
was onceDept.
called “Symmetric NAT”.
34
February 1, 2010
of Computer Science and Engineering
Filtering Behavior (1)
• Endpoint-Independent Filtering
internal network
external network
Local
Global
Remote
<AL, PL> <AN, PN> <any, any>
Host-L
Addr: AL
PR
PR’
PL
Host-R
Addr: AR
PN
NAT
Addr: AN
PX
Host-X
Addr: AX (≠AR)
NAT forwards all packets from any external endpoints (Addr : any, Port : any)
to a local host (Host-L) which has already sent a packet to the external network,
TOBE, GOTO Laboratory,
Dept.
卒業論文審査会
if the NAT behaves asKazuhiro
“Endpoint-Independent
Filtering”.
35
February 1, 2010
of Computer Science and Engineering
Filtering Behavior (2)
• Address-Dependent Filtering
internal network
external network
Local
Global
<AL, PL> <AN, PN>
Host-L
Addr: AL
Remote
<AR, any>
PR
PR’
PL
Host-R
Addr: AR
PN
NAT
Addr: AN
PX
Host-X
Addr: AX (≠AR)
NAT forwards packets from the only remote Host-R (Addr : AR, Port : any) that
a local (Host-L) has already sent a packet to, but drops packets from any other
Kazuhiro
TOBE,as
GOTO
Laboratory,
Dept.
卒業論文審査会
remote hosts, if the NAT
behaves
“Endpoint-Independent
Filtering”.
36
February 1, 2010
of Computer Science and Engineering
Filtering Behavior (3)
• Address and Port-Dependent Filtering
internal network
external network
Local
Global
<AL, PL> <AN, PN>
Host-L
Addr: AL
Remote
< AR, PR>
PR
PR’
PL
Host-R
Addr: AR
PN
NAT
Addr: AN
PX
Host-X
Addr: AX (≠AR)
NAT forwards packets from the only endpoint (Addr : AR, Port : PR) that a local
(Host-L) has already sent a packet to, but drops packets from any other remote
Kazuhiro
GOTO Laboratory,
Dept.
卒業論文審査会
hosts, if the NAT behaves
as TOBE,
“Endpoint-Independent
Filtering”.
37
February 1, 2010
of Computer Science and Engineering
ポートフォワーディング/ポートマッピング
(Aterm DR203Cの設定画面)
(例)
UDP
5730
192.168.0.2
5730
38
パケットフィルタ
(Aterm DR203Cの設定画面)
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
39
ISP規模のIPv4アドレス共有方式
• 大規模NAT (Large Scale NAT : LSN)
• NAT444
• DS-lite [Dual-stack lite broadband deployments post
IPv4 exhaustion]
• A+P [The A+P Approach to the IPv4 Address Shortage]
アドレスを共有する以上、どの形式を採用しても
使用できるポート番号数の制限は避けられない。
⇒ NAT444以外のモデルにおいても本研究は有効
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
40
IPアドレス管理の構造
【出典】IPアドレス管理の基礎知識, http://www.nic.ad.jp/ja/ip/admin-basic.html
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
41
IPアドレスが欲しい時は
【出典】IPアドレスが欲しい時は, http://www.nic.ad.jp/ja/ip/whereto/
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
42
Projected RIR and IANA
Consumption (/8s)
Projected IANA Unallocated Address Pool Exhaustion: 09-Sep-2011
Projected RIR Unallocated Address Pool Exhaustion: 10-Oct-2012
【出典】Geoff Huston, IPv4 Address Report, http://www.potaroo.net/tools/ipv4/index.html
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
43
IPv4 Address Status
【出典】Geoff Huston, IPv4 Address Report, http://www.potaroo.net/tools/ipv4/index.html
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
44
NAT444
•
NAT 444 model uses two Network Address and
Port Translators (NAPTs) with three types of
IPv4 address blocks.
The IPv4
The IPv6
1. Private Address inside CPE
2. an IPv4 Address block
between CPEs and LSN
3. IPv4 Global Addresses
that is outside LSN
•
The ISPs using NAT444
provide IPv6 connectivity
by dual stack model.
卒業論文審査会
February 1, 2010
Internet
Internet
LSN
IPv4
Global Address
IPv4 IPv6
Dual Stack
IPv4 NAT /
IPv6 Dual Stack CPE
IPv4 Private Address /
IPv6 Dual Stack
IPv4/IPv6
Dual Stack host
45
NAT444 (Cont.)
• What type of IPv4 Address block should
we use between CPEs and LSN?
• Global Address
• RFC1918 Private Address (10/8)
could conflict with its customer's network address
• Class-E Address (240/4)
• ISP Shared Address
is intended to be assigned between CPE and LSN
in a NAT444
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
46
DS-Lite (NAT464)
※B4 element
= Basic Bridging BroadBand element
home
router
home
network
2001:0:0:1::1
ISP
core network (IPv6)
Address Family
Transfer Router
(AFTR)
B4
concentrator
10.0.0.2
IPv4 over IPv6
tunnel
2001:0:0:2::1
NAT-44
129.0.0.1
10.0.0.2
host
The dual-stack lite model is built on
IPv4 over IPv6 tunnels to cross
the network to reach a carriergrade IPv4-IPv4 NAT.
128.0.0.1
the Internet (IPv4)
host (IPv4)
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
47
A+P (Address + Port)
• avoid the presence of a CGN function.
• assign
• the same IP public address to several
customers at the same time (shared address)
• a restricted port range to each customer
• so that two customers with the same IP address
have two different port ranges that do not overlap
• introduce a new function in the ISP
network called Port Range Router (PRR).
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
48
NAT444 v.s. DS-lite/A+P
NAT444
• 利点
DS-lite/A+P(ハイブリッド構成も可)
• 利点
• ユーザ宅の機器 (CPE)
の交換が不要
• 欠点
• NATが多段になる
• UPnPが機能しない
• ISP Shared Address
(IPv4) が必要
• ステートフル
×:Scalability/Availability
卒業論文審査会
February 1, 2010
• NATが1段で済む
• UPnPが機能する
• ISP網をIPv6オンリーで
構成可能
• ステートレス
○:Scalability/Availability
• 欠点
• ユーザ宅の機器 (CPE)
の交換が必要
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
49
提案手法1(PortPredictionの拡張)の問題点
• NATが多段で自分が所属するNATより上に
Symmetric NATがあると機能しない
○ これは
Internet
Symmetric NAT
でOK
×
○これも
Symmetric NAT
でOK
自分
これが
Symmetric NAT
だと機能しない
• でも、LSNはSymmetric NATで実装されない
• NAT MUST have Endpoint-Independent Mapping [16]
• LSNもNATなので、Endpoint-Independent Mapping
(Cone NAT≠Symmetric NAT) として実装されるはず
Kazuhiro TOBE, GOTO Laboratory,
Dept.
卒業論文審査会
50
February 1, 2010
of Computer Science and Engineering
利用シーン
Q. キャプチャ法はルーターの下にスイッチがあると
すべてのパケットをキャプチャすることができないが、
どういう利用シーンを想定しているか?
A. NAT越えが必要になるのは主にIP電話やオンライ
ンゲームなどのP2Pアプリケーションであり、これら
は家庭の小さなネットワークで使用されることが多
いため、問題にならない。
卒業論文審査会
February 1, 2010
Kazuhiro TOBE, GOTO Laboratory,
Dept.
of Computer Science and Engineering
51