home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / LN2V100.ZIP / TECHNOTE.TXT < prev   
Text File  |  1998-08-26  |  19KB  |  349 lines

  1.  
  2.  
  3.  
  4. ┌───────────────────────────────────────────────────────────────────── ┌┬┐┌┬┬┐┌┐
  5. │░ LNET-II 1.00 TECHNICAL NOTES ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │├┤│├┤│││
  6. └───────────────────────────────────────────────────────────────────── └┴┘└┘└┘└┘
  7.  
  8. ╔════════════════╗ LNET-II is written in Microsoft PDS [Professional Development
  9. ║ PROGRAM SOURCE ║ System] v7.1, a high-powered variant of QuickBASIC.  The ANSI 
  10. ╚════════════════╝ decoder is a heavily modified version of Tom Hanlin's ANSI-
  11. print() routine from the BASWIZ library.  LNET-II's screens were designed in
  12. TheDraw and are displayed using TheDraw's "crunched object" format.
  13.  
  14. The source code is 13,163 lines in fifteen modules occupying 394.1K [not
  15. counting screen objects].  Development was started on 09/27/1996.  Some core
  16. portions, such as the packet pre-scan and item validation algorithms, were
  17. borrowed from the Dead-Fix v2.30 source code.
  18.  
  19. ╔═════════════════════╗ LNET-II is compiled and linked with nine of its fifteen
  20. ║ MEMORY REQUIREMENTS ║ modules in overlays.  While this increases the size of 
  21. ╚═════════════════════╝ the .EXE file, it also significantly reduces the pro-
  22. gram's conventional memory requirements - the basic conventional RAM requirement
  23. is approximately 269K before the program allocates its data space.  If you have
  24. EMS/XMS, the overlays will be loaded into high RAM and called as needed.  If you
  25. have only 640K RAM, or no EMS/XMS driver loaded, overlays will be swapped in and
  26. out of conventional RAM from disk.  Please note, though, that this will slow the
  27. program down somewhat, so EMS/XMS is highly recommended.
  28.  
  29. LNET-II reads header data for only one item at a time, so even the largest
  30. packets can be handled with very little memory overhead.  Items' locations
  31. within the packet are stored in a temporary index file, eliminating the need to
  32. index the entire packet in memory.  By creating an index, LNET-II is able to
  33. perform extremely fast access of individual items in a packet.  This does,
  34. however, require some HD space overhead - 15 bytes per item are used to create
  35. the index.  A packet's index file is deleted when the packet is closed.  Index
  36. files are named *.LN2 [i.e. DEAD.NET -> DEAD.LN2].  These files are written in
  37. the packet's network directory.
  38.  
  39. Occasionally, the text of a message might be too large to display.  The PDS
  40. language limits individual strings to 32767 bytes.  LNET-II will never attempt
  41. to display messages larger than 32767 bytes; however, some processes internal to
  42. LNET-II may overrun the program's allocated string space.  [Unlike C, the PDS
  43. language doesn't have the low-level memory control functions necessary to
  44. dynamically allocate string space, although it can do so for array space.  This
  45. limitation is probably one of the few leftovers from the older versions of MS
  46. BASIC.]  When an item is too large to display, LNET-II recovers from the error
  47. by aborting the text display process.  An error message will indicate that the
  48. item cannot be displayed.
  49.  
  50. When an item's text is being displayed, LNET-II first closes the packet [which
  51. is opened in BINARY mode], reopens it in INPUT mode, counts the number of lines
  52. in the item's text, reads and displays the item one line at a time [using the
  53. BASIC 'LINE INPUT' function], then closes the packet and reopens it in BINARY
  54. mode.  Although this may sound unnecessarily complicated, it actually makes it
  55. easier to handle the item, because it eliminates the need to read the entire
  56.  
  57.  
  58. ───────────────────┤ LNET-II v1.00 Technical Notes - Page 1 ├───────────────────
  59.  
  60.  
  61.  
  62. message into memory as one big block [which can EASILY overrun the available
  63. string space].  Reading one line at a time makes it far less likely that the
  64. program's string space will be overrun, but there still may be cases when an
  65. individual line of text is too long to handle.  This is most likely to happen
  66. when trying to view binary data, such as DE* encrypted items, and when viewing
  67. very long lines of ANSI data.
  68.  
  69. The /LOMEM option reduces LNET-II's memory requirements by causing the program
  70. not to load certain data and by disabling the item text display [which can use
  71. quite a bit of memory on large items].  However, LNET-II may still occasionally
  72. exhibit unusual behavior if the amount of available memory is extremely low.  If
  73. you have limited memory and LNET-II operates improperly even with /LOMEM active,
  74. try to make more memory available, then run the program again.
  75.  
  76. Because the PDS language limits arrays to no more than 32,767 subscripts [indi-
  77. vidual elements of an array's rows or columns], LNET-II cannot handle networks
  78. with more than 32,767 nodes.  However, this is EXTREMELY unlikely to occur at
  79. any time - as we all know, many nets are shrinking in the face of Internet
  80. competition, and those few nets which are growing are not doing so at a rate
  81. which will ever give them this many systems.  LNET-II will recognize node
  82. numbers up to @65535, but it cannot handle more than 32,767 total nodes in a
  83. network.  In the unlikely event that LNET-II needs to handle a network with more
  84. than 32,767 individual nodes, please contact the author [see page 49 of the user
  85. manual LN2V100.DOC] - although it would be somewhat difficult, a patch could
  86. probably be made to allow up to 65,535 nodes in a network.
  87.  
  88. ╔══════════════╗ The largest packet readable by LNET-II is 2,147,483,647 bytes
  89. ║ PACKET SIZES ║ [(2^31)-1].  This is because the PDS language uses SIGNED LONG
  90. ╚══════════════╝ values for file access.  Since the smallest possible single
  91. WWIV network item is 24 bytes - the length of the network header structure -
  92. this packet could contain up to 89,478,485 items.  The largest possible valid
  93. non-deleted item is 24 + 8192 + 32767 bytes [40,983 total], so this packet could
  94. contain no less than 52,399 non-deleted items.  [See LN2V100.DOC for item
  95. validation specifications.]  A single deleted item can occupy the entire length
  96. of a packet, regardless of the packet's size; these items are not subject to the
  97. WWIV 32K limit.
  98.  
  99. ╔══════════════╗ LNET-II is compiled as a DOS real-mode application.  At this
  100. ║ FILE LOCKING ║ time, it has been successfully tested under MS-DOS 6.22,
  101. ╚══════════════╝ Windows 3.11, Windows 95 / MS-DOS 7.00, Novell NetWare Lite,
  102. and OS/2 Warp.  The program includes routines which help make it compatible with
  103. multi-instance BBS systems by locking write access [and, in some cases, read
  104. access] of currently open files.  Locks are released when LNET-II closes files.
  105. The availability of file locking is automatically detected via a call to DOS
  106. interrupt service 2Fh.  The packet currently being read is held open and locked.
  107. The same applies to the packet's temporary index file.  Because of this, the
  108. same packet cannot be opened simultaneously by two instances of LNET-II, and no
  109. other process will be able to read/write the open packet until LNET-II closes it
  110. and releases its locks.
  111.  
  112.  
  113.  
  114.  
  115.  
  116. ───────────────────┤ LNET-II v1.00 Technical Notes - Page 2 ├───────────────────
  117.  
  118.  
  119.  
  120. Files are never held open when they are not needed.  With the exception of the
  121. currently loaded packet and its index file, most files will be open and locked
  122. only for a fraction of a second while they are being read or written.  LNET-II's
  123. file locking is designed to prevent interference with other processes as much as
  124. possible.
  125.  
  126. When running LNET-II under multi-tasking operating systems with their own
  127. internal file locking services, it is not necessary to have SHARE.EXE loaded.
  128. SHARE.EXE is usually not needed if your BBS is being run as a single-node system
  129. under DOS; it is used mostly for DOS-based LAN environments.  [Note: If you use
  130. WWIV's /I# parameter when loading the BBS, and you are NOT in a multi-tasking
  131. environment, you will need to have SHARE.EXE loaded.  WWIV will insist on it.]
  132.  
  133. ╔══════════════════╗ During development and beta testing, one of the testers
  134. ║ THE /NOHI SWITCH ║ reported that his system was locking up immediately after
  135. ╚══════════════════╝ LNET-II had displayed the opening logo.  I examined the
  136. source code for a possible cause, and on a hunch, I added the /NOHI command line
  137. switch to disable all detection and use of high-resolution text modes.  [This
  138. tester had also mentioned something about not being able to use high-resolution
  139. text modes in LNET-II.  He is running Windows 95.]  For some reason, which I am
  140. completely at a loss to explain, the video mode detection process caused the
  141. beta tester's system to lock up after it had displayed the opening logo.  By
  142. disabling the video mode detection process and forcing 25-line displays with the
  143. /NOHI switch, his lockups were eliminated.  Go figure.
  144.  
  145. LNET-II detects high-resolution text modes by attempting to switch the display
  146. into those modes, then checking to see whether an internal error code is gene-
  147. rated.  If there is no error after a mode is tried, LNET-II considers that mode
  148. to be available.  The video mode detection process may cause a very brief period
  149. of visible display blinking just before the opening CMI Software logo is shown
  150. [after the initial loading messages are printed to the DOS screen].  This is a
  151. normal side-effect of switching from one display mode to another; on a VGA
  152. display, up to five different modes may be accessed.
  153.  
  154. See the user manual LN2V100.DOC for further details on the /NOHI switch.
  155.  
  156. ╔═════════════════════════════╗ Systems using Quarterdeck's VIDRAM might not be
  157. ║ RUNNING LNET-II WITH VIDRAM ║ able to use LNET-II's VGA 30-line and 60-line
  158. ╚═════════════════════════════╝ item text displays.  This is because it is
  159. necessary to switch the display into graphics mode to get 30/60-line text, but
  160. VIDRAM takes over the display's graphics memory space to increase EMS/XMS memory
  161. and prevents the screen from switching into graphics modes.  If VIDRAM is being
  162. used, LNET-II probably will not auto-detect the 30 or 60-line modes and will
  163. only allow 25, 43, and/or 50-line text modes.  VIDRAM is most likely to be used
  164. on systems running DESQview.  [LNET-II has not yet been tested under DESQview;
  165. perhaps one of you can do that for me.]
  166.  
  167. ╔═══════════════════╗ LNET-II properly recognizes the full range of possible
  168. ║ HIGH NODE NUMBERS ║ WWIV node numbers, from @1 to @65535.  It has been brought
  169. ╚═══════════════════╝ to my attention that some packet readers do not properly
  170. display node numbers over @32767, probably because they are treating node num-
  171. bers as signed integers.  LNET-II does not have this problem; all node numbers
  172. are treated as UNSIGNED values when they are being displayed.
  173.  
  174. ───────────────────┤ LNET-II v1.00 Technical Notes - Page 3 ├───────────────────
  175.  
  176.  
  177.  
  178. Networks using my 65-region node numbering system might have problems with high
  179. node numbers when using other packet readers or network utilities.  [E-mail me
  180. for details on my node numbering system.  It is currently in use on DigiNet and
  181. will also be used on USLink.]
  182.  
  183. ╔═════════════════════════════╗ Development of LNET-II was assisted by the
  184. ║ WWIV NETWORK TECHNICAL DATA ║ WW4NTECH technical manual for WWIV networking,
  185. ╚═════════════════════════════╝ written by Midnight Tree Bandit.  This file is
  186. widely available; Midnight Tree Bandit's system is The Many Titled Board at
  187. 804-288-8630.  WW4NTECH contains far more detail than is necessary for this
  188. document - I recommend reading WW4NTECH if you really want to get into the nuts-
  189. and-bolts of WWIV networking and packet layout.
  190.  
  191. I would also like to thank Wayne Bell, JAFO, Deltigar, and Oderus Urungus for
  192. supplying other information used in the development of LNET-II.
  193.  
  194. ╔═════════════╗ The LNET-II documentation uses various terms to refer to packets
  195. ║ TERMINOLOGY ║ and their contents.  Basically, they are:
  196. ╚═════════════╝
  197.  
  198. PACKET: A collection of individual messages, or items, formatted into a single
  199. file.  Some packets may be compressed by NETWORK1.EXE, using a subset of the
  200. PKWARE compression library; however, they are not .ZIP files.  [WW4NTECH con-
  201. tains technical data and source code in C for calling PKWARE library functions
  202. in a WWIV packet handler.]  If a packet is compressed, the first item in the
  203. packet will have TOSYS and TOUSER values of 65534 [or -2 if you are reading the
  204. numbers as signed integers].  If the first four bytes of the packet are FE FF FE
  205. FF in hex, the packet is considered to be compressed.  Compressed packets are
  206. usually named Z*.NET.
  207.  
  208. ITEM: A single message within a packet.  This includes the item's HEADER, its
  209. DESTINATION LIST [if any], and its TEXT SEGMENT [if any].  Every item must have
  210. a HEADER.  Destination lists are optional on most items and prohibited on a few
  211. items [such as e-mails].  Some items do not need a text segment.
  212.  
  213. HEADER: 20 bytes of data at the start of every item, indicating what kind of
  214. message it is, where it's from, where it's going, when it was created, how large
  215. it is, and whether it is encrypted.  The header contains the following data:
  216.  
  217.     TOSYS: The destination system of the message.  This will be zero if the item
  218.     has multiple destinations; in this case, the HEADER is immediately followed
  219.     by the DESTINATION LIST [a series of two-byte integer values representing
  220.     node numbers] and the LISTLEN field contains a count of the number of nodes
  221.     which are to receive copies of the message.
  222.  
  223.     TOUSER: The WWIV user number of the person who is to receive the message.
  224.     Generally relevant only for e-mails and SSM's.
  225.  
  226.     FROMSYS: The system which originated the message.  In gated e-mails, this
  227.     will be the number of the node which handled the gating of the mail into the
  228.     current network.
  229.  
  230.  
  231.  
  232. ───────────────────┤ LNET-II v1.00 Technical Notes - Page 4 ├───────────────────
  233.  
  234.  
  235.  
  236.     FROMUSER: The WWIV user number of the person who wrote the message.
  237.     Sometimes this is #0 to indicate a message from the net software - or from
  238.     another utility - to the sysop, or to indicate a type 7 e-mail-by-name.
  239.  
  240.     MAIN TYPE: Each item has a number [currently in the range 1 to 27] indi-
  241.     cating the purpose of the item.   For instance, MAIN TYPE 2 is a standard
  242.     e-mail from one user to another on the current network.  The main type is
  243.     set to 65535 when an item is marked to be deleted from a packet.  See
  244.     LN2V100.DOC for a detailed listing of allocated main and minor types.
  245.  
  246.     MINOR TYPE: Further identifies the purpose of an item.  For instance, MAIN
  247.     TYPE 3 is a post from a sub's host system to its subscribers, and MINOR TYPE
  248.     12345 would indicate that the post belongs to sub type 12345.  Main and
  249.     minor types are often shown together - for instance, 5/10 would be main type
  250.     5, minor type 10.  Minor types are rarely displayed alone.
  251.  
  252.     LISTLEN: Indicates how many nodes, if any, are in the item's DESTINATION
  253.     LIST.  When ListLen is non-zero, ToSys is zero, and vice-versa.  Some items
  254.     cannot have multiple destinations; their ListLen values must be zero.
  255.  
  256.     DATEN: A four-byte value which indicates the date and time of an item's
  257.     origin.  It is calculated in seconds since midnight on 01/01/1970.  The
  258.     daten format originated on UNIX systems.
  259.  
  260.     LENGTH: A four-byte value indicating the size of an item's TEXT SEGMENT.  It
  261.     does not include the size of the DESTINATION LIST.  A deleted item [main
  262.     type 65535] may occupy the entire length of a packet; non-deleted items are
  263.     currently limited per WWIV network specifications to 32,767 bytes of text.
  264.  
  265.     METHOD: Some items are encrypted and/or require a call to an external
  266.     program in order to handle them.  EN*.EXE - where '*' represents the method
  267.     number - is used to encode an item, and DE*.EXE is used to decode it.  For
  268.     instance, an item with method 123 would be encoded by EN123.EXE and decoded
  269.     by DE123.EXE.  All items may be Method<>0; some require Method<>0.  The
  270.     encoder is called by NETWORK1.EXE when an item having Method<>0 is being
  271.     analyzed and prepared to go out from the originating system.  The decoder is
  272.     called by NETWORK2.EXE while the LOCAL.NET packet is being unpacked.
  273.  
  274. DESTINATION LIST: If an item is going to more than one node, the HEADER will be
  275. followed by a series of data - two bytes per node - listing all of the nodes
  276. which are to receive copies of the item.  This is also referred to as "stacking"
  277. an item.  When an item is stacked, TOSYS will be 0 and LISTLEN will indicate the
  278. number of nodes in the destination list.
  279.  
  280. SUBHEADER: Additional data about certain items, used by third-party network
  281. utilities.  These follow the DESTINATION LIST and are seen by the net software
  282. [and by other programs which do not specifically recognize them] as simply the
  283. first 'x' bytes of the TEXT SEGMENT.
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290. ───────────────────┤ LNET-II v1.00 Technical Notes - Page 5 ├───────────────────
  291.  
  292.  
  293.  
  294. TEXT SEGMENT: The actual text of the message itself.  This follows the header,
  295. and is preceded by the DESTINATION LIST if the item is going to more than one
  296. node.  Certain types of items do not need text segments, since all data needed
  297. to process them is in the header.  The type 20/0 SUBS.INF 'ping' is a good
  298. example of this.
  299.  
  300. OPTIONAL LINES: Some messages contain lines which may or may not be shown to the
  301. person reading the message.  These lines will begin with a ^D [ASCII 4] charac-
  302. ter, followed by a digit from 0 to 9.  If the reader's "optional line" setting
  303. is equal to, or less than, the digit in the optional line's prefix, then that
  304. line will be shown to the reader.  [The BBS uses a value of 10 when a user does
  305. not want to see any optional lines; it never displays lines having a prefix of
  306. ^D0.  LNET-II can display all optional lines.]  If the reader has "optional
  307. lines" set to 5, then only those optional lines having prefixes of ^D5 through
  308. ^D9 will be displayed.  The routing stamps added to posts and e-mails [starting
  309. with NET33] have a prefix of ^D0.  Some mail utilities also use the ^D0 prefix
  310. to write a FIDO-style 'TO:' field.  Some editors write user signatures as
  311. optional lines with ^D9 prefixes, and write the BBS tags starting with ^D8 and
  312. working downward.
  313.  
  314. DELETED ITEMS: LNET-II usually regards an item as "deleted" when it originally
  315. had main type 65535 OR when it has been marked for deletion with the ALT+D,
  316. CTRL+D, or ALT+T commands.  When items are marked to be deleted by LNET-II, they
  317. do NOT have their main types changed to 65535; rather, LNET-II simply places a
  318. flag in the packet's index file, indicating that the item is to be deleted when
  319. the packet is rewritten.  The search features consider an item to be deleted
  320. only if it is main type 65535 - items marked for deletion are, technically, not
  321. yet deleted.  Items having main type 65535 cannot be undeleted by LNET-II.
  322.  
  323. NONEXISTENT NODES: LNET-II considers a node to be "nonexistent" when no data for
  324. it is found in the network's BBSDATA.NET file.  It is important to note that
  325. such nodes MIGHT actually exist but that the updates containing their data
  326. simply haven't reached your system yet.  LNET-II can display only the numbers of
  327. nonexistent nodes; it cannot display any BBS details for them.
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348. ───────────────────┤ LNET-II v1.00 Technical Notes - Page 6 ├───────────────────
  349.