无法理解标题中的uTorrent传输协议“扩展”选项

时间:2018-11-23 15:14:10

标签: tcp udp bittorrent

我试图了解uTP标头的结构,以及它如何处理流量和拥塞以及所有这些问题。

浏览文档here时,我无法完全理解标头的“扩展”部分的工作原理。这是标题:

0       4       8               16              24              32
+-------+-------+---------------+---------------+---------------+
| type  |  ver  | extension     | connection_id                 |
+-------+-------+---------------+---------------+---------------+
| timestamp_microseconds                                        |
+---------------+---------------+---------------+---------------+
| timestamp_difference_microseconds                             |
+---------------+---------------+---------------+---------------+
| wnd_size                                                      |
+---------------+---------------+---------------+---------------+
| seq_nr                        | ack_nr                        |
+---------------+---------------+---------------+---------------+

这是谈论“扩展”字段的部分:

extension

The type of the first extension in a linked list of extension headers. 0 means no extension.

There is currently one extension:

    Selective acks

Extensions are linked, just like TCP options. If the extension field is non-zero, immediately following the uTP header are two bytes:

0               8               16
+---------------+---------------+
| extension     | len           |
+---------------+---------------+

where extension specifies the type of the next extension in the linked list, 0 terminates the list. And len specifies the number of bytes of this extension. Unknown extensions can be skipped by simply advancing len bytes.

链接列表如何进入所有这些? (对我而言)是否意味着有更多可用的扩展?

1 个答案:

答案 0 :(得分:0)

数据包头包含第一个扩展头的描述符(1个字节)或哨兵值0。 第一个扩展名依次包含扩展名标头(这次是2个字节,因为它包含一个长度)和扩展名主体。标头将再次指向下一个扩展名或为前哨值。

这是一个链接列表,因为第N个扩展头链接到第N + 1个扩展。

这是在固定布局的数据包头和主有效载荷之间插入可变数量的扩展名的常见模式。例如。 IPv6TCP使用非常相似的机制。

相关问题