?? tyt05fi.htm
字號:
<HTML>
<HEAD>
<TITLE>tyt05fi.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="tyt06fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt06fi.htm">
<LINK REL="Previous" HREF="tyt04fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt04fi.htm"></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"><A ID="I0" NAME="I0"></A>
<P><P ALIGN=CENTER>
<A HREF="tyt04fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt04fi.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="tyt06fi.htm" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/tyt06fi.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="#E68E48" >Gateways, Bridges, and Routers</A></LI>
<LI>
<A HREF="#E68E49" >Gateway Protocols</A></LI>
<LI>
<A HREF="#E68E50" >Routing Daemons</A></LI>
<LI>
<A HREF="#E68E51" >Routing</A></LI>
<UL>
<LI>
<A HREF="#E69E72" >Fewest-Hops Routing</A></LI>
<LI>
<A HREF="#E69E73" >Type of Service Routing</A></LI>
<LI>
<A HREF="#E69E74" >Updating Gateway Routing Information</A></LI></UL>
<LI>
<A HREF="#E68E52" >The IGP and EGPGateway Protocols</A></LI>
<LI>
<A HREF="#E68E53" >Gateway-to-Gateway Protocol (GGP)</A></LI>
<LI>
<A HREF="#E68E54" >The External Gateway Protocol (EGP)</A></LI>
<UL>
<LI>
<A HREF="#E69E75" >Neighbors and EGP</A></LI>
<LI>
<A HREF="#E69E76" >EGP Messages</A></LI>
<UL>
<LI>
<A HREF="#E70E26" >Neighbor Acquisition Messages</A></LI>
<LI>
<A HREF="#E70E27" >Neighbor Reachability Messages</A></LI>
<LI>
<A HREF="#E70E28" >Poll Messages</A></LI>
<LI>
<A HREF="#E70E29" >Update Messages</A></LI>
<LI>
<A HREF="#E70E30" >Error Messages</A></LI></UL>
<LI>
<A HREF="#E69E77" >EGP to GGP Messages</A></LI>
<LI>
<A HREF="#E69E78" >EGP State Variables and Timers</A></LI></UL>
<LI>
<A HREF="#E68E55" >Interior Gateway Protocols (IGP)</A></LI>
<UL>
<LI>
<A HREF="#E69E79" >The Routing Information Protocol (RIP)</A></LI>
<LI>
<A HREF="#E69E80" >The HELLO Protocol</A></LI>
<LI>
<A HREF="#E69E81" >The Open Shortest Path First (OSPF) Protocol</A></LI>
<UL>
<LI>
<A HREF="#E70E31" >OSPF Packets</A></LI>
<LI>
<A HREF="#E70E32" >HELLO Packets</A></LI>
<LI>
<A HREF="#E70E33" >Link State Request and Update Packets</A></LI></UL></UL>
<LI>
<A HREF="#E68E56" >Summary</A></LI>
<LI>
<A HREF="#E68E57" >Q&A</A></LI>
<LI>
<A HREF="#E68E58" >Quiz</A></LI></UL></UL></UL>
<HR ALIGN=CENTER>
<A ID="E66E5" NAME="E66E5"></A>
<H1 ALIGN=CENTER>
<CENTER>
<FONT SIZE=6 COLOR="#FF0000"><B>— 5 —</B>
<BR><B>Gateway and Routing Protocols</B></FONT></CENTER></H1>
<BR>
<P>TCP/IP functions perfectly well on a local area network, but its development was spurred by internetworks (more specifically by the Internet itself), so it seems logical that TCP/IP has an architecture that works well with internetwork operations. Today I examine these internetwork specifics in more detail by looking at the manner in which gateways transfer routing information between themselves.
<BR>
<P>The routing method used to send a message from its origin to destination is important, but the method by which the routing information is transferred depends on the role of the network gateways. There are special protocols developed specifically for different kinds of gateways, all of which function with TCP.
<BR>
<BR>
<A ID="E68E48" NAME="E68E48"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Gateways, Bridges, and Routers</B></FONT></CENTER></H3>
<BR>
<P>To forward messages through networks, a machine's IP layer software compares the destination address of the message (contained in the Protocol Data Unit, or PDU) to the local machine's address. If the message is not for the local machine, the message is passed on to the next machine. Moving messages around small network is quite easy, but large networks and internetworks add to the complexity, requiring gateways, bridges, and routers, which try to establish the best method of moving the message to its destination.
<BR>
<P>Defining the meaning of these terms is relatively easy:
<BR>
<UL>
<LI>A gateway is a device that performs routing functions, usually as a stand-alone device, that also can perform protocol translation from one network to another.
<BR></LI>
<BR>
<LI>A bridge is a network device that connects two or more networks that use the same protocol.
<BR></LI>
<BR>
<LI>A router is a network node that forwards datagrams around the network.
<BR></LI>
<BR>
</UL>
<P>The gateway's protocol conversion capability is important (otherwise, the machine is no different from a bridge). Protocol conversion usually takes place in the lower layers, sometimes including the transport layer. Conversion can occur in several forms, such as when moving from a local area network format to Ethernet (in which case the format of the packet is changed) or from one proprietary file convention to another (in which case the file specifications are converted).
<BR>
<P>Bridges act as links between networks, which often have a bridge at either end of a dedicated communications line (such as a leased line) or through a packet system such as the Internet. There might be a conversion applied between bridges to increase the transmission speed. This requires both ends of the connection to understand a common protocol.
<BR>
<P>Routers operate at the network level, forwarding packets to their destination. Sometimes a protocol change can be performed by a router that has several delivery options available, such as Ethernet or serial lines.
<BR>
<P>A term you might occasionally see is <I>brouter,</I> a contraction of both bridge and router. As you might expect, brouters perform the functions of both a bridge and a router, although sometimes not all functions are provided. The term brouter is often applied for any device that performs some or all of the functions of both a bridge and a router.
<BR>
<P>A term in common use when dealing with routes is <I>packet-switching</I>. A packet-switched network is one in which all transfers are based on a self-contained packet of data (like that of TCP/IP's datagrams). There are also message-switched (self-contained complete messages, as with UNIX's UUCP system) and line-switched (fixed or dedicated connections) networks, but these are rarely used with TCP/IP. Packet-switched networks tend to be faster overall than message-switched networks, but they are also considerably more complex.
<BR>
<BR>
<A ID="E68E49" NAME="E68E49"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Gateway Protocols</B></FONT></CENTER></H3>
<BR>
<P>Gateway protocols are used to exchange information with other gateways in a fast, reliable manner. Using gateway protocols, transmission time over large internetworks has been shown to increase, although there is considerable support for the idea of having only one protocol across the entire Internet (which would eliminate gateway protocols in favor of TCP/IP throughout).
<BR>
<P>The Internet provides for two types of gateways: core and non-core. All core gateways are administered by the Internet Network Operations Center (INOC). Non-core gateways are not administered by this central authority but by groups outside the Internet hierarchy (who might still be connected to the Internet but administer their own machines). Typically, corporations and educational institutions use non-core gateways.
<BR>
<P>The origin of core gateways arose from the ARPANET, where each node was under the control of the governing agency. ARPANET called them <I>stub </I><I>gateways</I>, whereas any gateway not under direct control (non-core in Internet terms) was called a <I>nonrouting gateway</I>. The move to the Internet and its proliferation of gateways required the implementation of the Gateway-to-Gateway Protocol (GGP), which was used between core gateways. The GGP was usually used to spread information about the non-core gateways attached to each core gateway, enabling routing tables to be built.
<BR>
<P>As the Internet grew, it became impossible for any one gateway to hold a complete map of the entire internetwork. This was solved by having each gateway handle only a specific section of the internetwork, relying on neighboring gateways to know more about their own attached networks when a message was passed. One problem that frequently occurred was a lack of information for complete routing decisions, so default routes were used.
<BR>
<P>Earlier in this book, the term <I>autonomous system</I> was introduced. An autonomous system is one in which the structure of the network it is attached to is not visible to the rest of the internetwork. Usually, a gateway leads into the network, so all traffic for that network must go through the gateway, which hides the internal structure of the local network from the rest of the internetwork.
<BR>
<P>If the local network has more than one gateway and they can talk to each other, they are considered interior neighbors. (The term interior neighbor is sometimes applied to the machines within the network, too, not just the gateways.) If the gateways belong to different autonomous systems, they are exterior gateways. Thus, when default routes are required, it is up to the exterior gateways to route messages between autonomous systems. Interior gateways are used to transfer messages into an autonomous system.
<BR>
<P>Within a network, the method of transferring routing information between interior gateways is usually the Routing Information Protocol (RIP) or the less common HELLO protocol, both of which are Interior Gateway Protocols (IGPs). These protocols are designed specifically for interior neighbors. On the Internet, messages between two exterior gateways are through the Exterior Gateway Protocol (EGP). RIP, HELLO, and EGP all rely on a frequent (every thirty seconds) transfer of information between gateways to update routing tables.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>
<IMG SRC="note.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/note.gif" WIDTH = 75 HEIGHT = 46>The three gateway protocols are intertwined: EGP is used between gateways of autonomous systems, whereas the IGPs RIP and HELLO are used within the network itself. GGP is used between core gateways.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>Why not use GGP for all internetwork communications, dropping the need for EGPs? The answer lies in the fact that core gateways that use GGP know about all the other core gateways on the internetwork. This simplifies their messaging and provides complete routing tables. However, core gateways usually lead into many complex networks of more autonomous networks, most of which the core gateways don't know about. However, the exterior gateways must know about all the networks directly connected to it, but not all the networks on the entire internetwork, so the routing tables and routing algorithms for a core and non-core gateway are different. This also means that messages can have different formats, because routing information for a non-core gateway has some connections that are hidden from other gateways.
<BR>
<P>It is possible for a large autonomous system to be composed of several subnetworks or areas, each of which communicates with the other areas through an IGP. Each subnetwork or area has a designated gateway, called a <I>border gateway</I>, or <I>border router</I>, to indicate that it is within an area. Border routers communicate with each other using IGP. A commonly encountered term is <I>boundary gateway</I>, which is the same as an exterior gateway or a path to another autonomous network. This is illustrated in Figure 5.1, which shows three subnetworks or areas that communicate with each other through boundary gateways or routers using IGP, and two exterior gateways (also called boundary gateways) that communicate with the rest of the internetwork using EGP.
<BR>
<P><B><A HREF="05tyt01.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/05tyt01.gif">Figure 5.1. Interior and exterior gateways.</A></B>
<BR>
<BR>
<A ID="E68E50" NAME="E68E50"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Routing Daemons</B></FONT></CENTER></H3>
<BR>
<P>To handle the routing tables, most UNIX systems use a daemon called routed. A few systems run a daemon called gated. Both routed and gated can exchange RIP messages with other machines, updating their route tables as necessary. The gated program can also handle EGP and HELLO messages, updating tables for the internetwork. Both routed and gated can be managed by the system administrator to select favorable routes, or to tag a route as not reliable.
<BR>
<P>The configuration information for gated and routed is usually stored as files named gated.cfg, gated.conf, or gated.cf. Some systems specify gated information files for each protocol, resulting in the files gated.egp, gated.hello, and gated.rip. A sample configuration file for EGP used by the gated process is shown here:
<BR>
<PRE>
<FONT COLOR="#000080"># @(#)gated.egp 4.1 Lachman System V STREAMS TCP source
# sample EGP config file
traceoptions general kernel icmp egp protocol ;
autonomoussystem 519 ;
rip no;
egp yes {
group ASin 519 {
neighbor 128.212.64.1 ;
} ;
} ;
static {
default gateway 128.212.64.1 pref 100 ;
} ;
propagate proto egp as 519 {
proto rip gateway 128.212.64.1 {
announce 128.212 metric 2 ;
} ;
proto direct {
announce 128.212 metric 2 ;
} ;
} ;
propagate proto rip {
proto default {
announce 0.0.0.0 metric 1 ;
} ;
proto rip {
noannounce all ;
} ;
} ;</FONT></PRE>
<P>The code above shows a number of configuration details. It starts with a number of options and the switch that turns EGP on and sets the neighbor IP address. This is followed by code that defines the way EGP behaves. Most of the details are of little interest and are seldom (if ever) modified by a user. Instead, configuration routines tend to manage this file’s contents.
<BR>
<P>The UNIX system administrator also has a program called route that enables direct entry of routing table information. The information on a UNIX system regarding routing is usually stored in the file /etc/gateways.
<BR>
<P>It has become common practice to allow a default network Internet address of 0.0.0.0, which refers to a gateway on the network that should be capable of resolving an unknown address. (This is included in the previous sample configuration file as <I>proto default</I>.) The default route is used when the local machine cannot resolve the address properly. Because the routing tables on a gateway are usually more complete than those on a local machine, this helps send packets to their intended destination. If the default address gateway cannot resolve the address, an Internet Control Message Protocol (ICMP) error message is returned to the sender.
<BR>
<BR>
<A ID="E68E51" NAME="E68E51"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Routing</B></FONT></CENTER></H3>
<BR>
<P>Routing refers to the transmission of a packet of information from one machine through another. Each machine that the packet enters analyzes the contents of the packet header and decides its action based on the information within the header. If the destination address of the packet matches the machine's address, the packet should be retained and processed by higher-level protocols. If the destination address doesn't match the machine's, the packet is forwarded further around the network. Forwarding can be to the destination machine itself, or to a gateway or bridge if the packet is to leave the local network.
<BR>
<P>Routing is a primary contributor to the complexity of packet-switched networks. It is necessary to account for an optimal path from source to destination machines, as well as to handle problems such as a heavy load on an intervening machine or the loss of a connection. The route details are contained in a routing table, and several sophisticated algorithms work with the routing table to develop an optimal route for a packet.
<BR>
<P>Creating a routing table and maintaining it with valid entries are important aspects of a protocol. Here are a few common methods of building a routing table:
<BR>
<UL>
<LI>A fixed table is created with a map of the network, which must be modified and reread every time there is a physical change anywhere on the network.
<BR></LI>
<BR>
<LI>A dynamic table is used that evaluates traffic load and messages from other nodes to refine an internal table.
<BR></LI>
<BR>
<LI>A fixed central routing table is used that is loaded from the central repository by the network nodes at regular intervals or when needed.
<BR></LI>
<BR>
</UL>
<P>Each method has advantages and disadvantages. The fixed table approach, whether located on each network node or downloaded at regular intervals from a centrally maintained fixed table, is inflexible and can't react to changes in the network topology quickly. The central table is better than the first option, simply because it is possible for an administrator to maintain the single table much more easily than a table on each node.
<BR>
<P>The dynamic table is the best for reacting to changes, although it does require better control, more complex software, and more network traffic. However, the advantages usually outweigh the disadvantages, and a dynamic table is the method most frequently used on the Internet.
<BR>
<BR>
<A ID="E69E72" NAME="E69E72"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Fewest-Hops Routing</B></FONT></CENTER></H4>
<BR>
<P>Most networks and gateways to internetworks work on the assumption that the shortest route (in terms of machines traveled through) is the best way to route messages. Each machine that a message passes through is called a <I>hop</I>, so this routing method is known as <I>fewest hops</I>. Although experimentation has shown that the fewest-hops method is not necessarily the fastest method (because it doesn't take into account transmission speed between machines), it is one of the easiest routing methods to implement.
<BR>
<P>To provide fewest-hops routing, a table of the distance between any two machines is developed, or an algorithm is available to help calculate the number of hops required to reach a target machine. This is shown using the sample internetwork of gateways in Figure 5.2 and its corresponding table of distances between the gateways in the figure, which is shown in Table 5.1.
<BR>
<P><B><A HREF="05tyt02.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/05tyt02.gif">Figure 5.2. An internetwork of gateways.</A></B>
<BR>
<BR>
<P ALIGN=CENTER>
<CENTER>
<FONT COLOR="#000080"><B>Table 5.1. Table of fewest hops from Figure 5.2</B>.</FONT></CENTER>
<BR>
<CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3 >
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TD>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>A</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>B</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>C</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>D</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>E</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>F</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>G</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>H</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>I</I></B>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B>A</B>
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TD>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>1
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -