Is it possible to use a pseudoterminal to redirect PPP’s dataflow to an application?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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.






share|improve this question




















  • When you say device#2 has no OS, what does it have?
    – Penn
    Mar 14 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 at 8:02














up vote
0
down vote

favorite












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.






share|improve this question




















  • When you say device#2 has no OS, what does it have?
    – Penn
    Mar 14 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 at 8:02












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.






share|improve this question












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.








share|improve this question











share|improve this question




share|improve this question










asked Mar 14 at 14:24









SC0

1




1











  • When you say device#2 has no OS, what does it have?
    – Penn
    Mar 14 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 at 8:02
















  • When you say device#2 has no OS, what does it have?
    – Penn
    Mar 14 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 at 8:02















When you say device#2 has no OS, what does it have?
– Penn
Mar 14 at 17:55




When you say device#2 has no OS, what does it have?
– Penn
Mar 14 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 at 8:02




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 at 8:02










1 Answer
1






active

oldest

votes

















up vote
0
down vote













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.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430186%2fis-it-possible-to-use-a-pseudoterminal-to-redirect-ppp-s-dataflow-to-an-applicat%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    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.






    share|improve this answer
























      up vote
      0
      down vote













      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.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 18 at 5:07









        mulad

        962




        962






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430186%2fis-it-possible-to-use-a-pseudoterminal-to-redirect-ppp-s-dataflow-to-an-applicat%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay