Last updated: July 7, 1994
This document was originally a post by Jon Lewis, jlewis@inorganic5.chem.ufl.edu,
in the comp.protocols.tcp-ip.ibmpc group in USENET.

The following is Copyright 1994 Jon Lewis.  You may not redistribute this
information for any charge, fee, donation, or other compensation without
my express written permission. 

This information is intended to be freely distributed.

The following are the autoexec.bat, config.sys, k9q.bat, and slip.nos files 
used on my KA9Q slip server that started working a few months ago.  I 
could never have gotten the system working without major help from 
Karl-Heinz Weiss and minor help from Ashok Aiyar who's config files I 
got a few ideas from and who wrote parts of the nos that I'm using.  In
the interest of keeping others from bothering Karl as much as I did while
trying to get the system working, I'm posting all relevent info that 
I've gathered on the subject.

The following IP addresses and site names are real and mine.  

DO NOT USE MY IP ADDRESSES OR SITE NAMES IN YOUR OWN SLIP SERVER.  

I'm told that stealing someone elses IP address can cause major problems
for both people trying to use the address.  Plus it would really tick me off.

I'd like to hear from anyone that uses these files.  It took a long time to 
get this to work for me, and I'd like to know how portable they are.

Other important info is that I use nos11cjc.exe and Karl-Heinz Weiss's sliplog 
and comtool.  You can get these from mvmpc9.ciw.uni-karlsuhe.de (129.13.118.9)
or from me.  Nos11cjc is Ashok Aiyar's (CWRU) Nos11c with a few of my own
relatively minor modifications.

I've setup a dir on my ftp site with all needed executables.  It's 
gopher/pub/nos on inorganic5.chem.ufl.edu (128.227.16.134).  When 
you log in as anonymous, you'll be in gopher/pub already.

One important thing to note is that there seems to be a bug in dos (I'm using 
MS DOS 6.2) that affects the calendar.  When my nos box runs for several days
between reboots, the calendar only moves forward once.  After that, the clock 
continues to work, but the numerical date stays the same.  This caused trouble 
when I setup my system to run slip all weekend.  Monday, it thought it was still
Sunday and continued running the slip server.  Fortunately, nos11c includes a time
client and I have many nearby time servers.  I'm sure I don't need as many TIME SET 
statements as I currently have...but it's pretty important that I keep the date
right and every so often a time server might go down...so better safe than sorry.
If you don't have time servers around, you can also get around this bug by doing
a cold reset daily.  The type of reboot caused by Ctrl-Alt-Del doesn't seem to
fix the calendar bug.  The nos command remote -k pwd address reset does cause a 
cold reset. 

The program dow.exe is a Turbo Pascal program that I litteraly threw together.  It 
will create 2 files when run, sun|mon|tue|wed|thu|fri|sat and weekday|weekend.  
Sure, I could/should have probably done this with errorlevels but didn't know
how and didn't want to learn at the time.  I just wanted my slip server up over
the weekend and this works for me.  The files will have the extension .dow.  It
creates these in c:\.  First it will delete c:\*.dow, then create 2 files.  
This is what I use to tell if it's the weekend and safe to keep slip running all
day.  I don't use the day.dow file, but figured someone might.

Use all this at your own risk.  All I can guarantee is that it probably won't work
for some people...and that it currently does for me.  It shouldn't trash your system
but who knows what might happen.


Currently, there is some debate over what the best settings for MTU, MSS, 
TCP Window, and ibufsize should be.  These settings seem to have alot to 
do with how nos uses RAM.  With an unhappy combination of settins, nos may
either use up all the nibufs and run iminfree down to 0, or it may require
extremely large amounts of RAM from the heap and the heapsize will increase
until coreleft decreases to nothing and the system may crash with out of 
memory erros.

