0

I want to set PPP in order to use a pseudoterminal slave (/dev/pts/N) instead of a physical serial link, handle its data flow in an application (from /dev/ptmx) and redirect that flow … somewhere appropriate. After reading all the documentation I understand that this is doable, however, I’ve found no trace of someone that actually tried. So, can someone at ease with PTS confirm that I’m not missing something?

I could try myself, but it would involve quite a bit of software development to answer the question. I’m particularly wondering about dataflow issues (I’d use XOn/Xoff) or latency issues…

Long story ...

I’m on an embedded Linux (Call it device#1). This device has an application that communicates with a second device (Call it device#2) through a homemade protocol on serial link. At the moment, Device#1 use PPP and a modem connected to a second serial link for its communication.
The point is that device#2 also has a modem. So, I want to remove the modem from device#1 in order to reduce the cost of our solution and redirect PPP’s dataflow to the other device/modem.

My idea is to use a pseudoterminal pair, modify the application in order to read the flow from the PTM, encapsulate it in the homemade protocol and send it to device#2. Device#2 can be modified in order to handle this flow properly, that’s not the point.

  • Device#2 has no Operating System (I can’t reasonably use socat between the two devices).
  • tty0tty could be a solution, but I wish to avoid as far as possible the installation of a package,
  • SSL/TCP has to be set up in device#1 (Linux) for security reason. This is mandatory.
  • When you say device#2 has no OS, what does it have? – Penn Mar 14 '18 at 17:55
  • device#2 is an ARM9 board. It's running an Embedded software developped in ANSI C. Almost no library available (not enough memory). – SC0 Mar 16 '18 at 8:02
0

I've used pppd to run traffic through SSH connections before, which should be similar to what you're attempting. I did that after having trouble with traditional SSH tunneling, where the creation/teardown of forwarded TCP connections bogged things down a lot. The ssh+pppd combination worked much better, so hopefully that means you wouldn't have much trouble with latency. I can't speak to the Xon/Xoff situation, though.

I included a line in a /etc/ppp/peers/<linkname> file that looked something like this:

pty "/usr/bin/ssh -t -P -l username servername"

You'd obviously want to replace that ssh command with your own tool for translating the serial link.

There are also people who have done the same sort of thing with socat and nc, so I'd expect this to be doable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.