V2EX  ›  英汉词典
Enqueued related words: Host-Byte-Order

Network Byte Order

Definition / 定义

Network byte order 指网络协议中规定的多字节数据(如 16 位、32 位整数)在传输时的字节排列顺序,通常为大端序(big-endian):高位字节在前、低位字节在后。常见于 IP、TCP、UDP 等协议字段,以及 C 语言套接字编程中的 htons/htonlntohs/ntohl 转换。(也有人把它简称为 NBO。)

Pronunciation / 发音

/ˈnɛtˌwɝːk baɪt ˈɔːrdər/

Examples / 例句

The port number is sent in network byte order.
端口号会以网络字节序发送。

When parsing the TCP header, convert the 32-bit sequence number from network byte order to host byte order before doing arithmetic on it.
解析 TCP 首部时,应先把 32 位序列号从网络字节序转换为主机字节序,再对其进行运算。

Etymology / 词源

该术语由 network(网络)+ byte(字节)+ order(顺序)组成。早期互联网协议为了在不同硬件架构(大小端不同)之间保持一致,规定传输采用统一的字节序;最终在主流协议与标准文档中固定为大端序,并被称为 “network byte order”。

Related Words / 相关词

Notable Works / 文献与名著中的出现

  • *RFC 791: Internet Protocol (IP)*(提及多字节字段按网络约定顺序解释,即网络字节序/大端序)
  • *RFC 793: Transmission Control Protocol (TCP)*(TCP 首部字段的网络表示方式与字节序约定)
  • W. Richard Stevens, TCP/IP Illustrated, Volume 1: The Protocols(套接字与协议解析中频繁讨论 network byte order)
  • Andrew S. Tanenbaum & David J. Wetherall, Computer Networks(讲解端序与跨平台网络数据表示)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   680 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 20:59 · PVG 04:59 · LAX 12:59 · JFK 15:59
♥ Do have faith in what you're doing.