-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebUI blank when accessing espurna over OpenVPN on 1.13.5 (WS sends incomplete data) #1610
Comments
Last data frame over vpn is the relayConfig object, whilst the last data frame locally is the one with all the configuration. This explains why over overvpn the UI can't load. Does anything come to mind that could cause this? |
Maybe the packet is fragmented and somehow lost? Possibly a misconfiguration in MTU size. You might be able to test by specifying packet size in ping, start at 1500 (too big for VPN normally, but the standard for Ethernet) but you might find it works around 1432. Just a guess though 😀 |
That thought crossed my mind already, will have to find some time to
test it out. The funny thing is that this was working perfectly on 1.13.3,
along with all the other stuff I have. Is it possible something new was
introduced in the latest version?
…On Wed, Mar 6, 2019, 7:49 PM Colin Shorts ***@***.***> wrote:
Maybe the packet is fragmented and somehow lost? Possibly a
misconfiguration in MTU size. You might be able to test by specifying
packet size in ping, start at 1500 (too big for VPN normally, but the
standard for Ethernet) but you might find it works around 1432.
Just a guess though 😀
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1610 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsGU8hnGALl0OhsxTdZu_oKS0A0-pw_ks5vUA2hgaJpZM4bhh7x>
.
|
I think that it's too low level to be attributed directly to espurna directly, possibly network stack related, that is unless the packet now contains a lot more data than it used to. I might be able to test this tomorrow, but I'd likely need to flash two devices and dust off my VPN server. I normally use a dynamic socks proxy over SSH, maybe you could try that as a workaround in the mean time? |
The difference is that old one sends several ws data frames instead of just one in 1.13.5 And, funnily enough, the first thing i tried is reverse ssh tunnel + wscat tool on the remote server (~150ms for good measure), which worked perfectly. |
The problem is indeed with mtu, it seems the large data frame is being
dropped because it exceeds the maximum mss negotiated in the TCP handshake.
This won't be reproducible with ssh tunnels, since ssh will most probably
break down the frame to fit in it's own packet size. On the other hand,
openvpn will refuse to fragment it at layer 3 by default.
The main question now for me is, why doesn't espurna (or the underlying
lib) split the tcp packet to fit the negotiated mss?
Hope this makes sense.
…On Thu, Mar 7, 2019, 10:05 AM Max Prokhorov ***@***.***> wrote:
The difference is that old one sends several ws data frames instead of
just one in 1.13.5
Technically, it must work exactly the same, because the underlying library
will space out the data.
And, funnily enough, the first thing i tried is reverse ssh tunnel + wscat
tool on the remote server (~150ms for good measure), which worked perfectly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1610 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsGU0MY_gKuR1ZnlmSaMV3kZpeb0TpPks5vUNZcgaJpZM4bhh7x>
.
|
I still think this problem is caused way deeper than espurna, i.e. by way of inclusion from: There is an example of a user with problems using Hyperion and a large string of WS28nn LED's who runs into problems with fragmentation/dropped packets here caveat emptor, I do use a lot of espurna devices, and on the odd occasion OpenVPN (just not together). I'm not a developer and tend to get a bit lost in the code at points. @xoseperez or @mcspr will know a lot more than me from the code/library side. |
I see your point. The thing is that the response for / gets split down properly according to the negotiated MSS. It's just the WS datagram that's not, I suspect this to be true for the whole WS conversation. |
Right. Both responses are handled by ESPAsyncWebServer: Have almost the same results on my test openvpn setup, it fails even with 1.6kb of data :/ |
It might be a moot point, but I take it you are both (also) using UDP for OpenVPN? |
Yes. But problem is still there with |
The same thing happens if you use NAT port forwarding but not if you use an ssh tunnel. It would appear that the issue is not related to UDP or TCP as it happens with both. |
I think @icoma89 already had outlined the exact problem - MTU/MSS size matters.
shows default MTU of 1500 - everything works
edited: mtu value from #1614, because mss below is 1413 Causes config ws frame to be dropped by the router. ref tcpdump:
And the same, but properly fragmented, when using lwip2:
edit: |
Related lwip bug: Since we are still suffering with Core 2.3.0, lwip can be built from source:
Resulting library is |
@xoseperez two options about shipping lwip1 fix:
|
Hi all, I'm a programmer but not a very expert C compiler, could you please provide some more info on how to include the fix into the project? Thanks a lot! |
@simonedimarzio Easiest way is to just build using latest Core versions, where lwip2 is the default. I think #1723 is "good enough" solution. If user has all dependencies installed, this will automatically patch lwip1 in Core only when |
Thanks for this @mcspr. I can confirm issue is resolved with espurna-1.13.6-dev.nightly20190519+gitaac2e1e4-itead-sonoff-pow-r2.bin (Sonoff POW R2). |
Thanks @mcspr, also for me the fix worked perfectly! Steps:
|
Bug description
WebUI blank when accessing espurna over OpenVPN
Steps to reproduce
Access and login to webui over OpenVPN
Expected behavior
WebUI works same as when on local network
Screenshots
Over VPN:
Locally;
Tested on SONOFF POW-R2, T1 (1,2,3 gang), BASIC and S20
Accessing WEBUI no longer works for me on 1.13.5 when I'm connected via OpenVPN, this used to work properly on 1.13.3. Inspecting the WS I can see that over the VPN, the device does not send all the data frames that it sends when connected locally. I doubt this has to do anything with the VPN or network per se, since when connected locally, all my devices are still on another VLAN, so traffic is routed (via a pfsense router).
The text was updated successfully, but these errors were encountered: