







                              NORD><LINK



                      Terrestrial Application of the
                             PACSAT-Protocol



               MANUAL for USERs, SYSOPs and Programmers


    Translation by G0KIU @ GB7MAM



    I.  Overview:


    II. User-Part:
        1.  General Considerations for the Mail-Broadcasts as addition to a 
            User-Entry 
        2.  Description of the PACSAT-Protocol with Terrestrial Employment.
        3.  PACSAT in Practice


    III.SYSOP-Part:
        1.  Requirements for TheNetNode-Digipeaters with PACSAT
        2.  Operation of PACSAT and Entry on the same QRG


    IV. Programmers-Part:
        1.  AX.25 as Carrier-Protocol for PACSAT-Broadcasts
        2.  PACSAT File-IDentifier
        3.  Construction of a PACSAT-Data-Frame
        4.  The PACSAT Message-Header
        5.  PACSAT MANDATORY HEADER
        6.  PACSAT EXTENDED HEADER
        7.  PACSAT OPTIONAL HEADER

    Appendices:
        A.  Constants (extract)
        B.  Packet Procedure
        C.  CRC-Routines







    The Protocol described here, corresponds to the actual Version. 
    Alterations and errors held in reserve. A list of the occurring marking 
    Characters, I spare myself. 

    This Documentation is created with the friendly assistance of  
    DL9HCJ/Matthias, DL5HBF/Ulli, DL9GYA/Roland and DL2LAY/ Kurt. 
    Questions, Corrections, Additional recommendations please to: 

                        DB7KG @ DB0HRO.#MVP.DEU.EU
                        Andreas Gal
                        Dorfstae 34b
                        23617 Stockelsdorf
              
    (or at on of our NORD><LINK Service places :-) )
    
    
    II.1  General Considerations for the Mail-Broadcasts as an addition to 
    ---------------------------------------------------------------------
    a User-Entry 
    ----------

    If one observes any Packet-Radio Net-Entry for a painstaking long Time, 
    it quickly attracts the attention, in that on the Entry of the 
    Digipeater it sends with a very high Redundancy, i.e. the same Data 
    (Messages will be requested by more Users and through that multiple 
    sendings. This leads to a wastage of the available standing Send-
    Capacity. Actually it has been sufficient, if ONE User requests a 
    Message and all others, who wished to have this Message, copied 
    passively. Unfortunately it is only very seldom that Programs enable 
    this (e.g. DigiPoint on the ATARI), so that this Method for the most 
    part is bundled with a considerable effort. A further drawback is the   
    missing Error reliability, which can lead to Data-Loss/Falsification. 
    Besides after the copying in most cases a following Manual edit is 
    required. 
    On Packet-Radio-Entries, where the Send-Time is especially curt, 
    e.g.PACket-SATellites, it has been chosen from the beginning as a 
    method for the Message Exchange, that enables a 100% error secured   
    passive Copying. All Messages which the Satellite sends out, are 
    addressed "to  all", therefore will be obtained by every Station. Then 
    afterwards, one can decide whether to retain the Message or not. 
    Through that will be prevented, the same Message being sent out a 
    multitude of times. With the always ever increasing amount of Data on 
    the Entries, a change to such a BROADCAST-Protocol is also sensible 
    with PR-Entries. 

    II.2  Description of the PACSAT-Protocol with terrestrial Usage.
    ---------------------------------------------------------------

    On the one hand, in order to be able to fall back on experience, but 
    also on the already available Programs, NORD><LINK itself has decided, 
    that with the Packet-Radio-Satellites, to use the ordinary "PACSAT-
    Protocol" also for the terrestrial Broadcast, i.e. one can fall back on 
    the same Software for the Decoding of the Message-Broadcasts of a 
    TheNetNode-Digipeater, as one uses it for the Satellite-Operation. As 
    



    an Example the Program "WISP" should be called, which will be 
    distributed through the AMSAT. 
    
    But because the TheNetNode-Broadcast-Software  has partially other 
    basic conditions, a few Modifications must be undertaken on the PACSAT-
    Execution. As a rule, Satellites send  Full-Duplex, but which most 
    (all?) Digipeaters use simplex or Echo-Duplex. Consequently with that 
    it is possible with Satellite-Operation, to send Data at the Box. This 
    is not possible with terrestrial usage, because the Digipeater sends 
    continually and cannot hear. Also a "REJECT" as with the Satellite-
    Operation is not possible, but also not necessary. First hardly any 
    malfunction appears and on the other hand the Digipeater cannot convert 
    through its non-limited audible time a considerable large multitude of 
    Data as a Satellite and consequently attain the Error Correction 
    through Multiple transmissions of the Message. For the PACSAT-Operation  
    at least 9600 Baud Transfer Rate is recommended. From that it 
    establishes for itself a somewhat effective Data-Rate of 800 Bytes / s, 
    consequently approximately 2.8MB per hour and 67MB a Day. Switching and 
    Wait-Time lose as with Entrances and increase the effective Data Rate 
    uo to 10-15 times ! 
    Per Day percipitates in DL approximately 200 new Info-Mails. Certainly 
    for that Volume of Mail the Node requires approx 10 Minutes in order to 
    send out the 200 Mails. With that, a User must not listen 24 Hours a 
    Day Digipeater-QRG, the last 200 Messages repeat. Every 2nd. Message
    will be a Message from the entire Message-Volumes of the last Days, 
    Months, Years (according to HD Size of the Digipeaters). Consequently a 
    User can listen for short times (20-30 Minutes) to copy the new 
    Messages or through a longer Copy obtain yet more interesting Messages. 
    The Broadcast-Principle eliminates the discrimination of weaker 
    Stations, which will be flattened from "Large Radio Places". Also SWLs 
    can follow problem free of the Packet occurrence. 

    II.3 PACSAT in Practice
    -----------------------

    Most PACSAT-Broadcast-"Outlets"  (Entries would be a false Word) will 
    send its Data at 9600 Baud, i.e. a 9600 Baud Modem by G3RUH/DF9IC will 
    be required. Because it is not required to send, nearly every 70cm TRX 
    is suitable, self PLL-Hand Helds, which for the regular 9600 Baud 
    operation are useless, by reason of of their bad Sending quality. 
    The Decoding of the PACSAT-Sending operates fully automatic without the 
    assistance of the User. PC-Users can receive the Messages with the 
    Program WISP under Windows (also in the background). Through the "Last-
    In-First-Out" one can copy with short time listening, already the 
    actual Messages. For the ATARI the Program "DigiPoint" enables the  
    Decoding of the PACSAT-Transmissions. 

    III.1 Requirements of TheNetNode-Digipeaters with PACSAT
    --------------------------------------------------------

    In order to ease the change on to PACSAT, the PACSAT-Server has been 
    integrated in the Digipeater-Software. Through that no further Computer 
    Hardware is required, other than an adequately large dimensioned Hard 
    Disk. The PACSAT-Server is a Standard-Integral of the TNN-Software from 
    Version 1.55. With that the Server automatically obtains all Messages 
    from the Net, it must be bundled with ONE Box close to the S&F. As a 

 
    rule a Waiting of the PACSAT-Servers through the Sysop is not 
    necessary. 
    10 new QRGs in the 70cm-ISM-Area have been arranged from the BUS-Admin. 
    for Broadcast-Outlets. They can be used with corresponding Filter-
    Devices to an available 70cm Entry in the upper Band Region. The Server 
    makes continuous-keying, insofar as not configured otherwise, on the 
    Output-Frequency, i.e. the TRX is correspondingly to refresh and to set 
    the Hardware-Watchdog of the Modem out of operation. It is to be noted, 
    that a 9600 Baud (synchronous) continuous keying requires on the 
    Tokenring-Side (asynchronous) a Data Flow of aproximately 14000 Baud. 
    A 19k2 Tokenring is then already overloaded further Entries. Generally 
    for Packet, VANESSA is to be recommended absolutely. 

    III.2 Operation of PACSAT and Entry on the same QRG
    ---------------------------------------------------

    If it is required to test the possibility of the Broadcast, switch onto 
    an available PACSAT-Broadcast Entry. The Timing with that is freely 
    selectable. Via the time controlled Batches it allows the PACSAT-
    Broadcast to switch off the Main-Operation-Times etc. also. In the 
    interest of the Band allocation in the ISM-Region an individual 
    Broadcast-Frequency is preferable. 

    IV.1 AX.25 as Carrier-Protocol for PACSAT-Broadcasts
    ----------------------------------------------------

    With that PACSAT can be operated trouble free in parallel with normal  
    Packet Radio, PACSAT Frames will be packaged in AX.25 Carrier-Frames.  
    They are UI (unnumbered information) Frames with the PID (protocol 
    Identifier) 0xBB directed to the End-Call-Sign QST-1. The Sender-Call-
    Sign is the Call-Sign of the Satellite/of the Digipeater. 

    fm DB0HRO to QST-1 ctl UI^ pid BB
    <PACSAT-Data Contents>

    With the recognition of PACSAT Frames it is also to be considered on 
    the correct PID and on the Target-Call-Sign QST-1. Because the PID of 
    the AX.25 PID F0 differs, the sending out of PACSAT with a TNC without 
    alteration in the Host-Mode is NOT POSSIBLE. 

    IV.2 PACSAT File-IDentifier
    ---------------------------

    Because the length of the Data-Field is limited with most TNCs on 256, 
    nearly all Messages must be cut up into more PACSAT-Data-Frames. With 
    that, a Data-Frame can be allotted unequivocally to a Message, every 
    Message contains a FID (File ID). This FID is 4-Bytes LONG, with which 
    the Message will be allocated. Every PACSAT-Server confers a FID only 
    once, i.e. it cannot arrive at Collisions. the Decoding-Program saves 
    the FIDs of all Messages which have been decoded already and prevents 
    a doubled receive. With that it is to be observed, that the FID is sent 
    unequivocally only for A PACSAT-Server, e.g. DB0HRO and DB0LUB both 
    PACSAT, then the FID 1234567 can indicate different Messages, therefore 
    the Decoder-Program must separate the transmission from Sender Call-
    Signs. 
    

    
    IV.3 Construction of a PACSAT-Data-Frame
    ---------------------------------------- 

    Each Data-Frame, that is sent out, contains a Frame-Header. This 
    contains Information that is variable. Only the form used by TNN will 
    be included here. At the beginning every PACSAT-Frame contains a 9 Byte 
    Header, then a variable Data-Quantity and at the End 2 CRC (Checksum) 
    Bytes. The Header is constructed as follows: 

    Name      Length    Function
    <FLAGS>   1 Byte    determines the Type of the Header, with TNN a PF_0 
                        always stands here which displays the presence of 
                        an OFFSET-Field.
    <FID>     4 Bytes   PACSAT-File Identifier (see. IV.2)
    <TYPE>    1 Byte    Type of the Message, with TNN (at present) 0x00
    <OFFSET>  3  Bytes  Offset, on which the Data-Bytes are to be written 
                        in the Receive-File.

    With the 3-Byte Offset the maximum File Size is 16MB, which should be 
    sufficient therefore, for future Baud-Rates. If all parts have been 
    received, then a file has been received, which at first contains a 
    Binary-Message-Header and then the individual File in unpacked ASCII-
    Format. The last two Bytes in the Carrier-Frame builds a CRC via the   
    Frame-Header and the Data-Bytes. They will be calculated from the 
    method in the Appendix. 

    IV.4 The PACSAT Message-Header
    ------------------------------
    (free translation of the English Original-Documentation by NK6K)

    All  Elements of the Message-Header (file header) have the same Format:

    <ID><Length>[<Data> . . . ]

    IV.4.1 <ID>-Field
    -----------------
          2-Byte  Integer, which identifies the Element, is Bit 15 set,   
    it deals with it as a user-defined Header-Field. 

         The <ID> will be transmitted first, as all mutli-byte-Integers 
    with the  LSB (last significant byte), therefore again the IBM-PC does 
    that as normal. All Motorolla-CPUs notice accurately returned. 

    IV.4.2 <Length>-Field
    ---------------------
         This Field is an unsigned character and indicates the quantity of  
    Data-Bytes in the Header-Element. Unrecognized Header-Element can be  
    passed over. Also Header-Elements, which have a fixed length, have the 
    length-  Field. 

    IV.4.3 <Data>-Field
    -------------------
         Contained here, is the Data of the Field, certainly from the type 
    of the Header-Element they  can have different Formats. 



 
    The PACSAT Message-Header will always be transferred uncompressed, if 
    the Message itself should be compressed (at the present with 
    TheNetNode, always uncompressed ASCII-Text). 

    The End of the Header is recognised through an Element with the ID 
    0x0000 (2 Bytes) and the Length 0, therefore the sequence 0x00 0x00 
    0x00. 

    IV.5 PACSAT MANDATORY HEADER
    ----------------------------

    The "MANDATORY  HEADER" must be contained with all PACSAT Sendings. It 
    will be commenced with the Byte-Sequence 0xaa 0x55, after that follows 
    the Header-Element in an ascending sequence of their ID's. 

    IV.5.1 file_number
    ------------------
        ID           :   0x01
        Length       :   4
        Date         :   unsigned long file_number

        Here the File-Identifier will be transferred.

    IV.5.2 file_name
    ----------------
        ID           :   0x02
        Length       :   8
        Date         :   char file_name[8];

         <file_name>  is the Filename without Extension filled from the 
    right with Spaces (0x20), if unknown then 8 Spaces must stand here, 
    then the  Receiving-Station selects an individual Name. [TheNetNode 
    transfers 8 Spaces here] 

    IV.5.3 file_ext
    ---------------
        ID           :   0x03
        Length       :   3
        Date         :   char file_ext[3];

        Here the same is valid as for file_name.
        [TheNetNode transfer 3 Spaces here]

    IV.5.4 file_size
    ----------------
        ID           :   0x04
        Length       :   4
        Date         :   unsigned long file_size;

          <file_size>  indicates the total length of the File, including
    Header, the Magic-Bytes (0xaa 0x55) and the Message.

    
    
    
    


    IV.5.5 create_time
    ------------------
        ID           :   0x05
        Length       :   4
        Date         :   unsigned long create_time;

         Date, when the File has been created. The input follows in Unix-
    Time, also the Seconds, which have elapsed since the 1st. Jan.1970. 
         [Here TheNetNode transfers the Time, when the Message has been 
    received via the Store & Forward] 

    IV.5.6 last_modified_time
    -------------------------
        ID           :   0x06
        Length       :   4
        Date         :   unsigned long last_modified_time;

         [Here TheNetNode transfers the Time, when the Message has been 
    received via the S&F]. 

    IV.5.7 seu_flag
    ---------------
        ID           :   0x07
        Length       :   1
        Date         :   unsigned char seu_flag;

        [With terrestrial Usage this Flag is always 0]

    IV.5.8 file_type
    ----------------
        ID           :   0x08
        Length       :   1
        Date         :   unsigned char file_type;

         [TheNetNode only uses Type 0x00 at the moment]

    IV.5.9 body_checksum
    --------------------
        ID           :   0x09
        Length       :   2
        Date         :   unsigned int body_checksum;

          body_checksum  is the 16-Bit Sum of all Bytes of the transferred 
    Files without the Header (therefore only the Message).

    IV.5.10 header_checksum
    -----------------------
        ID           :   0x0a
        Length       :   2
        Date         :   unsigned int header_checksum;

        as body_checksum, but via all Bytes of the Headers.

    
    
    


    IV.5.11 body_offset
    -------------------
        ID           :   0x0b
        Length       :   2
        Date         :   unsigned int body_offset

         Indicates the Offset of the 1st. Byte of the transferred File, also
    the length of the Header. The File will be transferred immediately 
    following the Header.

    IV.6 PACSAT EXTENDED HEADER
    ---------------------------

    The "EXTENDED HEADER" contains further Information about the 
    transmitted Message. A few Elements are of no interest for the 
    terrestrial operation and have only a Dummy-Function. They are 
    indicated with a *. 

    IV.6.1 Source
    -------------
    ID           :   0x10
    Length       :   various
    Date         :   char source[];

    This  Field indicates the Sender in the ASCII-Format.

    IV.6.2 ax25_uploader*
    ---------------------
    ID           :   0x11
    Length       :   6
    Date         :   char ax25_uploader[6];

    This Field determines the Call Sign of the Station, that has saved the 
    Message. [with terrestrial Usage 6 empty Characters stand here]

    IV.6.3 upload_time*
    -------------------
    ID           :   0x12
    Length       :   4
    Date         :   unsigned long upload_time;

    This Field displays Field the Time of the Upload of a Message in 
    the Satellite. [With TheNetNode again will be incorporated the 
    Receiving-Time from the S&F] 

    IV.6.4 download_count*
    ----------------------
    ID           :   0x13
    Length       :   1
    Date         :   unsigned char download_count;

    This Field contains the number of transfers of a Message. 
    [With TheNetNode this Field is always 0]

    
    


    IV.6.4 destination
    ------------------
    ID           :   0x14
    Length       :   various
    Date         :   char destination[];
    
    This Field determines the End-Address. [Here,TheNetNode consigns the 
    Hierarchical Routing Address, z.B. DB7KG @ DB0HRO or IBM @ DL] 

    IV.6.5 ax25_downloader*
    -----------------------
    ID           :   0x15
    Length       :   6
    Date         :   char ax25_downloader[6];

    This Field contains the Call-Sign of the Station, which has demanded 
    the Message. [With TheNetNode Messages will be sent to a fixed Time 
    Plan, not from Requests, here again stands only 6 Spaces] 

    IV.6.6 download_time
    --------------------
    ID           :   0x16
    Length       :   4
    Date         :   unsigned long download_time

    This Field determines the Time when the Message was successfully 
    received. [Here, TheNetNode fixes the Time, when the transfer of the 
    Files began]

    IV.6.7 expire_time
    ------------------
    ID           :   0x17
    Length       :   4
    Date         :   unsigned long expire_time

    This Field contains the Time/Date when the File "overruns" and should 
    be erased. [The Lifetime can be calculated from this Field:  
    (expire_time  -  present_time)   / seconds_pro_day] 

    IV.6.8 priority*
    ----------------
    ID           :   0x18
    Length       :   1
    Date         :   unsigned char priority

    [With terrestrial Usage, this Field always contains 0] 

    IV.7 PACSAT OPTIONAL HEADER
    ---------------------------

    All of these Header-Elements are optional, i.e. they can occur in 
    optional sequence and must not all be onhand. They will be described 
    only for the terrestrial used relevant Elements. 


    


    IV.7.1 compression_type
    -----------------------
    ID           :   0x19
    Length       :   1
    Date         :   unsigned char compression_type;
    The transferred Message can be compressed in order to raise the transfer 
    capacity. See Appendix for the defined Packing-Method. [At the present 
    this will not yet be supported by TheNetNode, the Packing-Method is 
    always 0 and consequently off]

    IV.7.2 bulletin_id_number
    -------------------------
    ID           :   0x21
    Length       :   various
    Date         :   char bid[];

    The Bulletin-ID of the  Message. With User-Mails also possibly not
    indicated.

    IV.7.3 title
    ------------
    ID           :   0x22
    Length       :   various
    Date         :   char title[];

    ASCII-Title of the Message.

    IV.7.4 user_file_name
    ---------------------
    ID           :   0x26
    Length       :   various
    Date         :   char user_file_name[];

    Name of the File by the Sender. [will be set but of no further 
    meaning] Appendix A. Constants (extract) 

    /* Frame-Header Flags */
    #define    PF_O                            2

    /* Header ID's of mandatory Headers */
    --------------------------------------

    #define    PH_HEADER_END                   0
    #define    PH_FILE_NUMBER                  1
    #define    PH_FILE_NAME                    2
    #define    PH_FILE_EXT                     3
    #define    PH_FILE_SIZE                    4
    #define    PH_CREATE_TIME                  5
    #define    PH_LAST_MODIFIED_TIME           6
    #define    PH_SEU_FLAG                     7
    #define    PH_FILE_TYPE                    8
    #define    PH_BODY_CHECKSUM                9
    #define    PH_HEADER_CHECKSUM              10
    #define    PH_BODY_OFFSET                  11
    



    /* Header ID's of extended Headers */
    -------------------------------------

    #define    PH_SOURCE                       16
    #define    PH_AX25_UPLOADER                17
    #define    PH_UPLOAD_TIME                  18
    #define    PH_DOWNLOAD_COUNT               19
    #define    PH_DESTINATION                  20
    #define    PH_AX25_DOWNLOADER              21
    #define    PH_DOWNLOAD_TIME                22
    #define    PH_EXPIRE_TIME                  23
    #define    PH_PRIORITY                     24

    /* Header ID's of optional Headers */
    -------------------------------------

    #define    PH_COMPRESSION_TYPE             32
    #define    PH_BULLETIN_ID_NUMBER           34
    #define    PH_TITLE                        35
    #define    PH_USER_FILE_NAME               39

    Appendix B. Packing-Method

    0x00    uncompressed
    0x01    compressed with PKARC*
    0x02    compressed with PKZIP*

    [* will not be supported by TNN]

    Appendix C. CRC-Routine
    -----------------------

    /* CRC for a Byte calculation */
    unsigned int gen_crc(unsigned int crc, char data) {

        unsigned int y;

        crc ^= ((unsigned int)data) << 8;
        for(y = 0; y < 8; y++)
             if( crc & 0x8000)
                 crc = (crc << 1) ^ 0x1021;
             else
                  crc <<= 1;
        return(crc);

    }

    /* CRC of a Frame check */
    void ckcrc(char *frame, int len) {

        unsigned int crc = 0;
        int x;
        for (x = 0; x < len-2; x++)
            crc = gen_crc(crc, frame[x]);
        crc = gen_crc(crc, frame[x+1]); /* 1. CRC Byte */
        if (gen_crc(crc, frame[x+2]))

             printf("CRC Error\n");
    }


    Instead of the slow Bit-Method it can be worked via Tables, they can 
    be drawn from the TheNetNode Source-Code. 


    Translation by G0KIU @ GB7MAM
