网关(gateway)可以追溯到未出现计算机网络的时候,当时用于电话系统之间的通信。
下面说计算机网络后,网关这个词第一次用在计算机网络是在 International Network Working Group (INWG) 关于通信系统的报告里面。在此之前,例如 ARPANET 使用的是 switching node 这个术语。
随后互联网协议(Internet protocol)在 RFC 上发表,即 RFC 791,里面提出对于路由(routing)的定义
The internet modules use the addresses carried in the internet header
to transmit internet datagrams toward their destinations. The
selection of a path for transmission is called routing.
同时也定义了网关
Gateways implement internet protocol to forward datagrams between
networks. Gateways also implement the Gateway to Gateway Protocol
(GGP) to coordinate routing and other internet control information.
由上面可以看到网关用于转发数据报(datagram),而转发数据报选择的路径称为路由。
路由器(router),根据历史,我猜测可能是 Cisco 第一个使用的这个术语,毕竟第一个多协议路由器是 Cisco 的创立者发明的:
Stanford’s router program was led by William Yeager and MIT’s by Noel
Chiappa.
所以按照 RFC 标准,应该使用 gateway,但是现在 router 使用的更多,并成为主流。
在计算机网络中,根据 RFC,你所使用的终端设备被称为 host 或 end-system
与 host 的连接的第一个路由器被称为 first-hop router,也叫 default gateway,即代表边缘的默认路由器。
在一个 AS 中,存在 internal router 和 gateway router,这里的 gateway router 是与另一个 AS 连接的设备。