Repository navigation
Conversation
Add HeavyPdoTrace ((interval since last PDO, bytes)) and LightPdoTrace (CellReplay light PDO records: timestamp, base delay, PDO times), with models under the new pdo-model feature, a CellReplay light PDO loader, and load_mahimahi_heavy_pdo_trace which merges same-ms lines into one PDO. Refs stack-rs/rattan#98
Lethe10137
left a comment
There was a problem hiding this comment.
I agree that we do not need repeated version for LightPdoTrace.
However, I think that we should make the light pdo trace self-contained, both in the config (TraceLightPdoConfig), and the trace LightPdoTrace.
Consider this chain of "source of truth" of the PDO size here:
- The user input (e.g. in a config file for Rattan) says its 1400, either by explicitly designate the number or left that as default.
- Rattan loads that config file, call
into_modeland then it was built into an object in memory. - The Cell reads the trace object, and execute that, according to the object in memory.
If 3. has to know about 1. , that's unnecessary entanglement.
| pub fn build(self) -> StaticHeavyPdo { | ||
| StaticHeavyPdo { | ||
| interval: self.interval.unwrap_or_else(|| Duration::from_millis(1)), | ||
| bytes: self.bytes.unwrap_or(1500), |
There was a problem hiding this comment.
Let's make this a public constant named CELLREPLAY_PDO_SIZE here.
About the defualt value, considering the potential usecases:
- loading a mahimahi trace -- We already have the 1504 bytes version constant in
mahimahi.rs. - loading a Cellreplay trace , the defualt should be 1400
So just making this defualt as 1400.
| pub struct TraceLightPdoConfig { | ||
| pub pattern: Vec<LightPdo>, | ||
| } |
There was a problem hiding this comment.
Let's add a PDO size field here, thus the config can be self-contained.
Use the CELLREPLAY_PDO_SIZE as default.
| /// The next_light_pdo function either returns **the next record** | ||
| /// in the sequence, or **None** if the trace goes to end. | ||
| pub trait LightPdoTrace: Send { | ||
| fn next_light_pdo(&mut self) -> Option<LightPdo>; |
There was a problem hiding this comment.
lets add an getter, fn pdo_size(&self) -> u64
Add CELLREPLAY_PDO_SIZE (1400 bytes) and use it as the default size of StaticHeavyPdo (was 1500). TraceLightPdoConfig gets an optional pdo_size (defaults to CELLREPLAY_PDO_SIZE), and LightPdoTrace gets a pdo_size() getter, so a cell can read the size from the trace itself.
|
Thanks for the review @Lethe10137! Pushed 3902c67 with all 3:
The source of truth thing makes sense, the cell will just call |
Description
This is the netem-trace part of stack-rs/rattan#98 (CellReplay), following what @Lethe10137 suggested there. These are just the trace types; the cell in rattan comes after this.
Everything is behind a new
pdo-modelfeature (also added tomodel):HeavyPdoTrace: yields(interval since last PDO, bytes). No bandwidth anywhere.LightPdoTrace: yields aLightPdo { timestamp, base_delay, opportunities }, which is one line of a CellReplay light PDO (packet train) file.StaticHeavyPdo,TraceHeavyPdo,RepeatedHeavyPdoPattern,TraceLightPdo, with configs and serde (human format too).load_mahimahi_heavy_pdo_trace(trace, count, pdo_bytes): lines with the same ms become one PDO with more bytes.MAHIMAHI_PDO_BYTES(1504) is for mahimahi; CellReplay's heavy files use the same format, so 1400 works for those. Repeating works like in mahimahi (the next cycle starts at the last timestamp).load_cellreplay_light_pdo_trace(&str): parsestime base_delay pdo0 pdo1 ...(all ms) and checks that the timestamps and PDO times don't go down.The old
load_mahimahi_trace(bw) is not changed.Some things I wasn't sure about:
LightPdoonly stores the PDO times, not their size. CellReplay counts every light PDO as 1400 B, so I left the size to the cell. Should it be in the trace instead?Refs stack-rs/rattan#98
How Has This Been Tested
On Ubuntu 24.04 (WSL), stable Rust:
cargo test --features fullandcargo test --features model,mahimahi,serdepasscargo check --no-default-features --features pdo-modelpassescargo clippy --all-features --all-targets -- -Dwarningsandcargo fmt --all -- --checkare cleanThere's a test that replays the heavy PDOs from a mahimahi trace and checks that you get the exact same timestamps back, across 2 cycles. Plus tests for the error cases of both loaders and for serde.
Types of changes
Checklist