Skip to content

Commit f7bb2e0

Browse files
Lethe10137BobAnkh
andauthored
docs(guide): explain how Rattan synchronize trace (#158)
Co-authored-by: BobAnkh <[email protected]>
1 parent 6b8a2d0 commit f7bb2e0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

guide/src/guide/flexible-configuration.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ Possible cell types:
202202
- `Bw`: Fixed bandwidth
203203
- `BwReplay`: Bandwidth trace replayer
204204
- `Delay`: Fixed delay
205+
- `DelayReplay`: Delay trace replayer
205206
- `DelayPerPacket`: Delay specified per-packet
206207
- `Loss`: Loss pattern
208+
- `LossReplay`: Loss trace replayer
207209
- `Spy`: Log all packets
208210
- `Custom`: Custom cell, only specify the cell ID used in link section, and the cell must be built by the user
209211

@@ -220,6 +222,25 @@ queue_config = { packet_limit = 60 }
220222

221223
For detailed parameters, you can check the [documentation of `rattan-core`](https://docs.rs/rattan-core/latest/rattan-core) or the example config file [config.example.toml](https://github.com/stack-rs/rattan/blob/main/config.example.toml).
222224

225+
To make the result more duplicable, Rattan synchronize the start time of all cell types that are time-dependent, including `DelayReplay`, `BwReplay`, and `LossReplay`, for them to replay traces at the same time base.
226+
The start time is conditionally defined. By default, we use the `FIRST_PACKET` time as the start time. But users can also choose to use the Rattan start-up time as the start time.
227+
228+
The `FIRST_PACKET` is defined as the first L2 unicast packet to enter Rattan. An L2 unicast packet has a **destination** MAC address with the 8th bit (the Individual/Group bit) set to `0`.
229+
230+
For example, `38:7e:58:e7:02:01` is a unicast MAC address because the 8th bit (the least-significant bit of the first byte, `0x38`) is `0`. In contrast, MAC addresses like `01:00:5e:00:00:fb` or `33:33:00:00:02` are **not** unicast.
231+
232+
**Examples of a `FIRST_PACKET`:**
233+
234+
- A TCP SYN packet from the client.
235+
- An ICMP Echo Request (Ping).
236+
237+
**Packets that cannot be a `FIRST_PACKET` (often generated by the Linux network stack):**
238+
239+
- An ICMPv6 Router Solicitation.
240+
- An mDNS (Multicast Domain Name System) query.
241+
242+
This design ensures that the trace does not begin replaying until actual application traffic has started.
243+
223244
### Links Section
224245

225246
This section describes how to link the cells.

0 commit comments

Comments
 (0)