Can't pass the authentification phase with pppd - PPP

This is a discussion on Can't pass the authentification phase with pppd - PPP ; Hello all, I am trying to implement the AT functions on a softmodem, and have problems with pppd. What I'm just trying to do for the moment is fit a program between a computer using pppd and a real modem ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Can't pass the authentification phase with pppd

  1. Can't pass the authentification phase with pppd

    Hello all,

    I am trying to implement the AT functions on a softmodem, and have
    problems with pppd. What I'm just trying to do for the moment is fit a
    program between a computer using pppd and a real modem (which supports
    AT).
    The program is very (too) simple : it reads on one side writes and
    writes on the other. And changes sides :
    -------------------------------------------
    int res;
    char buffer[BUFFER_SIZE + 1];

    fd1 = open("/dev/ttyS0", O_RDWR | O_NONBLOCK | O_NOCTTY);
    fd2 = open("/dev/ttyS1", O_RDWR | O_NONBLOCK | O_NOCTTY);
    while (1) {
    res = read(fd1, buffer, BUFFER_SIZE);
    if (res>0)
    write(fd2, buffer, res);
    res = read(fd2, buffer, BUFFER_SIZE);
    if (res>0)
    write(fd1, buffer, res);
    }
    -------------------------------------------

    However, this does not fully work. The modem correctly initialises,
    and dials the good number. But when pppd comes into play it fails to
    authentificate itself.
    By the way, it DOES work when there is a simple wire between computer
    and modem.

    Could someone tell me what I forgot?
    Perhaps pppd is changing the setting of the serial ports. Can I
    prevent him from doing that?

    Thanks.
    Schmeldric

    --
    Sample packets exchange : User is pppd side, numbers in <> are ascii
    codes
    =>>>>> User -> modem: 45 bytes:
    ~}#!}!}!} }4}"}&} } } } }%}&?uG}'}"}(}"~
    <<<<<= user <- Modem: 51 bytes:
    ~}#!}!} }8}"}&} } } } }#}$# }%}&}0#w}'}"}(}"%~
    =>>>>> User -> modem: 51 bytes:
    ~}#!}"} }8}"}&} } } } }#}$#}%}&}0#w}'}"}(}"P~
    <<<<<= user <- Modem: 46 bytes:
    ->~}#!}"}!} }4}"}&} } } } }%}&?uG}'}"}(}"}%~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><1><0><31><8><8>~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><2><0><31><8><29>~
    =>>>>> User -> modem: 31 bytes:
    -><0><31><8>~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><4><0><31><8>7H~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><5><0><31><8>h~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><6><0><31><8><9>~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><7><0><31><8>")~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><8><0><31><8>r~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><9><0><31><8>~
    =>>>>> User -> modem: 36 bytes:
    ->~#<1><10><0><31><8>"~
    =>>>>> User -> modem: 56 bytes:
    ->~}#!}%}"} ,Failed to authenticate ourselves to peer~
    <<<<<= user <- Modem: 9 bytes:
    ->!<6><2><0><4>"<10>~
    =>>>>> User -> modem: 56 bytes:
    ->~}#!}%}#} ,Failed to authenticate ourselves to peerT~
    <<<<<= user <- Modem: 5 bytes:
    -><0><4>HW~
    <<<<<= user <- Modem: 14 bytes:
    -><10><10>NO CARRIER<10><10>
    --

  2. Re: Can't pass the authentification phase with pppd

    In article <5400716.0404260800.236336f8@posting.google.com>,
    Schmeldric wrote:
    >Hello all,
    >
    >I am trying to implement the AT functions on a softmodem, and have
    >problems with pppd. What I'm just trying to do for the moment is fit a
    >program between a computer using pppd and a real modem (which supports
    >AT).
    >The program is very (too) simple : it reads on one side writes and
    >writes on the other. And changes sides :
    >-------------------------------------------
    > int res;
    > char buffer[BUFFER_SIZE + 1];
    >
    > fd1 = open("/dev/ttyS0", O_RDWR | O_NONBLOCK | O_NOCTTY);
    > fd2 = open("/dev/ttyS1", O_RDWR | O_NONBLOCK | O_NOCTTY);
    > while (1) {
    > res = read(fd1, buffer, BUFFER_SIZE);
    > if (res>0)
    > write(fd2, buffer, res);
    > res = read(fd2, buffer, BUFFER_SIZE);
    > if (res>0)
    > write(fd1, buffer, res);
    > }
    >-------------------------------------------
    >
    >However, this does not fully work. The modem correctly initialises,
    >and dials the good number. But when pppd comes into play it fails to
    >authentificate itself.
    >By the way, it DOES work when there is a simple wire between computer
    >and modem.
    >
    >Could someone tell me what I forgot?
    >Perhaps pppd is changing the setting of the serial ports. Can I
    >prevent him from doing that?
    >
    >Thanks.
    >Schmeldric
    >
    >--
    >Sample packets exchange : User is pppd side, numbers in <> are ascii
    >codes


    Note: Please don't post pure binary to newsgroups. It can break things and
    make it difficult for people to respond. When you're dumping data that makes
    up PPP packets, it's best to dump them in HEX so control characters aren't
    hidden or obscured.

    >=>>>>> User -> modem: 45 bytes:
    > ~\xff}#\xc0!}!}!} }4}"}&} } } } }%}&?\x9auG}'}"}(}"\xee\xb7~
    ><<<<<= Modem -> User: 51 bytes:
    > ~\xff}#\xc0!}!\x8c} }8}"}&} } } } }#}$\xc0# }%}&}0\x84#w}'}"}(}"\x9c%~
    >=>>>>> User -> modem: 51 bytes:
    > ~\xff}#\xc0!}"\x8c} }8}"}&} } } } }#}$\xc0#}%}&}0\x84#w}'}"}(}"P\xc8~
    ><<<<<= Modem -> User: 46 bytes:
    > ->~\xff}#\xc0!}"}!} }4}"}&} } } } }%}&?\x9auG}'}"}(}"}%\xde~


    I'm gonna guess these are LCP Config-Requests/Acks that work or you wouldn't
    be doing authentication so soon.

    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><1><0><31><8><8>\xeb~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><2><0><31><8><29>\x8a~
    >=>>>>> User -> modem: 31 bytes:
    > -><0><31><8>\xee\xaa~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><4><0><31><8>7H~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><5><0><31><8>\xc4h~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><6><0><31><8>\xd1<9>~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><7><0><31><8>")~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><8><0><31><8>r\xc4~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><9><0><31><8>\x81\xe4~
    >=>>>>> User -> modem: 36 bytes:
    > ->~\xc0#<1><10><0><31><8>"\x85~
    >=>>>>> User -> modem: 56 bytes:
    > ->~\xff}#\xc0!}%}"} ,Failed to authenticate ourselves to peer\x90\xbe~


    Notice that you didn't hear back from the "modem" since LCP got to the
    Opened state. This is often due to problems with the ACCM. Any chance one
    or both of your serial ports (ttyS0 or ttyS1) are configured for software
    flow control (XON/XOFF)??? Or do these serial ports do any kind of character
    translation?!?

    Why don't you set up a temporary account and password so you can dump the
    entire packets byte-by-byte? It'll make analyzing this so much easier!

    ><<<<<= Modem -> User: 9 bytes:
    > ->\xc0!<6><2><0><4>"<10>~


    The "modem" sending an LCP Terminate-Ack.

    >=>>>>> User -> modem: 56 bytes:
    > ->~\xff}#\xc0!}%}#} ,Failed to authenticate ourselves to peerT\xd1~


    The "User" sending an LCP Terminate-Request.

    ><<<<<= Modem -> User: 5 bytes:
    > -><0><4>HW~
    ><<<<<= Modem -> User: 14 bytes:
    > -><10><10>NO CARRIER<10><10>


    Hope this helps?

    ========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
    Patrick Klos Email: patrick@klos.com
    Klos Technologies, Inc. Web: http://www.klos.com/
    ==================== What goes around, comes around... =====================

  3. Re: Can't pass the authentification phase with pppd

    schmeldric@yahoo.fr (Schmeldric) writes:
    > fd1 = open("/dev/ttyS0", O_RDWR | O_NONBLOCK | O_NOCTTY);
    > fd2 = open("/dev/ttyS1", O_RDWR | O_NONBLOCK | O_NOCTTY);


    The most likely cause is that the default configuration of one or both
    of those serial ports doesn't support passing 8 bit data properly.

    If you really want to do this, you'll need to (at least) set up the
    serial ports appropriately using the termios ioctls. You may also
    want to translate SIGHUP from one side to setting the speed to 0
    (lowering DTR) on the other and vice-versa.

    Good luck ... this sounds like a non-trivial application.

    --
    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

  4. Re: Can't pass the authentification phase with pppd

    Thank you all for your time and answers.
    I did not solve the problem, but you gave me some hints on how to find
    out the problem(s).

    Schmeldric

+ Reply to Thread