V2EX network-byte-order

Network Byte Order

Definition / 定义

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

Pronunciation / 发音

/ntwk bat rdr/

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”。

RelatedWords / 相关词

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     1346 人在线   最高记录 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 36ms UTC 17:17 PVG 01:17 LAX 10:17 JFK 13:17
Do have faith in what you're doing.
ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86