wl2k-go icon indicating copy to clipboard operation
wl2k-go copied to clipboard

transport: Support AGWPE over TCP (direwolf)

Open martinhpedersen opened this issue 5 years ago • 22 comments

As pointed out by @kd8drx in #47, Direwolf appears to have a full AX.25 implementation exposed via the AGW-over-TCP format.

If we could implement a package to support AGW-over-TCP, that could be a nice way to support AX.25 on multiple platforms until #56 is resolved.

martinhpedersen avatar Oct 01 '19 20:10 martinhpedersen

I would personally vote for the AGW route as this would allow you to leverage Direwolf's AX25 v2.2 stack and all of it's built-in intelligence vs. dumb things down via the KISS interface.

dranch avatar Oct 28 '19 15:10 dranch

I have received some example C code from @wb2osz, and some documentation. If someone is willing to give this a go, then please let me know so I can forward the files.

I am considering to prioritize this feature soon... but I haven't found the time yet :/

martinhpedersen avatar May 27 '20 20:05 martinhpedersen

I wouldn't mind seeing those files, but I know nothing of the code in this project to help at this time.

zachfi avatar May 28 '20 01:05 zachfi

I would love to give this a go. If you could send me the example code and documentation, I'll take a crack at it.

KI7ODK avatar Jun 04 '20 17:06 KI7ODK

I'm very glad to hear that! I've sent an inquiry to the original author today, requesting permission to share the code with you :)

Thank you!

martinhpedersen avatar Jun 05 '20 20:06 martinhpedersen

@martinhpedersen I actually received some code and documentation from @wb2osz yesterday that I have started looking through.

KI7ODK avatar Jun 05 '20 20:06 KI7ODK

AGWPE has a security feature that would be prudent to include for full AGWPE functionality. However, I believe Direwolf does not implement this.

From the documentation:

Login/Password validation. The AGW Packet Engine user has now the ability to prohibit access of agwpe for other programs. The Security levels are 3.

  1. Allow any program to use agwpe.
  2. Allow only programs that run in his LAN.
  3. Allow only programs that run in his computer. If the security level is set to 2 or 3. Then a program can gain access with a login validation procedure. This is done using the new frame ‘P’ (capital letter P).

This is fairly simple to implement as it only requres sending the login frame to AGW. However, I don't see any straight forward way right now to pass AGW username and password information into the TNC open/init functions. It doesn't look like it can be done cleanly via the dialer url anyways.

What are our thoughts on this? Also, please let me know if this is the best place to post questions and seek feedback as I'm working on this.

KI7ODK avatar Jul 04 '20 20:07 KI7ODK

Also, please let me know if this is the best place to post questions and seek feedback as I'm working on this.

Sure, we can continue the discussion here :) But feel free to email directly if you prefer.

However, I don't see any straight forward way right now to pass AGW username and password information into the TNC open/init functions. It doesn't look like it can be done cleanly via the dialer url anyways.

It sounds to me like this is something that we could add in a separate config section for agw, and pass to the TNC as part of the open/init function.

Dave Cheney's Functional options for friendly APIs comes to find as a nice way to open up for this but still maintain a good and uncluttered API.

Another approach could be to let Open() take an ~~optional Config-struct~~ Options-struct, similar to boltdb's API.

AGWPE has a security feature that would be prudent to include for full AGWPE functionality. However, I believe Direwolf does not implement this.

I suspect that most users will prefer Direwolf over AGWPE, simply because more than 95% of Pat users run Linux. So IMHO, I think we can defer this security feature. But that's for you to decide 👍

Thanks for taking the time to work on this!

martinhpedersen avatar Jul 07 '20 18:07 martinhpedersen

For the record. https://github.com/la5nta/pat/wiki/Adding-transports was added today, as discussed in https://github.com/la5nta/pat/issues/175.

martinhpedersen avatar Jul 07 '20 18:07 martinhpedersen

