s5linbox.jpg (4356 bytes)             Back      Home


ETNC V1.0 Theory of operation

Ethernet TNC program for the S5LinBOX hardware supports two modes of
operation: transparent TCP/IP with AX25 datagram mode and AXIP
(AX25 over IP, RFC1226) mode with two submodes: AXIP/UDP or
AXIP/IP (IP with AX25 protocol, Linux or xNOS like).

Transparent TCP/IP with AX25 datagram mode of operation is based on
simple static AX25 ARP table including destination IP#, destination AX25 call
with SSID and AX25 path (i.e. 44.15.1.1,S50LEA-0,S55YLJ-3). If ARP
request is heard on ethernet port with destination IP found in this table then
ETNC responds with ARP reply with its own MAC address. And the game
continues usual way. All successive TCP/IP frames with appropriate MAC
address will be ancapsulated into AX25 frames and sent to HDLCA port
again based on information found in AX25 ARP table.
At the other hand, when AX25 frame with encapsulated IP frame is received
from the HDLCA port with destination IP# found in the ethernet ARP table
(automatically built) AX25 header will be stripped out and IP frame sent to
the ethenet port. ETNC setup program is provided to maintain AX25 ARP table.

ETNC listen for UDP port 93 or IP frames with AX25 protocol on ethernet port.
When it receives such ethernet frame addressed to its own MAC and IP# it at first
makes an entry into the AXIP table with next information: source IP#, UDP port #
or -1 if AX25 protocol, source MAC address. Secondly it strip IP and UDP header
and send it to HDLCA port. At the other hand, when ETNC receives AX25
frame it builds IP (UDP) ethernet frames for all AXIP table entries and
send them over ethernet port. This mode of operation enables us to use
Flexnet32 for Windows over axip driver or i.e. LinKT terminal under Linux
with ax25ipd running.

Initial Software downloading

To download ETNC software You need some Tools and binary image files.
Connect Your PC Printer port to JTAG connector of the S5LinBOX using JTAG cable.
Start OCD_Commander, make connection to target board (Commands/Connection)
and init CPU configuration registers for SDRAM at address 0x0 (Commands/Macro)
using macro file nr-sdr0.mac. After successful CPU initialization You can download
image files in next order: boots.S19, nr.S19 and norom.S19 (Commands/Download).
Connect S5LinBOX RS232 port to an ASCII terminal (or Hyperterm under Win)
and start ETNC running at address 0x0 (Go). You must get next prompt at the terminal:

------------------------------------------------
1. S19 Pgm Download   -[P]   2. Flash        -[F]
8. MAC/Ethernet Test  -[L]   10.I2C Test     -[S]
3. ETNC Setup         -[X]   4. Memory Test  -[M]
-------------------------------------------------
Ethernet TNC by S57MMK, ver 1.0 2001/2002

Select Test Item :


Select command F (Flash). You get next prompt:
+---------------------------------------------------+
| 3. SST :Compare 0x180000 <-> 0x1000000 len 1f000  |
| 4. SST :M29LV040B or M29W160DB Program            |
| 5. SST :M29LV040B or M29W160DB Erase              |
+---------------------------------------------------+

$$ Select EEPROM type :

Selest 5<Enter>. It will erase Flash. Then select 4<Enter>. It will burn Flash with
downloaded ETNC software. Reset S5LinBOX and You must get the same prompt.
Your ETNC is running. Proceed with Initial setup.

Initial ETNC Setup

From the prompt select X (ETNC Setup). You must get next prompt:

ETNC Setup :
-----------------------
1. MyMACAddress -[A]
2. MyIP_No      -[I]
3. MyAX25Call   -[C]
4. MyATxDelay   -[D]
5. AX25ARP      -[R]
6. Burn         -[B]
7. QUIT         -[Q]
-----------------------

Select Param :

Set MyMACAddress (type A) to 0x0000F0112200,
Set MyIP_No (I) to 44.150.1.112,
Set MyAX25CALL to Your call with SSID (i.e. S57MMK6 or S52D  4. without -SSID),
Set MyTxDelay (D) to 200 (resolution 10usec),
Clear AX25 ARP table:
      Select AX25ARP (R), You will get next prompt:
      0...N - Edit, A - Add, Q - Quit ? []
      selest 0 (first table entry) and You will get next prompt:
      IP number : [xx.xx.xx.xx] :
      enter 0.0.0.0         that will clear ARP table
      enter anything for the next prompt (AX25 Path). You will get back to R prompt.
      select Q and You are back to X prompt. Now select Burn (B), it will write
      all setup data to EEPROM.

