路由器有一项特殊的工作,它必须促进端到端原则。
基本上,路由器的工作是解释目标 IP 地址并确定将其发送到的下一个路由器(或终端节点)。路由器通常会做两件事:
一般来说,它不应该进一步解释数据包。
现在,NAT 会破坏端到端,因为它进一步解释和转换数据包。例如,NAT 可能会更改数据包的源地址。在这种情况下,您已经破坏了端到端,因为另一个 Internet 主机将无法识别发送数据包的特定主机。他们只能识别 NAT 的源地址。
编辑:RFC 1812 在第 2.2.1 节中明确说明了这一点,其中描述了分层职责:
o Transport Layer
The Transport Layer provides end-to-end communication services.
...
TCP is a reliable connection-oriented transport service that
provides end-to-end reliability, resequencing, and flow control.
...
o Internet Layer
All Internet transport protocols use the Internet Protocol (IP) to
carry data from source host to destination host. IP is a
connectionless or datagram internetwork service, providing no
end-to-end delivery guarantees.
在第 2.2.3 节中,它继续声明:
Routers provide datagram transport only, and they seek to minimize
the state information necessary to sustain this service in the
interest of routing flexibility and robustness.
“普通”路由器根本不处理“端到端”原则。它的工作只是在 Internet 层传递数据包,根据定义,这就是“不提供端到端传递保证”。这就是传输层的工作。 NAT 通过在传输层而不是简单的 Internet 层运行来“打破端到端”,并为每个连接保留过多的状态。
希望这是有道理的。我知道这可能会令人困惑。