According to Frank J. Derfler, Jr.'s Guide to Connectivity, published by 
Ziff-Davis and my interpretation...the maximum packet size supported by 
ethernet is 1536 bytes.  This 1536 bytes consists of a data segment of up
to 1500 bytes and 36 bytes of ethernet overhead.  When TCP/IP is sent over 
ethernet, the TCP/IP packets are sent in the ethernet data segment.  Thus,
the MTU for TCP/IP over ethernet should be 1500.  TCP/IP has a header of 40
bytes, so the MSS (TCP/IP data segment) should by your MTU-40.  The TCP window
is normally a small integer times the MSS.  I've chosen 4*MSS, but other values 
will likely work.  According to my interpretation of nos_1229.man, the ibufsize
should be MTU+22.  

Using MTU=1024, MSS=984, TCP Window=3936, ibufsize=1046, and nibufs=40, I get
reasonably stable performance from nos11cjc.  For example, when I start nos11cjc
as a slip server, the heap is usually about 90kb and iminfree starts at 39.
After running 8 hours, the heap has increased to 140kb, but there's nearly 53kb
of available space in the heap.  Coreleft (the amount of 0-640kb RAM that is
still available) is still 120kb.  Note that this is with everything other than
nos loaded into UMB space.  Iminfree is 26.  Nos_1229.man says to make sure
iminfree stays above 2, so this is fine.

Recently, I found that certain winsock clients, mostly wsarchie, would not 
function properly with the above settings.  I was told (by KH Weiss) that
those settings are fine for a system just running nos, but that if nos is 
going to act as a router, it may be necessary to set the MTU to the maximum
allowed value.  So I'm back to using an MTU=1500, MSS=1460, TCP Window=5840, 
ibufsize=1522, and nibufs=35.  I've been running this way for only a day, so
I don't know how stable the server is, but all clients seem to work now.

Don't forget to modify slip.nos accordingly.  I'm not going to bother keeping
these example files that up to date.

BTW, on my SLIP client, I use MTU=1024, MSS=984, Window=5904.

To keep up with the latest developments in the nos11c series, read 
comp.protocols.tcp-ip.ibmpc and subscribe to Ashok Aiyar's nos mailing list
by sending the following single line to listserv@po.cwru.edu:

subscribe pcgopher firstname lastname

---------------------------------------slip.nos-------------------
# =============
# /autoexec.nos for slip
# =============
# first of all define the name and the ip-address of
# your slip-machine.
hostname inorganic5.chem.ufl.edu
ip address 128.227.16.134

domain suffix chem.ufl.edu.
#try just ufl.edu 
# load slip- and ethernet-packetdriver
attach packet 0x63 sl0 10 1024
attach packet 0x61 en0 10 1024

# a logfile may be useful
log c:\ka9q\net.log

# define one ore more name-server
domain addserver 128.227.16.3
domain addserver 128.227.128.24

domain verbose on
domain translate off
domain cache size 50
domain cache wait 600
domain cache clean yes
domain retry 2
domain maxwait 60
domain diskbuf 4096

# a little bit of memory-vodoo ;-)
# I found, that 'nibufs' is critical. If too small,
# the garbage collector of NOS may confuse the gate.
# this often happens when telnet-sessions are routed
# and the mtu-size of the client is too big (>296)
watch on
watchdog on
memory thresh 16384
memory efficient yes
memory ibufsize 1046
memory nibufs 40

# TCP/IP
ip rtimer 60
#ip ttl 50
tcp mss 984
tcp window 3936
tcp irtt 10000
#try turning off syn+data
tcp syn off

# Slip-routing. All users have the same IP
route add 128.227.16.131 sl0

# ethernet-ip and slip-ip use the same linklayer-address
# while routed over the ethernet
arp publish 128.227.16.131 ether 00:AA:00:29:48:FB

# Route all traffic to our local gateway, if the first
# 3 bytes differ from 128.227.16.  I'm on a class B net, but it behaves
# like a class C net for some odd reason.

route add default en0 128.227.16.1
route add 128.227.16.0/24 en0


#nos mailbox stuff
#mbox secure on
mbox maxmsg 600
mbox expert off
mbox password mypwd
#third-party off
mbox motd "Press A to see a list of areas.  A areaname to change areas."

