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

📄 tyt10fi.htm

📁 tcpip14study_14天学会TCPIP编程裁减移植_好书啊!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML>

<HEAD>

<TITLE>tyt10fi.htm</TITLE>

<LINK REL="ToC" HREF="index.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/index.htm">

<LINK REL="Index" HREF="tppmsgs/msgs0.htm#3" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/htindex.htm">

<LINK REL="Next" HREF="tyt11fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt11fi.htm">

<LINK REL="Previous" HREF="tyt09fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/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" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt09fi.htm" TARGET="_self"><IMG SRC="blanprev.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/blanprev.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/index.htm" TARGET="_self"><IMG SRC="blantoc.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/blantoc.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="TOC"></A>

<A HREF="tyt11fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt11fi.htm" TARGET="_self"><IMG SRC="blannext.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/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" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/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.INI

SET 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:

⌨️ 快捷键说明

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