Has there been any development on this feature addition? I would love to use pat without having to deal with kernel ax.25 or kiss. AGW is my preferred interface for APRS clients and is much, much easier to set up for users (I've been struggling with this the last several days).

italic-r avatar Feb 19 '21 09:02 italic-r

There has been some minor work done on it but I haven’t made any significant progress as of late. I’ll see if I can reprioritize this effort since you have expressed interest!

P.S. I have never had much luck using the kernel ax.25 implementation myself for some reason.

On Feb 19, 2021, at 4:18 AM, italic [email protected] wrote:

 Has there been any development on this feature addition? I would love to use pat without having to deal with kernel ax.25 or kiss. AGW is my preferred interface for APRS clients and is much, much easier to set up for users (I've been struggling with this the last several days).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

KI7ODK avatar Feb 19 '21 13:02 KI7ODK

This feature would be very beneficial. Setting up AX.25 for Linux is complicated and a new bug was discovered recently. https://groups.io/g/direwolf/message/5074

wb2osz avatar Mar 29 '21 13:03 wb2osz

Adding voice in support of this. Thank you!

dboune avatar Feb 01 '22 07:02 dboune

Sent my very first WinLink via RF packets tonight... Linux Ax.25 implementation made it terrible, with more obtuse configuration than expected and some kind of bug in reconnecting. I don't think the implementation feels ready for prime time.

Tyler-2 avatar May 16 '22 06:05 Tyler-2

I've started working on a transport package implementing this. Will probably take some time 🐌.

martinhpedersen avatar Jun 07 '22 17:06 martinhpedersen

I have picked my work on this back up within the past few weeks. I don’t have much done, but I can transfer what I’ve learned about the AGWPE protocol if you’d like. I feel like I have a good understanding of the protocol now, but I’ve been a little slow writing code since I’m still picking up golang.

On Jun 7, 2022, at 1:28 PM, Martin Hebnes Pedersen @.***> wrote:

 I've started working on a transport package implementing this. Will probably take some time 🐌.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

KI7ODK avatar Jun 07 '22 17:06 KI7ODK

Sure, it would be great if you could share what you've found so far 👍

I'll try to push my branch within a couple of days so you can have a look at it. Maybe we can work on this together somehow 🙂

I have been using direwolf as my test modem, and it looks like the login procedure is not required at all. I've managed to register a callsign+port and also initiated the dialing operation by sending a 'c' frame to direwolf. Direwolf have some very handy logging capabilities, so that's going to be very helpful I think.

So far I have written code for encoding/decoding frames, and started implementing a TNC type to represent the AGWPE connection. I don't have a clear picture on how to manage the TNC state yet. From my own experience writing the ARDOP and WINOR packages, that's the hardest thing to get right when it comes to writing a transport driver. Especially for modems supporting concurrent connections. My plan is to do some experimenting with different designs to come up with a good approach for handling the TNC/port/connection states correctly, without too much complexity.

I've been using this as my protocol reference so far: https://www.on7lds.net/42/sites/default/files/AGWPEAPI.HTM.

martinhpedersen avatar Jun 07 '22 20:06 martinhpedersen

Quick update: I've been making some progress on this over the summer. I believe I've found a good approach for managing the TNC state by demultiplexing the incoming frames to various goroutines. I have done some preliminary testing with two Pat instances (P2P) and a small "chat" app I wrote just to see how the TNC (Direwolf) behaves.

I still haven't tested with the original AGWPE application on Windows, but hopefully the two TNCs behave the same 🤞.

I've also started to fiddle with a solution for having multiple transports supporting the ax25:// scheme in Pat, with a config option to select the default driver.

To be continued...

martinhpedersen avatar Aug 13 '22 10:08 martinhpedersen

@martinhpedersen Sounds great! Do you have code I could test and compare to what I have right now?

KI7ODK avatar Aug 17 '22 21:08 KI7ODK

@KI7ODK - I've pushed the branch now :) Will push relevant changes to the Pat repo as soon as I have done my own review of the code.

martinhpedersen avatar Aug 20 '22 07:08 martinhpedersen

Here is the chat app I've been using for testing purposes:

https://go.dev/play/p/b_5rTBdTKi4

martinhpedersen avatar Aug 20 '22 07:08 martinhpedersen

I've pushed a branch of Pat that uses this transport if anyone wants to check it out: https://github.com/la5nta/pat/tree/feature/agwpe-engine.

martinhpedersen avatar Aug 24 '22 18:08 martinhpedersen