#smtp stuff
smtp batch no
#set gateway to campus smart smtp gate
smtp gateway 128.227.128.10
smtp maxclients 5
smtp mode route
smtp quiet yes
smtp timer 600
smtp t4 120

time server 128.227.16.3

start pop3
start smtp
start ftp
start telnet
start www
start gopher
start remote
start finger
ftptdisc 600
ftpmaxcli 6

# allow remote-reset with a password
remote -s pwd

#lock the keyboard
lock pass pwd

# We have something to do at 5:00 am and 5:00 pm
# at won't work, if keyboard is locked you must first unlock ...

at 2255 pwd
#make sure time and date are right
at 2300 "source getdate.nos"
at 0001 pwd
at 0006 "source getdate.nos"
at 0620 pwd
at 0625 "set time"
at 0630 exit
lock



--------------------------end slip.nos------------------------

------------------autoexec.bat----------------------------
@ECHO OFF
If %config%==KA9Q-NOS Goto NOS
C:\WINDOWS\net start
rem C:\WINDOWS\SMARTDRV.EXE c+ 2048 128 
PROMPT $p$g
PATH C:\EXCEL;C:\WINWORD;c:\winsock;C:\WINDOWS;C:\DOS;C:\UTIL;c:\ka9q
SET TEMP=C:\temp
Set QVTHOST_Dir=c:\winsock
rem set TAPE=TAPE$
rem init modem

rem load pkt drivers

lh c:\ka9q\pktmux 2 64
lh c:\ka9q\pktdrv 65 64
lh c:\ka9q\pktdrv 61 64
lh c:\ka9q\pktdrv 60 64

LH c:\winsock\winpkt 0x65
LH c:\winsock\winpkt 0x61
lh c:\winsock\winpkt 0x60
GOTO %config%
:Windows
win
:No-Windows
GOTO END

:NOS
rem join d: c:\drived
c:\windows\smartdrv c 2048
PROMPT $p$g
PATH c:\;C:\WINDOWS;C:\DOS;C:\UTIL;c:\ka9q
SET TEMP=C:\temp
Set tmp=c:\temp
lh exp16 0x61
lh dimmer /d 5 -63
cd \ka9q
k9q
:END

-------------end autoexec.bat--------------------------

-------------config.sys------------------------
[Menu]
MenuItem=Windows
MenuItem=No-Windows
MenuItem=KA9Q-NOS
MenuDefault=KA9Q-NOS,10


[Common]
DEVICE=C:\WINDOWS\HIMEM.SYS /Testmem:off
DEVICE=C:\WINDOWS\IFSHLP.SYS

[Windows]
rem device=c:\qic02.sys 100 3 5

[Common]
device=c:\windows\emm386.exe noems d=64
DOS=HIGH,umb
FILES=50
LASTDRIVE=G
devicehigh=c:\dos\ansi.sys
DEVICEhigh=C:\DOS\SETVER.EXE
rem devicehigh=c:\mouse.sys
STACKS=9,256


[No-Windows]
[KA9Q-NOS]
----------------end config.sys-------------------

k9q.bat runs in a loop restarting nos 2 times a day with different 
"autoexec.nos" files...slip.nos, and noslip.nos.  This is because my slip 
server uses our lab telephone, and can only be setup for slip at night 
and weekends. 
During the day, the server is up without slip for FTP and Mail use.

----------------k9q.bat------------------------

REM Note that this is the init string for my Boca 1440i.
REM Due to differences in v.32bis modems, you SHOULD check to
REM see what each of these commands does on YOUR modem.
REM Generally different modems will need slightly different init
REM strings.
REM Due to some strange hardware conflicts, I had to put the modem
REM on COM 4, IRQ 5.
:loop
if exist c:\testing.nos goto noslip
if "%1"=="t" goto noslip2

