Skip to main content

3. Error Checking

3a. All messages sent over the network will be error checked initally so as to help isolate software and hardware bugs.​

3b. A checksum will be associated with each message, which is order dependent.​

3b1. The following algorithm is one which might be used:​

3b1a. A checksum of length 1 may be formed by adding successive fields in the string to be checked serially, and adding the carry bit into the lowest bit position of the sum.​

              +--------------+
| |
+---FIELD 1----+

ADD +--------------+
| |
+----FIELD 2---+

+-+--------------+
| | |
+-+--------------+
\
\ +--+
ADD CARRY---> | |
+--+

+--------------+
| |
+----RESULT----+
3b1a1. This process is known as folding.​
3b1a2. Several fields may be added and folded in parallel, if they are folded appropiately after the addition.​
              +---------+---------+---------+---------+
              | FIELD 4 | FIELD 3 | FIELD 2 | FIELD 1 |
              +---------+---------+---------+---------+

              +---------+---------+---------+---------+
              | FIELD 8 | FIELD 7 | FIELD 6 | FIELD 5 |
              +---------+---------+---------+---------+
            ADD
            +-+---------+---------+---------+---------+
            | |         |         |         |         |
            +-+---------+---------+---------+---------+
             |      |        |         |         |
             |      |        |         |         v
             |      |        |         |    +---------+
             |      |        |         |    |         |
             |      |        |         |    +---------+
             |      |        |         |
             |      |        |         \    +---------+
             |      |        |          `-> |         |
             |      |        |              +---------+
             |      |        |
             |      |        \              +---------+
             |      |         `-----------> |         |
             |      |                       +---------+
             |      |
             |      \                       +---------+
             |       `--------------------->|         |
             |                              +---------+
             |
             \                                    +---+
              `-----CARRY------------------------>|   |
                                                  +---+
                                  ADD
                                  +---------+---------+
                                  |         |         |
                                  +--CARRY--+---------+
                                       |
                                       \        +-----+
                                    ADD `-----> |     |
                                                +-----+

                                            +---------+
                                            |         |
                                            +-RESULT--+
3b1a2a. Using this scheme, it is assumed that, if there are n fields, the carries from the first n-1 fields are automatically added into the low order position of the next higher field, so that in folding, one need only add the [n] result fields to the carry from the nth field, and then add in an appropiately sized carry from that addition (and repeat the desired number of times to achieve the result.​
3b1a3. A checksum computed in this manner has the advantage that the word lengths of different machines may each be used optimally:​
3b1a3a. If a string of suitable length is chosen for computing the checksum, and a suitable checksum field length is selected, the checksum technique for each of the machines will be relatively optimal.​
3b1a3a1. Field length: 288 bits (lowest common denomenator of (24,32,36)​
3b1a3a2. Checksum length: 8 bits (convenient field size for all machines)​

3b1b. If a message is divided into groups of fields, and each group is checksummed in this manner, an order dependent checksum may be got by shifting the checksum for each group, and adding it in (successively) to the checksum of the next group​