BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Cormorant · Separate packet jitter from a fixed clock offset

Separate variation in packet delivery from a constant difference between clocks.

Separate packet jitter from a fixed clock offset

Absolute one-way delay depends on clock alignment. Changes in transit can still reveal jitter when the clock offset is stable. Transit changes by 32 ticks. Starting from zero, the one-sixteenth update yields two ticks of smoothed jitter.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-cormorant.git
cd blyx-cormorant
blyxc native-run project.blyx -- "0,16" "100,148" 0

API and return values

Returns [transit range, smoothed jitter, adjacent pairs]. Input rows must be in arrival order and use unwrapped sender timestamps. Invalid input returns an empty vector.

ArgumentAccepted input
sentVector of: exact signed integer
arrivedVector of: exact signed integer
initialnonnegative finite number

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
32
2
1
Open in the full playground →

Practice

Change sent = [0, 10], arrived = [3, 13]. Predict the result, then run the program.

Hint

Returns [transit range, smoothed jitter, adjacent pairs]. Input rows must be in arrival order and use unwrapped sender timestamps.

Worked solution

The result vector is [0, 0, 1]. Compare its fields with the return layout in the API section.

Find

    let sent = [0, 16];

Replace with

    let sent = [0, 10];

Find

    let arrived = [100, 148];

Replace with

    let arrived = [3, 13];

Output after the change

0
0
1