📄 ch4.htm
字号:
<HTML><HEAD><TITLE>Chapter 4 -- How Intranet Routers Work</TITLE><META></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#CE2910"><H1><FONT SIZE=6 COLOR=#FF0000>Chapter 4</FONT></H1><H1><FONT SIZE=6 COLOR=#FF0000>How Intranet Routers Work</FONT></H1><HR><P><CENTER><B><FONT SIZE=5><A NAME="CONTENTS">CONTENTS</A></FONT></B></CENTER><UL><LI><A HREF="#HowIntranetRoutersWork">How Intranet Routers Work</A></UL><HR><P>Routers are the traffic cops of intranets. They make sure thatall data gets sent to where it's supposed to go and that it getssent via the most efficient route. Routers are also useful toolsto make the most efficient use of the intranet. Routers are usedto segment traffic and provide redundancy of routes. Routers useencapsulation to permit different protocols to be sent acrossotherwise incompatible networks.<P>When you sit down at your computer on an intranet and send orreceive data, that information generally must first go throughat least one router, and often more than one router before itreaches its final destination. Routers can be simple or quitesophisticated. Factors that determine the required complexityof a router include the size of the intranet, the type and quantityof traffic on segments, and security concerns of the intranet.The more complex the intranet, and, in particular, the greaternumber of possible destinations for data, the greater the needfor sophisticated router hardware and software.<P>Routers open the IP packet to read the destination address, calculatethe best route, and then send the packet toward the final destination.If the destination is on the same part of an intranet, the packetwould be sent directly to the destination computer by the router.If the packet is destined for another intranet or subnetwork (orif the destination is on the Internet), the router considers factorslike traffic congestion and the number of <I>hops</I>-a term thatrefers to the number of routers or gateways on any given path.The IP packet carries with it a segment that holds the hop countand a router will not use a path that would exceed a predefinednumber of hops. Multiple routes within an acceptable hop countrange are desirable in intranets to provide redundancy and assurethat data can get through. For example, if a direct route betweenSan Francisco and New York were unavailable, sophisticated routerswould send data to New York via another router probably in anothercity on the intranet-and this would all be transparent to theusers.<P>Routers have two or more physical ports: receiving (input) portsand sending (output) ports. In actuality, every port is bi-directionaland can receive or send data. When a packet is received at aninput port, a software routine called a routing process is run.This process looks inside the header information in the IP packetand finds the address where the data is being sent. It then comparesthis address against an internal database called a <I>routingtable</I> that has information detailing to which port packetswith various IP addresses should be sent. Based on what it findsin the routing table, it sends the packet to a specific outputport. This output port then sends the data to the next routeror to the destination itself.<P>At times, packets are sent to a router's input port faster thanit can process them. When this happens, the packets are sent toa special holding area called an <I>input queue</I>, an area ofRAM on the router. That specific input queue is associated witha specific input port. A router can have more than one input queue,if several input ports are being sent packets faster than therouter can process them. Each input port will process packetsfrom the queue in the order in which they were received.<P>If the traffic through the router is very heavy, the number ofpackets in the queue can be greater than the capacity of the queue.(The capacity of the queue is called the queue's <I>length</I>.)When this happens, there is a possibility that packets may bedropped and so will not be processed by the router, and won'tbe sent to their destination. This doesn't mean, though, thatthe information has be to lost. The TCP protocol was designedto take into account that packets can be lost en route to theirfinal destination. If not all the packets are sent to the receivingend, TCP at the receiving computer recognizes that and asks thatthe missing packets be re-sent. It will keep requesting that thepackets be re-sent until they are all received. Sophisticatedrouters can be managed and problems diagnosed and resolved usingspecial software, such as SNMP (Simple Network Management Protocol).TCP can tell what actions to take because there are various flagsin the packet, like the hop count in IP, that tell TCP what itneeds to know to act. For example, the <I>ack</I> flag, set to"on," indicates that it is responding to (acknowledging)a previous communication.<P>A wide variety of routing hardware and software is available.In some cases, a variety of different kinds of routing softwarecan be run on a given piece of hardware. For example, Novell'sMulti Protocol Router is routing software that runs on routerhardware. In other instances-and particularly when routers arehigh-performance routers-the routing software is built directlyinto a router's hardware or firmware.<P>There are several kinds of tables used in routing. In the simplestkind of intranet, an exceedingly simple routing table can be used,called a <I>minimal routing table</I>. When an intranet is composedof a single TCP/IP network, and when that network is not connectedto any other TCP/IP network or to the Internet, minimal routingcan be used. In minimal routing, a program called <I>ifconfig</I>automatically creates the table, which contains only a few basicentries. Since there are very few places that data can be sent,only a minimal number of routes need to be configured.<P>If an intranet has only a limited number of other TCP/IP networks,then a <I>static routing table</I> can be used. In this case,packets with specific addresses are sent to specific routers-therouters do not redirect packets to adjust to changing networktraffic. Static routing should be used when there is only oneroute to each given destination. A static routing table allowsan intranet administrator to add or take away entries in the routingtable. <P><I>Dynamic routing</I> <I>tables </I>are the most sophisticatedrouting tables. They should be used when there is more than oneway in which data can be sent from a router to the final destination,and in more complex intranets. These tables constantly changeas network traffic and conditions change, so that they alwaysroute data the most efficient way possible, taking into accountthe current state of traffic on the intranet.<P>Dynamic routing tables are built using routing protocols. Theseprotocols are ways in which routers communicate with one another,giving each other information about the most efficient way ofrouting data given the current state of the intranet. A routerwith a dynamic routing table can automatically switch data toa backup route if the primary route is down. It can also alwaysdetermine the most efficient way of routing data toward its finaldestination. Routers advertise their IP addresses and know theIP addresses of their neighbors. Routers can use this informationin an algorithm to calculate the best route to send packets.<P>The most common routing protocol that performs these best-casecalculations is known as RIP (Routing Information Protocol). WhenRIP determines the most efficient route for data, it calculatesthe hop count for the route. RIP always chooses the path withthe lowest hop count as the route to send data over. It assumesthat the fewer the hops, the more efficient the path. RIP willnot allow any path with a hop count of over 16. If there is ahop count of over 16, it will discard the route. On most intranetsthis shouldn't be a problem.<P>The Exterior Gateway Protocol (EGP) is used for the Internet wheremany more routers might have to be traversed before a packet reachesits final destination. It will not be needed on an intranet sinceit's rare that an intranet would be so large that data would haveto pass through more than 16 routers or gateways in order to besent to the final destination.<P>The thing to keep in mind about intranets and routing technologyis that it is not an either/or situation. Many different kindsof routing technologies can be used on a single intranet, dependingon the needs of that particular part of the network. Some partsmay be able to use routers with static routing tables, while otherparts may require dynamic routing tables. As in anything havingto do with intranets, the whole point is flexibility and usingthe right tool for the job. <H2><A NAME="HowIntranetRoutersWork"><FONT SIZE=5 COLOR=#FF0000>How Intranet Routers Work</FONT></A></H2><P>Just as routers direct traffic on the Internet, sending informationto its proper destination, routers on an intranet perform thesame function. Routers-equipment that is a combination of hardwareand software-can send the data to a computer on the same subnetworkinside the intranet, to another network on the intranet, or outsideto the Internet. They do this by examining header informationin IP packets, and then sending the data on its way. Typically,a router will send the packet to the next router closest to thefinal destination, which in turn sends it to an even closer router,and so on, until the data reaches its intended recipient.<OL><LI>A router has input ports for receiving IP packets, and outputports for sending those packets toward their destination. Whena packet comes to the input port, the router examines the packetheader, and checks the destination in it against a routing table-adatabase that tells the router how to send packets to variousdestinations. <LI>Based on the information in the routing table, the packetis sent to a particular output port, which sends the packet tothe next closest router to the packet's destination.<LI>If packets come to the input port more quickly than the routercan process them, they are sent to a holding area called an inputqueue. The router then processes packets from the queue in theorder they were received. If the number of packets received exceedsthe capacity of the queue (called the length of the queue), packetsmay be lost. When this happens, the TCP protocol on the sendingand receiving computers will have the packets re-sent.<LI>In a simple intranet that is a single, completely self-containednetwork, and in which there are no connections to any other networkor the intranet, only minimal routing need be done, and so therouting table in the router is exceedingly simple with very fewentries, and is constructed automatically by a program called<I>ifconfig.</I><LI>In a slightly more complicated intranet which is composedof a number of TCP/IP-based networks, and connects to a limitednumber of TCP/IP-based networks, static routing will be required.In static routing, the routing table has specific ways of routingdata to other networks. Only those pathways can be used. Intranetadministrators can add routes to the routing table. Static routingis more flexible than minimal routing, but it can't change routesas network traffic changes, and so isn't suitable for many intranets.<LI>In more complex intranets, dynamic routing will be required.Dynamic routing is used to permit multiple routes for a packetto reach its final destination. Dynamic routing also allows routersto change the way they route information based on the amount ofnetwork traffic on some paths and routers. In dynamic routing,the routing table is called a dynamic routing table and changesas network conditions change. The tables are built dynamicallyby routing protocols, and so constantly change according to networktraffic and conditions.<LI>There are two broad types of routing protocols: interior andexterior. Interior routing protocols are typically used on internalrouters inside an intranet that routes traffic bound only forinside the intranet. A common interior routing protocol is theRouting Information Protocol (RIP). Exterior protocols are typicallyused for external routers on the Internet., AÊcommon exteriorprotocol is the Exterior Gateway Protocol (EGP).</OL><HR><CENTER><P><A HREF="ch3.htm"><IMG SRC="PC.GIF" BORDER=0 HEIGHT=88 WIDTH=140></A><A HREF="#CONTENTS"><IMG SRC="CC.GIF" BORDER=0 HEIGHT=88 WIDTH=140></A><A HREF="contents.htm"><IMG SRC="HB.GIF" BORDER=0 HEIGHT=88 WIDTH=140></A><A HREF="ch5.htm"><IMG SRC="NC.GIF" BORDER=0 HEIGHT=88 WIDTH=140></A><HR WIDTH="100%"></P></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -