unx37.htm
来自「Unix Unleashed, Third Edition is written」· HTM 代码 · 共 2,306 行 · 第 1/5 页
HTM
2,306 行
<CENTER><A ID="I22" NAME="I22">
<FONT SIZE=3><B>Segmenting the Network</B>
<BR></FONT></A></CENTER></H4>
<P>Depending on how you plan to use the network, UNIX systems can place much more traffic on a network than can a comparable number of PCs or Macs. If you intend to share disk resources across the network using NFS, UNIX can saturate a network very
quickly.
<BR></P>
<P>In designing a UNIX network, you need to keep in mind the following goals:
<BR></P>
<UL>
<LI>Diskless and dataless clients should be on the same segment as their servers.
<BR>
<BR></LI>
<LI>File servers can be on the same segment, or if they serve multiple segments, on a backbone segment.
<BR>
<BR></LI>
<LI>Don't overload any segment. Depending on the amount of file sharing, 12 to 24 nodes per segment should be considered full.
<BR>
<BR></LI>
<LI>Place servers for broadcast services, such as RARP and BOOTP, on each segment and do not transmit broadcasts between segments.
<BR>
<BR></LI>
<LI>Use bridging routers or routers to connect the segments to the backbone.
<BR>
<BR></LI></UL>
<P>Although each segment as well as the backbone needs its own network address, you do not need to use a Class C address for each network. With only 24 nodes per network being considered full load, using 5 bits for the node address will allow 30 nodes.
This give 3 bits for subnetting, allowing 6 networks to share the same Class C address.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP: </B>If you use a hierarchy of networks for routing purposes, and you split a Class C network as described, place the 0 net (the one with the 3 bits, 001) on the backbone, and then place the others on
segments below the backbone. This will allow other nets that are outside the backbone to route using the 24-bit netmask to the backbone and let it use a 27-bit netmask to route to the segments connected to it. In the external gateway, the netmask for the
190.109.252 net, which is used to reach all 8 subnets, is 255.255.255.0, or 24 bits. However, each router would be using a 27-bit netmask of 255.255.255.224 to reach the other subnets, and a default route of the address of the external gateway,
190.109.252.33. Hosts on each of the subnets would use a 27-bit netmask and a default route of the router on their network (in the case of 190.109.252.64 net, the default route would be 190.109.252.65).
<BR></NOTE>
<HR ALIGN=CENTER>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="caution.gif" WIDTH = 37 HEIGHT = 35><B>CAUTION: </B>Be careful. Not all software supports non—byte-aligned netmasks. While all UNIX systems do, many PCs and Macs do not follow the specifications for TCP/IP and allow for non—byte-aligned
netmasks.
<BR></NOTE>
<HR ALIGN=CENTER>
<H4 ALIGN="CENTER">
<CENTER><A ID="I23" NAME="I23">
<FONT SIZE=3><B>Draw a Map</B>
<BR></FONT></A></CENTER></H4>
<P>It really helps when planning a network to draw a logical connection map such as the one in Figure 37.4. This map does not show the geography of the net, but it does show its logical topology. Note how I listed the node addresses of each gateway to the
network on the map. You use these to make up your routing tables.
<BR></P>
<P>Draw several maps, at different level of details. It's not necessary, nor even desirable, to show which nodes are connected to each of the networks in the map. But each of the subnets would also have its own map showing every node connected and their
addresses. Having and keeping these maps up-to-date might take a small amount of time, but it's worthwhile when you have to figure out configurations or troubleshoot the network.
<BR></P>
<H3 ALIGN="CENTER">
<CENTER><A ID="I24" NAME="I24">
<FONT SIZE=4><B>Down to the Wire</B>
<BR></FONT></A></CENTER></H3>
<P>So far this chapter has dealt with the network as a virtual entity. It's time to give the network some identity. Most UNIX systems connect to an EtherNet-type local area network. EtherNet was invented by Xerox to act as a network for their printers and
it was perfected by a cooperative effort of DEC, Intel, and Xerox. EtherNet is a bus-based network in which all nodes on the network can hear all other nodes. All EtherNets share some common features:
<BR></P>
<UL>
<LI>A 10 MB-per-second transfer rate.
<BR>
<BR></LI>
<LI>Limited distance for the network cable. The actual limit is based on the cable type and it ranges from 250 meters (10BASE2) to about 750 meters (10BASE5).
<BR>
<BR></LI>
<LI>A limit on the number of nodes possible on a segment.
<BR>
<BR></LI>
<LI>Uses the Carrier Sense Multi-Access with Collision Detection protocol for transmission on the cable.
<BR>
<BR></LI>
<LI>Uses a 48-bit Media Access Control (MAC) address that is unique. The first 24 bits are the vendor and model of the EtherNet adapter, the last 24 bits are a serial number. No two EtherNet adapters are supposed to have the same MAC-level address.
<BR>
<BR></LI></UL>
<P>Specialized chips now handle the mechanics of listening to the network, deciding when to transmit, transmitting, receiving, and filtering packets.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I25" NAME="I25">
<FONT SIZE=3><B>Types of EtherNets</B>
<BR></FONT></A></CENTER></H4>
<P>EtherNet comes in three main connection types, which describe the type of cable used.
<BR></P>
<H5 ALIGN="CENTER">
<CENTER><A ID="I26" NAME="I26">
<FONT SIZE=3><B>10BASE5, or Thicknet</B>
<BR></FONT></A></CENTER></H5>
<P>This is the original EtherNet. It is a triaxial cable, usually yellow or orange in color, with black bands every 2 meters. The nodes are connected to the cable using taps at those black bands. While rarely used for new installations any longer, many
backbones have used this connection method.
<BR></P>
<P>Thicknet networks require external transceivers to connect the EtherNet board to the cable. A drop cable called an AUI (Attachment Unit Interface) cable is used to connect the transceiver to the network board. The AUI cable has 15 pin connectors on each
end and uses a special variant of the DB-15 connector with an unusual slide-locking mechanism.
<BR></P>
<P>Thicknet is the most expensive method of connecting nodes, but can also connect the most nodes over the longest distances.
<BR></P>
<H5 ALIGN="CENTER">
<CENTER><A ID="I27" NAME="I27">
<FONT SIZE=3><B>10BASE2, or Thinnet</B>
<BR></FONT></A></CENTER></H5>
<P>In an effort to reduce costs, the next development was to place the transceiver directly on the board and drop the expensive triaxial cable for inexpensive RG-58/U cable and BNC connectors. This led to Thinnet, or as it is often called, Cheapernet. In
10BASE5 the transceivers tap onto the cable and an AUI stub cable allows the node to be up to 30 meters from the network backbone cable. In 10BASE2 the cable is looped through each node and a BNC T-connector is used to connect directly to the network
board.
<BR></P>
<P>10BASE2 networks are limited in distance to several hundred meters, and a fault at any point in the network usually takes down the entire network. However, 10BASE2 networks are very reliable.
<BR></P>
<H5 ALIGN="CENTER">
<CENTER><A ID="I28" NAME="I28">
<FONT SIZE=3><B>10BASET, or Twisted Pair</B>
<BR></FONT></A></CENTER></H5>
<P>The newest type of EtherNet simulates the bus topology, using a star configuration and a central repeating hub. It uses two twisted-pair cables running directly from each node to a central hub. At the node end, these cables are usually terminated in an
RJ-45 connector that looks like a telephone plug but is 8 pins wide instead of the usual 6 for the RJ-11.
<BR></P>
<P>At the hub end many different connection types are used, including RJ-45 for single lines and 25 pair Amphenol connectors for multiple terminations. Hubs are available with from 4 to hundreds of ports and many even have sophisticated monitoring
abilities.
<BR></P>
<P>This method was developed to allow EtherNet to use existing twisted-pair telephone cabling. However, it works better if type 3 network cabling is used. It is also the least expensive method of wiring a new network.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I29" NAME="I29">
<FONT SIZE=3><B>What Is a Hub?</B>
<BR></FONT></A></CENTER></H4>
<P>10BASET networks need a central device to repeat the signals from each leg of the star onto all other legs. This is performed by a hub. It converts the star back into a logical bus topology. It also provides signal conditioning and regeneration to allow
the twisted-pair cable to be used at EtherNet speeds.
<BR></P>
<P>Hubs are content-passive devices in that anything received on one port is retransmitted on all other ports of the hub.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I30" NAME="I30">
<FONT SIZE=3><B>What Is a Repeater?</B>
<BR></FONT></A></CENTER></H4>
<P>Because EtherNets are limited in length due to signal timings and attenuation, a device was needed to regenerate the signals to extend the network. This is the repeater. It is connected between two segments of an EtherNet network and repeats whatever it
hears on one segment onto the other segment.
<BR></P>
<P>Repeaters are also content-passive devices in that anything received from one segment is repeated on the other one.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I31" NAME="I31">
<FONT SIZE=3><B>What Is a Bridge?</B>
<BR></FONT></A></CENTER></H4>
<P>A bridge is also used to connect two segments of a network. However, its not content passive. It is a link-level filtering device. It reads the EtherNet MAC header, looking for the MAC-level address. If the address is for another node it recognizes as
being on the same segment on which it received the packet, it discards the packet. If it is a broadcast packet, or one it does not recognize, it repeats the packet onto the other network.
<BR></P>
<P>Bridges have to read the packet to determine the address, so there is a delay inherent in going through a bridge. This delay could be just long enough to read the MAC header and determine whether to forward the packet. Other bridges store the entire
packet and then retransmit it. This type of bridge has a longer delay because it must read not just the header but the entire packet.
<BR></P>
<P>Bridges are rated by the number of packets per second they can forward.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I32" NAME="I32">
<FONT SIZE=3><B>What Is a Router?</B>
<BR></FONT></A></CENTER></H4>
<P>Whereas a bridge makes its decision based on the link level or MAC address, a router makes its forwarding decisions based on the network level or IP address. Routers read the entire packet into memory, and then decide what to do with the packet, based
on its contents.
<BR></P>
<P>Whereas bridges work at the EtherNet level and do not need to understand the protocol being used in the messages, routers work at the network level and need special software to understand every network protocol being used (IP, IPX, DECNET, and so on).
<BR></P>
<P>Routers are very configurable and can be used to filter packets and isolate networks from other network problems. Some configurations can also be used as security filters to keep out unwanted traffic.
<BR></P>
<P>However, for all this flexibility and protection you pay a price. Routers are more expensive and slower than bridges. They must read in the entire packet, and this causes a delay at least equal to the time it takes to read in the entire packet. This
delay is called latency, and although it has little effect on throughput, it does effect response time.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I33" NAME="I33">
<FONT SIZE=3><B>What Is Switched EtherNet?</B>
<BR></FONT></A></CENTER></H4>
<P>With the growth in networking and multimedia software, the old 10 MB/s EtherNet is showing its age. One stop gap measure on the way to faster networks is switched EtherNet. Using a special computer as a switch, a private EtherNet is created between the
switch and each node. Then the switch forwards the packets onto the desired node on its private EtherNet connection.
<BR></P>
<P>This breaks the bus and sends only broadcast and addressed traffic to each node. The overall traffic can be higher when each node talks to many other nodes. It works well, but introduces latency. The switch must delay the packet at least long enough to
read the MAC-level address. Often switches are implemented as a store and forward bridge.
<BR></P>
<P>In addition, the use of switched Ethernet makes it more difficult to diagnose problems on the network because you can no longer listen in to the bus from any node to determine where problems are occurring.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I34" NAME="I34">
<FONT SIZE=3><B>How to Segment and Expand an EtherNet Network</B>
<BR></FONT></A></CENTER></H4>
<P>When a segment is getting too full, the first thing to do is to split it into two segments connected by a bridge. This reduces the traffic on each segment, but does not require you to readdress all of the IP addresses on the network.
<BR></P>
<P>Place all diskless systems on the same segment as their servers and try to split the groups of servers and workstations across both segments. Then split the network and place a bridge between the two segments.
<BR></P>
<P>If this is insufficient for the growth, it will be necessary to split the network into two or more subnets and use routing instead of bridging to reduce the traffic load.
<BR></P>
<H3 ALIGN="CENTER">
<CENTER><A ID="I35" NAME="I35">
<FONT SIZE=4><B>Configuring TCP/IP</B>
<BR></FONT></A></CENTER></H3>
<P>When you first hook a UNIX system to the network there are many files that need to be populated with the data describing the IP network. Several of these files have default contents provided by the vendor. These may be sufficient, but often there are
additions needed. This section describes the contents of the UNIX TCP/IP configuration files found in the /etc directory.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> If you are running Network Information Service (NIS), most of these files are not used past boot and starting NIS. NIS provides networkwide access to the same information, allowing you to enter it
only once. NIS is covered later in this chapter.
<BR></NOTE>
<HR ALIGN=CENTER>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> On some UNIX systems the files actually reside in /etc/inet. There are symbolic links from the /etc/inet directory to the names in the /etc directory. This should not affect you when you're editing
the files.
<BR></NOTE>
<HR ALIGN=CENTER>
<H4 ALIGN="CENTER">
<CENTER><A ID="I36" NAME="I36">
<FONT SIZE=3><B>Assigning Addresses—</B><B><I>/etc/hosts</I></B>
<BR></FONT></A></CENTER></H4>
<P>The hosts file is used for translating names into IP addresses and IP addresses back into names. A sample file consists of:
<BR></P>
<PRE>#
# Internet host table
#
127.0.0.1 localhost loghost
190.109.252.1 gateway
190.109.252.2 sn1-router
190.109.252.33 sn1-gateway
190.109.252.34 sn1-host sn1-boothost</PRE>
<P>The # is the common character, which means that the system ignores all the characters that appear on a line following the #.
<BR></P>
<P>Entries are individual lines. Each entry starts with the dotted quad for the IP address, followed by white space, blanks, and/or tabs, and a list of names for this host. Any one of the names listed will be translated into the IP address. Looking up the
hostname for an IP address will return the first name listed. All the rest of the names are considered aliases.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="caution.gif" WIDTH = 37 HEIGHT = 35><B>CAUTION: </B>The same IP address cannot appear on more than one line in the file. Although this will not normally hurt, it can confuse NIS and cause the entire host file information not to be made available
via NIS.
<BR></NOTE>
<HR ALIGN=CENTER>
<H4 ALIGN="CENTER">
<CENTER><A ID="I37" NAME="I37">
<FONT SIZE=3><B>Naming Networks—</B><B><I>/etc/networks</I></B>
<BR></FONT></A></CENTER></H4>
<P>Just as it is easier to refer to hosts by name rather than by number, it's also easiest to refer to networks by name. A file is provided to separate network numbers from host numbers. This file differs from the hosts file in that only the network number
portion is listed in the file as seen in this example:
<BR></P>
<PRE>#
# The networks file associates Internet Protocol (IP) network
# numbers with network names. The format of this file is:
#
# network-name network-number nicnames . . .
#
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?