Routers use routing tables to determine where to forward data packets. Static routes can be manually configured, but dynamic routing protocols allow routers to automatically share routing information with each other to keep tables up to date. When a packet arrives, the router checks the destination address and forwards it to the next hop listed in the routing table for that destination network. If no matching route is found, it may be forwarded to a default gateway.
Routers use routing tables to determine where to forward data packets. Static routes can be manually configured, but dynamic routing protocols allow routers to automatically share routing information with each other to keep tables up to date. When a packet arrives, the router checks the destination address and forwards it to the next hop listed in the routing table for that destination network. If no matching route is found, it may be forwarded to a default gateway.
Handled Communication within a network, or subnet, happens without a network layer device. When a host communicates outside the local network, a router acts as a gateway and performs the network layer function of choosing a path for the packet. Supporting Communication Outside the Network
• A host has a default gateway address
defined. • As shown in Figure , this gateway address is the address of a router interface that is connected to the same network as the host. • The router interface is actually a host on the local network, so the host IP address and the default gateway address must be on the same network. Supporting Communication Outside the Network Default Gateway
The default gateway is configured on a
host. On a Windows computer, the Internet Protocol (TCP/IP) Properties tools are used to enter the default gateway IPv4 address. Both the host IPv4 address and the gateway address must have the same network (and subnet, if used) portion of their respective addresses. Figure 5-13 depicts the Windows TCP/IP Properties configuration. Default Gateway ROUTING PROCESS • No packet can be forwarded without a route. Whether the packet is originating in a host or being forwarded by an intermediary device, the device must have a route to identify where to forward the packet. • A host must either forward a packet to the host on the local network or to the gateway, as appropriate. • To forward the packets, the host must have routes that represent these destinations. A router makes a forwarding decision for each packet that arrives at the gateway interface. This forwarding process is referred to as routing ROUTING PROCESS • When a router interface is configured with an IP address and subnet mask, the interface becomes part of that network. • The routing table now includes that network as a directly connected network. • All other routes, however, must be configured or acquired through a routing protocol. • To forward a packet, the router must know where to send it. • This information is available as routes in a routing table. ROUTING Table
• The routing table stores information about
connected and remote networks. • Connected networks are directly attached to one of the router interfaces. These interfaces are the gateways for the hosts on different local networks. • Remote networks are networks that are not directly connected to the router. • Routes to these networks can be manually configured on the router by the network administrator or learned automatically using dynamic routing protocols. ROUTING Table Routes in a routing table have three main features: • Destination network • Next-hop • Metric • The router matches the destination address in the packet header with the destination network of a route in the routing table and forwards the packet to the next-hop router specified by that route. • If there are two or more possible routes to the same destination, the metric is used to decide which route appears on the routing table. ROUTING Table Host Routing Table Routing Routing is the process a router performs when making forwarding decisions for each packet arriving at the gateway interface. To forward a packet to a destination network, the router requires a route to that network. If a route to a destination network does not exist on the router, the packet will be forwarded to a default gateway. If no default gateway is configured, the packet cannot be forwarded. Routing Default Route • Remember that a default route is the route used if no specific route is available to be selected for delivery. • In IPv4 networks, the address 0.0.0.0 is used for this purpose. • Packets with a destination network address that does not match a more specific route in the routing table are forwarded to the next-hop router associated with the default route. Default Route Packet Forwarding: Moving the Packet Toward Its Destination • Routing is performed packet by packet and hop by hop. • Each packet is treated independently by each router along the path. • At each hop, the router examines the destination IP address for each packet and then checks the routing table for forwarding information. The router will then do one of the following with the packet: • Forward it to the next-hop router • Forward it to the destination host • Drop it How Routes Are Learned • Routers need information about other networks to build a reliable routing table. Networks and routes are constantly changing, with new networks coming on and routes going down. • If a router has bad information about routes, it is likely it will forward packets incorrectly, causing packets to be delayed or dropped. • The two ways in which a router can learn information about routes is through static routing and dynamic routing. Static Routing • The route information can be manually configured on the router, creating what is known as a static route. • An example of a static route is a default route. Static routing requires a network administrator for initial setup and for any changes to routes. • Static routes are considered very reliable, and the router does not use much overhead to process packets. • On the other hand, static routes do not update automatically and have higher continuing administrative costs. Dynamic Routing • Routers can also learn about routes automatically from other routers in the same internetwork, which is known as dynamic routing. • Dynamic routing updates arrive from other routers and are used by the receiving router without administrative configuration. • Dynamic routing has higher router processing overhead but little administrative cost after initial setup. • If dynamic routing is not enabled and configured on a router, static routes to the next hops must be in place for the router to know where to forward packets. Routing Protocols • It is imperative that all routers in an internetwork have up-to-date and extensive route knowledge. • Maintaining the routing table by manual static configuration is not always feasible. • Configuring one of several available dynamic routing protocols on network routers is a much more efficient way to keep the routers updated. • Routing protocols are the set of rules by which routers dynamically share their routing information Routing Protocols • The most common routing protocols used are: • Routing Information Protocol (RIP) • Enhanced Interior Gateway Protocol (EIGRP) • Open Shortest Path First (OSPF)
• The advantage of routing protocols providing
routers with up-to-date routing tables is tempered by added overhead costs. • The exchange of route information adds overhead by consuming network bandwidth. • This overhead can be an issue with low-bandwidth links between routers. Routing Protocols