网络字节序----阿里巴巴2015实习生笔试题

IP数据报头采用()字节序,在此字节序下从低地址到高地址0x1234的表示形式为 () 。

正确答案: C   你的答案: A (错误)

big_endian,0x12 0x34 0 0
little_endian,0x34 0x12 0 0
big_endian,0 0 0x12 0x34
little_endian, 0 0 0x34 0x12

解析:

其实 big endian 是指低地址存放最高有效字节( MSB ),而 little endian 则是低地址存放最低有效字节( LSB )。 所有网络协议也都是采用 big endian 的方式来传输数据的。所以有时我们也会把 big endian 方式称之为网络字节序。当两台采用不同字节序的主机通信时,在发送数据之前都必须经过字节序的转换成为网络字节序后再进行传输。

比如数字 0x12345678 在两种不同字节序 CPU 中的存储顺序如下所示:

Big Endian


1
2
3
4
5
6
7
    低地址                                            高地址
     ----------------------------------------->
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |     12     |      34    |     56      |     78    |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


Little Endian


   低地址                                            高地址
   ----------------------------------------->
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     78     |      56    |     34      |     12    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经典计算机网络教材 Computer Networks, Fourth Edition By Andrew S. Tanenbaum Table of Contents Chapter 1. Introduction Section 1.1. Uses of Computer Networks Section 1.2. Network Hardware Section 1.3. Network Software Section 1.4. Reference Models Section 1.5. Example Networks Section 1.6. Network Standardization Section 1.7. Metric Units Section 1.8. Outline of the Rest of the Book Section 1.9. Summary Chapter 2. The Physical Layer Section 2.1. The Theoretical Basis for Data Communication Section 2.2. Guided Transmission Media Section 2.3. Wireless Transmission Section 2.4. Communication Satellites Section 2.5. The Public Switched Telephone Network Section 2.6. The Mobile Telephone System Section 2.7. Cable Television Section 2.8. Summary Chapter 3. The Data Link Layer Section 3.1. Data Link Layer Design Issues Section 3.2. Error Detection and Correction Section 3.3. Elementary Data Link Protocols Section 3.4. Sliding Window Protocols Section 3.5. Protocol Verification Section 3.6. Example Data Link Protocols Section 3.7. Summary Chapter 4. The Medium Access Control Sublayer Section 4.1. The Channel Allocation Problem Section 4.2. Multiple Access Protocols Section 4.3. Ethernet Section 4.4. Wireless LANs Section 4.5. Broadband Wireless Section 4.6. Bluetooth Section 4.7. Data Link Layer Switching Section 4.8. Summary Chapter 5. The Network Layer Section 5.1. Network Layer Design Issues Section 5.2. Routing Algorithms Section 5.3. Congestion Control Algorithms Section 5.4. Quality of Service Section 5.5. Internetworking Section 5.6. The Network Layer in the Internet Section 5.7. Summary Chapter 6. The Transport Layer Section 6.1. The Transport Service Section 6.2. Elements of Transport Protocols Section 6.3. A Simple Transport Protocol Section 6.4. The Internet Transport Protocols: UDP Section 6.5. The Internet Transport Protocols: TCP Section 6.6. Performance Issues Section 6.7. Summary Chapter 7. The Application Layer Section 7.1. DNS—The Domain Name System Section 7.2. Electronic Mail Section 7.3. The World Wide Web Section 7.4. Multimedia Section 7.5. Summary Chapter 8. Network Security Section 8.1. Cryptography Section 8.2. Symmetric-Key Algorithms Section 8.3. Public-Key Algorithms Section 8.4. Digital Signatures Section 8.5. Management of Public Keys Section 8.6. Communication Security Section 8.7. Authentication Protocols Section 8.8. E-Mail Security Section 8.9. Web Security Section 8.10. Social Issues Section 8.11. Summary Chapter 9. Reading List and Bibliography Section 9.1. Suggestions for Further Reading Section 9.1.1. Introduction and General Works Section 9.2. Alphabetical Bibliography

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值