A router is an Intermediate System (IS) which operates at the network layer
of the OSI reference model. Routers may be used to connect two or more IP
networks, or an IP network to an internet connection.
A router consists of a computer with at least two network interface cards
supporting the IP protocol. The router receives packets from each interface via
a network interface and forwards the received packets to an appropriate output
network interface. Received packets have all link layer protocol headers
removed, and transmitted packets have a new link protocol header added prior to
transmission.
The router uses the information held in the network layer header (i.e. IP
header) to decide whether to forward each received packet, and which network
interface to use to send the packet. Most packets are forwareded based on the
packet's IP destination address, along with routing information held within the
router in a routing table. Before a packet is forwarded, the processor checks
the Maximum Transfer Unit (MTU) of the specified interface. Packets larger than
the interface's MTU must be fragmented by the router into two or more smaller
packets. If a packet is received which has the Don't Fragment (DF) bit set in
the packet header, the packet is not fragmented, but instead discarded. In this
case, an ICMP error message is returned to the sender (i.e. to the original
packet's IP source address) informing it of the interface's MTU size. This forms
the basis for Path MTU discovery (PMTU).
The routing and filter tables resemble similar tables in link layer bridges
and switches. Except, that instead of specifying link hardware addresses (MAC
addresses), the router table sepcify network (IP addresses). The routing table
lists known IP destination addresses with the appropraite network interface to
be used to reach that destiantion. A default entry may be specified to be used
for all addresses not explicitly defined in the table. A filter table may also
be used to ensure that unwanted packets are discarded. The filter may be used to
deny access to particular protocols or to prevent unauthorised access from
remote computers by discarding packets to specified destination addresses.
A router forwards packets from one IP network to another IP network. Like
other systems, it determines the IP network from the logical AND of an IP
address with the associated subnetwork address mask. One execption to this rule
is when a router receives an IP packet to a network broadcast address. In this
case, the router discards the packet. Forwarding broadcast packet can lead to
severe storms of packets, and if uncontrolled could lead to network overload.
A router introduces delay (latency) as it processes the packets it receives.
The total delay observed is the sum of many components including:
- Time taken to process the frame by the data link protocol
- Time taken to select the correct output link (i.e. filtering and
routing)
- Queuing delay at the output link (when the link is busy)
- Other activities which consume processor resources (computing routing
tables, network management, generation of logging information)
|