Discussion:
Send/Receive Procedures in pppd 2.4.1
(too old to reply)
addams013
2007-01-30 14:38:41 UTC
Permalink
I have a Multitech modem that will support AT commands even while the
PPP link is up if I send this:

<wait 2 seconds> +++ <wait 2 seconds>

... and come back online when "ato0" is issued.

I'd like to do this while the PPP link is up because the modem is
aware of certain things. It's wireless, and knows the signal strength
it's seeing, the VSWR, and so on. I'd like the Linux box to know
these things, too, so asking the modem seems natural enough.

After beating my head against several brick walls, it looks like I'm
going to have to put procedures to handle this in pppd itself (since
pppd doesn't look like it wants to share the serial port; even the
usual read(,,) and write(,,) procedures fail). What are the
procedures in pppd that send and receive characters? And what
procedures are run when the PPP link is considered "up"?

Thanks in advance for any help you can lend me. I'm rather new at
this. :)
James Carlson
2007-02-14 13:30:14 UTC
Permalink
Post by addams013
I have a Multitech modem that will support AT commands even while the
<wait 2 seconds> +++ <wait 2 seconds>
... and come back online when "ato0" is issued.
Actually, I've used somewhat slicker modems in the past that are able
to drop to command mode when DTR is dropped. It makes for a bit of a
cleaner (and faster) implementation.

Better still are the commercial modems used in communications servers;
they typically have a separate interface for extracting statistics and
issuing commands while the modem is on-line.
Post by addams013
I'd like to do this while the PPP link is up because the modem is
aware of certain things. It's wireless, and knows the signal strength
it's seeing, the VSWR, and so on. I'd like the Linux box to know
these things, too, so asking the modem seems natural enough.
Yes. Many people have discussed this before, but it seems that nobody
has been interested enough to work out the design and code.
Post by addams013
After beating my head against several brick walls, it looks like I'm
going to have to put procedures to handle this in pppd itself (since
pppd doesn't look like it wants to share the serial port; even the
usual read(,,) and write(,,) procedures fail). What are the
procedures in pppd that send and receive characters? And what
procedures are run when the PPP link is considered "up"?
No, I don't think that'll cut it.

Pppd starts off by running the serial connection in a normal
character-oriented mode. This is used to exec the 'chat' process (the
"connect" command) and any other serial initialization. Once that's
done, it switches the kernel into PPP mode.

When the kernel is in that mode, pppd receives only complete and
decoded AHDLC frames that don't match one of the kernel's well-known
protocol ID numbers. Those that do match (IP, IPv6, IPX, and a few
others) are sent directly to the kernel routine that handles those
packets.

Similarly, writes by pppd to the serial port are AHDLC-encoded and
sent as packets.

In other words, data packets are handled in the kernel, not in user
space.

Thus, in order to change the system so that it can send a non-PPP
packet (such as <pause>+++<pause>) when in PPP mode, you'll need to
modify the kernel modules that handle AHDLC encoding. Pppd is just
the start of such a project.
Post by addams013
Thanks in advance for any help you can lend me. I'm rather new at
this. :)
Good luck.
--
James Carlson, Solaris Networking <***@sun.com>
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
Loading...