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

transport: Support AGWPE over TCP (direwolf) #57

Closed
martinhpedersen opened this issue Oct 1, 2019 · 22 comments · Fixed by #81
Closed

transport: Support AGWPE over TCP (direwolf) #57

martinhpedersen opened this issue Oct 1, 2019 · 22 comments · Fixed by #81

Comments

@martinhpedersen
Copy link
Member

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.

@dranch
Copy link

dranch commented Oct 28, 2019

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.

@martinhpedersen
Copy link
Member Author

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 :/

@zachfi
Copy link

zachfi commented May 28, 2020

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

@KI7ODK
Copy link

KI7ODK commented Jun 4, 2020

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.

@martinhpedersen
Copy link
Member Author

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!

@KI7ODK
Copy link

KI7ODK commented Jun 5, 2020

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

@KI7ODK
Copy link

KI7ODK commented Jul 4, 2020

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.

@martinhpedersen
Copy link
Member Author

martinhpedersen commented Jul 7, 2020

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
Copy link
Member Author

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

@italic-r
Copy link

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).

@KI7ODK
Copy link

KI7ODK commented Feb 19, 2021 via email

@wb2osz
Copy link

wb2osz commented Mar 29, 2021

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

@dboune
Copy link

dboune commented Feb 1, 2022

Adding voice in support of this. Thank you!

@Tyler-2
Copy link

Tyler-2 commented May 16, 2022

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.

@martinhpedersen
Copy link
Member Author

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

@martinhpedersen martinhpedersen self-assigned this Jun 7, 2022
@KI7ODK
Copy link

KI7ODK commented Jun 7, 2022 via email

@martinhpedersen
Copy link
Member Author

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 martinhpedersen changed the title transport: Support AGW over TCP (direwolf) transport: Support AGWPE over TCP (direwolf) Aug 7, 2022
@martinhpedersen
Copy link
Member Author

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...

@KI7ODK
Copy link

KI7ODK commented Aug 17, 2022

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

@martinhpedersen
Copy link
Member Author

@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
Copy link
Member Author

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

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

@martinhpedersen
Copy link
Member Author

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.

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

Successfully merging a pull request may close this issue.

8 participants