为什么网络字节顺序被定义为大端? [英] Why is network-byte-order defined to be big-endian?

查看:35
本文介绍了为什么网络字节顺序被定义为大端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题中所写,我的问题是,为什么 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 表示一定是这样.(并将网络字节顺序定义为大端).

RFC1700 stated it must be so. (and defined network byte order as big-endian).

互联网协议文档中的约定是以十进制表示数字并以大端"表示数据命令[科恩].也就是说,字段是从左到右描述的,最左边的重要八位字节和最不重要的八位字节在左边没错.

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

摘要可以在 IEN-137 或在 这个 IEEE 页面.

总结:

选择哪种方式并不过分不同之处.就订单达成一致比达成一致更重要订单已达成一致.

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.

这篇关于为什么网络字节顺序被定义为大端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