English Chinese (Simplified)
Naming and addressing 命名和寻址
The network and the transport layers rely on addresses that are encoded as fixed size bit strings. A network layer address uniquely identifies a host. Several transport layer entities can use the service of the same network layer. For example, a reliable transport protocol and a connectionless transport protocol can coexist on the same host. In this case, the network layer multiplexes the segments produced by these two protocols. This multiplexing is usually achieved by placing in the network packet header a field that indicates which transport protocol should process the segment. Given that there are few different transport protocols, this field does not need to be long. The port numbers play a similar role in the transport layer since they enable it to multiplex data from several application processes. 网络层与传输层依赖于被编码成固定长度的二进制地址。一个网络层地址可以唯一的识别一台主机。多个传输层单元可以使用同一个网络层的服务。例如,一个可靠传输协议和一个无连接传输协议可以在同一台主机上共存。在这种情况下,网络层复用于这两种协议。为了实现复用,往往通过替换数据包包头的一个特定字段来标记其所使用的传输协议。鉴于只存在几个不同的传输层协议,这个字段不需要很长。端口号在传输层扮演着同样的角色,它使得多个进程可以同时传输数据。
While addresses are natural for the network and transport layer entities, humans prefer to use names when interacting with network services. Names can be encoded as a character string and a mapping services allows applications to map a name into the corresponding address. Using names is friendlier for humans, but it also provides a level of indirection which is very useful in many situations. 尽管网络层和传输层的实体生来就有地址,人们更愿意使用名称来访问网络设施。名称可以被编码成一个字符串,然后通过一个映射服务映射至对应的地址。对于用户来说,使用名称是更加便利的。名称同时还能作为一层中间件,可以在许多场景下发挥作用。