25 · Enabling Internet Connectivity啟用網際網路連線

Benefits and Drawbacks of NATNAT 的優點與缺點

Here are the benefits of NAT:

以下是 NAT 的優點:

  • NAT conserves public addresses by enabling multiple privately addressed hosts to communicate using a limited, small number of public addresses instead of acquiring a public address for each host that needs to connect to internet. The conserving effect of NAT is most pronounced with PAT, where internal hosts can share a single public IPv4 address for all external communication.NAT 讓多個使用私有位址的主機能共用少量的公有位址進行通訊,而不必為每台需要連上網際網路的主機都取得一個公有位址,藉此節省公有位址。這種節省效果在使用 PAT 時最為明顯,因為內部主機可以共用單一個公有 IPv4 位址進行所有的外部通訊。
  • NAT increases the flexibility of connections to the public network.NAT 增加了連上公有網路的彈性。
  • NAT provides consistency for internal network addressing schemes. When a public IPv4 address scheme changes, NAT eliminates the need to readdress all hosts that require external access, saving time and money. The changes are applied to the NAT configuration only. Therefore, an organization could change ISPs and not need to change any of its inside clients.NAT 為內部網路定址方案提供一致性。當公有 IPv4 定址方案變更時,NAT 使組織不必為所有需要對外連線的主機重新定址,因而節省時間與成本。變更只需套用在 NAT 設定上即可。因此,一個組織可以更換 ISP,而不必變更任何內部用戶端的位址。
  • NAT can be configured to translate all private addresses to only one public address or to a smaller pool of public addresses. When NAT is configured, the entire internal network hides behind one address or a few addresses. To the outside, it seems that there is only one or a limited number of devices in the inside network. This hiding of the internal network helps provide additional security as a side benefit of NAT.NAT 可以設定為將所有私有位址都轉譯成單一公有位址,或轉譯成較小的公有位址集區。設定 NAT 後,整個內部網路就隱藏在一個或少數幾個位址背後。對外部而言,看起來內部網路中只有一台或有限數量的裝置。這種隱藏內部網路的效果,也是 NAT 帶來的額外安全性附帶好處。

The disadvantages of NAT include:

