Need clarification on some fields in media stats

I’ve been using Janus with Video Room plugin in a production application for a few months, now, with very little surprises. Everything on the Janus side is stable and predictable. However, I’m trying to build some monitoring logic around the media stats received, and I want to make sure I am interpreting a few of these stats correctly. I did not find any reference that included these fields, so feel free to point me toward some docs. I did start with the Janus source but following C structs back and forth gets a bit complex if you don’t work in the source every day.

On a publisher video stream, in particular,

nacks-sent: is this the number of NACKs that Janus sent to the peer, or that the peer sent to Janus?
retransmissions-received: is this the number of successfully processed retransmissions at the request of NACKs? And is that again retransmissions from the peer or from Janus?

Also, in reading through the source, it looks like “lost” and “lost-by-remote” are for the RTP layer vs media. How do the lost packets correlate to NACKs in these stats?

Finally, I have not seen a clear description of the difference between the in-link-quality and the in-media-link-quality. Again, turning to the source, it looks like the media link quality considers retransmissions while the other does not.

I would like to potentially build some alerts around poor network conditions or at minimum some solid reporting on network conditions at various times of the day. However, I don’t want to make any assumptions about the media stats.

All adjectives refer to Janus’ perspective: so “sent” will be sent by Janus, “remote” will be the remote peer, etc.

That was my exact assumption, thank you.

Is it safe to say that if the nacks-sent value is considerably higher than retransmissions-received, that this is an indication of network packet loss between the peer and Janus? This does not appear to correlate to a bad in-link or in-media-link quality value when I see large differences between the nacks and retransmissions. I DO see incorrect blocks of color in the recorded video that correlate to the situations with high nacks and low retransmissions received.

I am trying to differentiate between a poor network connection for a user/client (bad bandwidth, too far away from a wifi access point, etc) vs a problem in network routing or firewalls between the client and Janus.