On Thu, 29 Mar 2001, Tom Rauschenbach wrote:
> Turning on the debug option of pppd is by definition useless. 

  I think you are still confused.  :-)

  Why is the debug option "by definition useless"?  Your stated goal is to
watch how the IP address is negotiated.  That is the primary purpose of the
"debug" option in the first place.  It seems tailor-made for what you are
asking.  What part of it are you unhappy with?

> If I have a pppd then it is too late. 

  pppd(8) is responsible for negotiating the IP address (among other things).  
Indeed, in many configurations, pppd(8) is the first program invoked as part
of PPP call-out process.  About all you can examine before pppd(8) is invoked
is a dial tone.  :-)

> If I have an IP address then it is too late.  I want to watch the
> negotiation that occurs to get the IP address.

  This is done by pppd(8).  Turn on the debug option.

> My machine can have a different IP address everytime I dial into my ISP.

  Right, most ISPs use a dynamic address pool, since the average customer does
not care about their IP address.

> I want to watch the conversation that takes place between my machine and
> the ISP before I have an IP address.

  There is more then one such conversation.

  You (or your software) has to initialize and dial the modem.  On Linux, this
is typically done by the chat(8) program, called from pppd(8).

  The modems talk to each other in some sort of elite modem-speak which mere
mortals cannot see or understand.  When they are done, you have a serial link
between you and the ISP.

  Then any pre-PPP login script needs to run.  That is, if your ISP uses a
human-readable terminal login prompt, your computer has to send the right
responses.  On Linux, this is typically handled by the same chat(8) script
mentioned above.  If your ISP just dumps you right into PPP negotiation after
connect, this conversation be skipped.

  Lastly, one end (you or the ISP) sends a PPP start sequence.  The other end
responds by starting PPP negotiation.  As part of the PPP link setup, an IP
address will be assigned to you.

  Which one of these did you want to watch?  Or all of them?  :-)

> No, sorry that's probably exactly what I have to do.  I suspect that the
> negotiation to determine things like line quality and baud rate take place
> in an analog domain ...

  Line quality and carrier rate are negotiated by the modem hardware.  The only
way to monitor *that* is by using a telephone line signal decoder.  I
understand such equipment usually costs around $20,000.

> Then, once my ISP and I know how to trade bits, we talk about about things
> like IP addresses and such.  That's the part I'm curious about.

  The "debug" option of pppd(8) includes just about every part of the PPP link
setup, so I suspect that will satisfy your curiosity.

  Have you actually gone and *tried* the debug option of pppd(8)?  :-)

> I looked into the kernel source last night and I think I've found the
> neighborhood of where I'd need to put my hacks, but it also looks to be
> timing sensitive so I still may not get there from here.

  If you've really got your heart set on monitoring the actual bits, outside
of the PPP software... you basically need to intercept the serial data to and
from pppd.  You can do this by allocating a pair of pseudo-ttys, connecting
pppd to one, the modem to the other, and sticking a serial debugger (basically
a character pass-thru program with decoding options, similar to a network
packet sniffer) in between.

  If you have an external modem and three serial ports, you can do it without
pseudo-ttys.  Call the serial ports S0, S1, and S2.  Tell pppd(8) to use S0.  
Connect the modem to S2.  Connect S0 and S1 with a null-modem cable.  Tell the
serial debugger to use S0 and S1.

  The details of all this, including where to obtain a serial debugger for
Linux, are left as an exercise to the reader.  :-)

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to