⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tyt10fi.htm

📁 一个学习tcp/ip协议的教程
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML><HEAD><TITLE>tyt10fi.htm</TITLE><LINK REL=ToC HREF=index-1.htm><LINK REL=Index HREF=tppmsgs/msgs0.htm#37><LINK REL=Next HREF=tyt11fi.htm><LINK REL=Previous HREF=tyt09fi.htm></HEAD><BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#0000FF VLINK=#800080><A ID=I0 NAME=I0></A><P><P ALIGN=CENTER><A HREF=tyt09fi.htm TARGET=_self><IMG SRC=blanprev.gif WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Previous Page"></A><A HREF=index-1.htm TARGET=_self><IMG SRC=blantoc.gif WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT=TOC></A><A HREF=tyt11fi.htm TARGET=_self><IMG SRC=blannext.gif WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Next Page"></A><HR ALIGN=CENTER><P><UL><UL><UL><LI><A HREF=#E68E97>DOS-Based TCP/IP: ftp Software's PC/TCP</A></LI><UL><LI><A HREF=#E69E132>Installing PC/TCP</A></LI><UL><LI><A HREF=#E70E34>The AUTOEXEC.BAT File</A></LI><LI><A HREF=#E70E35>The CONFIG.SYS File</A></LI><LI><A HREF=#E70E36>The PROTOCOL.INI File</A></LI><LI><A HREF=#E70E37>The PCTCP.INI File</A></LI><LI><A HREF=#E70E38>The Windows SYSTEM.INI File</A></LI></UL><LI><A HREF=#E69E133>Windows for Workgroups using NetBIOS</A></LI><LI><A HREF=#E69E134>Testing PC/TCP</A></LI></UL><LI><A HREF=#E68E98>Windows-Based TCP/IP: NetManage's Chameleon</A></LI><UL><LI><A HREF=#E69E135>Installing Chameleon</A></LI><UL><LI><A HREF=#E70E39>The AUTOEXEC.BAT File</A></LI><LI><A HREF=#E70E40>The CONFIG.SYS File</A></LI><LI><A HREF=#E70E41>The SYSTEM.INI File</A></LI><LI><A HREF=#E70E42>The PROTOCOL.INI File</A></LI></UL><LI><A HREF=#E69E136>Configuring Chameleon</A></LI><LI><A HREF=#E69E137>Testing Chameleon</A></LI></UL><LI><A HREF=#E68E99>Configuring Windows 95 for TCP/IP</A></LI><UL><LI><A HREF=#E69E138>Installing TCP/IP</A></LI><LI><A HREF=#E69E139>Further TCP/IP Configuration</A></LI><LI><A HREF=#E69E140>Testing TCP/IP</A></LI></UL><LI><A HREF=#E68E100>Winsock</A></LI><UL><LI><A HREF=#E69E141>Trumpet Winsock</A></LI><LI><A HREF=#E69E142>Installing Trumpet Winsock</A></LI><LI><A HREF=#E69E143>Configuring the TCP/IP Packet Driver</A></LI></UL><LI><A HREF=#E68E101>Summary</A></LI></UL></UL></UL><HR ALIGN=CENTER><A ID=E66E10 NAME=E66E10></A><H1 ALIGN=CENTER><CENTER><FONT SIZE=6 COLOR=#FF0000><B>&#151; 10 &#151;</B><BR><B>Setting Up a Sample TCP/IP Network: DOS and Windows Clients</B></FONT></CENTER></H1><BR><P>Yesterday, you configured the servers on the sample network. All three UNIX servers followed the same procedure and had similar configuration files. The Windows NT server was configured using the built-in TCP/IP stack. Today you configure some clients for the network. The clients communicate with the server through a TCP/IP stack loaded on each machine. You configure three clients: one DOS, one Windows 3.<I>x</I>, and one Windows 95. Any of the operating systems you configured yesterday as servers can also act as clients on the sample network.<BR><P>Windows 95 includes TCP/IP client software as part of the distribution software package, but it is not configured when Windows 95 is installed. This is because Windows 95 installs NetWare's IPX/SPX network protocols as the default. Today you see how to change the default protocol to TCP/IP. For the DOS and Windows 3.<I>x</I> machines, several products are available to offer TCP/IP protocols. I have selected two of the most popular packages to configure on these systems. The DOS machine is configured using ftp Software's PC/TCP software product. The Windows 3.<I>x</I> machine, running Microsoft Windows for Workgroups 3.11, is configured with NetManage's ChameleonNFS.<BR><P>Configuring DOS and Windows machines is different than configuring UNIX systems because of the changes in filesystems, operating system architecture, and the individual software vendor's approaches. However, the same basic information is required, and the steps to add DOS machines are analogous to those for a UNIX system.<BR><P>Although today I use two specific commercial packages for the DOS and Windows 3.11 machines, the process is similar to other vendors' TCP/IP products. The names of files and the exact configuration information might differ, but the same general principles apply.<BR><BR><A ID=E68E97 NAME=E68E97></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR=#FF0000><B>DOS-Based TCP/IP: ftp Software's PC/TCP</B></FONT></CENTER></H3><BR><P>PC/TCP from ftp Software has been available for several years and has become a de facto standard for DOS machines that want to connect with a TCP/IP network. PC/TCP runs under both DOS and Windows. It lets a user perform all the TCP/IP functions, such as ftp and telnet, and includes software for several members of the TCP family of protocols, including SNMP. Other machines can also access a PC running PC/TCP, copying its files (assuming access has been granted). Bear in mind that we are configuring this machine as a DOS platform only, even though PC/TCP offers some Windows icons. The machine might be an older device that doesn't support Windows, for example, or the user might not want to install Windows 3.X on this machine. Some DOS-based applications might not work with a Windows-based TCP/IP stack&#151;hence the need for a DOS-only TCP/IP configuration.<BR><P>PC/TCP can run TCP/IP as the sole network protocol on the PC, or it can piggy-back on top of other networks, such as Windows for Workgroups (NetBEUI and NetBIOS) or Novell NetWare (IPX/SPX). Your system administrator can decide the best configuration for your machine, depending on the nature of the network. For example, if a large Windows for Workgroups network already exists but a user wants access to a TCP/IP UNIX server, it might not make sense to convert the entire network to TCP/IP. In that case, either a second network card can be added specifically for the TCP/IP network or TCP/IP can coexist with the Windows for Workgroups system. (Remember that TCP/IP isn't particular about the network transport type.)<BR><P>The sample network you are configuring is TCP/IP-based, so PC/TCP is installed to run on that network protocol only. However, because it would be useful to be able to run Windows for Workgroups over the network between the DOS and Windows 3.11 machines, the installation process you take is designed so that both NetBEUI and TCP/IP can reside simultaneously on the network.<BR><P>One approach is to set the PC/TCP system to enable Windows for Workgroups and TCP/IP packets on the same network. With this approach, TCP/IP sends out IP packets, and Windows for Workgroups sends out NetBEUI packets (the default type). Both protocols use NDIS (Network Device Interface Specification) device drivers to communicate with the network card. The problem with this approach is that other machines receiving the packets might get confused because of two different packet types, and the system does not work well if an external network is to be accessed (such as the Internet), because routers do not handle NetBEUI packets.<BR><P>The alternative approach is to configure Windows for Workgroups to encapsulate its message within IP packets, which can then be sent across the internetwork and the local network between TCP/IP machines with no problems. This approach has a couple of useful advantages. The network is completely IP-based, so routers can handle the traffic through internetworks. Also, a Windows for Workgroups computer on another network can communicate through the router, hence making the Windows for Workgroups services more widely available. A receiving Windows for Workgroups machine has to extract the information from the IP packet, but otherwise the system works well.<BR><P>The sample network you are installing is configured to enable both PC/TCP and Windows for Workgroups to coexist using NDIS drivers. This results in two software stacks&#151;one for PC/TCP and one for Windows for Workgroups&#151;coexisting and communicating with the NDIS driver. This structure is shown in Figure 10.1. This is probably not the best choice for the sample network, because all the other machines on the network prefer TCP/IP packet formats, but this approach shows how PC/TCP can be configured for dual protocols on other networks.<BR><P><B><A HREF=10tyt01.gif>Figure 10.1. PC/TCP and Windows for Workgroups </B><B>stacks using NDIS.</A></B><BR><P>PC/TCP uses a kernel that is loaded into memory when DOS boots. The kernel is a Terminate and Stay Resident (TSR) program. To ensure that the network is available at all times, the kernel load command is usually added to the AUTOEXEC.BAT file. The sample network uses a kernel called ETHDRV.EXE, which is the Ethernet driver supplied with PC/TCP. (A different kernel must be used if the network is IEEE 802.3 Ethernet, which differs from the normal DIX Ethernet.) In addition, an NDIS Converter must be loaded in the AUTOEXEC.BAT file as a device driver to provide NDIS-format packets to the protocol manager.<BR><BR><A ID=E69E132 NAME=E69E132></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>Installing PC/TCP</B></FONT></CENTER></H4><BR><P>PC/TCP includes an automated installation procedure that copies the distribution media to the hard disk and sets up some of the configuration files. Today, most of the system is configured manually to show the necessary steps, and to enable you to verify the changes made to system files by the installation program. In practice, you would allow PC/TCP to install itself and perform the configuration automatically, then check the files for proper content.<BR><P>Installation of PC/TCP requires the same basic information as TCP/IP under UNIX: the device driver, the system's name and IP address, and the names and IP addresses of other systems to be accessed. The process begins with a properly installed network card. The IRQ and memory address of the card must be known, and a device driver for it must be present for inclusion in the CONFIG.SYS file. Device drivers are usually supplied by the network card vendor, but generic drivers are also included with the PC/TCP software disks. They include drivers for the most popular types of network systems but might not include all possible cards.<BR><P>After copying all the distribution files to the hard drive, the configuration can begin. The sample machine is running DOS 6.22 and Windows for Workgroups 3.11, although you are configuring the DOS operating system in particular in this section. Changes in the DOS software release number might affect the following details, but the PC/TCP installation instructions are updated for new releases. When installing PC/TCP with Windows for Workgroups, the Windows network must be installed, configured, and running properly before PC/TCP modifies the Windows files to enable both DOS and Windows to work over the network.<BR><P>During the installation process, PC/TCP requires a lengthy serial number and authentication key. These verify the software and prevent a network from using many copies of the same software when only one license has been purchased.<BR><P>Four files are involved in the initial configuration:<BR><UL><LI>AUTOEXEC.BAT: Starts the PC/TCP kernel<BR></LI><BR><LI>CONFIG.SYS: Starts the device drivers for the network and PC/TCP<BR></LI><BR><LI>PROTOCOL.INI: Defines the type of network and drivers<BR></LI><BR><LI>PCTCP.INI: Kernel parameters for PC/TCP<BR></LI><BR></UL><P>In yesterday's material, UNIX kernel parameter configuration was mentioned in passing as a way to fine-tune the behavior of the operating system with TCP/IP. In some cases, this is necessary with the DOS PC/TCP system, as well. A utility program called KAPPCONF enables the kernel parameters to be altered. The settings for the kernel are saved in a configuration file called PCTCP.INI.<BR><BR><A ID=E70E34 NAME=E70E34></A><H5 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>The AUTOEXEC.BAT File</B></FONT></CENTER></H5><BR><P>The AUTOEXEC.BAT file requires environment variables to be properly set for PC/TCP and two instructions added to the file. One instruction starts the network and the other loads the Ethernet driver. The sample machine already had Windows for Workgroups installed, so a line in the AUTOEXEC.BAT file reads<BR><BR><PRE><FONT COLOR=#000080>C:\WINDOWS\NET START</FONT></PRE><P>This line starts the network. The NET START command can remain in place or be replaced with a PC/TCP command called NETBIND, which accomplishes the same thing for NDIS drivers. If both commands are in the AUTOEXEC.BAT file, an error message results when the second network startup command is executed. (The drive assignments for all the examples today might be different on other systems, as might the installation directories. Installation defaults were used throughout this chapter for both PC/TCP and Windows for Workgroups. Change their values as needed to match your system.)<BR><P>After the NET START or NETBIND command, the following line must be added to the AUTOEXEC.BAT file:<BR><BR><PRE><FONT COLOR=#000080>C:\PCTCP\ETHDRV</FONT></PRE><P>This starts the PC/TCP Ethernet driver. If another network system is being used, this would be replaced with the device driver for that network (such as IEEEDRV for IEEE 802.3 Ethernet or SLPDRV for SLIP).<BR><P>It is useful to define two environment variables in the AUTOEXEC.BAT file for the PC/TCP software to use when searching for file. One is a simple addition to the PATH command, adding the PCTCP installation directory to the search path. The second is an environment variable that points to the PCTCP.INI file. The two declarations look like this:<BR><PRE><FONT COLOR=#000080>SET PCTCP=C:\PCTCP\PCTCP.INISET PATH=C:\PCTCP;%PATH%</FONT></PRE><P>The latter change to the PATH command adds C:\PCTCP to an already defined PATH. An alternative would be to edit the PATH command to include the directory on the same line as the rest of the declaration. The PC/TCP software can be run without these environment variables defined, but problems with file locations can result if commands are not executed from the installation directory.<BR><P>Therefore, on the DOS machine, the completed AUTOEXEC.BAT file should have one of the following four-line combinations in it:<BR><PRE><FONT COLOR=#000080>SET PCTCP=C:\PCTCP\PCTCP.INISET PATH=C:\PCTCP;%PATH%C:\WINDOWS\NET STARTC:\PCTCP\ETHDRV</FONT></PRE><P>or<BR><PRE><FONT COLOR=#000080>SET PCTCP=C:\PCTCP\PCTCP.INISET PATH=C:\PCTCP;%PATH%C:\PCTCP\NETBINDC:\PCTCP\ETHDRV</FONT></PRE><P>When these lines are executed during the system boot process, the system displays status messages when each command is completed. The NETBIND command displays this message if it loads successfully:<BR><PRE><FONT COLOR=#000080>MS-DOS LAN Manager v2.1 NetbindMicrosoft Netbind version 2.1</FONT></PRE><P>A third line might display a status message about the interrupt vector used by the system. If NETBIND couldn't load correctly, it generates a message like this:<BR><PRE><FONT COLOR=#000080>MS-DOS LAN Manager v2.1 NetbindError: Making PROTMAN IOCTL call.</FONT></PRE><P>This usually is generated when the network is already running (such as from issuing a NET START command before the NETBIND command; you might recall that only one of these two should be in the AUTOEXEC.BAT file).<BR><P>The ETHDRV command displays a message with status information when it loads successfully. It looks like this:<BR><PRE><FONT COLOR=#000080>MAC/DIS converterFTP Software PC/TCP Resident Module 2.31   01/07/94 12:38Copyright  1986-1993 by FTP Software, Inc.  All rights reserved.Patch level 17637Patch time: Fri Jan 07 14:25:09 1994Kernel interrupt vector is 0x61Code Segment occupies 49.0K of conventional memoryData Segment occupies 19.5K of conventional memoryPacket Driver found at vector 0x60        name:        version: 30, class: 1, type: 57, functionality: 6ifcust (PC/TCP Class 1 packet driver - DIX Ethernet) initialized5 free packets of length 1514, 5 free packets of length 160The Resident Module occupies 68.7K of conventional memory</FONT></PRE><P>If there is an error when the ETHDRV program loads, it generates an error message (of varying utility for debugging purposes). A sample error is shown here:<BR><PRE><FONT COLOR=#000080>FTP Software PC/TCP Resident Module 2.31    01/07/94 12:38Copyright  1986-1993 by FTP Software, Inc.  All rights reserved.Patch level 17637Patch time: Fri Jan 07 14:25:09 1994PC/TCP is already loaded (interrupt 0x61). Use 'inet unload' to unload it.</FONT></PRE><P>This error occurred because a PC/TCP driver had been loaded prior to the ETHDRV command.<BR><P>Some DOS users like to leave these commands out of the AUTOEXEC.BAT file and issue them manually. This has the advantage of reducing the amount of memory chewed up when the machine boots and the network is not required. A useful compromise is to create a small batch file that has these two commands and then run the batch file only if the network is used. Both NETBIND and ETHDRV do not seem to be critical as far as when they are loaded in the startup sequence (as opposed to some software that insists on being loaded first or last in the AUTOEXEC.BAT file).<BR><BR><A ID=E70E35 NAME=E70E35></A><H5 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>The CONFIG.SYS File</B></FONT></CENTER></H5><BR><P>The CONFIG.SYS file has to have drivers loaded for the protocol manager, the NDIS packet converter, and the network card driver. Systems running Windows for Workgroups might require additional drivers. The CONFIG.SYS file must have an entry setting the number of files open at one time to at least 20. If this doesn't exist, PC/TCP crashes. Add this line:<BR><BR><PRE><FONT COLOR=#000080>FILES=20</FONT></PRE><P>to the CONFIG.SYS file. Depending on the amount of memory available, the number could be readily increased. With 8MB RAM or more, a value of 40 is satisfactory. Numbers above this setting tend to be counter-productive because RAM is wasted for no reason.<BR><P>The protocol manager is supplied as part of Windows for Workgroups, and one is included with the PC/TCP software package. The choice of which to use is yours or your system administrator's. If Windows for Workgroups 3.1 (not 3.11) was already loaded and functional, CONFIG.SYS has a line similar to this:<BR><BR><PRE><FONT COLOR=#000080>DEVICE=C:\WINDOWS\PROTMAN.DOS /I:C:\WINDOWS</FONT></PRE><P>The protocol manager is not always used with the Windows for Workgroups 3.11 release because it is included with other drivers within the CONFIG.SYS file (such as IFSHLP.SYS). If there is no protocol manager started at boot time, one should be added from the PC/TCP software. The entry within the CONFIG.SYS file is<BR><BR><PRE><FONT COLOR=#000080>DEVICE=C:\PCTCP\PROTMAN.DOS \I:C:\PCTCP</FONT></PRE><P>This loads the PC/TCP protocol manager. The \I at the end of the command tells the driver where to look for files (in this case, the PC/TCP installation directory).<BR><P>A network card driver should appear next in CONFIG.SYS. This differs for each network card, but for the sample network DOS machine's Intel EtherExpress 16 network card, the line is<BR><BR><PRE><FONT COLOR=#000080>DEVICE=C:\WINDOWS\EXP16.DOS</FONT></PRE><P>This loads the EXP16 driver for the Intel network card. This was included with the Windows for Workgroups software, but it is also available as a generic driver. Some machines with Windows for Workgroups already installed might have this command already in the CONFIG.SYS file.<BR><P>The final step is to load the PC/TCP NDIS Packet Converter. The current release of PC/TCP uses a packet converter called DIS_PKT.GUP. The line looks like this:<BR><BR><PRE><FONT COLOR=#000080>DEVICE=C:\PCTCP\DIS_PKT.GUP</FONT></PRE><P>Some systems running Windows for Workgroups 3.1 (and a few that have upgraded to 3.11) have the line<BR><BR><PRE><FONT COLOR=#000080>DEVICE=C:\WINDOWS\WORKGRP.SYS</FONT></PRE><P>in the CONFIG.SYS file. This is for Windows for Workgroups' use and is not necessary if PC/TCP is to be used as a DOS-based system only. If the file was not installed by Windows for Workgroups and the system works properly without it, there is no need to add it.<BR><P>When the system boots, the device drivers are loaded in turn. Each displays a short message showing its version number. Any errors that occur are also displayed. Usually the device drivers don't cause any problems.<BR><P>The properly configured CONFIG.SYS file for the DOS machine should have these lines in it<BR><PRE><FONT COLOR=#000080>DEVICE=C:\WINDOWS\PROTMAN.DOS /I:\C:\WINDOWSDEVICE=C:\WINDOWS\EXP16.DOSDEVICE=C:\PCTCP\DIS_PKT.GUP</FONT></PRE><P>if it is using the Windows for Workgroups protocol manager. It should have the following lines if it is using the PC/TCP protocol manager:<BR><PRE><FONT COLOR=#000080>DEVICE=C:\PCTCP\PROTMAN.DOS /I:\C:\PCTCPDEVICE=C:\WINDOWS\EXP16.DOSDEVICE=C:\PCTCP\DIS_PKT.GUP</FONT></PRE><P>As noted earlier, the network interface driver (EXP16) is different if your machine does not use the Intel EtherExpress 16 board.<BR><P>The position of these lines within the CONFIG.SYS file isn't critical, although there might be problems if they are loaded into high memory with other drivers. Experimentation is the only way to find the most memory-efficient sequence.<BR><BR><A ID=E70E36 NAME=E70E36></A><H5 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>The PROTOCOL.INI File</B></FONT></CENTER></H5><BR><P>Windows for Workgroups has a PROTOCOL.INI file as part of its setup. The file tells the system about the network cards and drivers in use. The PC/TCP PROTOCOL.INI file does the same, but it resides in the PCTCP directory.<BR><P>The contents of the PROTOCOL.INI file are different for each network card and driver configuration. There must be a section labeled [PKTDRV] (all in uppercase) that defines the driver name, the binding to the network card, and any configuration information needed. The sample network's PROTOCOL.INI file looks like this:<BR><PRE><FONT COLOR=#000080>[PKTDRV]drivername=PKTDRV$bindings=MS$EE16intvec=0x60[MS$EE16]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -