为什么将网络字节顺序定义为big-endian? [英] Why is network-byte-order defined to be big-endian?
问题描述
如标题中所述,我的问题是,为什么 TCP/IP 在传输数据时使用大端编码,而不是替代的小端方式?
As written in the heading, my question is, why does TCP/IP use big endian encoding when transmitting data and not the alternative little-endian scheme?
推荐答案
RFC1700 说必须是. (并将网络字节顺序定义为big-endian).
RFC1700 stated it must be so. (and defined network byte order as big-endian).
Internet协议文档中的约定是 以十进制表示数字,并以大端"顺序显示图片数据 [科恩]也就是说,字段是从左到右描述的,最多 左边的有效八位位组和左边的最低有效八位位组 是的.
The convention in the documentation of Internet Protocols is to express numbers in decimal and to picture data in "big-endian" order [COHEN]. That is, fields are described left to right, with the most significant octet on the left and the least significant octet on the right.
他们引用的是
On Holy Wars and a Plea for Peace
Cohen, D.
Computer
摘要:
选择哪种方式不会赚太多 区别.达成订单要比达成订单更重要 订单已达成共识.
Which way is chosen does not make too much difference. It is more important to agree upon an order than which order is agreed upon.
结论是,大端和小端方案都是可能的.没有更好/更糟方案,只要在整个系统/协议中保持一致,就可以使用任何一种方案来代替另一种方案.
It concludes that both big-endian and little-endian schemes could've been possible. There is no better/worse scheme, and either can be used in place of the other as long as it is consistent all across the system/protocol.
这篇关于为什么将网络字节顺序定义为big-endian?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!