📄 ch10.htm
字号:
a process where the client and server module agree on what special functions or capabilities
will be available during the session. After negotiation is complete, the end-user
can begin using the service.</P>
<P>How exactly does a client system initiate a link to a server system? Under the
TCP/IP architecture, connections can be initiated using the IP name of the server
system or IP address of the server system. As explained in the following sections
of this chapter, the IP name and IP address define the network path that leads from
the client system to the server system.
<H2><A NAME="Heading5"></A><FONT COLOR="#000077">TCP/IP Host Name Resolution</FONT></H2>
<P>Every system in a TCP/IP network normally has both an IP name and an IP address.
These two variables work together to enable end-to-end connections between TCP/IP
hosts. Unfortunately, all TCP/IP hosts do not support the same methods and protocols
for assigning IP numbers and translating IP names into IP addresses. In this section
you will see the common methods used to resolve IP names into addresses--in the next
section you will take a closer look at IP addresses.</P>
<P>Before you get into the details of IP names, be aware of a little secret--you
don't really need to use IP names at all in a TCP/IP network. If you know the IP
address for every system you want to contact, you're all set. IP host names are merely
tools that assist your personal analog-based memory. For example, IP names free you
from having to remember that your production system is "192.0.0.1" and
your test system is "192.0.0.2"; instead you can assign them descriptive
names like "prod" and "test" (or cute names like "kirk"
and "spock").
<H3><A NAME="Heading6"></A><FONT COLOR="#000077">Informal and Formal Names</FONT></H3>
<P>If you are operating in the confines of a self-contained network (termed a <I>domain</I>),
you can reference another system using just its system name. On the other hand, if
you function in a large network where multiple domains are interconnected, a system
name must be expanded into an fully qualified IP name that follows the format:</P>
<P><host name>.<domain name>.<type></P>
<P>In this format, <host name> refers to the name of a specific system (for
example, <B>kirk</B> or <B>spock</B>) and <domain name> identifies the name
of the organization, institution, or enterprise network that the system belongs to
(for example, <B>ieee</B>, <B>ibm</B>, or <B>netcom</B>). Domain names can contain
multiple components. For example, <B>as400.ibm</B> and <B>java.sun</B> are both legitimate
domain names.</P>
<P>The final component, <type> classifies the type of business or organization
serviced by the domain. Some of the more common <type> values include:
<UL>
<LI><B>.gov</B>  government body (for example, <B>whitehouse.gov</B>)<BR>
<BR>
<LI><B>.edu</B>  educational institution (for example, <B>msu.edu</B>)<BR>
<BR>
<LI><B>.com</B>  any commercial institution (for example, <B>ibm.com</B>)<BR>
<BR>
<LI><B>.org</B>  organizations/standards bodies (for example, <B>ieee.org</B>)
</UL>
<P>For international access, <type> can be further broken down into multiple
components. For example, <B>co.uk</B> and <B>co.nz</B> refer to institutions in the
United Kingdom and New Zealand respectively.</P>
<P>Again, you often need to use the full IP name when you leave your domain; otherwise,
you can just use the system name. For example, if you want to send something from
<B>kirk.trek.com</B> to <B>spock.trek.com</B>, you can simply use the address <B>spock</B>.
If, however, you want to send from <B>kirk.trek.com</B> to <B>xena.warrior.com</B>,
you typically have to use the fully qualified name (in other words, <B>xena.warrior.com</B>).
In a network environment where you frequently work with multiple local domains you
can, in fact, set up a domain search list to look for a host name in a series of
domains.
<H3><A NAME="Heading7"></A><FONT COLOR="#000077">Making the Address Translation</FONT></H3>
<P>You can invoke all TCP/IP services using either the IP address or IP name of the
target system. For example, you can initiate a <I>File Transfer Protocol (FTP)</I>
session using either of the following two commands:
<UL>
<LI>FTP SPOCK<BR>
<BR>
<LI>FTP 192.0.0.2
</UL>
<P>Assuming that the system named <B>spock</B> has an IP address of <B>192.0.0.2</B>,
both of these commands accomplish exactly the same thing, but the first variation
is certainly easier to remember.</P>
<P>Because the underlying TCP/IP protocols can't do much with the system name, TCP/IP
services such as Telnet, FTP, SMTP, and others invoke a translation process that
converts the host name into its corresponding IP address. This translation occurs
"under the covers," so you never see it happening--you only see the results.</P>
<P>The first step in the translation process is to look up the host name in a <I>host
table</I> file stored on the originating (local) system. This file--normally named
<I>hosts</I>--is manually maintained, and it contains a list of system names and
the corresponding IP addresses for those systems. If the specified host name is present
in the local host table, the process is complete, and the IP address is returned
to the requesting service. That service then initiates activity over the network
using the IP address. If, however, the specified host is not present in the local
host table, the translation process will turn to one or more systems in the network
that have been designated as a <I>name server</I>.</P>
<P>A name server is a system on the network that maintains a database of host names
and their corresponding IP addresses. In a nutshell, a name server provides a way
of centralizing the information contained in various systems' host tables--name servers
were developed to eliminate the need for each system to download a single master
hosts file whenever a network change was made. Any given host name can appear in
both a name server database and in a local host table. However, using both host tables
and name servers creates a reasonable balance between speed and manageability.</P>
<P>On one hand, it is difficult and often unreasonable to try to maintain a current
list of all host names and IP addresses on every system in the network. On the other
hand, retrieving an IP address from a name server takes more time than retrieving
it from a local host table file. By using both approaches, individual system administrators
or users can maintain a short list of frequently accessed host names in the local
host table file so access to those hosts can proceed at best possible speed. The
IP address for less frequently accessed hosts can be retrieved over the network from
a name server.</P>
<P>Finally, note that whenever a system resolves a name into an IP address, it stores
the results in a memory cache. The memory cache is always consulted first for name-to-address
resolution. If an entry isn't in the cache, then the system uses the hosts file and/or
the name server to resolve the name. Memory cache speeds up the process of accessing
the same host over and over again, but the cache is lost whenever a system reboots.
<H2><A NAME="Heading8"></A><FONT COLOR="#000077">Name Servers</FONT></H2>
<P>TCP/IP often provides several different ways of performing the same task. Names
servers are no different. In today's TCP/IP market, you will run into three common
name server implementations:
<UL>
<LI><I>Domain Name Server (DNS).</I> DNS is the most wide-spread implementation of
a name server--for example, DNS is the preferred name server implementation on the
Internet. DNS is a sophisticated implementation that even allows name servers to
contact one another in the event they cannot resolve a name in their own databases.
When most people say <I>name server,</I> they are referring to the DNS implementation.<BR>
<BR>
<LI><I>Network Information Service (NIS)</I> (formerly called yellow pages or yp).
NIS was developed by Sun Microsystems as part of its TCP/IP network architecture.
Although there are plenty of technical differences between DNS and NIS, they can
be viewed as functionally identical (but not interoperable) solutions for the purpose
of this discussion.<BR>
<BR>
<LI><I>Windows Internet Naming Service (WINS).</I> This is a relatively new service
that, despite the name, is not really used for native TCP/IP traffic. WINS is a facility
that allows NetBIOS-based host names to be resolved over TCP/IP. It is an important
component in Microsoft's implementation of native Windows networking services over
TCP/IP.
</UL>
<P>Interestingly enough, these name server implementations are not exclusive of one
another--a system can engage them as needed. For example, if an HP system can't resolve
a name via NIS, it may invoke DNS. Similarly, a Windows 95 or Windows NT system can
use both WINS and DNS to resolve names.</P>
<P>As you can see, IP names play an important role in TCP/IP networking because they
add structure to the network and they allow users to reference systems by easy-to-remember
names. Just remember, all IP names eventually get translated into IP addresses before
action can be taken.
<H2><A NAME="Heading9"></A><FONT COLOR="#000077">IP Address Construction</FONT></H2>
<P>Under the TCP/IP architecture, each system in a network is assigned a four byte
(32 bit) address, termed the <I>IP address.</I> Instead of representing these bytes
as hexadecimal values, however, they are normally represented using the format <B>w.x.y.z</B>,
where w, x, y, and z are replaced with a decimal number between 0 (hex 00) and 255
(hex FF). For example, <B>192.0.0.12</B> is a valid IP address.</P>
<P>This four-byte address is then further broken down into a network address and
a system address. For example, the IP address <B>192.0.0.12</B> identifies system
"12" within network "192.0.0". Similarly, IP address <B>128.10.20.12</B>
identifies system "20.12" within network "128.10". The breakdown
of how many bytes are used for the network portion of the address and how many bytes
apply to the system is predetermined based on the <I>class</I> of the IP address.
There are three real address classes, and they are as follows:
<UL>
<LI><I>Class A.</I> This class follows the format "network.host.host.host,"
with the network byte falling in the range between 0 and 127 (exclusive of 0 and
127), and the host bytes being greater than 0. For example, in the address "64.0.1.12",
"64" identifies the network and "0.1.12" identifies the host
system. In case you're wondering, "0" is not a legal network address and
"127" is used to define a "loopback" address within an IP host
system.<BR>
<BR>
<LI><I>Class B.</I> This class follows the format "network.network.host.host,"
with the first (left-most) network byte falling in the range from 128 to 191 (including
128 and 191), and the host bytes being greater than 0. For example, in the address
"130.101.0.68", "130.101" identifies the network, and "0.68"
identifies the host system.<BR>
<BR>
<LI><I>Class C.</I> This class follows the format "network.network.network.host,"
with the first network byte falling in the range from 192 to 223 (including 192 and
223), and the host bytes being greater than 0. For example, in the address "200.1.1.37",
"200.1.1" identifies the network, and "37" identifies the host
system. Class C is the most common implementation because it provides the greatest
flexibility for creating multiple networks.
</UL>
<BLOCKQUOTE>
<P>
<HR>
<B><font color=#000077>NOTE:</font> </B>There is a fourth type of address--<I>Class D.</I> This virtual
address class is used for multi-cast addresses, which are intended for multiple systems
that possibly reside in different networks. Class D addresses have no network or
host components and addresses begin with a byte that falls in the range of 224 to
239 (including 224 and 239). n
<HR>
</BLOCKQUOTE>
<P>Note that in all classes, you cannot assign "0" or "255" as
host numbers. These numbers are reserved for TCP/IP broadcast messages. As a general
rule, you can select whatever address class makes sense for the composition of your
enterprise-wide network. If you're going to hook up into the Internet, however, you
need to obtain approval for your class assignment and address range through your
local Internet access provider.
<H3><A NAME="Heading10"></A><FONT COLOR="#000077">Assigning IP Addresses</FONT></H3>
<P>Once you've determined and possibly registered the class and range of addresses
you are going to use, you can go about the business of configuring your systems.
All systems can be manually configured to use a specific IP address. Alternatively,
some systems (for example, PCs, Macintoshes, and UNIX systems) can dynamically set
their IP addresses using the services of an <I>address server</I>.
<BLOCKQUOTE>
<P>
<HR>
<B><font color=#000077>NOTE:</font> </B>You <I>must</I> take Internet access into consideration when
you develop your IP address plan. If you are never going to connect your network
to the Internet or if you are only going to connect through a proxy server (which
hides your internal IP addresses), then you can use whatever addresses you desire.
If, however, you are going to connect to the Internet using a conventional gateway
or router, then you must <I>only</I><B> </B>use the IP addresses you registered.
n
<HR>
</BLOCKQUOTE>
<P>Before you set up an IP address server, you must decide on which dynamic address
protocol you can (and want to) use. The three popular choices are the Reverse Address
Resolution Protocol (RARP), the boot protocol (bootp), or the Dynamic Host Configuration
Protocol (DHCP).
<UL>
<LI><I>RARP and boot</I>. These two protocols were developed to handle diskless UNIX
workstations. When a system boots up using RARP or bootp, the system broadcasts its
LAN adapter address, and the address server returns an assigned IP address. In order
to use RARP or bootp, a network administrator must manually create and maintain a
file on an address server that maps specific LAN adapter addresses to specific IP
addresses. Bootp has the added capability of downloading additional configuration
information, such as the addresses of the name servers and gateways.<BR>
<BR>
<LI><I>DHCP </I>. This protocol was developed as an alternative to bootp. Unlike
RARP and bootp, a DHCP address server does not need to be configured with the hardware
address of each and every system it will service. Instead, the DHCP server assigns
IP address from a <I>pool</I> of addresses. Therefore, when a system makes a DHCP
request, it will receive an IP address from the pool that may or may not be the same
IP address it used the last time. Like bootp, DHCP can also download additional configuration
information to the requesting system.
</UL>
<P>Although DHCP was developed as a general purpose TCP/IP protocol, its popularity
and use have soared because Microsoft has adopted DHCP as its preferred methodology
for IP address assignment in Windows 95 and Windows NT TCP/IP networks. Microsoft's
decision has, in turn, convinced a number of PC and Mac network software vendors
to introduce support for DHCP in their client software packages. And with Service
Pack 2 of NT Server 4.0, Microsoft broadened the scope of DHCP by enabling an NT-based
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -