* Can we run a PPP server & client simultaneously???
@ 2007-07-23 10:52 LeeD
2007-07-23 11:59 ` James Carlson
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: LeeD @ 2007-07-23 10:52 UTC (permalink / raw)
To: linux-ppp
Is it possible for linux to support both a PPP server and PPP client (with
dial on demand) simultaneously on the same serial port?
I have a PPP client setup to support dial on demand, however this locks the
serial port preventing any call answering programs (such as mgetty) from
using the same serial port and modem.
I have seen server advertised which offer both PPP client and server, so how
to they do it?
Regards,
Lee
--
View this message in context: http://www.nabble.com/Can-we-run-a-PPP-server---client-simultaneously----tf4128929.html#a11741524
Sent from the linux-ppp mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we run a PPP server & client simultaneously???
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
@ 2007-07-23 11:59 ` James Carlson
2007-07-23 12:08 ` Christopher Fowler
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: James Carlson @ 2007-07-23 11:59 UTC (permalink / raw)
To: linux-ppp
LeeD writes:
> Is it possible for linux to support both a PPP server and PPP client (with
> dial on demand) simultaneously on the same serial port?
They can't be _active_ at the same time, but two defined PPP instances
can share a single serial port. (PPP doesn't have servers or clients.)
> I have a PPP client setup to support dial on demand, however this locks the
> serial port preventing any call answering programs (such as mgetty) from
> using the same serial port and modem.
It's not supposed to do that. In pppd, main.c blocks for demand first
(waiting for packets in handle_events()), and only calls start_link()
-- which ends up locking the port only when requested via the 'lock'
option -- when there's actual traffic.
So, I don't see how the current code could do what you're describing,
but I'd guess that this is a bug of some sort.
> I have seen server advertised which offer both PPP client and server, so how
> to they do it?
That's a much more complicated question, I think, because you end up
having to deal with 'attaching' an inbound connection to an existing
IP interface configured as demand dial. This is something that I
think Linux cannot currently do.
On the Annex communications server, we wrote special demand-dial
management code to look up a dormant interface by address and bring it
to life when the peer called us. That way, the return traffic (reply
packets) wouldn't trigger an outbound attempt that would fail.
On Linux, you may be able to get away with it if both links have
different sets of IP addresses.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we run a PPP server & client simultaneously???
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
2007-07-23 11:59 ` James Carlson
@ 2007-07-23 12:08 ` Christopher Fowler
2007-07-23 12:28 ` James Carlson
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Christopher Fowler @ 2007-07-23 12:08 UTC (permalink / raw)
To: linux-ppp
On Mon, 2007-07-23 at 07:59 -0400, James Carlson wrote:
> On the Annex communications server, we wrote special demand-dial
> management code to look up a dormant interface by address and bring it
> to life when the peer called us. That way, the return traffic (reply
> packets) wouldn't trigger an outbound attempt that would fail.
>
> On Linux, you may be able to get away with it if both links have
> different sets of IP addresses.
You can do it on Linux. I have hundreds doing this. Yes you do have 2
interfaces. I'm curious as to details on how you solved it on the
Annex. They way we solved it is via if-down and if-up. That is a C
program on our device. When pppd calls that program it looks for an
interface that is in the UP state but not our own. It places that
interface in the DOWN state. When if-down is called it looks for an
interface that is DOWN but not our own and it places that in UP. The
effect is that you'll end up with 2 ppp interfaces with the same
address. Only one is UP.
I've had this working for a couple years now and I've not had any
problems. I think the only problem I could see is if pppd died and
never called if-down. You would end up with a PPP interface in the DOWN
state and the remote could never call home. Calling from the server
would rectify the situation.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we run a PPP server & client simultaneously???
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
2007-07-23 11:59 ` James Carlson
2007-07-23 12:08 ` Christopher Fowler
@ 2007-07-23 12:28 ` James Carlson
2007-07-23 12:35 ` Christopher Fowler
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: James Carlson @ 2007-07-23 12:28 UTC (permalink / raw)
To: linux-ppp
Christopher Fowler writes:
> On Mon, 2007-07-23 at 07:59 -0400, James Carlson wrote:
> > On the Annex communications server, we wrote special demand-dial
> > management code to look up a dormant interface by address and bring it
> > to life when the peer called us. That way, the return traffic (reply
> > packets) wouldn't trigger an outbound attempt that would fail.
> >
> > On Linux, you may be able to get away with it if both links have
> > different sets of IP addresses.
>
> You can do it on Linux. I have hundreds doing this. Yes you do have 2
> interfaces. I'm curious as to details on how you solved it on the
> Annex.
The advantages of having a single address space unobstructed by an
MMU -- we simply had a global table of demand links and matched
inbound links against that table before creating a new interface. If
it matched, then we'd attach to the interface in that table, otherwise
create a new one.
The internal design of the Annex is really quite different from Linux.
The PPP code there wasn't based on pppd.
> They way we solved it is via if-down and if-up. That is a C
> program on our device. When pppd calls that program it looks for an
> interface that is in the UP state but not our own. It places that
> interface in the DOWN state. When if-down is called it looks for an
> interface that is DOWN but not our own and it places that in UP. The
> effect is that you'll end up with 2 ppp interfaces with the same
> address. Only one is UP.
Interesting.
> I've had this working for a couple years now and I've not had any
> problems. I think the only problem I could see is if pppd died and
> never called if-down. You would end up with a PPP interface in the DOWN
> state and the remote could never call home. Calling from the server
> would rectify the situation.
I think that process may have race conditions, given that if-up is
triggered after the interface is marked 'UP', and nothing in the
system actually waits for that script to complete. For that reason, I
wouldn't suggest that as a design for a new feature in the pppd code
base.
Otherwise, though, it seems like a somewhat reasonable solution for a
pppd user.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we run a PPP server & client simultaneously???
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
` (2 preceding siblings ...)
2007-07-23 12:28 ` James Carlson
@ 2007-07-23 12:35 ` Christopher Fowler
2007-07-23 16:23 ` Bill Unruh
2007-07-24 8:07 ` Lee Davies
5 siblings, 0 replies; 7+ messages in thread
From: Christopher Fowler @ 2007-07-23 12:35 UTC (permalink / raw)
To: linux-ppp
On Mon, 2007-07-23 at 08:28 -0400, James Carlson wrote:
> I think that process may have race conditions, given that if-up is
> triggered after the interface is marked 'UP', and nothing in the
> system actually waits for that script to complete. For that reason, I
> wouldn't suggest that as a design for a new feature in the pppd code
> base.
>
> Otherwise, though, it seems like a somewhat reasonable solution for a
> pppd user.
CORRECT! I do not suggest this as a design for future pppd based code.
It really needs not to be. It is a design based on what we have and
what we needed to do to make it work. I'm always looking for
improvements.
Also I do have changes to pppd 2.4.2 that anyone can have. We changed
that version to allow us to specify multiple ttys on the command line.
This allowed us to support outbound pooling with pppd.
/usr/sbin/pppd ttyR0,ttyR1,ttyR2,... 57600 ....
Works like that. When the pppd process needs to call a remote it will
look for lock files and use the first available tty. This feature I
would suggest as something that should be added since it is useful in a
a demand implementation. Inbound pooling is handled by a single DID and
hunt group on those lines.
If the multiple tty feature is something you guys might like to add just
let me know and I'll tarball our source and make it available. It is
considered a derivative work of pppd since we modified the source.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we run a PPP server & client simultaneously???
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
` (3 preceding siblings ...)
2007-07-23 12:35 ` Christopher Fowler
@ 2007-07-23 16:23 ` Bill Unruh
2007-07-24 8:07 ` Lee Davies
5 siblings, 0 replies; 7+ messages in thread
From: Bill Unruh @ 2007-07-23 16:23 UTC (permalink / raw)
To: linux-ppp
On Mon, 23 Jul 2007, LeeD wrote:
>
> Is it possible for linux to support both a PPP server and PPP client (with
> dial on demand) simultaneously on the same serial port?
ppp is peer to peer, so any ppp is both a client and a server at the same
time. However one serial port or modem can only be used for one connection
at a time. not for more than one at a time.
>
> I have a PPP client setup to support dial on demand, however this locks the
> serial port preventing any call answering programs (such as mgetty) from
> using the same serial port and modem.
Stop using dial on demand. It is completely useless when you are connected
as a server anyway. Ie, if you want to use outgoing ppp, just run a progrm
to start it instead of trying to do on demand.
>
> I have seen server advertised which offer both PPP client and server, so how
> to they do it?
>
> Regards,
>
> Lee
>
--
William G. Unruh | Canadian Institute for| Tel: +1(604)822-3273
Physics&Astronomy | Advanced Research | Fax: +1(604)822-5324
UBC, Vancouver,BC | Program in Cosmology | unruh@physics.ubc.ca
Canada V6T 1Z1 | and Gravity | www.theory.physics.ubc.ca/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we run a PPP server & client simultaneously???
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
` (4 preceding siblings ...)
2007-07-23 16:23 ` Bill Unruh
@ 2007-07-24 8:07 ` Lee Davies
5 siblings, 0 replies; 7+ messages in thread
From: Lee Davies @ 2007-07-24 8:07 UTC (permalink / raw)
To: linux-ppp
>>
>> I have a PPP client setup to support dial on demand, however this
>> locks the
>> serial port preventing any call answering programs (such as mgetty) from
>> using the same serial port and modem.
>
> Stop using dial on demand. It is completely useless when you are
> connected
> as a server anyway. Ie, if you want to use outgoing ppp, just run a
> progrm
> to start it instead of trying to do on demand.
Sorry Bill I forgot to mention that I'm using the linux box as a GPRS
router. When any PC connected to my Linux router box accesses any thing
remotely, the router will automatically fire up the GPRS modem. This bit
works well :-)
However I'd like the ability to dial up the router from work and poll a
few devices connected to it. Since I only have one serial port and one
modem, it would be nice to configure the Linux box to support
dial-on-demand and as a dial up server.
Regards,
Lee
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-07-24 8:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 10:52 Can we run a PPP server & client simultaneously??? LeeD
2007-07-23 11:59 ` James Carlson
2007-07-23 12:08 ` Christopher Fowler
2007-07-23 12:28 ` James Carlson
2007-07-23 12:35 ` Christopher Fowler
2007-07-23 16:23 ` Bill Unruh
2007-07-24 8:07 ` Lee Davies
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).