c:\ka9q\comtool 2e8 5 ^b1 at&F^cr^t10^
c:\ka9q\comtool 2e8 5 ^b1 AT&C1&D2&K3%C1%E1\N3^cr^t10^
c:\ka9q\comtool 2e8 5 ^b1 ATL0S10=254S11=50S7=60^cr^t10^
c:\ka9q\comtool 2e8 5 ^b1 ATS48=7S46=138S95=47&S1^cr^t10^
c:\ka9q\comtool 2e8 5 ^b1 ATS0=4^cr^t10^
lh c:\ka9q\cslipper port=2e8 irq=5 baud=57600 vec=63 ether
lh sliplog 2e8 5 63 c:\ka9q\ 128.227.16.131
lh sliplog 63 -W 3 
echo Continue running NOS?
choice /t:y,5
if errorlevel 2 goto endslip
 
:slip
nos11cjc -b -d/ka9q slip.nos
dow
 
echo Continue running NOS?
choice /t:y,5
if errorlevel 2 goto endslip
 
IF EXIST C:\WEEKEND.DOW GOTO REBOOT
 
REM else we are ending slip mode
sliplog 63 -U
termin 0x63
c:\ka9q\comtool 2e8 5 ^b1 ATS0=0^cr^t10^
 
echo Continue running NOS?
choice /t:y,5
if errorlevel 2 goto end
 
:noslip
csap \gopher
netlog net.log
netlog spool\mail.log
netlog spool\www.log
netlog spool\gopher.log
:noslip2
nos11cjc -b -d/ka9q noslip.nos
echo Continue running NOS?
choice /t:y,5
if errorlevel 2 goto end
 

:REBOOT
C:\UTIL\BOOT.COM
 
:endslip
sliplog 63 -U
termin 0x63
c:\ka9q\comtool 2e8 5 ^b1 ATS0=0^cr^t10^
:end
 


-----------------end k9q.bat-------------------

this is the file to run nos without the slip server active
----------------noslip.nos------------------
# =============
# /autoexec.nos for noslip
# =============
# first of all define the name and the ip-address of
# your slip-machine.
hostname inorganic5.chem.ufl.edu
ip address 128.227.16.134

domain suffix chem.ufl.edu.

# load slip- and ethernet-packetdriver
attach packet 0x61 en0 10 1024

# a logfile may be useful
log c:\ka9q\net.log

# define one ore more name-server
domain addserver 128.227.16.3
domain addserver 128.227.128.24

domain verbose on
domain translate off
domain cache size 50
domain cache wait 600
domain cache clean yes
domain retry 2
domain maxwait 60
domain diskbuf 4096

# a little bit of memory-vodoo ;-)
# I found, that 'nibufs' is critical. If too small,
# the garbage collector of NOS may confuse the gate.
# this often happens when telnet-sessions are routed
# and the mtu-size of the client is too big (>296)
watch on
watchdog on
memory thresh 16384
memory efficient yes
memory ibufsize 1046
memory nibufs 40

# TCP/IP
# ip rtimer 60
ip ttl 50
tcp mss 984
tcp window 3936
tcp irtt 10000
tcp syn off

# Route all traffic to our local gateway, if the first
# 3 bytes differ from 129.13.118 (we have a class C-net)
route add default en0 128.227.16.1
route add 128.227.16.0/24 en0

#nos mailbox stuff
#mbox secure on
mbox maxmsg 600
mbox expert off
mbox password mypwd
#third-party off
mbox motd "Press A to see a list of areas.  A areaname to change areas."


#smtp stuff
smtp batch no
smtp gateway nervm.nerdc.ufl.edu
smtp maxclients 5
smtp mode route
#smtp quiet yes
smtp timer 120
smtp t4 120

time server 128.227.16.3
start pop3
start smtp
start ftp
start telnet
start www
start gopher
start remote
start finger
ftptdisc 600
ftpmaxcli 6

# allow remote-reset with a password
remote -s pwd

#lock the keyboard
lock pass pwd
# We have something to do at 5:00 am and 5:00 pm
# at won't work, if keyboard. is locked.
# So you must first unlock ...
# then exit NOS
at 1155 pwd
at 1200 "source getdate.nos"
at 1655 pwd
at 1700 exit
lock

-----------------------end noslip.nos-------------------

----------getdate.nos-----------
time set
time server 128.227.128.24
time set
time server 128.227.16.3
lock
--------end getdate.nos---------