Skip to content

pion/scp

Repository files navigation


SCTP Compliance & Performance

SCTP Test & Performance Tool

Pion scp join us on Discord Follow us on Bluesky
GitHub Workflow Status Go Reference Coverage Status Go Report Card License: MIT

Any connection between this project name and the SCP Foundation is purely coincidental… or not. 👀

🚧 Under construction, come back soon! 🚧

THis is currently made and optimized to test RACK, (Stream Schedulers and User Message Interleaving)RFC-8260, and compatiblity testing with older clients

This project is a tool that tests Pion's SCTP implementations across revisions. It can:

  • Test any Pion SCTP version or local checkout
  • Simulate network conditions such as dynamic RTT, loss, and reordering
  • Run cross-version compatibility and regression scenarios

Usage

Run the CLI directly with Go:

go run ./cmd/scp <command> [flags]

Global flags:

  • --verbose enable verbose logging
  • --dry-run show actions without writing results

Resolve references

Resolve ref selectors into .scp/manifest.json and .scp/lock.json:

Selectors:

  • tag:v1.8.0
  • branch:master (supports wildcards: branch:release/*)
  • commit:deadbeef
  • pr:1234
  • path:/absolute/path or path:./relative/path
  • range:>=1.9,<1.10 (semver constraint, expands to matching tags)

Flags:

  • --refs comma-separated selector list (may repeat, or pass selectors as args)
  • --repo repository URL to mirror (default: https://github.com/pion/sctp)
  • --cache cache directory for mirrors and checkouts (default: .scp/cache)
  • --include-pre include prerelease tags when resolving ranges
  • --out-manifest output path for manifest JSON (default: .scp/manifest.json)
  • --out-lock output path for lock JSON (default: .scp/lock.json)
  • --freeze-at RFC3339 timestamp to pin moving refs
  • --local-allow-dirty permit path selectors with local modifications

Update lock entries

Refresh lock entries for floating selectors in the manifest:

go run ./cmd/scp update --manifest .scp/manifest.json --lock .scp/lock.json

Flags:

  • --manifest path to manifest.json
  • --lock path to lock.json to update
  • --only comma-separated entry names to refresh
  • --freeze-at RFC3339 timestamp to pin moving refs

Generate harness code

Generate wrappers, runners, and harness code into generated/:

go run ./cmd/scp generate --lock .scp/lock.json --out generated

Flags:

  • --lock path to lock.json
  • --features path to features.yaml
  • --out output directory for generated code
  • --package name of generated API package
  • --runner-proto runner transport protocol (stdio-json or rpc)
  • --modmode module resolve mode (remote or local-cache)
  • --license optional license header file path
  • --only comma-separated list of lock entries to generate

Run tests

Run cross-revision scenarios (this generates and runs the harness under generated/):

go run ./cmd/scp test --lock .scp/lock.json --pairs matrix --cases max-burst --repeat 3

Flags:

  • --lock path to lock.json
  • --pairs pair selection mode: adjacent (default), latest-prev, matrix, explicit, self
  • --include include only these entries (comma-separated)
  • --exclude exclude these entries (comma-separated)
  • --explicit explicit pairs when --pairs=explicit (comma-separated A:B, use names from lock.json)
  • --cases scenario IDs to run (comma-separated)
  • --timeout overall timeout for each pair (default: 2m)
  • --seed base seed (0 = default)
  • --out path to write JUnit XML results
  • --out-dir directory to write run artifacts
  • --interleaving override interleaving mode (auto, on, off)
  • --pprof-cpu path to write CPU profile
  • --pprof-heap path to write heap profile
  • --pprof-allocs path to write allocs profile
  • --repeat number of times to run each pair (>=1)

Scenario IDs (with default network profiles):

  • max-burst (default) — baseline burst with no induced delay/loss/reordering
  • handshake — handshake-only scenario with baseline network settings
  • unordered-late-low-rtt — min delay 10ms, jitter 10ms, unordered, 0% loss
  • unordered-late-high-rtt — min delay 180ms, jitter 60ms, unordered, 0% loss
  • unordered-late-dynamic-rtt — min delay 40ms, jitter 180ms, unordered, 0% loss
  • congestion — min delay 60ms, jitter 40ms, ordered, 2% loss
  • retransmission — min delay 40ms, jitter 20ms, ordered, 5% loss
  • reorder-low — min delay 15ms, jitter 25ms, unordered, 1.5% loss
  • reorder-high — min delay 140ms, jitter 120ms, unordered, 2.5% loss
  • burst-loss — min delay 50ms, jitter 50ms, unordered, 4% loss
  • fragmentation — oversized payloads to trigger fragmentation/reassembly
  • interleaving — oversized payloads with interleaving enabled (RFC 8260)
  • media-hevc — one-way 4 Mbps RTP-like HEVC pattern with B-frames (3% loss)
  • fault-checksum — corrupts every 7th data chunk checksum (negative case)
  • fault-bad-chunk-len — corrupts every 7th data chunk length (negative case)
  • fault-nonzero-padding — corrupts every 7th data chunk padding (negative case)

Examples:

go run ./cmd/scp resolve --refs "tag:v1.8.0,branch:master"
go run ./cmd/scp test --lock .scp/lock.json
go run ./cmd/scp test --pairs explicit --explicit "branch_master_abcdef0:tag_v1_8_0_1234567"
go run ./cmd/scp test --cases "congestion,retransmission" --out .scp/out/results.xml

Artifacts

  • .scp/manifest.json resolved selector list
  • .scp/lock.json pinned revisions
  • .scp/cache/ git mirrors and checkouts
  • generated/ harness module and wrappers
  • --out JUnit XML report
  • --out-dir per-run artifacts (config.json, results.json, seed.txt, packets//iter.jsonl)
  • --pprof-* optional CPU/heap/allocs profiles

Community

Pion has an active community on the Discord.

Follow the Pion Bluesky or Pion Twitter for project updates and important WebRTC news.

We are always looking to support your projects. Please reach out if you have something to build! If you need commercial support or don't want to use public methods you can contact us at team@pion.ly

Contributing

Check out the contributing wiki to join the group of amazing people making this project possible

License

MIT License - see LICENSE for full text

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages