home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / dos_win / winsock / maillist / 94-04.Z / 94-04 / text0036.txt < prev    next >
Encoding:
Text File  |  1994-04-30  |  4.6 KB  |  91 lines

  1. >I have a network packet driver under DOS which is allowing my computer to 
  2. >communicate with my network card. When WinSock runs under Windows it creates 
  3. >a TCP/IP stack which allows programs to communciate via TCP protocol to the 
  4. >packet driver. Is this all WinSock is doing? or is there a bit more to it?
  5. >  
  6. >Also can I get a TCP/IP stack to run under DOS? Would this be a replacement 
  7. >for WinSock if I ran the TCP/IP stack under DOS and used some modified 
  8. >version 
  9. >
  10. >of winpkt.com to allow the virtual machine handling for the DOS stack? Would 
  11. >this allow DOS programs to communicate via TCP/IP if they do not contain 
  12. >heir own stack (NCSA has its own but I want to use something diff.)?
  13.  
  14. Actually, these are valid and common questions.
  15.  
  16. The architecture of the stack supporting a WinSock DLL varies between
  17. different WinSock implementations.  You can understand the differences 
  18. if you first get a good picture of the conceptual model, which looks
  19. like this (the OSI Network Model is the basis of this breakdown, so I
  20. include it for reference):
  21.     
  22.                 WinSock Model                OSI Network Model
  23. OSI layer #
  24.            +-----------------------+    +---------------------------+
  25.       5-7  |   Windows Sockets     |    | Application, Presentation |
  26.            |     Application       |    |     and Session Layers    |
  27.            +-----------------------+    +---------------------------+
  28. WinSock--->+-----------------------+    +---------------------------+
  29.   API      |     WinSock DLL       |    |                           |
  30.            |       +---------------+    |                           |
  31.            |       |+-----++-------+    |                           |
  32.            |       ||     || other |    |                           |
  33.            |       ||     ||  DLL  |    |       Transport and       |
  34.       3-4  +-------+|     |+-------+    |                           |
  35.            +--------+     +--------+    |       Network Layers      |
  36.            |     Virtual Device    |    |                           |
  37.            |      Driver (VxD)     |    |                           |
  38.            |         +-------------+    |                           |
  39.            |         |+------------+    |                           |
  40.            |         || TSR stack  |    |                           |
  41.            +---------++------------+    +---------------------------+
  42. Driver---->+-----------------------+    +---------------------------+
  43.   API      |   Network Interface   |    |                           |
  44.         2  | Drivers (packet driver|    |      Data Link Layer      |
  45.            |    ODI, NDIS, etc     |    |                           |
  46.            +-----------------------+    +---------------------------+
  47.            +-----------------------+    +---------------------------+
  48.         1  | Network Interface Card|    |       Physical Layer      |
  49.            +-----------------------+    +---------------------------+
  50.                       |
  51.                       +--->network
  52.  
  53. Here are some of the different architectures illustrated (NOTE: the
  54. TCP/IP protocol stack provides the equivalent of the OSI network and 
  55. transport layers (layers 3 & 4)):
  56.  
  57.   1) WinSock DLL has a TCP/IP stack built-in.
  58.   2) WinSock DLL maps API to another DLL, that has TCP/IP built-in.
  59.   3) WinSock DLL that maps to VxD that has TCP/IP built-in.
  60.   4) WinSock DLL that maps to another DLL that uses a VxD that has
  61.       the TCP/IP stack built-in.
  62.   5) WinSock DLL that maps to another DLL that uses a VxD, that
  63.       multiplexes to a real-mode "Terminate and Stay Resident" (TSR) 
  64.       stack.
  65.  
  66. The architectures numbered 4 and 5 are the only ones that could
  67. support TCP/IP applications running in a DOS box in Windows.  Of
  68. course, the TCP/IP applications would *NOT* be WinSock applications
  69. since it wouldn't be possible for them to use the DLL.  Only
  70. model 5 could support applications running in DOS itself (i.e. after
  71. you *exit* Windows).
  72.  
  73. You *might* be able to run a DOS application that had a TCP/IP
  74. stack embedded in it in a DOS box.  If you had another TCP/IP
  75. stack already loaded you'd have to use PKTMUX to allow more than
  76. one TCP/IP over a single driver.  Sounds questionable to me.
  77.  
  78. I may be wrong, but the assumption I've made is that all the WinSock
  79. implementations use a Virtual Device Driver (VxD) to interface with
  80. (and multiplex) the real mode TSR stack or Network Interface driver.
  81. There could be some doing direct DPMI, or even using an NDIS 3
  82. protected-mode driver that I don't have illustrated.
  83.  
  84. I welcome any corrections/improvements to this illustration.
  85.  
  86. Regards,
  87. --
  88.  Bob Quinn                                             rcq@ftp.com
  89.  FTP Software, Inc.                                No. Andover, MA
  90.  
  91.