home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / FSC.ZIP / FSC-0011.TXT < prev    next >
Text File  |  1987-12-04  |  25KB  |  357 lines

  1. FSC-0011   by Bob Hartman
  2.  
  3. These are some thoughts that I had on FSC001 after implementing things in
  4. BinkleyTerm.  The state tables I show I believe reflect a little bit more of
  5. reality than the older tables.  I think that BT corresponds to 99% of the
  6. stuff that I wrote, and it can talk to everything that is out there.  The
  7. biggest thing is to be able to trick everyone currently in existance into
  8. doing what they do best without killing someone that can't do all the fancy
  9. stuff (ie Fido 11w).  Let me know if I can be of any help deciphering any of
  10. it.  I think it is pretty straightforward.  I would prefer if it was not
  11. published in FSC001 (since that really should not change, except perhaps for
  12. typos and the EOT stuff mentioned below), but this can be an addendum (I'll
  13. write something a bit more involved if you want) to be given to developers so
  14. that they can be most efficient in transfers with other systems.  I just put
  15. all this stuff in, and looking at the time (3:33am) I may have goofed in some
  16. places.  Let me know if you see anything that looks fishy.  Let me know if
  17. you want me to go any further with this (I probably will anyway, simply as an
  18. example of the type of documentation on features that I think would be
  19. acceptable in the future).
  20.  
  21.  
  22. This is the current state table for sending mail:
  23.  
  24.     .-----+----------+-------------------------+-------------------------+-----.
  25.     |State| State    | Predicate(s)            | Action(s)               | Next|
  26.     |  #  | Name     |                         |                         | St  |
  27.     |-----+----------+-------------------------+-------------------------+-----|
  28.     | S0  | SendInit |                         | dial modem              | S1  |
  29.     |-----+----------+-------------------------+-------------------------+-----|
  30.     | S1  | WaitCxD  | 1 carrier detected      | delay 1-5 seconds       | S2  |
  31.     |     |          | 2 busy, etc.            | report no connection    | exit|
  32.     |     |          | 3 voice                 | report no carrier       | exit|
  33.     |     |          | 4 carrier not detected  | report no connection    | exit|
  34.     |     |          |   within 60 seconds     |                         |     |
  35.     |-----+----------+-------------------------+-------------------------+-----|
  36.     | S2  | WhackCRs | 1 over 30 seconds       | report no response <cr> | exit|
  37.     |     |          | 2 ?? <cr>s received     | delay 1 sec             | S3  |
  38.     |     |          | 3 <cr>s not received    | send <cr> <sp> <cr> <sp>| S2  |
  39.     |     |          |                         |   delay ??? secs        |     |
  40.     |-----+----------+-------------------------+-------------------------+-----|
  41.     | S3  | WaitClear| 1 no input for 0.5 secs | send TSYNCH = AEH       | S4  |
  42.     |     |          | 2 over 60 seconds       | hang up, report garbage | exit|
  43.     |     |          |   and line not clear    |                         |     |
  44.     |-----+----------+-------------------------+-------------------------+-----|
  45.     | S4* | SendMail |                         | (XMODEM send packet XS0)| S5  |
  46.     |-----+----------+-------------------------+-------------------------+-----|
  47.     | S5  | CheckMail| 1 XMODEM successful     | (Fido registers success)| S6  |
  48.     |     |          | 2 XMODEM fail or timeout| hang up, report mail bad| exit|
  49.     |-----+----------+-------------------------+-------------------------+-----|
  50.     | S6* | SendFiles|                         | (BATCH send files BS0)  | S7  |
  51.     |-----+----------+-------------------------+-------------------------+-----|
  52.     | S7  | CheckFile| 1 BATCH send successful |                         | S8  |
  53.     |     |          | 2 BATCH send failed     | hang up, rept files fail| exit|
  54.     |-----+----------+-------------------------+-------------------------+-----|
  55.     | S8  | TryPickup| 1 wish to pickup        | note send ok            | R2* |
  56.     |     |          | 2 no desire to pickup   | delay 5 secs            | exit|
  57.     |     |          |                         |   hang up, rept send ok |     |
  58.     `-----+----------+-------------------------+-------------------------+-----'
  59.  
  60. This note is mentioned:
  61.  
  62.     Although  the  above  shows  the  sender  emitting only one  TSYNCH,  it  is
  63.     recommended  that a timeout of 5-20 seconds should initiate another TSYNCH.
  64.     The receiver should tolerate multiple TSYNCHs.
  65.  
  66.  
  67. The correct state table should be:
  68.  
  69.     .-----+----------+-------------------------+-------------------------+-----.
  70.     |State| State    | Predicate(s)            | Action(s)               | Next|
  71.     |  #  | Name     |                         |                         | St  |
  72.     |-----+----------+-------------------------+-------------------------+-----|
  73.     | S0  | SendInit |                         | dial modem              | S1  |
  74.     |-----+----------+-------------------------+-------------------------+-----|
  75.     | S1  | WaitCxD  | 1 carrier detected      | delay 1-5 seconds       | S2  |
  76.     |     |          | 2 busy, etc.            | report no connection    | exit|
  77.     |     |          | 3 voice                 | report no carrier       | exit|
  78.     |     |          | 4 carrier not detected  | report no connection    | exit|
  79.     |     |          |   within 60 seconds     |                         |     |
  80.     |-----+----------+-------------------------+-------------------------+-----|
  81.     | S2  | WhackCRs | 1 over 30 seconds       | report no response <cr> | exit|
  82.     |     |          | 2 ?? <cr>s received     | delay 1 sec             | S3  |
  83.     |     |          | 3 <cr>s not received    | send <cr> <sp> <cr> <sp>| S2  |
  84.     |     |          |                         |   delay ??? secs        |     |
  85.     |-----+----------+-------------------------+-------------------------+-----|
  86.     | S3  | WaitClear| 1 no input for 0.5 secs | send TSYNCH = AEH       | S4  |
  87.     |     |          | 2 over 60 seconds       | hang up, report garbage | exit|
  88.     |     |          |   and line not clear    |                         |     |
  89.     |-----+----------+-------------------------+-------------------------+-----|
  90.     | S4* | TSyncChk | 1 'C' or NAK (peeked at)| (XMODEM send packet XS1)| S5  |
  91.     |     |          | 2 over 2 seconds        | eat noise, resend TSync | S4  |
  92.     |     |          | 3 over 30 seconds       | hang up report not Fido | exit|
  93.     |-----+----------+-------------------------+-------------------------+-----|
  94.     | S5  | CheckMail| 1 XMODEM successful     | (Fido registers success)| S6  |
  95.     |     |          | 2 XMODEM fail or timeout| hang up, report mail bad| exit|
  96.     |-----+----------+-------------------------+-------------------------+-----|
  97.     | S6* | SendFiles|                         | (BATCH send files BS0)  | S7  |
  98.     |-----+----------+-------------------------+-------------------------+-----|
  99.     | S7  | CheckFile| 1 BATCH send successful |                         | S8  |
  100.     |     |          | 2 BATCH send failed     | hang up, rept files fail| exit|
  101.     |-----+----------+-------------------------+-------------------------+-----|
  102.     | S8  | TryPickup| 1 wish to pickup        | note send ok            | R2* |
  103.     |     |          | 2 no desire to pickup   | delay 5 secs            | exit|
  104.     |     |          |                         |   hang up, rept send ok |     |
  105.     `-----+----------+-------------------------+-------------------------+-----'
  106.  
  107. In state S4, the phrase "peeked at" means that the character is not removed
  108. from the buffer.  Therefore when XS1 is started the proper character for
  109. beginning the Xmodem transfer will be detected.  Notice also that XS1 is a
  110. change from the XS0 that is given in the original.  XS0 is for doing Telink,
  111. not Xmodem.  Since the first part (the mail packet) is sent Xmodem, the
  112. proper place to enter is XS1 (I think).
  113.  
  114. This next is the current table for Xmodem receiving:
  115.  
  116.     XMODEM/TeLink Receiver
  117.  
  118.     .-----+----------+-------------------------+-------------------------+-----.
  119.     |State| State    | Predicate(s)            | Action(s)               | Next|
  120.     |  #  | Name     |                         |                         | St  |
  121.     |-----+----------+-------------------------+-------------------------+-----|
  122.     | XR0 | RecStart | 1 prefer crc mode       | Send "C"                | XR1 |
  123.     |     |          | 2 want checksum mode    | send NAK                | XR1 |
  124.     |-----+----------+-------------------------+-------------------------+-----|
  125.     | XR1 | WaitFirst| 1 10 retries or 1 minute| report receive failure  | exit|
  126.     |     |          | 2 > 3 retries or 30 secs| set want checksum mode  | XR0 |
  127.     |     |          | 3 EOT received          | send ACK, report no file| exit|
  128.     |     |          | 4 TeLink block recd     | send ACK, set crc/cksm  | XR2 |
  129.     |     |          | 5 data block recd       | send ACK, set crc/cksm  | XR2 |
  130.     |     |          | 6 bad block or 2-10 secs| incr retry count        | XR0 |
  131.     |-----+----------+-------------------------+-------------------------+-----|
  132.     | XR2 | WaitBlock| 1 10 retries or 1 minute| report receive failure  | exit|
  133.     |     |          | 2 EOT received          | send ACK, report recd ok| exit|
  134.     |     |          | 3 data block received   | send ACK                | XR2 |
  135.     |     |          | 4 bad block or 2-10 secs| send NAK, incr retry cnt| XR2 |
  136.     `-----+----------+-------------------------+-------------------------+-----'
  137.  
  138. The following inserts the small fix I mentioned in FTSC about the EOT probs:
  139.  
  140.     XMODEM/TeLink Receiver
  141.  
  142.     .-----+----------+-------------------------+-------------------------+-----.
  143.     |State| State    | Predicate(s)            | Action(s)               | Next|
  144.     |  #  | Name     |                         |                         | St  |
  145.     |-----+----------+-------------------------+-------------------------+-----|
  146.     | XR0 | RecStart | 1 prefer crc mode       | Send "C"                | XR1 |
  147.     |     |          | 2 want checksum mode    | send NAK                | XR1 |
  148.     |-----+----------+-------------------------+-------------------------+-----|
  149.     | XR1 | WaitFirst| 1 10 retries or 1 minute| report receive failure  | exit|
  150.     |     |          | 2 > 3 retries or 30 secs| set want checksum mode  | XR0 |
  151.     |     |          | 3 EOT received          | delay 1 sec, purge input| exit|
  152.     |     |          |                         | send ACK, report no file|     |
  153.     |     |          | 4 TeLink block recd     | send ACK, set crc/cksm  | XR2 |
  154.     |     |          | 5 data block recd       | send ACK, set crc/cksm  | XR2 |
  155.     |     |          | 6 bad block or 2-10 secs| incr retry count        | XR0 |
  156.     |-----+----------+-------------------------+-------------------------+-----|
  157.     | XR2 | WaitBlock| 1 10 retries or 1 minute| report receive failure  | exit|
  158.     |     |          | 2 EOT received          | delay 1 sec, purge input| exit|
  159.     |     |          |                         | send ACK, report recd ok|     |
  160.     |     |          | 3 data block received   | send ACK                | XR2 |
  161.     |     |          | 4 bad block or 2-10 secs| send NAK, incr retry cnt| XR2 |
  162.     `-----+----------+-------------------------+-------------------------+-----'
  163.  
  164. As I mentioned in the FTSC conference, the delay to eat characters is needed
  165. in order to purge the extra EOT's that some software sends out.  The delay can
  166. be shorter than 1 second (in practice 2/10ths seems to work well), but 1 sec
  167. fit nicely in the little box.
  168.  
  169. This is the current Modem7 filename sender:
  170.  
  171.     MODEM7 Filename Sender
  172.  
  173.     .-----+----------+-------------------------+-------------------------+-----.
  174.     |State| State    | Predicate(s)            | Action(s)               | Next|
  175.     |  #  | Name     |                         |                         |  St |
  176.     |-----+----------+-------------------------+-------------------------+-----|
  177.     | MS0 | WaitNak  | 1 20 retries or 1 minute| filename send failed    | exit|
  178.     |     |          | 2 NAK received          | send ACK & 1st ch of fn | MS1 |
  179.     |-----+----------+-------------------------+-------------------------+-----|
  180.     | MS1 | WaitChAck| 1 ACK rcd, fname done   | send SUB = 1AH          | MS2 |
  181.     |     |          | 2 ACK rcd, fname ~done  | send next ch of fname   | MS1 |
  182.     |     |          | 3 other char or 1 sec   | send "u", incr retry cnt| MS0 |
  183.     |-----+----------+-------------------------+-------------------------+-----|
  184.     | MS2 | WaitCksm | 1 cksum recd and ok     | send ACK, report fn ok  | exit|
  185.     |     |          | 2 cksum recd but bad    | send "u", incr retry cnt| MS0 |
  186.     |     |          | 3 no cksum in 1 sec     | send "u", incr retry cnt| MS0 |
  187.     `-----+----------+-------------------------+-------------------------+-----'
  188.  
  189. The drawbacks of this one are that it does not take into account the
  190. possibility of a SEAdog at the other end (or other software) that does not
  191. wish to do Modem7 filename transfer.  The other end will send a "C" instead
  192. of the usual NAK, and that should be accounted for:
  193.  
  194.     MODEM7 Filename Sender
  195.  
  196.     .-----+----------+-------------------------+-------------------------+-----.
  197.     |State| State    | Predicate(s)            | Action(s)               | Next|
  198.     |  #  | Name     |                         |                         |  St |
  199.     |-----+----------+-------------------------+-------------------------+-----|
  200.     | MS0 | WaitNak  | 1 20 retries or 1 minute| filename send failed    | exit|
  201.     |     |          | 2 NAK received          | send ACK & 1st ch of fn | MS1 |
  202.     |     |          | 3 C received            | return fn skipped       | exit|
  203.     |-----+----------+-------------------------+-------------------------+-----|
  204.     | MS1 | WaitChAck| 1 ACK rcd, fname done   | send SUB = 1AH          | MS2 |
  205.     |     |          | 2 ACK rcd, fname ~done  | send next ch of fname   | MS1 |
  206.     |     |          | 3 other char or 1 sec   | send "u", incr retry cnt| MS0 |
  207.     |-----+----------+-------------------------+-------------------------+-----|
  208.     | MS2 | WaitCksm | 1 cksum recd and ok     | send ACK, report fn ok  | exit|
  209.     |     |          | 2 cksum recd but bad    | send "u", incr retry cnt| MS0 |
  210.     |     |          | 3 no cksum in 1 sec     | send "u", incr retry cnt| MS0 |
  211.     `-----+----------+-------------------------+-------------------------+-----'
  212.  
  213. If a C is received, it should trigger that the other end does not wish to do
  214. a Modem7 filename transfer.  Since the data in a Telink header block (as well
  215. as SEAlink header block) makes the Modem7 filename redundant, the sender can
  216. return a good filename and slip into Telink send with no problem.  Substituting
  217. SEAlink send for Telink send is also a viable possibility.
  218.  
  219. Currently this is the state machine for Modem7 receiver:
  220.  
  221.     MODEM7 Filename Receiver
  222.  
  223.     .-----+----------+-------------------------+-------------------------+-----.
  224.     |State| State    | Predicate(s)            | Action(s)               | Next|
  225.     |  #  | Name     |                         |                         |  St |
  226.     |-----+----------+-------------------------+-------------------------+-----|
  227.     | MR0 | SendNak  | 1 20 tries or 1 minute  | report filename failure | exit|
  228.     |     |          | 2                       | send NAK, incr try cnt  | MR1 |
  229.     |-----+----------+-------------------------+-------------------------+-----|
  230.     | MR1 | WaitAck  | 1 rcd ACK               |                         | MR2 |
  231.     |     |          | 2 rcd EOT               | report no files remain  | exit|
  232.     |     |          | 3 5 secs & no ACK/EOT   |                         | MR0 |
  233.     |-----+----------+-------------------------+-------------------------+-----|
  234.     | MR2 | WaitChar | 1 recd EOT (can happen?)| report no files remain  | exit|
  235.     |     |          | 2 recd SUB              | send checksum byte      | MR3 |
  236.     |     |          | 3 recd "u"              |                         | MR0 |
  237.     |     |          | 4 recd char of name     | send ACK                | MR2 |
  238.     |     |          | 5 no char in 1 second   |                         | MR0 |
  239.     |-----+----------+-------------------------+-------------------------+-----|
  240.     | MR3 | WaitOkCk | 1 recd ACK within 1 sec | report recd filename ok | exit|
  241.     |     |          | 2 recd "u" or other char|                         | MR0 |
  242.     `-----+----------+-------------------------+-------------------------+-----'
  243.  
  244. To get rid of the necessity for the Modem7 filename, do the following:
  245.  
  246.     MODEM7 Filename Receiver
  247.  
  248.     .-----+----------+-------------------------+-------------------------+-----.
  249.     |State| State    | Predicate(s)            | Action(s)               | Next|
  250.     |  #  | Name     |                         |                         |  St |
  251.     |-----+----------+-------------------------+-------------------------+-----|
  252.     | MR0 | SendC    | 1 5 tries               | cannot skip, must do it | MR0b|
  253.     |     |          | 2                       | send C  , incr try cnt  | MR0a|
  254.     |-----+----------+-------------------------+-------------------------+-----|
  255.     | MR0a| WaitSkip | 1 SOH or SYN peeked at  | return fname skipped    | exit|
  256.     |     |          | 2 1 second passes       |                         | MR0 |
  257.     |     |          | 3 other char received   | eat character           | MR0 |
  258.     |-----+----------+-------------------------+-------------------------+-----|
  259.     | MR0b| SendNak  | 1 20 tries or 1 minute  | report filename failure | exit|
  260.     |     |          | 2                       | send NAK, incr try cnt  | MR1 |
  261.     |-----+----------+-------------------------+-------------------------+-----|
  262.     | MR1 | WaitAck  | 1 rcd ACK               |                         | MR2 |
  263.     |     |          | 2 rcd EOT               | report no files remain  | exit|
  264.     |     |          | 3 5 secs & no ACK/EOT   |                         | MR0 |
  265.     |-----+----------+-------------------------+-------------------------+-----|
  266.     | MR2 | WaitChar | 1 recd EOT (can happen?)| report no files remain  | exit|
  267.     |     |          | 2 recd SUB              | send checksum byte      | MR3 |
  268.     |     |          | 3 recd "u"              |                         | MR0 |
  269.     |     |          | 4 recd char of name     | send ACK                | MR2 |
  270.     |     |          | 5 no char in 1 second   |                         | MR0 |
  271.     |-----+----------+-------------------------+-------------------------+-----|
  272.     | MR3 | WaitOkCk | 1 recd ACK within 1 sec | report recd filename ok | exit|
  273.     |     |          | 2 recd "u" or other char|                         | MR0 |
  274.     `-----+----------+-------------------------+-------------------------+-----'
  275.  
  276. This allows the filename receiver to notice that he has triggered the other
  277. system into skipping the Modem7 filename stuff.  Once that happens, as in
  278. the Modem7 sender, the filename can be done away with and simple Telink or
  279. SEAlink transfer can commence.  Note that once again, the byte received is
  280. peeked at, so that it can remain in the buffer to start the Telink/SEAlink
  281. transfer.  Returning fname skipped, rather than fname ok signals the other
  282. states not to send an originating NAK (see below):
  283.  
  284.     BATCH File Receiver
  285.  
  286.     .-----+----------+-------------------------+-------------------------+-----.
  287.     |State| State    | Predicate(s)            | Action(s)               | Next|
  288.     |  #  | Name     |                         |                         | St  |
  289.     |-----+----------+-------------------------+-------------------------+-----|
  290.     | BR0*| RecvName |                         | (MODEM7 FName recv MR0) | BR1 |
  291.     |-----+----------+-------------------------+-------------------------+-----|
  292.     | BR1 | CheckFNm | 1 MODEM7 no more files  | report files recd ok    | exit|
  293.     |     |          | 2 MODEM7 Filename ok    | (TeLink recv file XR0)  | BR2 |
  294.     |     |          | 3 MODEM7 Filename skip  | (TeLink recv file XR1)  | BR2 |
  295.     |     |          | 4 MODEM7 Filename bad   | report name recv bad    | exit|
  296.     |-----+----------+-------------------------+-------------------------+-----|
  297.     | BR2 | CheckFile| 1 TeLink recv ok        |                         | BR0 |
  298.     |     |          | 2 TeLink recv bad       | report file recv bad    | exit|
  299.     `-----+----------+-------------------------+-------------------------+-----'
  300.  
  301. Now, the sender must also have a slight adjustment:
  302.  
  303.     BATCH File Sender
  304.  
  305.     .-----+----------+-------------------------+-------------------------+-----.
  306.     |State| State    | Predicate(s)            | Action(s)               | Next|
  307.     |  #  | Name     |                         |                         | St  |
  308.     |-----+----------+-------------------------+-------------------------+-----|
  309.     | BS0*| MoreFiles| 1 more files to send    | (MODEM7 FName send MS0) | BS1 |
  310.     |     |          | 2 no more files to send |                         | BS3 |
  311.     |-----+----------+-------------------------+-------------------------+-----|
  312.     | BS1 | CheckFNm | 1 MODEM7 Filename ok    | (TeLink send file XS0)  | BS2 |
  313.     |     |          | 2 MODEM7 Filename skip  | (Telink send file XS0a) | BS2 |
  314.     |     |          | 3 MODEM7 Filename bad   | report name send bad    | exit|
  315.     |-----+----------+-------------------------+-------------------------+-----|
  316.     | BS2 | CheckFile| 1 TeLink send ok        |                         | BS0 |
  317.     |     |          | 2 TeLink send bad       | report file send bad    | exit|
  318.     |-----+----------+-------------------------+-------------------------+-----|
  319.     | BS3 | EndSend  | 1 rec NAK for next file | send EOT, report send ok| exit|
  320.     |     |          | 2 10 seconds no NAK     | send EOT, report no NAK | exit|
  321.     `-----+----------+-------------------------+-------------------------+-----'
  322.  
  323. Here is the modified Xmodem sender:
  324.  
  325.     XMODEM/TeLink Sender
  326.  
  327.     .-----+----------+-------------------------+-------------------------+-----.
  328.     |State| State    | Predicate(s)            | Action(s)               | Next|
  329.     |  #  | Name     |                         |                         | St  |
  330.     |-----+----------+-------------------------+-------------------------+-----|
  331.     | XS0a| SendTeLnk|                         | send TeLink, incr tries | XS0 |
  332.     |-----+----------+-------------------------+-------------------------+-----|
  333.     | XS0 | WaitTeLnk| 1 over 40-60 seconds    | report sender timeout   | exit|
  334.     |     |          | 2 over 2 tries          | note TeLink block failed| XS1 |
  335.     |     |          | 3 NAK or "C" received   | send TeLink, incr tries | XS0 |
  336.     |     |          | 4 ACK received          | TeLink ok, set crc/cksm | XS2 |
  337.     |-----+----------+-------------------------+-------------------------+-----|
  338.     | XS1 | WaitStart| 1 over 40-60 seconds    | report sender timeout   | exit|
  339.     |     |          | 2 over 20 tries         | report send failed      | exit|
  340.     |     |          | 3 NAK received          | set checksum mode       | XS2 |
  341.     |     |          | 4 "C" recd, I can crc   | set crc mode            | XS2 |
  342.     |     |          | 5 "C" recd, I can't crc |                         | XS1 |
  343.     |-----+----------+-------------------------+-------------------------+-----|
  344.     | XS2 | SendBlock| 1 more data available   | send next data block    | XS3 |
  345.     |     |          |                         |   as checksum or crc    |     |
  346.     |     |          | 2 last block has gone   | send EOT                | XS4 |
  347.     |-----+----------+-------------------------+-------------------------+-----|
  348.     | XS3 | WaitACK  | 1 10 retries or 1 minute| report send failed      | exit|
  349.     |     |          | 2 ACK received          |                         | XS2 |
  350.     |     |          | 3 NAK (or C if 1st blk) | resend last block       | XS3 |
  351.     |-----+----------+-------------------------+-------------------------+-----|
  352.     | XS4 | WaitEnd  | 1 10 retries or 1 minute| report send failed      | exit|
  353.     |     |          | 2 ACK received          | report send successful  | exit|
  354.     |     |          | 3 NAK received          | resend EOT              | XS4 |
  355.     `-----+----------+-------------------------+-------------------------+-----'
  356.  
  357.