PPP state machine
Hi all,
I am trying to put the complete PPP state machine into the kernel space.
PPP implementation in linux is divided into kernel space code and user space code. The state machine is implemented in user space.
I am trying to put the complete state machine into the kernel space and make it work with Farsync card(V.35 interface).
Farsync depends on syncppp code which contains the implementation of the PPP protocol. But the code is not complete. There is not authentication phase and IPCP protocol implementation is not complete.
Is it possible to port the user space code to kernel space. If so how do I proceed.
Did anyone tried this?
TIA
Regards
bhaskar
Quoted 1 line · Bhaskar-ROCSYS
I am trying to put the complete PPP state machine into the kernel space.
The first big question to ask is "why?" Why do you want to do this? It will undoubtedly reduce functionality (it's hard to link to system libraries or launch external helper programs from kernel space) and lower system stability and security. By far, the most complex piece of PPP is the state machine and related support components. Why would anyone want these complex bits added to the kernel?
What is the problem being solved? I don't think it can be a performance issue, since the state machine is part of the control path, and the entire data path is already in the kernel.
Quoted 3 lines
Farsync depends on syncppp code which contains the implementation of the PPP protocol. But the code is not complete. There is not authentication phase and IPCP protocol implementation is not complete.
I take it that this means that there's some third party code that you're using that's designed this way. I'd suggest changing that code so that it just behaves as a normal synchronous interface, and use pppd as it is.
Quoted 3 lines
Is it possible to port the user space code to kernel space. If so how do I proceed.
Did anyone tried this?
Other than embedded systems, where there's often no kernel/user distinction, I don't think so.
Hi
First of all thanks for the response.
To answer to big question of "Why?", farsync card that I am using has 4 interfaces. And the application in which i am working on may need all the 4 interfaces to be up.
If I have to use the existing code, then I need to run 4 different instances of pppd. And if I want to use the same code, then I need to go for a design similar to pppoe. For such design i need to write code both in kernel space and user space.
I decide to stick to kernel space and implement the complete state machine in kernel space. I am only interested in state machine. Once this is done I will initiate the state machine from the sync ppp code.
I think for implementing the state machine is independent of the mode.
Regards
bhaskar
Quoted 30 lines · James Carlson
Quoted 1 line · Bhaskar-ROCSYS
I am trying to put the complete PPP state machine into the kernel space.
The first big question to ask is "why?" Why do you want to do this? It will undoubtedly reduce functionality (it's hard to link to system libraries or launch external helper programs from kernel space) and lower system stability and security. By far, the most complex piece of PPP is the state machine and related support components. Why would anyone want these complex bits added to the kernel?
What is the problem being solved? I don't think it can be a performance issue, since the state machine is part of the control path, and the entire data path is already in the kernel.
Quoted 3 lines
Farsync depends on syncppp code which contains the implementation of the PPP protocol. But the code is not complete. There is not authentication phase and IPCP protocol implementation is not complete.
I take it that this means that there's some third party code that you're using that's designed this way. I'd suggest changing that code so that it just behaves as a normal synchronous interface, and use pppd as it is.
Quoted 3 lines
Is it possible to port the user space code to kernel space. If so how do I proceed.
Did anyone tried this?Other than embedded systems, where there's often no kernel/user distinction, I don't think so.
Quoted 8 lines · Bhaskar-ROCSYS
Hi
First of all thanks for the response.To answer to big question of "Why?", farsync card that I am using has 4 interfaces. And the application in which i am working on may need all the 4 interfaces to be up.
If I have to use the existing code, then I need to run 4 different instances of pppd.
Right. Is having four daemons a problem? It makes the links easy to administer and configure. What's the problem being solved?
Quoted 3 lines
And if I want to use the same code, then I need to
go for a design similar to pppoe. For such design i need to write code both in kernel space and user space.
Since you're talking about sync PPP, I don't understand the reference to PPPoE. PPPoE is a bit of an ugly hack that involves (on Linux) multiple trips in and out of the kernel for the data path. I don't know why you'd want to do that.
The user space daemon already supports running on sync ports, and the implementation is efficient -- it doesn't involve the pty tricks as done for PPPoE. The data path is all in the kernel.
As far as I can tell, you don't need to change anything in user space. You just need a sync driver for your card.
Quoted 5 lines
I decide to stick to kernel space and implement the complete state machine in kernel space. I am only interested in state machine. Once this is done I will initiate the state machine from the sync ppp code.
I think for implementing the state machine is independent of the mode.
In that case, best of luck.
Quoted 5 lines · Bhaskar-ROCSYS
To answer to big question of "Why?", farsync card that I am using has 4 interfaces. And the application in which i am working on may need all the 4 interfaces to be up.
If I have to use the existing code, then I need to run 4 different instances of pppd. And if I want to use the same code, then I need to
Those 4 instances will share code, only the data pages will be private to each process. If you said you needed thousands of instances I might have some sympathy. If you really need to trim it down you could link pppd against one of the smaller libc implementations that are out there instead of using glibc.
Quoted 5 lines
go for a design similar to pppoe. For such design i need to write code both in kernel space and user space.
I decide to stick to kernel space and implement the complete state machine in kernel space. I am only interested in state machine. Once this is done I will initiate the state machine from the sync ppp code.
Unfortunately the authors of the syncppp code in Linux have never converted it to use the ppp_generic module. That would be the correct approach IMO.
I can't see any advantage to putting the state machine in the kernel apart from saving a few pages of memory, and if memory is that tight, why are you running Linux anyway?
Paul.
Quoted 3 lines · James Carlson
Since you're talking about sync PPP, I don't understand the reference to PPPoE. PPPoE is a bit of an ugly hack that involves (on Linux) multiple trips in and out of the kernel for the data path.
The ugly hack part is correct, but with the in-kernel pppoe module the data path is at least entirely in the kernel. :)
Paul.
Quoted 3 lines · [email protected] wrote:
Unfortunately the authors of the syncppp code in Linux have never converted it to use the
ppp_genericmodule. That would be the correct approach IMO.
Dan Eble wrote some code that allows the HDLC layer to interface with the normal PPP code.
It works great.
Check list archives for patches.
--
Matthew N. Dodd <[email protected]>
Software Engineer, Patton Electronics
7622 Rickenbacker Dr., Gaithersburg, MD 20879
(301) 975-1000x184
Quoted 3 lines · Matthew Dodd
Dan Eble wrote some code that allows the HDLC layer to interface with the normal PPP code. It works great. Check list archives for patches.
Quoted 1 line · Bhaskar
Oh thats great. Can I get the code ?
Process error. Use the list archives. Search.
http://marc.theaimsgroup.com/?l=linux-ppp&w=2&r=1&s=HDLC+Dan+Eble&q=b
Or use google.
http://www.google.com/search?q=hdlc%20%22dan%20eble%22
Signature · 3 lines
James Cameron http://quozl.netrek.org/ HP Open Source, Volunteer http://opensource.hp.com/ PPTP Client Project, Release Engineer http://pptpclient.sourceforge.net/
Oh thats great. Can I get the code ?
Regards
bhaskar
Quoted 22 lines · Matthew N. Dodd
Quoted 3 lines · [email protected] wrote:
Unfortunately the authors of the syncppp code in Linux have never converted it to use the
ppp_genericmodule. That would be the correct approach IMO.Dan Eble wrote some code that allows the HDLC layer to interface with the normal PPP code.
It works great.
Check list archives for patches.
--
Matthew N. Dodd <[email protected]>
Software Engineer, Patton Electronics
7622 Rickenbacker Dr., Gaithersburg, MD 20879
(301) 975-1000x184-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html