Giter VIP home page Giter VIP logo

Comments (6)

7oxicshadow avatar 7oxicshadow commented on July 21, 2024 1

A quick update. Managed to test this with a friend over the internet today.

We left the wg0,conf files as default (other than keys) so we were using the wireguard adapters as you originally intended. When we pinged each other on the wireguard interface we had a ping of 19ms. We both have an upload of 19Mbps and 68Mbps down.

During initial testing the service was unusable. The video would be fine for the first second of starting the receiver but after that it would give periodic updates and a grey screen a lot of the time making it unreliable.

We kept experimenting and as a last ditch resort we decided to change the MTU in the sender.sh to 1320 instead of 1400. I was expecting this to make things worse but it actually fixed everything? The stream after changing that setting was flawless and the latency was so low that it was barely noticeable.

We went further and tried dropping the MTU to 1200 and it still worked perfectly.

I do not understand why it works. If I understand correctly, lowering the MTU should make things worse because you run the risk of having to send multiple packets instead of sending a single one to achieve the same thing. Again this could be something unique to our setup but all that matters is that it works (very well) and I hope to give this a proper test in the not so distant future.

(Note: To anyone who might read this. We have not tested the usbip package as we have written our own custom userspace driver to send and receive controller inputs over UDP so our latency tests might be different to your experience)

from kaukosohva.

raspi avatar raspi commented on July 21, 2024

This might break WireGuard over the internet as WireGuard uses UDP and you need 48 bytes for WireGuard overhead and internet uses MTU of 1500. So setting WireGuard MTU to 1500 is actually 1548. What you might be seeing is that your network gear supports Jumbo Frames (MTU 9000) and thus everything works fine, but if you switch sending packets to internet, stuff starts to break again.

My view currently is that GStreamer should be tuned to send correct sized packets to eliminate packet fragmentation (queue, udpsink, rtph264pay, ..).

from kaukosohva.

raspi avatar raspi commented on July 21, 2024

Really interesting result. I too expect things to break if the MTU is too small as it should increase packet fragmentation and possibly WireGuard packet resends. You could additionally try higher resolutions with lot of moving data so that packets are always "full". I've been using Quake 1 fork quakespasm with original Q1 intro demos as video test source as it has a lot of moving stuff in 1080p. Additionally if possible this could be tested from different ISPs.

from kaukosohva.

raspi avatar raspi commented on July 21, 2024

You can also run tracepath between your IP addresses (actual endpoint addresses, not internal VPN IPs) to see PMTU values and possible issues.

from kaukosohva.

raspi avatar raspi commented on July 21, 2024

Also are you running WireGuard over IPv4 or IPv6 as that also affects the packet size and overhead?

from kaukosohva.

7oxicshadow avatar 7oxicshadow commented on July 21, 2024

Thanks. Will try what you suggested. I seem to remember my friend (client side) reporting that the time stamps kept stopping at his end with a message inbetween. I never thought of taking a log so you could see it. Thankfully its easy to reproduce so I will get one next time.

Also i am 99% sure that we are on separate ISP's.

Your idea of keeping the packets full might actually be on to something. I think fast moving scenes were better than scenes with say a black backgound and only the character moving.

I am going to assume IPv4 as I would not know how to enable IPv6 on wireguard.

from kaukosohva.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.