Need help regarding PPP client on Linux. - PPP

This is a discussion on Need help regarding PPP client on Linux. - PPP ; We are working on development of a Virtual serial port driver over ethernet on Linux. We need to support PPP data transfer over this serial port. It will be of great help, if you could kindly throw some light on ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Need help regarding PPP client on Linux.

  1. Need help regarding PPP client on Linux.

    We are working on development of a Virtual serial port driver over
    ethernet on Linux. We need to support PPP data transfer over this
    serial port.

    It will be of great help, if you could kindly throw
    some light on the following,

    1. What are the basic support required within our
    serial port driver for a PPP packet to get routed
    through it

    2. What ioctls need to be supported in order for our
    driver to handle PPP connections

    Regards,
    Pavan


  2. Re: Need help regarding PPP client on Linux.

    pchinnabhandar@gmail.com writes:
    > We are working on development of a Virtual serial port driver over
    > ethernet on Linux. We need to support PPP data transfer over this
    > serial port.


    I hope you've done some looking around for suitable alternatives,
    because this is well-trodden ground.

    > It will be of great help, if you could kindly throw
    > some light on the following,
    >
    > 1. What are the basic support required within our
    > serial port driver for a PPP packet to get routed
    > through it
    >
    > 2. What ioctls need to be supported in order for our
    > driver to handle PPP connections


    Your best bet is to read and understand the pppd source code.

    Pppd supports two kinds of serial ports: asynchronous and synchronous.
    Synchronous is simpler but rarely seen in the wild; it's a framed
    interface with few options, and hardware does most of the heavy byte
    lifting. Asynchronous is common but much more complicated.

    The short answer is that the minimum required by PPP is an 8-bit clean
    bidirectional datapath. You don't absolutely need to support modem
    control signals, flow control, bit rates, or any of the rest of the
    common async port behavior, provided that you can give PPP the link
    characteristics it wants.

    However, as with any networking software design, the quality of your
    implementation depends strongly on an accurate analysis of your needs
    and not on the minimum requirements of PPP.

    Since this is a Linux-specific question, and since the bulk of the
    work will involve using internal Linux kernel interfaces for serial
    drivers, I'd suggest going to linux-ppp@vger.kernel.org for more help.

    --
    James Carlson, KISS Network
    Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

  3. Re: Need help regarding PPP client on Linux.

    pchinnabhandar@gmail.com writes:

    >We are working on development of a Virtual serial port driver over
    >ethernet on Linux. We need to support PPP data transfer over this
    >serial port.


    ???? Why? This on the face of it sounds completely insane.


    >It will be of great help, if you could kindly throw
    >some light on the following,


    >1. What are the basic support required within our
    > serial port driver for a PPP packet to get routed
    > through it


    That signals be transmitted both outgoing and ingoing. And that distinct
    signals sent out, are received as distinct signals at the other end. You
    could impliment ppp over smoke signals if you wished.

    Now, if you want to use an existing ppp implimentation, with an existing
    serial port driver, then look at that implimentation and see what it
    demands from the serial port driver.


    >2. What ioctls need to be supported in order for our
    > driver to handle PPP connections


    None. Just write the ppp driver for the serial port
    driver.


    >Regards,
    >Pavan



  4. Re: Need help regarding PPP client on Linux.

    One more problem.
    During device open, pppd displays the following error
    messges.

    Sep 11 11:40:31 localhost pppd[3771]: Couldn't make tty exclusive:
    Operation not permitted
    Sep 11 11:40:31 localhost pppd[3771]: Couldn't attach to channel 0: No
    such device or address

    Can you please tell me what pppd is looking for?

    Unruh wrote:
    > pchinnabhandar@gmail.com writes:
    >
    > >We are working on development of a Virtual serial port driver over
    > >ethernet on Linux. We need to support PPP data transfer over this
    > >serial port.

    >
    > ???? Why? This on the face of it sounds completely insane.
    >
    >
    > >It will be of great help, if you could kindly throw
    > >some light on the following,

    >
    > >1. What are the basic support required within our
    > > serial port driver for a PPP packet to get routed
    > > through it

    >
    > That signals be transmitted both outgoing and ingoing. And that distinct
    > signals sent out, are received as distinct signals at the other end. You
    > could impliment ppp over smoke signals if you wished.
    >
    > Now, if you want to use an existing ppp implimentation, with an existing
    > serial port driver, then look at that implimentation and see what it
    > demands from the serial port driver.
    >
    >
    > >2. What ioctls need to be supported in order for our
    > > driver to handle PPP connections

    >
    > None. Just write the ppp driver for the serial port
    > driver.
    >
    >
    > >Regards,
    > >Pavan



  5. Re: Need help regarding PPP client on Linux.

    pchinnabhandar@gmail.com writes:
    > One more problem.
    > During device open, pppd displays the following error
    > messges.
    >
    > Sep 11 11:40:31 localhost pppd[3771]: Couldn't make tty exclusive:
    > Operation not permitted
    > Sep 11 11:40:31 localhost pppd[3771]: Couldn't attach to channel 0: No
    > such device or address
    >
    > Can you please tell me what pppd is looking for?


    Do you have access to the pppd source? The messages are fairly easy
    to find with grep.

    /*
    * Ensure that the tty device is in exclusive mode.
    */
    if (ioctl(tty_fd, TIOCEXCL, 0) < 0) {
    if ( ! ok_error ( errno ))
    warn("Couldn't make tty exclusive: %m");
    }
    [...]
    if (ioctl(fd, PPPIOCATTCHAN, &chindex) < 0) {
    error("Couldn't attach to channel %d: %m", chindex);
    goto err_close;
    }

    Getting these errors means that the kernel module you're using doesn't
    behave like a normal tty.

    TIOCEXCL is normally handled in drivers/char/tty_io.c, which is the
    common set of interface functions used by all tty drivers.

    PPPIOCATTCHAN is handled in drivers/net/ppp_generic.c. If that fails,
    I think it means that the kernel you're using is malfunctioning in
    some way. I don't see how that failure is possible -- I think it
    should have failed on PPPIOCGCHAN first.

    It sounds like the questions you need to have answered are related to
    Linux kernel internals, and not specifically related to PPP itself.
    You may have more success if you look for a group or support forum
    related to the Linux kernel.

    --
    James Carlson, KISS Network
    Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

  6. Re: Need help regarding PPP client on Linux.


    Thanks James. What I understand from your points is that pppd is
    calling ioctls TIOCEXCL defined in tty_io.c and PPPIOCATTCHAN
    ppp_generic.c and they are failing.

    I am sure that ppp_generic was inserted successfully. No idea why it
    failed.

    I strongly feel that TIOCEXCL should be defined in my serial port
    driver module. Is that right?
    So my next plan will be to support or define all the standard serial
    port ioctls in my driver module.

    Can I get the pppd source code please?

    Thanks a lot.

    Regards,
    Pavan


    James Carlson wrote:
    > pchinnabhandar@gmail.com writes:
    > > One more problem.
    > > During device open, pppd displays the following error
    > > messges.
    > >
    > > Sep 11 11:40:31 localhost pppd[3771]: Couldn't make tty exclusive:
    > > Operation not permitted
    > > Sep 11 11:40:31 localhost pppd[3771]: Couldn't attach to channel 0: No
    > > such device or address
    > >
    > > Can you please tell me what pppd is looking for?

    >
    > Do you have access to the pppd source? The messages are fairly easy
    > to find with grep.
    >
    > /*
    > * Ensure that the tty device is in exclusive mode.
    > */
    > if (ioctl(tty_fd, TIOCEXCL, 0) < 0) {
    > if ( ! ok_error ( errno ))
    > warn("Couldn't make tty exclusive: %m");
    > }
    > [...]
    > if (ioctl(fd, PPPIOCATTCHAN, &chindex) < 0) {
    > error("Couldn't attach to channel %d: %m", chindex);
    > goto err_close;
    > }
    >
    > Getting these errors means that the kernel module you're using doesn't
    > behave like a normal tty.
    >
    > TIOCEXCL is normally handled in drivers/char/tty_io.c, which is the
    > common set of interface functions used by all tty drivers.
    >
    > PPPIOCATTCHAN is handled in drivers/net/ppp_generic.c. If that fails,
    > I think it means that the kernel you're using is malfunctioning in
    > some way. I don't see how that failure is possible -- I think it
    > should have failed on PPPIOCGCHAN first.
    >
    > It sounds like the questions you need to have answered are related to
    > Linux kernel internals, and not specifically related to PPP itself.
    > You may have more success if you look for a group or support forum
    > related to the Linux kernel.
    >
    > --
    > James Carlson, KISS Network
    > Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    > MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677



  7. Re: Need help regarding PPP client on Linux.

    pchinnabhandar@gmail.com writes:


    >Thanks James. What I understand from your points is that pppd is
    >calling ioctls TIOCEXCL defined in tty_io.c and PPPIOCATTCHAN
    >ppp_generic.c and they are failing.


    >I am sure that ppp_generic was inserted successfully. No idea why it
    >failed.


    >I strongly feel that TIOCEXCL should be defined in my serial port
    >driver module. Is that right?


    What are you trying to do? If you want to support the standard Linux pppd,
    then yes, you should make your module as similar to the Linux serial port
    driver as you can. On the other hand, I still have no idea what you are
    trying to do. There exist pppoe ( ppp over ethernet) modules/drivers for
    linux already and included in the linux distros. Why would you want a
    serial port over ethernet driver in the first place? Ethernet already
    supports all of the transport that ppp via the serial port driver over
    ethernet would support.


    >So my next plan will be to support or define all the standard serial
    >port ioctls in my driver module.


    >Can I get the pppd source code please?


    Sure. It is part of any Linux distribution, or get it from
    ftp.samba.org/pub/ppp

    >Thanks a lot.


    >Regards,
    >Pavan



    >James Carlson wrote:
    >> pchinnabhandar@gmail.com writes:
    >> > One more problem.
    >> > During device open, pppd displays the following error
    >> > messges.
    >> >
    >> > Sep 11 11:40:31 localhost pppd[3771]: Couldn't make tty exclusive:
    >> > Operation not permitted
    >> > Sep 11 11:40:31 localhost pppd[3771]: Couldn't attach to channel 0: No
    >> > such device or address
    >> >
    >> > Can you please tell me what pppd is looking for?

    >>
    >> Do you have access to the pppd source? The messages are fairly easy
    >> to find with grep.
    >>
    >> /*
    >> * Ensure that the tty device is in exclusive mode.
    >> */
    >> if (ioctl(tty_fd, TIOCEXCL, 0) < 0) {
    >> if ( ! ok_error ( errno ))
    >> warn("Couldn't make tty exclusive: %m");
    >> }
    >> [...]
    >> if (ioctl(fd, PPPIOCATTCHAN, &chindex) < 0) {
    >> error("Couldn't attach to channel %d: %m", chindex);
    >> goto err_close;
    >> }
    >>
    >> Getting these errors means that the kernel module you're using doesn't
    >> behave like a normal tty.
    >>
    >> TIOCEXCL is normally handled in drivers/char/tty_io.c, which is the
    >> common set of interface functions used by all tty drivers.
    >>
    >> PPPIOCATTCHAN is handled in drivers/net/ppp_generic.c. If that fails,
    >> I think it means that the kernel you're using is malfunctioning in
    >> some way. I don't see how that failure is possible -- I think it
    >> should have failed on PPPIOCGCHAN first.
    >>
    >> It sounds like the questions you need to have answered are related to
    >> Linux kernel internals, and not specifically related to PPP itself.
    >> You may have more success if you look for a group or support forum
    >> related to the Linux kernel.
    >>
    >> --
    >> James Carlson, KISS Network
    >> Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    >> MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677



+ Reply to Thread