VxDTCP - A VxD based TCP/IP Stack for Windows 3.1 - Alpha2 Jagane D Sundar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ****** PLEASE NOTE THE CHANGE OF NAME: ******* What was released as WINTCP alpha1 has been renamed to VxDTCP from alpha 2 onwards. Thanks to fellow-netter Warner Losh(imp@boulder.parcplace.com), I came to know that WIN/TCP is a registered trademark of Wollongong. Confident that mine is the only VxD implementation of TCP, I am calling my stack VxDTCP. So there... ************************************************************* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VxDTCP is a winsock implementation for Windows 3.1. It uses a radically new approach in that the protocol stack is implemented as a VxD and the accompanying winsock.dll simply provides a way for applications to talk to the VxD. In addition the TCP/IP protocol layer is implemented using the industry standard Net/2 Release of UCB. All Aplha and Beta versions are free. The end product will include NFS client support and will be some form of inexpensive shareware. All Alpha, Beta testers will essentially get the software free for life including all real releases. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FEATURES ADDED IN ALPHA 2: - DNS Support. - ODI, packet driver support. (in addition to NDIS support already present) - AsyncSelect message bugs fixed. - Some interrupt handler code pages locked in memory. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% REQUIREMENTS: Following are the requirement to install VxDTCP. 1) ***** YOU MUST BE RUNNING WINDOWS IN 386 Enhanced mode. ***** 2) You must be prepared to configure your network software by hand as BOOTP support is lacking in this release. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FEATURES MISSING: 1) The AsyncGetXbyY routines are not yet done. Blocking versions of the same have been implemented with information taken from local files, except for hostname information, which is obtained using DNS. 2) BOOTP support for configuration is not supported. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PERFORMANCE: The major advantage of implementing the TCP/IP Protocol stack as a VxD is speed. Although I have spent little time tuning the VxD for speed, I can already beat the performance of many commercial vendors. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TESTED APPLICATIONS: Although VxDTCP does not come with any applications I have succesfully tested it with the following packages. WinQVT/v3.8: Telnet and ftp clients work fine. The ftp/rcp servers seem to be a little flaky. Trumpet for Winsock. Works fine. finger31: Works fine. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INSTALLATION PRIMER: If you are familiar with PC Network installation, skip this section and go directly to VXDTCP INSTALLATION. If you are unfamiliar with network installation this section may give you a little more information. It is not comprehensive. INSTALL NOTES: Wintcp installation involves 3 steps. 1) Installing and configuring the MAC layer drivers. MAC layer drivers can be of the following types, - NDIS Drivers. - ODI Drivers. - Packet drivers. 2) Installing the VxDTCP stack. 3) Network configuration using tcpx, the tiny tcp executive provided with VxDTCP. INSTALLING AND CONFIGURING THE MAC Layer DRIVERS: The MAC Layer drivers are the lowest layer of drivers that drive the network card and provide a standard interface for protocol stacks to use. The three predominant standards are ODI, NDIS and packet driver. Support is provided for all three by means of the included dos drivers ODIPKTW.COM, DIS_PKTW.COM and PKTW.COM respectively. YOU NEED TO INSTALL AND CONFIGURE ONLY ONE OF THE THREE TYPES(ODI, NDIS or PACKET Drivers). The card vendor normally provides ODI and NDIS drivers for your card. Packet drivers for your card are available from many ftp sites, courtesy of Russ Nelson. Your choice of ODI, NDIS or packet drivers will probably be influenced by other network software you wish to use(such as Netware or MS Lan Manager). NOTES ON INSTALLING AND CONFIGURING THE ODI DRIVERS: In order to install VxDTCP with ODI drivers you need the following. - lsl.com (included) - odi driver for card (eg. 3c503.com) (provided by card vendor) - odipktw.com (included) You also need ipxodi.com in order to run netware along with VxDTCP. The above drivers can be loaded using autoexec.bat or by hand. Detailed instruction for using ODI drivers are included in the install directions that follow. NOTES ON INSTALLING AND CONFIGURING THE NDIS DRIVERS: In order to do this you need the following files. 1 - Protman.dos: provided with VxDTCP, courtesy Microsoft. 2 - Protman.exe: provided with VxDTCP, courtesy Microsoft. 3 - XXXXXX.dos: NDIS MAC Driver for your ethernet card, usually included in the floppy of drivers that came with your card. If not you can probably get them at your favourite ftp site or BBS.Examples are smcmac.dos for WD80xx cards and ELNKII.DOS for etherlink II cards. I have included these two drivers with the VxDTCP zip file. But you are probably best off getting your NDIS MAC driver from the card vendor. 4 - dis_pktw.dos: A modified version of dis_pkt9.dos for use with VxDTCP. 5 - netbind.exe: provided with winttcp, courtesy Microsoft. Entries need to be made to start protman.dos, XXXXX.dos, and dis_pktw.dos from config.sys and netbind.com from autoexec.bat. NOTES ON INSTALLING AND CONFIGURING PACKET DRIVERS: Packet drivers are usually obtained as collections for various cards from various ftp archives. The ones written by Russ Nelson are the best. At the minimum you need the following files for packet driver configurations. 1) Packet driver for your card. Obtained from the internet or from Compuserve etc. 2) pktw.com (included). Load the packet driver for your card using the instructions that come with your packet driver. Then load pktw.com and tell it the original packet driver interrupt and the new one that pktw.com should use for its own purposes. INSTALLING THE VxDTCP STACK This is done by adding three lines to the windows\system.ini file in the Enh386 section. NETWORK CONFIG USING TCPX - VxDTCP Executive. In order to configure your PC for use in the network you need the following information. This CANNOT BE made up and needs to be obtained from your Internet admin or somebudy knowledgeable. 1) hostname ( unique name assigned by admin in most cases ). 2) IP Address ( Usually of form, 167.28.1.2). 3) Netmask ( Usually like 255.255.0.0 ). 4) Broadcast mask ( Usually like 255.255.0.0 ); 5) Default gateway address. (optional). TCPX is a really stupid little program that makes life a little easier for initial configuration. It lets you enter the above values and stores them in configuration files for VxDTCP to use. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VXDTCP INSTALLATION: You need the following in order to install VXDTCP. 1) hostname. Usually assigned by network admin. 2) IP Address ( Usually of form, 167.28.1.2). 3) Netmask ( Usually like 255.255.0.0 ). 4) Broadcast mask ( Usually like 255.255.0.0 ); 5) Default gateway address. (optional). 6) MAC Layer Driver for your ethernet card. These can be ODI NDIS or packet drivers. Look in notes above for the exact files you need. ************************* IMPORTANT ************************************ If you do not have the MAC driver for your network card, you cannot complete installation of VxDTCP. The MAC drivers for your card have not been included in this package. The MAC drivers can be found in the drivers floppy that came with your network card. It may also be downloaded from from many internet sites if you want it free. Many vendors also have BBS's form where you can download the drivers for free. If you feel like paying money for the same drivers you may download from COMPUSERVE. ************************************************************************* ---------------------------------------------------------------------------- STEP 1: Decide where you want to install VxDTCP. In this document C:\VxDTCP is taken as the directory. If you wish to install elsewhere substitute that directory for C:\VxDTCP in the rest of this document. Create C:\VxDTCP directory. mkdir C:\VxDTCP Unzip VxDTCP.zip into C:\VxDTCP. Use the -d option since the C:\VxDTCP\etc directory must to be created. pkunzip -d VxDTCP.zip ---------------------------------------------------------------------------- STEP 2: If you wish to use NDIS drivers skip to Step 3 If you wish to use packet drivers skip to Step 5 Step 3 is for people who want to use ODI drivers. INSTALLING AND CONFIGURING THE ODI DRIVERS: In order to install VxDTCP with ODI drivers you need the following. - lsl.com (included) - odi driver for card (eg. 3c503.com) (provided by card vendor) - odipktw.com (included) You also need ipxodi.com in order to run netware along with VxDTCP. The above drivers can be loaded using autoexec.bat or by hand. The file net.cfg in the same directory as the drivers is used to configure the drivers. A sample net.cfg with the required configuration parameters is also shown below. Sample Autoexec.bat; --------------------------------- c:\odi\lsl c:\odi\3c503 c:\odi\odipktw 1 96 --------------------------------- Line 1: Loads the lsl driver. net.cfg should be present in the same directory c:\odi in this case. Line 2: 3c503.com is the driver for the network card and came on the drivers floppy that ships with the card. It too gets its parameters from the net.cfg in c:\odi. Line 3: odipktw is a modified version of odipkt that is used by VxDTCP to access the network card. The first parameter is related to configutration info in the net.cfg file. See notes on net.cfg below. The second parameter (96) specified is the int that odipktw uses. It is specified in decimal. It must be the same as the one specified in windows\system.ini using the statement "VXDTCP_INT=60". Note that the number is specified in hex(60) in the system.ini file and in decimal(96) in the autoexec file. (Sorry guys, didnt have the energy to write hex number code in asm.). In addition you may need to use other other drivers such as ipxodi and netx to get netware ipx/spx services using the same network card. Sample net.cfg: --------------------------------- LINK DRIVER 3C503 INT 5 FRAME ETHERNET_802.3 MSB PROTOCOL IPX 0 ETHERNET_802.3 envelope type ETHERNET_II Link support buffers 6 1600 --------------------------------- The paragraph under section LINK DRIVER 3C503 is related to the card. The "Link support" paragraph is related to the odipktw driver and is necessary to run vxdtcp. Once you have set up the ODI drivers and confirmed that they load without any complaints, you can proceed with setting up VxDTCP for windows. Skip directly to the Step 6. ---------------------------------------------------------------------------- STEP 3: If you wish to use packet drivers for you network MAC layer skip to STEP 5 directly. Steps 3 and 4 relate to installing with NDIS layers. If you are already running NDIS drivers for some other reason such as MS Lan Manager, things will be easy. Go directly to STEP 4. If not do the following. **** NOTE USERS OF WFWG *** I have had reports that for Wfwg you need to use the protman.dos, and netbind.com that come with Wfwg and NOT the ones included with this package for this to work. The NDIS drivers need at least three entries in your config.sys and one entry in your autoexec.bat file. Also, the configuration of NDIS is read in from the file protocol.ini (located in c:\VxDTCP in our case). Modifying config.sys: Add the following lines to your config.sys. DEVICE=C:\VxDTCP\PROTMAN.DOS /I:C:\VxDTCP DEVICE=C:\VxDTCP\ELNKII.DOS # Line 1: The protocol manager driver. /I: parameter tells it where to find protocol.ini # Line 2: The NDIS MAC Driver for your card. Replace ELNKII.DOS with the driver for your own card. Create the protocol.ini file in c:\VxDTCP with a text editor. You need entries in this file for at least the network card driver( NDIS MAC Driver for your card) and the dis_pktw.dos hook for VxDTCP. Make the right entries in the c:\VxDTCP\protocol.ini file for your NDIS MAC driver. Shown below is the protocol.ini entry for the ELNKII card as suggested by 3COM. For other card there usually is a sample protocol.ini file somewhere in the drivers floppy which will give you an idea. [EtherLinkII] DRIVERNAME=ELNKII$ INTERRUPT=5 TRANSCEIVER=OnBoard IOADDRESS=0x300 Add the following line to your autoexec.bat. c:\VxDTCP\netbind ---------------------------------------------------------------------------- STEP 4: Add the following lines to your protocol.ini file. [pktdrv] drivername=pktdrv$ # Replace EtherLinkII with the name your network driver. bindings=EtherLinkII # The interrupt vector to use. NOTE THAT THE NEXT HIGHER VECTOR IS ALSO USED. intvec=0x60 chainvec=0x66 Add the following to your config.sys after the entry for protocol.dos and the network card. DEVICE=c:\VxDTCP\dis_pktw.dos Skip directly to STEP 6, and proceed with VxDTCP installation. ---------------------------------------------------------------------------- STEP 5: INSTALLING AND CONFIGURING THE PACKET DRIVERS: Installation of the packet driver can be done in the autoexec.bat file or by hand. The relevant sections of a sample autoexec.bat file are shown below. ----------------------- 3c503 0x60 5 0x300 c:\vxdtcp\pktw 96 98 ----------------------- Line 1 above loads the packet driver at vector 0x60. Line 2 loads the pkt driver hook at vector 98(hex 0x62). Note that pktw takes parameters in decimal. The first parameter(96) to pktw tells it the vector where the packet driver is currently loaded. It should be same number as parameter 1 for the packet driver(0x60) but in decimal instead of hex. The next parameter(98) tells it its own interrupt. PLEASE ENSURE THIS VECTOR IS ALWAYS MORE THAN THE PACKET VECTOR. Note this parameter down for later use in spectifying VXDTCP_INT in the windows\system.ini file. ---------------------------------------------------------------------------- STEP 6: Copy winsock.dll from c:\vxdtcp to your windows directory. If you have winsock.dll from other vedors in your windows directory, you may want to save it elsewhere. ENSURE THAT NO OTHER WINSOCK.DLL FROM ANY OTHER SOURCE IS IN THE PATH BECAUSE THE MOST COMMON PROBLEM SEEMS TO BE OUTDATED/INCORRECT WINSOCK.DLL KICKING IN WHEN ANY APP REQUESTS WINSOCK SERVICES. ---------------------------------------------------------------------------- STEP 7: Add C:\VxDTCP to your path. Reboot so that your drivers get loaded and path is set. If any of the drivers you added complain or if netbind complains that it cannot bind you need help configuring the NDIS drivers. If you are using ODI ensure that the drivers get loaded correctly. ---------------------------------------------------------------------------- STEP 8: Add the following three lines to your \windows\system.ini file in the 386Enh section. device=C:\VxDTCP\VxDTCP.386 VXDTCP=C:\VXDTCP --> If you are installing in a different directory, then specify that directory root. VXDTCP_INT=60 or VXDTCP_INT=62 | |---> NDIS NOTES: | Same as the entry in your protocol.ini file. BUT LEAVE OUT | THE 0x part. Also remember that the next vector is used | as well. Unless you have a really compelling reason, do not | change the vector from 60. I have had problems running it | at very high vector numbers. | | |---> ODI NOTES: | Same number as parameter 2 to oipktw. In above example | odipktw was loaded with "odipktw 1 96". Convert 96 to hex, | and use VXDTCP_INT=60 in the system.ini file. | Do not use 0x60. Use plain 60. | |---> PACKET DRIVER NOTES: | This numberr should be the same as the second parameter | to pktw.com. ie in the example above pktw was loaded | with the following line "pktw 96 98", so you need to use | the second parameter converted to hex, ie | VXDTCP_INT=62. Use plain 62 not 0x62. ---------------------------------------------------------------------------- STEP 8: - Start windows. - Run c:\VxDTCP\tcpx either from file manager, run menu or create an icon in you favourite group and click on the icon. - Use the Setup... menu item to setup the local host information you have( hostname, IP Address, Netmask, Broadcast mask and default router(optional). ) You will be warned that you need to REBOOT windows in order for your configuration information to be activated. But before rebooting you may add host entries in your local hosts file. - Setup DNS: In order to use VxDTCP with DNS, you need to fill in the domain name and the address of your nearest DNS servers. If you are not using DNS, then simply configure the local hosts file as explained below and proceed. - Using the Setup... item in the main menu and add host information to add the names of hosts that you are planning to use. If DNS was configured then DNS is consulted first, then hosts file. If DNS is not configured, then hosts file alone is used. ----------------------------- NOTE --------------------------------- The local hosts file resides in /VxDTCP/etc and is of the same format as the unix /etc/hosts file. You may setup minimal hosts using tcpx. Then ftp into your unix server and get the /etc/hosts file. concat the /VxDTCP/etc/hosts file and the hosts file you just downloaded to form the new /VxDTCP/etc/hosts file. If your network uses NIS(YP) then telnet into the server and do "ypcat hosts > hosts" and download and concat this file into your VxDTCP/etc/hosts file. --------------------------------------------------------------------- - Quit tcpx. - EXIT AND RESTART WINDOWS. - Your winsock tcp software is now ready. TCPX Need not be running for you application to get winsock services. However DNS service is provided by the TCPX application. Hence if you have DNS configured YOU MUST have TCPX running all the time to get DNS service. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% APPENDIX A FILE FORMATS The following files are used by VxDTCP for its configuration info. They are all in the VxDTCP/etc directory and closely resemble corresponding unix system files. In general you may modify any of these files using a text editor, but you will probably have to restart windows for any changes to take effect. /VxDTCP/etc/hostname.e0: Configuration information for ethernet0, the first ethernet card in the system. Multiple interface support will soon be added. Contains three lines exactly. First line contains hostname, second line contains IP Address and third line contains the netmask. NO COMMENTS ALLOWED IN THIS FILE.It is parsed by a stupid parser in the VxD. Comments in this file are a luxury I cannot afford. Example file contains: calvin 167.28.1.2 255.255.0.0 /VxDTCP/etc/services: Standard BSD /etc/services file with service port number entries. VxDTCP comes with the BSD standard services default file. To add entries you need to get the format from some unix system. /VxDTCP/etc/hosts Standard BSD /etc/hosts file. Comments are allowed. You can obtain hosts file from your local unix box and concat it to /VxDTCP/etc/host. /VxDTCP/etc/route: Standard gateway information file. Unix style. Refer to your unix box documentation for info on /etc/gateways. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% APPENDIX B COPYRIGHTS VXDTCP includes several components built from publicly available sources primarily from the BSD Net/2 release. The following Copyrights are relevant. /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp.h 7.7 (Berkeley) 6/28/90 */ The dis_pktw.dos driver is a modified version of the ndis shim and its copyright notice is included below. ; DIS_PKT.ASM - Adapter provides Packet Driver v1.09 interface over NDIS. ; Version 1.07 18 May 1991 by Joe R. Doupnik, Utah State Univ. ; Version 1.08 9 Aug 1991 by Dan Lanciani, ddl@harvard.harvard.edu ; Version 1.09 3 Nov 1991 by Joe R. Doupnik, Utah State Univ. ; Copyright (C) 1988 - 1991 FTP Software, Inc. ; ; This unmodified source file and it's executable form may be used and ; redistributed freely. The source may be modified, and the source or ; executable versions built from the modified source may be used and ; redistributed, provided that this notice and the copyright displayed by ; the exectuable remain intact, and provided that the executable displays ; an additional message indicating that it has been modified, and by whom. ; ; FTP Software Inc. releases this software "as is", with no express or ; implied warranty, including, but not limited to, the implied warranties ; of merchantability and fitness for a particular purpose. ; ; USE AT YOUR OWN RISK. ; The odipktw driver is a modified version of ODIPKT shim and its copyright is included below. ; ODIPKT.ASM - Adapter provides Packet Driver interface over ODI ; ; (c) Copyright Daniel D. Lanciani 1991-1993. All rights reserved. ; ; This unmodified source file and its executable form may be used and ; redistributed freely. The source may be modified, and the source or ; executable versions built from the modified source may be used and ; redistributed, provided that this notice and the copyright displayed by ; the exectuable remain intact, and provided that the executable displays ; an additional message indicating that it has been modified, and by whom. ; ; Daniel D. Lanciani releases this software "as is", with no express or ; implied warranty, including, but not limited to, the implied warranties ; of merchantability and fitness for a particular purpose. ; ; Please send bug reports to ddl@harvard.harvard.edu or ; ; Dan Lanciani ; 185 Atlantic Road ; Gloucester, MA 01930