home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / protocol / tcpip / ibmpc / 5016 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  3.8 KB

  1. Path: sparky!uunet!aspentec!tto
  2. From: tto@aspentec.com
  3. Newsgroups: comp.protocols.tcp-ip.ibmpc
  4. Subject: TSRs and(was Re: tcp-ip library nonblocking I/O (Berkeley compatible))?
  5. Message-ID: <1992Sep2.130319.862@aspentec.com>
  6. Date: 2 Sep 92 13:03:19 EST
  7. References: <9209011705.AA08725@ftp.com> <Btx5J4.2tD@watserv1.uwaterloo.ca>
  8. Distribution: world
  9. Organization: Aspen Technology, Inc. Cambridge, MA.
  10. Lines: 74
  11.  
  12. In article <Btx5J4.2tD@watserv1.uwaterloo.ca>,
  13. eengelke@steam.uwaterloo.ca (Erick Engelke) writes:
  14.  
  15. >...
  16. > ... Every DOS based TCP implementation has 
  17. > had to deal with the seemingly innumerable problems of fitting everything
  18. > into a TSR and dealing with DOS's memory/file services and the lack
  19. > thereof.  What does that mean?  They cannot allocate buffers on the
  20. > fly, they cannot necessarily do DOS i/o due to the re-entrancy of DOS,
  21. > and mapping tcp/ip i/o directly into the filespace (like unix does) 
  22. > is possible in part, but not fully.
  23.  
  24. How true.
  25.  
  26. > So all the popular TCP systems use a low-level homegrown API to do the
  27. > real communication between user applications and the TCP/IP kernel,
  28. > but they hide this layer underneath a BSD 4.1 or 4.3-ish set of function
  29. > calls.
  30. > Many products only provide the BSD-ish layer for external developers, 
  31. > that encourages them to use only documented facilities and makes the
  32. > product look nice so the TCP author doesn't look like he had to make
  33. > the kludges that are actually so necessary.  
  34. > But in doing so, these products force TSR developers to link in 
  35. > extra bulky functions, and in the case of at least one library, 
  36. > use a malloc(), a definate no-no in tsr development!
  37.  
  38. Yes, many developers have no idea how to do things properly in the DOS
  39. environment, let alone making programs suitable for a TSR.  E.g., Sun's
  40. PC/NFS uses malloc() and DEC's Pathwork TCP/IP (written by 3Com) traps
  41. INT 2F (AX=1122) and promptly undoes itself whenever one issues an
  42. INT 21 (AH=31) to terminate and stay resident!
  43.  
  44. > The solution?  FTP provides their BSD environment (with source which
  45. > maps it to their internal api)  and documents their internal API too.  
  46. > That tries to make everyone happy.  
  47. > Their internal API can be called practically any time.  
  48. > Compeditors systems which only provide the BSD-ish interface 
  49. > can rarely be called during DOS i/o, and sometimes have difficulty
  50. > when called during interrupt calls.  
  51.  
  52. Another nice thing about FTP's PC/TCP package is that it allows an easy
  53. access to the global file descriptors.  With other packages one has
  54. to do more work in order to share a descriptor among several applications.
  55. (By the way, sharing file descriptors is one of the few things that can
  56. be done more easily on DOS than on Unix.)
  57.  
  58. > I've done TSRs with many of the network stacks, using BSD and
  59. > internal APIs.  Here's my advice:
  60. >     If you are developing a non-TSR: stick to the BSD interface,
  61. >     it buys you compatibility.
  62. >     If you are doing a TSR: use the lowest level interface you
  63. >     can find for each vendor's product, and be prepared to do
  64. >     a lot of debugging.  Or hire someone else to do the dirty
  65. >     work... 
  66.  
  67. I have a slightly different opinion on this.  I have also done TSRs
  68. with several of these network stacks myself and I found that the BSD-ish
  69. interface is uniform enough so that I can use the same source code (with
  70. a few #ifdef's) for the high level stuff.  I would, however, watch
  71. very carefully at the backend to make sure that they are not doing anything
  72. unkosher such as allocating DOS memory.
  73.  
  74. Tak.
  75. -----------------------------------------------------------------------------
  76. Tak To                                                    (617) 497-9020 x377
  77. Aspen Technology, Inc                                Fax: (617) 497-7806
  78. 243 Vassar St, Cambridge, Ma 02139.                       tto@aspentec.com
  79. -----------------------------------------------------------------------------
  80.  
  81.