Network Address Translation
What is NAT
NAT定義於 in RFC 1631, 基本上它是在 router 中進行一個偷換 IP header
的動作, 以便讓多台電腦能共用一個 IP 連上 Internet 的技術. 許多的 router
目前有都有支援 NAT 這項功能, 其它如 Linux 中的 IP Masquerade, FreeBSD
中的 NATD, 或是 Win95 上的 Sygate 軟體也是指一樣的東西.
NAT 一般多配合 Private IP Address 一同使用
NAT 的優點
-
由於對外只使用一個 IP address, 因此內部使用的 IP 可重覆地在不同單位使用
-
只要少數 public address 就能讓單位內所有電腦都連上 Internet
-
只有使用 public address 的電腦會被單位外部網路所存取, 使用 private address
的電腦不會直接被存取, 有安全上的好處
NAT的缺點
-
通訊協定資料中如含有其 IP address者將無法使用
(一般的NAT實作會修改出現在 FTP 和 ICMP 通訊協定資料中的 IP address,
但其它協定就不管了)
-
以 IP address 作為安全檢查的方式將不可行
NAT的一些考量
-
private networks that span backbones
-
routers in all partition should maintain routes to private addresses of
all partitions
-
backbone does not maintain routes to any privte addresses
-
each NAT router should have a public address, they tunnel through the backbone
using encapsulation to propgate routes of private network
-
header manipulation
-
To modify the IP address, NAT has to modify the IP checksum, the TCP checksum
( cause TCP checksums cover pseudo IP header)
-
To make multiple private hosts share one common public address, NAT has
to modify the port number