Help Required in decoding multilink PPP packets from a PPP userspace application - PPP

This is a discussion on Help Required in decoding multilink PPP packets from a PPP userspace application - PPP ; Hi All, I have written a user space application that runs PPP on the slave side of a Pseudo terminal. I have a problem in decoding multilink ppp packets. I have customised the LINUX PPP kernel driver to fragment the ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Help Required in decoding multilink PPP packets from a PPP userspace application

  1. Help Required in decoding multilink PPP packets from a PPP userspace application

    Hi All,

    I have written a user space application that runs PPP on the slave
    side of a Pseudo terminal. I have a problem in decoding multilink ppp
    packets. I have customised the LINUX PPP kernel driver to fragment the
    PPP packets of fragment size specified by the user. ie., even if i
    have one multilink PPP session if i configure the fragmentsize as 500,
    larger packets will be fragmented and sent out on the ppp session.

    I have written an user space application which reads the PPP data from
    the
    master Pty and do some processing and send it out to the driver. Now
    the problem is when fragmentation occurs the kernel MLPPP modules
    fragments the packets and writes to the Master PTY. Since the task
    which reads the PPP data is in user space and i am using a larger
    buffer size(1500 bytes) to read the packet from the master PTY i am
    not able to demarcate the Multilink PPP packets of size of 500 bytes.
    Is there any way out for this problem other than reading only 500 + 8
    (MLPPP + PPP Header) bytes (fragment size as configured in MLPPP)

    Thanks,
    Vanitha

  2. Re: Help Required in decoding multilink PPP packets from a PPP userspace application

    vanitha@agilis.st.com.sg (Vanitha) writes:
    > I have written an user space application which reads the PPP data from
    > the
    > master Pty and do some processing and send it out to the driver. Now
    > the problem is when fragmentation occurs the kernel MLPPP modules
    > fragments the packets and writes to the Master PTY. Since the task
    > which reads the PPP data is in user space and i am using a larger
    > buffer size(1500 bytes) to read the packet from the master PTY i am
    > not able to demarcate the Multilink PPP packets of size of 500 bytes.
    > Is there any way out for this problem other than reading only 500 + 8
    > (MLPPP + PPP Header) bytes (fragment size as configured in MLPPP)


    I doubt that reading fixed-size buffers would work properly. When
    pppd runs over a pty, the data that are presented on the master side
    are in RFC 1662 AHDLC format -- just a stream of bytes. You have to
    process this data byte-by-byte, and use 0x7E to demarcate packet
    boundaries.

    --
    James Carlson, IP Systems Group
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677

  3. Re: Help Required in decoding multilink PPP packets from a PPP userspace application

    James Carlson wrote in message news:...
    > vanitha@agilis.st.com.sg (Vanitha) writes:
    > > I have written an user space application which reads the PPP data from
    > > the
    > > master Pty and do some processing and send it out to the driver. Now
    > > the problem is when fragmentation occurs the kernel MLPPP modules
    > > fragments the packets and writes to the Master PTY. Since the task
    > > which reads the PPP data is in user space and i am using a larger
    > > buffer size(1500 bytes) to read the packet from the master PTY i am
    > > not able to demarcate the Multilink PPP packets of size of 500 bytes.
    > > Is there any way out for this problem other than reading only 500 + 8
    > > (MLPPP + PPP Header) bytes (fragment size as configured in MLPPP)

    >
    > I doubt that reading fixed-size buffers would work properly. When
    > pppd runs over a pty, the data that are presented on the master side
    > are in RFC 1662 AHDLC format -- just a stream of bytes. You have to
    > process this data byte-by-byte, and use 0x7E to demarcate packet
    > boundaries.



    The PPP packets that i read from the master side of pty starts with the
    0xFF 0x03 followed by PPP Header + data. I dont see any 0x7E coming here.
    The 0x7E will be added by the HDLC driver after i send the packet
    from the master pty to the Sync Device driver. So in this case do i
    need to demarcate the packet with the 0xFF 0x03 header ?

  4. Re: Help Required in decoding multilink PPP packets from a PPP userspace application

    James Carlson wrote in message news:...
    > vanitha@agilis.st.com.sg (Vanitha) writes:
    > > I have written an user space application which reads the PPP data from
    > > the
    > > master Pty and do some processing and send it out to the driver. Now
    > > the problem is when fragmentation occurs the kernel MLPPP modules
    > > fragments the packets and writes to the Master PTY. Since the task
    > > which reads the PPP data is in user space and i am using a larger
    > > buffer size(1500 bytes) to read the packet from the master PTY i am
    > > not able to demarcate the Multilink PPP packets of size of 500 bytes.
    > > Is there any way out for this problem other than reading only 500 + 8
    > > (MLPPP + PPP Header) bytes (fragment size as configured in MLPPP)

    >
    > I doubt that reading fixed-size buffers would work properly. When
    > pppd runs over a pty, the data that are presented on the master side
    > are in RFC 1662 AHDLC format -- just a stream of bytes. You have to
    > process this data byte-by-byte, and use 0x7E to demarcate packet
    > boundaries.



    Sorry forgot to mention. I was running PPP in "sync" mode. Hence i am
    not getting the 0x7E flags. I want the HDLC bit stuffing to be done by
    the Synchronous device driver. Is there any other way to demarcate
    then ?

  5. Re: Help Required in decoding multilink PPP packets from a PPP userspace application

    vanitha@agilis.st.com.sg (Vanitha) writes:
    > Sorry forgot to mention. I was running PPP in "sync" mode. Hence i am
    > not getting the 0x7E flags. I want the HDLC bit stuffing to be done by
    > the Synchronous device driver. Is there any other way to demarcate
    > then ?


    Oh. In that case, I think you're on your own. I don't believe that
    the ptys support synchronous operation. They have no way to demarcate
    message boundaries.

    --
    James Carlson, IP Systems Group
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677

  6. Re: Help Required in decoding multilink PPP packets from a PPP userspace application

    vanitha@agilis.st.com.sg (Vanitha) wrote in message news:<15faa2ac.0401282156.58f9cb05@posting.google.com>...
    > James Carlson wrote in message news:...
    > > vanitha@agilis.st.com.sg (Vanitha) writes:
    > > > I have written an user space application which reads the PPP data from
    > > > the
    > > > master Pty and do some processing and send it out to the driver. Now
    > > > the problem is when fragmentation occurs the kernel MLPPP modules
    > > > fragments the packets and writes to the Master PTY. Since the task
    > > > which reads the PPP data is in user space and i am using a larger
    > > > buffer size(1500 bytes) to read the packet from the master PTY i am
    > > > not able to demarcate the Multilink PPP packets of size of 500 bytes.
    > > > Is there any way out for this problem other than reading only 500 + 8
    > > > (MLPPP + PPP Header) bytes (fragment size as configured in MLPPP)

    > >
    > > I doubt that reading fixed-size buffers would work properly. When
    > > pppd runs over a pty, the data that are presented on the master side
    > > are in RFC 1662 AHDLC format -- just a stream of bytes. You have to
    > > process this data byte-by-byte, and use 0x7E to demarcate packet
    > > boundaries.

    >
    >
    > The PPP packets that i read from the master side of pty starts with the
    > 0xFF 0x03 followed by PPP Header + data. I dont see any 0x7E coming here.
    > The 0x7E will be added by the HDLC driver after i send the packet
    > from the master pty to the Sync Device driver. So in this case do i
    > need to demarcate the packet with the 0xFF 0x03 header ?


    Hello,
    I could see the 0x7E flags coming if i run PPP in async mode.
    I want the HDLC framing to be done by the driver itself, because we
    have
    a HDLC Network processor in our board. I dont want the software to add
    the
    0x7E and 0x7D flags. Is there any other way to run ppp over the
    synchronous serial driver.?.

    What does the synchronous functions sppp_input, sppp_attach etc in
    syncppp.c do ?..When do we use them ?

  7. Re: Help Required in decoding multilink PPP packets from a PPP userspace application

    vanitha@agilis.st.com.sg (Vanitha) writes:
    > > from the master pty to the Sync Device driver. So in this case do i
    > > need to demarcate the packet with the 0xFF 0x03 header ?


    That won't work either, as FF 03 is perfectly legal in user data.

    > I could see the 0x7E flags coming if i run PPP in async mode.
    > I want the HDLC framing to be done by the driver itself, because we
    > have
    > a HDLC Network processor in our board.


    OK; sounds reasonable.

    > I dont want the software to add
    > the
    > 0x7E and 0x7D flags.


    Right. That's natural for synchronous applications. The 'unnatural'
    part is trying to run it over a pty. Ptys are async.

    > Is there any other way to run ppp over the
    > synchronous serial driver.?.


    Sure. Give pppd the /dev device node and the "sync" keyword in its
    options, and let pppd open the appropriate device and use it.

    > What does the synchronous functions sppp_input, sppp_attach etc in
    > syncppp.c do ?..When do we use them ?


    At a wild guess, I'll assume that you're looking at Linux source. ;-}

    For one example of the usage, see drivers/net/wan/comx-proto-ppp.c. I
    don't know of any written documentation for this interface (other than
    the source itself), but from my signature you might guess that I'm not
    an active Linux kernel developer.

    This newsgroup (comp.protocols.ppp) isn't really the best place to ask
    Linux kernel architecture questions. (I'm not saying "go away," but
    rather that you're likely to get better answers elsewhere; perhaps a
    mailing list or newsgroup related to Linux drivers rather than to
    PPP.)

    --
    James Carlson, IP Systems Group
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677

+ Reply to Thread