NAT 的缺點包括:

  • End-to-end functionality is lost. Many applications depend on the end-to-end property of IPv4-based communication. Some applications expect the IPv4 header parameters to be determined only at endpoints of communication. NAT interferes by changing the IPv4 address and sometimes transport protocol port (if using PAT) numbers at network intermediary points. Changed header information can block applications.端對端功能會喪失。許多應用程式依賴基於 IPv4 通訊的端對端特性,有些應用程式預期 IPv4 標頭參數只會在通訊的端點才會被判定。NAT 會在網路的中介節點更改 IPv4 位址,有時(若使用 PAT)也會更改傳輸層通訊協定的連接埠號,因而造成干擾。被更改的標頭資訊可能會導致應用程式無法運作。
    • For instance, call signaling application protocols include the information about the device's IPv4 address in its headers. Although the application protocol information is going to be encapsulated in the IPv4 header as data is passed down the TCP/IP stack, the application protocol header still includes the device's IPv4 address as part of its own information.例如,呼叫訊令(call signaling)應用程式通訊協定會在其標頭中包含裝置的 IPv4 位址資訊。雖然應用程式通訊協定的資訊在沿著 TCP/IP 堆疊往下傳遞時,會被封裝進 IPv4 標頭中作為資料,但應用程式通訊協定標頭本身仍會將裝置的 IPv4 位址列為自身資訊的一部分。
    • The transmitted packet will include the sender's IPv4 address twice: in the IPv4 header and in the application header. When NAT makes changes to the source IPv4 address (along the path of the packet), it will change only the address in the IPv4 header. NAT will not change IPv4 address information that is included in the application header.傳送出去的封包中會包含寄件者的 IPv4 位址兩次:一次在 IPv4 標頭,一次在應用程式標頭。當 NAT 沿著封包傳送路徑更改來源 IPv4 位址時,它只會更改 IPv4 標頭中的位址,不會更改應用程式標頭中所包含的 IPv4 位址資訊。
    • At the recipient, the application protocol will rely only on the information in the application header. Other headers will be removed in the de-encapsulation process. Therefore, the recipient application protocol will not be aware of the change NAT has made and it will perform its functions and create response packets using the information in the application header.在接收端,應用程式通訊協定只會依賴應用程式標頭中的資訊,其他標頭在解封裝過程中會被移除。因此,接收端的應用程式通訊協定不會察覺 NAT 所做的更改,仍會依應用程式標頭中的資訊執行其功能並建立回應封包。
    • This process results in creating responses for unroutable IPv4 addresses and ultimately prevents calls from being established. Besides signaling protocols, some security applications, such as digital signatures, fail because the source IPv4 address changes. Sometimes, you can avoid this problem by implementing static NAT mappings.這個過程會導致所建立的回應使用了不可路由的 IPv4 位址,最終使得通話無法建立。除了訊令協定之外,某些安全性應用程式(例如數位簽章)也會因來源 IPv4 位址改變而失敗。有時你可以透過設定靜態 NAT 對映來避免這個問題。
  • End-to-end IPv4 traceability is also lost. It becomes much more difficult to trace packets that undergo numerous packet address changes over multiple NAT hops, so troubleshooting is challenging. On the other hand, for malicious users, it becomes more difficult to trace or obtain the original source or destination addresses.端對端 IPv4 可追蹤性也會喪失。封包在經過多次 NAT 位址更改、跨越多個 NAT 節點後,要追蹤這些封包會變得困難許多,因而增加疑難排解的難度。另一方面,對惡意使用者而言,要追蹤或取得原始來源或目的位址也會變得更困難。
  • Using NAT also creates difficulties for the tunneling protocols, such as IP Security (IPsec), because NAT modifies the values in the headers. Integrity checks declare packets invalid if anything changes in them along the path. NAT changes interfere with the integrity checking mechanisms that IPsec and other tunneling protocols perform.使用 NAT 也會為 IP 安全(IPsec)等通道協定帶來困難,因為 NAT 會修改標頭中的數值。完整性檢查會判定封包在傳送路徑上若有任何內容遭到更改即視為無效。NAT 的更動會干擾 IPsec 及其他通道協定所執行的完整性檢查機制。
  • Services that require the initiation of TCP connections from an outside network (or stateless protocols, such as those using UDP) can be disrupted. Unless the NAT router makes specific effort to support such protocols, inbound packets cannot reach their destination. Some protocols can accommodate one instance of NAT between participating hosts (passive mode FTP, for example) but fail when NAT is performed at multiple points between communicating systems, for instance both in the source and in the destination network.需要由外部網路主動發起 TCP 連線的服務(或如使用 UDP 的無狀態通訊協定)可能會受到干擾。除非 NAT 路由器特別針對這類通訊協定做支援,否則入向封包將無法抵達目的地。有些通訊協定可以容許在通訊主機之間只經過一次 NAT(例如被動模式 FTP),但若在通訊系統之間的多個點都執行 NAT(例如同時在來源與目的網路都進行),就會失敗。
  • NAT can degrade network performance. It increases forwarding delays because the translation of each IPv4 address within the packet headers takes time. For each packet, the router must determine whether it should undergo translation. If translation is performed, the router alters the IPv4 header and possibly the TCP or UDP header. All checksums must be recalculated for packets in order for packets to pass the integrity checks at the destination. This processing is most time consuming for the first packet of each defined mapping. The performance degradation of NAT is particularly disadvantageous for real time applications, such as VoIP.NAT 可能降低網路效能。由於轉譯封包標頭中的每個 IPv4 位址都需要時間,因此會增加轉送延遲。對每個封包,路由器都必須判斷是否需要進行轉譯。若需要轉譯,路由器就會更改 IPv4 標頭,也可能更改 TCP 或 UDP 標頭。所有的總和檢查碼都必須重新計算,封包才能在目的地通過完整性檢查。這項處理對每個對映的第一個封包最為耗時。NAT 造成的效能下降,對即時應用程式(例如 VoIP)尤其不利。
Which NAT disadvantage is described in the following situation? A user is unsuccessfully trying to establish a video call from the head office to the branch office. After some troubleshooting, they find out that the signaling protocol uses private IPv4 addresses in its messages. Both caller and called hosts try to send video data to the private address.以下情境描述的是哪一項 NAT 缺點?某使用者嘗試從總公司對分公司建立視訊通話卻失敗。經過一番疑難排解後,發現訊令通訊協定在其訊息中使用了私有 IPv4 位址,導致主叫與被叫主機都試圖將視訊資料傳送到該私有位址。