The definition of a router is relatively simple: it is a device that makes decisions on how to route Layer 3 packets through an internetwork. The predominant Layer 3 protocol today is the Internet Protocol (IP), so routers today are most commonly IP routers. There have been other Layer 3 protocols, however, so many routers retain the ability to route some of these older protocols, including Novell's Internetwork Packet Exchange (IPX) protocol and Apple's Datagram Delivery Protocol (DDP).
It is important to distinguish between routing and bridging. The former is a Layer 3 function and is performed by routers; the latter is a Layer 2 function and is performed by Layer 2 switches (e.g., Ethernet). The industry has done much to confuse these concepts, because modern Layer 2 switches are also capable of routing, and modern routers are also capable of Layer 2 bridging. Still, routing remains a distinct and separate function from bridging, and a device that only does routing can easily be distinguished from one that only does bridging.
The Role of a Router
To say that routers operate at the Network Layer is to say that routers make their routing decisions based on the Network Layer address. Unlike the MAC address, the Network Layer address is hierarchically structured. Minimally, it comprises a network component and an end station (or host) component. All end stations attached to the same network have the same value in the network component of their Network Layer addresses. The end station component must differ for all end stations attached to the same network.
The image depicts a small internetwork with a router interconnecting two networks. In this figure, each network comprises a single LAN. The Network Layer addresses assigned to the end stations are depicted. In these addresses, the first two numbers of the Network Layer address represent the network and the last two numbers represent a specific end station in that network. Note that all of the end stations attached to either network share the same network address.
It is also important to note that the router has more than one Network Layer address. In fact, a router will have a unique Network Layer address for each network to which it is connected. This is because the router is a full participating member of each network. Unlike the bridge, which copies every frame it sees and makes filtering/forwarding decisions on each, the router only copies frames directly addressed (MAC Layer) to it. The contents of these frames now becomes crucial. In these frames are packets moving between end stations. The packets are addressed using the Network Layer address, the entity in which the router is interested. The frame in which a packet arrives is discarded by the router; as it is simply the vehicle in which a packet arrives. This means an end station must know that a given packet is destined for another network and must explicitly send it to the appropriate router for routing through the internetwork.
Functions of a Router
The primary function of a router is to route packets. For each packet received by the router, it must determine whether or not it knows how to reach the destination network and, if so, where the packet must be sent to continue it on its way. This description is important. A router seldom knows the entire route a given packet must traverse, simply the next hop (i.e., the next router) along that path. The router keeps that information in a routing table. Entries in the routing table can be manually (i.e., statically) built, or dynamically learned via a routing protocol. The two strategies (static and dynamic) can be combined so that some routing table entries are static and others are learned.
A router can also perform packet filtering. The filtering in which the router engages is typically for security or management purposes. A router can perform three basic types of filtering. “Access class” restrictions allow the router to designate which end stations or networks may send or receive data across that router. “Message type” filtering allows only certain protocols to be used between designated end stations or networks. Finally, routers can filter packets containing network routing and policy information, allowing only specified end stations or networks to provide this type of information.
A router can gather traffic statistics that are useful to a management entity. It can tgypically report the volume of traffic routed, the number and type of packets received from any designated network or end station, and the number and type of packets destined for any designated network or end station. Other information a router can gather includes queue lengths, delay, load, etc.
|<mp3>http://podcast.hill-vt.com/podsnacks/2007q1/router.mp3%7Cdownload</mp3> | Router|
|<mp3>http://podcast.hill-vt.com/podsnacks/2007q1/layer-3-switch.mp3%7Cdownload</mp3> | Layer 3 Switch|