

 ELKS TCP/IP
-------------

Table of contents
-----------------

1. Notes on networing code
2. Setup
3. Status


  1. Notes on networking code
-------------------------------

The current development model is based around using a user process as the
actual TCP/IP stack with socket file descriptors and device drivers dealt
with by the kernel. The diagram below shows how things should work.


            ___________________        ____________________
           |                   |      |                    |
           |Network Application|      |TCP/IP stack process|
           |___________________|      |____________________|
                       |               /           |
                       |              /            |
      _________________|_____________/_____________|________________
     |                 |            /              |                |
     | KERNEL          |           /               |                |
     |            _____|__________/_     __________|________        |
     |           |                  |   |                   |       |
     |           |  TCPDEV device   |   | RAW Driver        |       |
     |           |__________________|   |___________________|       |
     |                                             |                |
     |                                             |                |
     |_____________________________________________|________________|
                                                   |
                                         __________|________
                                        |                   |
                                        | Network Hardware  |
                                        |___________________|


The Network Application uses the standard BSD socket interface to open,
read and write sockets. The socket code passes the data on to the TCP/IP
stack process, through the /dev/tcpdev device.

The TCP/IP stack process then constructs TCP/IP packets and writes them to
the network device driver, including all the necessary hardware headers.


  2. Setup
------------

At the moment, ELKS supports only SLIP connections so you have to connect
the machine running ELKS with another machine using a serial cable. The
cable required is a so-called "null modem cable".

From now on, we will call the machine at the other end of the cable the
gateway.  Suppose that the gateway has the IP 192.168.1.1 and we like ELKS
to have the IP 192.168.1.2. On the gateway we do:

# slattach -p slip -L -s 9600 /dev/ttyS1 &
# ifconfig sl0 192.168.1.1 pointopoint 192.168.1.2

We use /dev/ttyS1 as the serial port - replace as required. Of course, the
kernel has to have slip support compiled in. This is all we need to do on
the gateway.

On the ELKS side, you need to have the kernel compiled with inet sockets.
You also build the ktcp module found in elksnet/ktcp. You boot up ELKS and
log in, then you do :

# ktcp 192.168.1.2 /dev/ttyS0 &

This tells ELKS to use your first serial line and that the local IP is
192.168.1.2. Note that this way the default baud rate will be used(9600bps).
To change that use the stty program that comes with the elkscmd packet.

# stty 1200 < /dev/ttys0

The above command will set the first serial line at 1200 bps.

This is it. Ping ELKS from the gateway to see if everything is fine.

* Note that if you use the disks that are created from the elkscmd package
with "make images.zip", the networking setup is much easier. Just edit the
/etc/rc.d/rc.sysinit file to enter the machine's IP and serial baud rate.


  3. Status
-------------

  This section desribes the current state of the networking code. It's
purpose is to give users an idea of what is done and what to expect of
the ELKS networking.

-- To be writen --

		Harry
