Skip to content
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

ppp compression is not enabled - how to debug #430

Open
rsend opened this issue Jun 12, 2023 · 6 comments
Open

ppp compression is not enabled - how to debug #430

rsend opened this issue Jun 12, 2023 · 6 comments
Assignees

Comments

@rsend
Copy link

rsend commented Jun 12, 2023

Hi,
I'm building a ppp connection over a slow, high latency radio link and I'm having some issues with enabling compression. In short, the host end is Raspberry Pi Zero (Bullseye, kernel 5.10 with ppp 2.4.9 I think) talking via a USB-Serial adapter to a 900Mhz radio. On the other end is a Netgear R6220 router running dd-wrt (MIPS, kernel 4.14 with ppp 2.4.8), talking to it's radio via the same USB-Serial adapter (both Prolific PL2303).

The only way I can make it work so far is to use the "noccp" option, which is unfortunate because the link is very slow and compression makes a significant difference.

If I don't specify "noccp", the symptom is that compression negotiation appears to go into an infinite loop, as follows:

sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] rcvd [CCP ConfReq id=0x3 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] sent [CCP ConfRej id=0x3 <mppe -H -M -S -L -D -C> rcvd [CCP ConfAck id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] rcvd [CCP ConfReq id=0x3 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] sent [CCP ConfRej id=0x3 <mppe -H -M -S -L -D -C>] rcvd [CCP ConfAck id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] rcvd [CCP ConfAck id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] rcvd [CCP ConfReq id=0x3 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] sent [CCP ConfRej id=0x3 <mppe -H -M -S -L -D -C>] ......

When I connect the host Raspberry Pi to a PC running the same pppd invocation (but ALSO v 2.4.9) , compression is enabled as expected.

What should I check for here? Or, is there any kind of known issue in talking between 2.4.8 and 2.4.9?

Thanks,
R

@Neustradamus
Copy link
Member

@paulusmack, @enaess: Have you seen this ticket?

@enaess
Copy link
Contributor

enaess commented Jun 14, 2023

@rsend

Would you be able to upgrade to the latest on at least either side, i.e. upgrade to pppd-2.5.0?

Also, please attach the configuration you have, and add some line feeds between each line:

sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
rcvd [CCP ConfReq id=0x3 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
sent [CCP ConfRej id=0x3 <mppe -H -M -S -L -D -C>
rcvd [CCP ConfAck id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
rcvd [CCP ConfReq id=0x3 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
sent [CCP ConfRej id=0x3 <mppe -H -M -S -L -D -C>] 
rcvd [CCP ConfAck id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
rcvd [CCP ConfAck id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
rcvd [CCP ConfReq id=0x3 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] 
sent [CCP ConfRej id=0x3 <mppe -H -M -S -L -D -C>]

Generally, this does look like a bug to me. The two peers should be able to converge on using one of <deflate 15> <deflate(old#) 15> <bsd v1 15>, and the peer with id=0x3 should remove the MS MPPE from the requested list of advertised compression in the subsequent transmissions as the peer with id=0x1 rejected it.

@rsend
Copy link
Author

rsend commented Jun 15, 2023

Sorry about the formatting - I put it as "code" and that's how it came out.

FWIW I forgot to add some possibly indicative information, the dd-wrt (mips) side reports over and over again:

ppp0: compressor dropped pkt

And no, I don't think I can upgrade either end. The dd-wrt side is tied to a package manager they call Entware, for which the pppd package has these notes:
https://github.com/Entware/Entware/blob/master/package/network/services/ppp/Makefile#L7

Actually, those guys did say "Just use dd-wrt toolchain" - does that mean I SHOULD be able to build a new version myself without rebuilding kernel? dd-wrt is not "exactly" user friendly - building the whole thing from scratch oneself isn't really supported. I had opened this question over there:

Entware/Entware#935

I did try one other indicative thing, I downgraded the Raspberry Pi side to 2.4.7 by installing an older version of Buster, same error against dd-wrt but fine against a PC.

Will add my invocation later. Thanks for checking, so far!

@enaess
Copy link
Contributor

enaess commented Jun 15, 2023

I think pppd-2.5.0 support is in progress, see here:
openwrt/openwrt#12848

I've never compiled or loaded it onto a openwrt device before. The problem with pppd is that there are many downstream projects dependent on pppd, so those will require a recompile as well. Your best bet would be to upgrade to the new OpenWRT firmware with the latest pppd-2.5.0 when it is ready. 🤷

Once you have time, it would be easier if you are able to describe in detail what is working and what is not. I think you have me lost somewhere in the weeds...

@paulusmack
Copy link
Collaborator

It would be useful to see the timestamps on the packets. That might illuminate why we send another ConfReq after getting a ConfAck.

Could the latency of the radio link be 1.5 seconds or greater, in each direction? If so then you probably want to increase the retransmission time to be more than 2 * latency.

@rsend
Copy link
Author

rsend commented Jun 16, 2023

@enaess OpenWRT and dd-wrt are very different things - I haven't tried OpenWRT yet. But maybe that will solve the problem, even on their current version which is more recent than the dd-wrt one! Will attempt and report back.

@paulusmack latency COULD be greater than 1.5 sec. I've seen 12 seconds pings on occasion (!), but that would be weird in my test setup - the radios are both sitting next to me and pings are usually ~ 200ms. Either way, where can I adjust this parameter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants