Skip to content

Commit

Permalink
Include doc/ folder in Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Jan 29, 2024
1 parent 83a456e commit 01075b1
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 140 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/.cache
/art
/coverage
/doc
/node/lib
/node/src/fbs
/rust
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/.cache
/art
/coverage
/doc
/node/lib
/node/src/fbs
/rust
Expand Down
3 changes: 2 additions & 1 deletion doc/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ Cleans built objects and binaries, `meson` and `ninja` installed in local prefix

### `invoke update-wrap-file [subproject]`

Updates the wrap file of a subproject (those in `worker/subprojects` folder) with Meson. Usage example:
Updates the wrap file of a subproject (those in `worker/subprojects` folder) with Meson. After updating it, `invoke setup` must be called by passing `MESON_ARGS="--reconfigure"` environment variable. Usage example:

```bash
cd worker
invoke update-wrap-file openssl
MESON_ARGS="--reconfigure" invoke setup
```

### `invoke mediasoup-worker`
Expand Down
6 changes: 2 additions & 4 deletions doc/Charts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Charts


## Broadcasting

mediasoup **v2** (a room uses a single media worker subprocess by design, so a single CPU).
Expand All @@ -9,9 +8,8 @@ Charts provided by [CoSMo](https://www.cosmosoftware.io) team.

Scenario:

* 1 peer producing audio and video tracks.
* N spy peers receiving them.

- 1 peer producing audio and video tracks.
- N spy peers receiving them.

#### Bandwidth out (Mbps) / number of viewers

Expand Down
91 changes: 54 additions & 37 deletions doc/Consumer.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,109 @@
# Consumer


## RTP sequence number handling

------------------------------------------------
---

INIT:

* rtpLastSeq: 1000
* rtpPreviousBaseSeq: 0
* rtpBaseSeq: 0
- rtpLastSeq: 1000
- rtpPreviousBaseSeq: 0
- rtpBaseSeq: 0

------------------------------------------------
---

packet (SYNC):
* seq: 3000
* rtpPreviousBaseSeq: 1000
* rtpBaseSeq: 3000

- seq: 3000
- rtpPreviousBaseSeq: 1000
- rtpBaseSeq: 3000

out:
* rtpLastSeq: 3000 - 3000 + 1000 + 1 = 1001

------------------------------------------------
- rtpLastSeq: 3000 - 3000 + 1000 + 1 = 1001

---

packet:
* seq: 3001

- seq: 3001

out:
* rtpLastSeq: 3001 - 3000 + 1000 + 1 = 1002

------------------------------------------------
- rtpLastSeq: 3001 - 3000 + 1000 + 1 = 1002

---

packet:
* seq: 3003

- seq: 3003

out:
* rtpLastSeq: 3003 - 3000 + 1000 + 1 = 1004

------------------------------------------------
- rtpLastSeq: 3003 - 3000 + 1000 + 1 = 1004

---

packet (SYNC):
* seq: 4050
- rtpPreviousBaseSeq: 1004
- rtpBaseSeq: 4050

- seq: 4050

* rtpPreviousBaseSeq: 1004
* rtpBaseSeq: 4050

out:
* rtpLastSeq: 4050 - 4050 + 1004 + 1 = 1005

------------------------------------------------
- rtpLastSeq: 4050 - 4050 + 1004 + 1 = 1005

---

packet:
* seq: 4051

- seq: 4051

out:
* rtpLastSeq: 4051 - 4050 + 1004 + 1 = 1006

------------------------------------------------
- rtpLastSeq: 4051 - 4050 + 1004 + 1 = 1006

---

packet (DROP):
* seq: 4052

- seq: 4052

if (seq > rtpLastSeq)
* rtpBaseSeq++: 4051

------------------------------------------------
- rtpBaseSeq++: 4051

---

packet:
* seq: 4053

- seq: 4053

out:
* rtpLastSeq: 4053 - 4051 + 1004 + 1 = 1007

------------------------------------------------
- rtpLastSeq: 4053 - 4051 + 1004 + 1 = 1007

---

probation packet:
* rtpLastSeq++ = 1008

- rtpLastSeq++ = 1008

out:
* rtpLastSeq: 1008
* rtpBaseSeq--: 4050

- rtpLastSeq: 1008
- rtpBaseSeq--: 4050

NOTE: probation packets should just be sent (assuming same RTP timestamp) **after** a video packet with `marker` bit set to 1.

------------------------------------------------
---

packet:
* seq: 4054

- seq: 4054

out:
* rtpLastSeq: 4054 - 4050 + 1004 + 1 = 1009

- rtpLastSeq: 4054 - 4050 + 1004 + 1 = 1009
34 changes: 17 additions & 17 deletions doc/Fuzzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Once we have built the `mediasoup-worker-fuzzer` target in a Linux environment w

## Related documentation

* [libFuzzer documentation](http://llvm.org/docs/LibFuzzer.html)
* [libFuzzer Tutorial](https://github.com/google/fuzzer-test-suite/blob/master/tutorial/libFuzzerTutorial.md)
* [webrtcH4cKS ~ Lets get better at fuzzing in 2019](https://webrtchacks.com/lets-get-better-at-fuzzing-in-2019-heres-how/)
* [OSS-Fuzz](https://github.com/google/oss-fuzz) - Continuous fuzzing of open source software ("fuzz for me")
- [libFuzzer documentation](http://llvm.org/docs/LibFuzzer.html)
- [libFuzzer Tutorial](https://github.com/google/fuzzer-test-suite/blob/master/tutorial/libFuzzerTutorial.md)
- [webrtcH4cKS ~ Lets get better at fuzzing in 2019](https://webrtchacks.com/lets-get-better-at-fuzzing-in-2019-heres-how/)
- [OSS-Fuzz](https://github.com/google/oss-fuzz) - Continuous fuzzing of open source software ("fuzz for me")

## Corpus files

Expand All @@ -31,55 +31,55 @@ The `fuzzer/reports` directory should be used to store those new crash reports.

It's recommended to (also) pass the following options to the fuzzer:

* `-max_len=1400`: We don't need much more input size.
- `-max_len=1400`: We don't need much more input size.

For memory leak detection enable the following environment variable:

* `LSAN_OPTIONS=verbosity=1:log_threads=1`
- `LSAN_OPTIONS=verbosity=1:log_threads=1`

The mediasoup-worker fuzzer reads some custom environment variables to decide which kind of fuzzing perform:

* `MS_FUZZ_STUN=1`: Do STUN fuzzing.
* `MS_FUZZ_RTP=1`: Do RTP fuzzing.
* `MS_FUZZ_RTCP=1`: Do RTCP fuzzing.
* `MS_FUZZ_UTILS=1`: Do C++ utils fuzzing.
* If none of them is given, then **all** fuzzers are enabled.
- `MS_FUZZ_STUN=1`: Do STUN fuzzing.
- `MS_FUZZ_RTP=1`: Do RTP fuzzing.
- `MS_FUZZ_RTCP=1`: Do RTCP fuzzing.
- `MS_FUZZ_UTILS=1`: Do C++ utils fuzzing.
- If none of them is given, then **all** fuzzers are enabled.

The log level can also be set by setting the `MS_FUZZ_LOG_LEVEL` environment variable to "debug", "warn" or "error" (it is "none" if unset).

## Usage examples

* Detect memory leaks and just fuzz STUN:
- Detect memory leaks and just fuzz STUN:

```bash
MS_FUZZ_STUN=1 LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=1400 fuzzer/new-corpus deps/webrtc-fuzzer-corpora/corpora/stun-corpus
```

* Detect memory leaks and just fuzz RTP:
- Detect memory leaks and just fuzz RTP:

```bash
MS_FUZZ_RTP=1 LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=1400 fuzzer/new-corpus deps/webrtc-fuzzer-corpora/corpora/rtp-corpus
```

* Detect memory leaks and just fuzz RTCP:
- Detect memory leaks and just fuzz RTCP:

```bash
MS_FUZZ_RTCP=1 LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=1400 fuzzer/new-corpus deps/webrtc-fuzzer-corpora/corpora/rtcp-corpus
```

* Detect memory leaks and just fuzz mediasoup-worker C++ utils:
- Detect memory leaks and just fuzz mediasoup-worker C++ utils:

```bash
MS_FUZZ_UTILS=1 LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=2000 fuzzer/new-corpus
```

* Detect memory leaks and fuzz everything with log level "warn":
- Detect memory leaks and fuzz everything with log level "warn":

```bash
MS_FUZZ_LOG_LEVEL=warn LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=1400 fuzzer/new-corpus deps/webrtc-fuzzer-corpora/corpora/stun-corpus deps/webrtc-fuzzer-corpora/corpora/rtp-corpus deps/webrtc-fuzzer-corpora/corpora/rtcp-corpus
```

* Verify that a specific crash is fixed:
- Verify that a specific crash is fixed:

```bash
LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer fuzzer/reports/crash-f39771f7a03c0e7e539d4e52f48f7adad8976404
Expand Down
11 changes: 5 additions & 6 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

**NOTE:** Internal documentation for developing purposes. Get the mediasoup public documentation at [mediasoup.org](https://mediasoup.org).

* [Building](Building.md)
* [Fuzzer](Fuzzer.md)
* [RTCP](RTCP.md)
* [Consumer](Consumer.md)
* [Charts](Charts.md)

- [Building](Building.md)
- [Fuzzer](Fuzzer.md)
- [RTCP](RTCP.md)
- [Consumer](Consumer.md)
- [Charts](Charts.md)
25 changes: 11 additions & 14 deletions doc/RTCP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This document also describes which RTCP packets are locally generated by mediaso

mediasoup does not forward feedback information from a remote RTP receiver, which could incur in the remote sender modifying the transmition rate in a way that it would affect the reception quality for the overall participants in a router (i.e. limiting the remote RTP sender transmition rate).


### Sender Reports

mediasoup locally generates the Sender Reports of the streams it sends and processes the Sender Reports is receives from producer endpoints.
Expand Down Expand Up @@ -150,31 +149,29 @@ This information is locally consumed to perform sender side bandwidth estimation

REMB RTCP is generated locally based on the remote bitrate estimation.


## Mediasoup internal behaviour for each type of RTCP

### Generic RTCP

| | SR | RR | SDES | BYE | APP |
| --------- | -- | -- | ---- | --- | --- |
| Consumer | G | C | | | |
| Producer | C | G | C | I | I |
| | SR | RR | SDES | BYE | APP |
| -------- | --- | --- | ---- | --- | --- |
| Consumer | G | C | | | |
| Producer | C | G | C | I | I |

### RTP Feedback RTCP

| | NACK | TMMBR | TMMBN | TLLEI | ECN-FB | PAUSE-RESUME | TCC |
| --------- | ---- | ----- | ----- | ----- | ------ | ------------ | --- |
| Consumer | C | I | I | I | I | I | |
| Producer | G | | I | I | | | |
| | NACK | TMMBR | TMMBN | TLLEI | ECN-FB | PAUSE-RESUME | TCC |
| -------- | ---- | ----- | ----- | ----- | ------ | ------------ | --- |
| Consumer | C | I | I | I | I | I | |
| Producer | G | | I | I | | | |

## PS Feedback RTCP

| | PLI | SLI | RPSI | FIR | TSTR | TSTN | VBCM | PSLI | AFB | REMB |
| --------- | --- | --- | ---- | --- | ---- | ---- | ---- | ---- | --- | ---- |
| Consumer | C | I | I | C | I | | I | | I | C |
| Producer | G | | | | | I | | I | | |
| Transport | | | | | | | | | | G |

| Consumer | C | I | I | C | I | | I | | I | C |
| Producer | G | | | | | I | | I | | |
| Transport | | | | | | | | | | G |

( ): Does not apply.

Expand Down
Loading

0 comments on commit 01075b1

Please sign in to comment.