# How does mediasoup deal with weak network connections?

**URL:** <https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054>\
**Category:** mediasoup libraries\
**Created:** [July 20, 2021, 3:12am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054 "2021-07-20T03:12:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jay](https://mediasoup.discourse.group/u/jay)\
**Post date:** [July 20, 2021, 3:12am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054/1 "2021-07-20T03:12:27Z")

</div>

From [Write our own bandwidth estimator · Issue #344 · versatica/mediasoup · GitHub](https://github.com/versatica/mediasoup/issues/344) I’ve noticed that currently `mediasoup` is depending on `libwebrtc` only for the congestion control algorithm. But there’re also other algorithms to deal with weak network in `libwebrtc`, such as ARQ, FEC, etc. What did mediasoup do in these area? How’s the effects compare with `libwebrtc`?  
Thanks!

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [July 20, 2021, 7:16am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054/2 "2021-07-20T07:16:59Z")

</div>

May I know the purpose of your question?

---

<div class="post-metadata">

**Author:** ![jay](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jay](https://mediasoup.discourse.group/u/jay)\
**Post date:** [July 20, 2021, 7:21am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054/3 "2021-07-20T07:21:37Z")

</div>

It’s mainly for understanding the underlying. I saw many open source SFU get rid of `libwebrtc` dependency, including mediasoup(still depends on `libwebrtc` for congestion control so far). But by constrast of the mature weak network connection algorithm in libwebrtc, I’m very curious that how the SFUs’ quality compare with the `libwebrtc` implementation. It won’t affect the uploading(from client to SFU), but may affect the downloading(from SFU to client).

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [July 20, 2021, 10:47am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054/4 "2021-07-20T10:47:05Z")

</div>

I don’t know what to answer, sorry. I don’t know how to compare our mediasoup C++ stack (written from scratch for a good reason) with libwebrtc.

---

<div class="post-metadata">

**Author:** ![jay](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jay](https://mediasoup.discourse.group/u/jay)\
**Post date:** [July 20, 2021, 11:21am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054/5 "2021-07-20T11:21:42Z")

</div>

Maybe I should ask the question more concretely.  
Let’s say client A and mediasoup M exchange stream over webrtc protocol. If the network is not good enough, there might be some packets lost. M will send NACK back to A to trigger A’s retransmission, which is implemented in `libwebrtc`. For the backward transmission(M → A), A will send NACK to M for M’s retransmission, am I right? Is there any difference between A and M’s retransmission strategy? It may affect a lot on weak network based on my experience.  
On the other hand, mediasoup seems no FEC at the moment [FEC implementation](https://mediasoup.discourse.group/t/fec-implementation/117).  
Please feel free to correct me if any misunderstanding. Thanks!

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [July 20, 2021, 11:30am UTC](https://mediasoup.discourse.group/t/how-does-mediasoup-deal-with-weak-network-connections/3054/6 "2021-07-20T11:30:18Z")

</div>

We implement RTP and RTCP standards in mediasoup the way they are supposed to work according to the spec, that’s all. Of course we test how it behaves with Chrome and other browsers. We are not gonna use libwebrtc just because Chrome uses it.

Right, mediasoup does not implement FEC. Neither libwebrtc does it properly, and we are waiting for FLEX FEC to be implemented in browsers/devices before we do it in mediasoup.