Now Your ETNC is ready to work. But first proceed with Your PC setup.

PC setup for ETNC under Windows

Make sure You have TCP/IP stack for Your PC ethernet controler with next
properties: IP# 44.xx.xx.xx, MASK 255.0.0.0, You ampr-> inet gateway
(i.e. s50lea.ampr.org or 44.150.1.1), Your DNS (i.e. 44.150.1.1).
Connect PC and S5linBOX using 1:1 UTP cable. Try ping 44.150.1.112.
You must get replies. If not, Your S5linBOX is not working properly or not
setup properly. If ping success, run Etnc_su.exe (under Win).
You can change all initial ETNC setup entries for the ETNC with IP#. After
You start setup prg first get current setup data (Get Data). Change whatever
You want and than save data to the S5linBOX (Put Data). At least You have to
Add an ARP entry.

etnc_su.jpg (26610 bytes)

Note that the first ARP table entry is default entry. That means that ETNC
will route all frames with IP# without entry in ARP table to it. You can move
entry to first position using Up button. You can Add ARP entry using Add button.
Normally, there is no need to change MAC address.

etnc_su1.jpg (10693 bytes)

If You want to use AX25 terminal under Windows You have to install Flexnet32 and
appropriate AX25 terminal program (i.e. WPP). You must setup AXIP channel on
Flexnet Control center (Tools/Parameters) in order to use AXIP features of  ETNC with
destination IP# set to 44.150.1.112 (or whatever You have set for My_IP_#) and
UDP port 93.

PC setup for ETNC under Linux (Thanks to Metod, S56WMN)

####
/etc/ax25ipd.conf
####
socket udp 93
mode tnc
device /dev/ttyq0
speed 0
loglevel 0
route S56WMN-0 44.150.1.112 d udp 93

####
/etc/axports
####
axip S56WMN-0 0 1600 7 axip

#### (chmod 777 ax.ip)
/etc/rc.boot/ax.ip
####
#!/bin/sh
/sbin/modprobe mkiss
/usr/sbin/kissattach -m 1580 /dev/ptyq0 axip 127.0.0.1
/usr/sbin/ax25ipd /etc/ax25/ax25ipd.conf

echo -n 35 > /proc/sys/net/ax25/ax0/t1_timeout
echo -n 2 > /proc/sys/net/ax25/ax0/t2_timeout
echo -n 90000 > /proc/sys/net/ax25/ax0/idle_timeout
echo -n 20 > /proc/sys/net/ax25/ax0/maximum_retry_count
echo -n 0 > /proc/sys/net/ax25/ax0/backoff_type

ussage:
listen axip -a
call axip s55ylj -r

ETNC Setup over ethernet specification

"I hope there is an Linux guru who will make such a prg for linux :-)"

It is possible to change ETNC setup data (MAC address, IP#, AX25 call, TxDelay and
AX25 ARP Table) from PC over ethernet. To do that use UDP datagrams to destination
port 99 and to already preset IP#. To read setup data You must fill first 8 bytes of UDP
datagram data to 0x0,0x0,0x55,0xAA,0x0,0x0,0x0,0x0. ETNC will reply with UDP
datagram including all setup data (see structure). To write setup data first four bytes of
UDP datagram data field MUST be 0x0,0x0,0xF0,0x11 (That is part of MAC addr)
continued with all other data from structure. ETNC does not reply to send data datagram.
You can verify writting by reading data afterwhile (writting to EEPROM takes abt 1sec).
Structure of read or write data is as follows:

struct etnc_setup_data {
    unsigned char mac_address [6]; // 0x0000F011xxyy
    unsigned char fill1 [2];       // fill with 0x0
    unsigned long ip_no;           // Your ETNC IP#
    unsigned long fill2;

    unsigned char my_ax25_call[7]; // in AX25 shifted notation with SSID
    unsigned char fill3[4];
    unsigned char TxDelay;         // 10usec resolution:  0 - 2.55 msec
    unsigned char fill4[12];
    struct ax25_arp_entry[10];     // AX25 ARP table, 10 entries
}
struct ax25_arp_entry {
    unsigned long ip_no;           // destination IP#
    unsigned char length;          // (number off via calls + 2) * 7
    unsigned char fill1[3];
    unsigned char dest_ax25_call[7];  // in ASCII with SSID like: S50LEA0
    unsigned char my_ax25_call[7];    // in ASCII with SSID like: S52D  4
    unsigned char via_ax25_calls[10][7];

             // max 10 AX25 calls in ASCII with SSID like "S55XX 1S55YLJ3"
    unsigned char fill2[36];
}

Back      Home