Computer Networks · 免费预览
表示格式
两台就协议达成一致的机器,仍可能对字节的含义产生分歧:不同架构以不同的字节序存储整数,编译器对结构体的填充方式也不同。因此,表示格式将应用数据编码为线上表示形式,并在远端解码。这一设计空间可按以下维度划分:支持哪些数据类型;转换是遵循规范的中间形式,还是由接收方自行修正;消息是携带类型标签,还是依赖已知数据结构的桩;以及这些桩是编译生成还是解释执行。XDR、ASN.1、NDR 和协议缓冲区是该空间中的典型代表,而 XML 则是自描述的极端情形。
1. The Disagreement Among Machines
The Disagreement Among Machines
2. A Taxonomy of Encodings
A Taxonomy of Encodings
3. Four Systems, Four Corners
Four Systems, Four Corners
4. The Self-Describing Extreme
The Self-Describing Extreme
5. The byte-order trap
A little-endian host sends the 32-bit integer 1 as raw memory bytes to a big-endian host. What does the receiver read?
6. The padded structure
Why can't a program simply write an in-memory structure to the network?
7. Two conversion strategies
What is the trade between canonical intermediate form and receiver-makes-right?
8. What tags buy
What does tagging the data in a message buy, and at what price?
9. Matching systems to axes
Which pairing of system and design choices is correct?
10. The markup trade
Why do loosely coupled web services gravitate toward markup languages rather than compact binary encodings?
11. The byte order names
What are the two byte orders called, one storing the most significant byte first and one the least significant first?
12. The one standard form
In which conversion strategy does every host translate its data to and from a single agreed external representation?
13. The opposite duty
In which strategy does the sender transmit its native format and the receiver perform whatever conversion is needed?
14. The self-describing message
What does a message carry when its type information travels inside the message itself rather than in a pre-shared stub?