auto dial slip (was Re: Exabyte and ..)

Stuart Lynne sl at van-bc.wimsey.bc.ca
Fri Apr 5 14:53:41 AEST 1991


In article <1991Apr03.144618.16111 at nstar.rn.com> larry at nstar.rn.com (Larry Snyder) writes:
>Hi Stuart - we like you connect via SLIP to another box
>running 386 based unix and are looking for an automated
>way to re-establish the connection should the line drop
>
>Do you have any pointers or ideas on this?

I use a pair of T2500's in raw V.32 mode. I don't turn on either compression or
reliable mode. I found that it didn't help throughput all that much, and did impair
latency which seemed to be bad for nntp. Of course this was a very subjective test.

The T2500 at the far end is just configured for 9600 bps operation, answer in V.32
or PEP mode as required. (We allow it to answer in PEP mode in case we need to
remote configure it, although it's been running a year without requiring it.)

This end the T2500 has the phone number for the far end in the second phone
register. It is configured to drop the connection when DTR goes away. And to dial
when DTR is raised. Connection to be made at 9600bps, in V.32 mode. Finally there is
a register to tell the T2500 to ignore data when dialing. This is needed because the
PC may or may not keep quiet and we don't want the T2500 to abort the dial mid-way.
The T2500 at this end seems to get clobberred about once or twice per week, probably
from being sent data in command mode. For some unknown reason the second phone
number get's clobberred less than the first one. So I put everything into
configuration "B" and leave the switch to "B". Usually when it won't dial properly,
just pressing the A/B switch from B->A and A->B again resets it. Very very
occasionally (twice in a year) I've had to cu to the modem and reset it by hand.

One of the Unix hosts has a simple script:

    #! /bin/sh

    IP=128.189.1.1			# which IP address to ping?
    TIMES=30				# ping in how many times?
    PERL=/usr/local/bin/perl		# where is perl?
    RESET=/usr/local/lib/router/remote	# where is the reset script?

    x=`ping $IP 8 $TIMES | egrep ' bytes from ' | wc -l`
    if [ $x -eq ' 0' ]; then
	    /usr/local/bin/perl $RESET
	    exit 0
    else
	    exit 1
    fi

This just tries to ping the far end and if it can't calls a perl script to bump the
local ka9q router into rebooting:


    #!perl
    #
    #   remote - tell the router to exit
    #   By Sam Lam

    eval "exec perl -S $0 $*"
	    if $running_under_some_shell;

    #$query = $ARGV[0];
    #die "Usage: $0 Name\n" unless $query;

    #$ROUTER = 'router.wimsey.bc.ca.';
    $PASSWORD = "ietf.ubc";

    $COMMAND = "\001";

    $UDP = 17;
    $REMOTE = 1234;
    $SOCK_DGRAM = 2;
    $AF_INET = 2;
    $PF_INET = $AF_INET;

    $sockaddr = 'S n a4 x8';

    #($name, $aliases, $type, $len, $thisaddr) = gethostbyname($ROUTER);
    #$this = pack($sockaddr, $AF_INET, 0, $thisaddr);

    $thataddr = pack('C4', 192, 48, 234, 132);
    $that = pack($sockaddr, $AF_INET, $REMOTE, $thataddr);

    $message = $COMMAND . $PASSWORD;

    socket(S, $PF_INET, $SOCK_DGRAM, $UDP) || die "socket: $!";
    $result = send(S, $message, 0, $that);
    close(S);

    if ($result != length($message)) {
	    print "Failed!  sendto()=", $result, "\n";
    } else {
	    print "Done.\n";
    }

Which of course will eventually toggle DTR and reset the modem dropping the line and
redialing etc.

Talk about Rube Goldberg :-)  This should be cross posted to alt.hackers....

Of course it does seem to work. Our up time is probably better than 95%. 

Tomorrow I'm picking up a pair of DSI V.32bis modems and will try 14.4 next week.
That will require teaching the ka9q configuration files how to pay attention to
RTS/CTS flow control. Hopefully I get Sam to figure that out (he does all the hard
stuff, I get all the glory :-)

-- 
Stuart Lynne	Computer Signal Corporation, Canada
		...!van-bc!sl 604-937-7532(voice)     	sl at wimsey.bc.ca 



More information about the Comp.unix.sysv386 mailing list