28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter<br />

CHAPTER<br />

8<br />

8<br />

IP Routing<br />

8<br />

8.0 Introduction<br />

Routing is the act of forwarding packets toward a given destination from one network<br />

segment or interface to the next. Routing tables, also sometimes called routing<br />

information bases (RIBs), are the databases that routers use to route traffic toward<br />

their destination. These tables contain the network addresses and prefixes that have<br />

been learned from dynamic routing protocols such as RIP, IS-IS, OSPF, and BGP;<br />

that have been learned statically from static (configured) routing-table entries; and<br />

that have been learned from the router’s network interfaces. Each address and prefix<br />

in a routing table has a next hop associated with it that takes the packet one hop<br />

closer to its destination.<br />

Each IP packet that a router receives contains two types of information: the packet<br />

data itself (the packet’s payload) and information that identifies the packet. In IP<br />

packets, the identifying information is at the beginning of the packet, in the header.<br />

One of these header fields is the source address, which states the packet’s origin;<br />

another, which is key to the routing tables, is the destination address, which tells<br />

where the packet is going when the router uses standard destination-based forwarding.<br />

(Routing policy can alter the path toward a destination.) When the router is<br />

determining the path toward the destination, it checks the routing table for a route<br />

that matches the packet’s destination and then sends the packet to the next hop<br />

associated with that route. If there is no exact match, the router locates a more general<br />

route, selecting the longest match, which is the route that matches the most bits<br />

in the network portion of the address. For example, if the packet’s destination is<br />

10.0.16.2 and the routing table contains a route to 10.0.16.2/32, which is the<br />

address of the specific host, the packet is sent using the next hop associated with<br />

that route. If the only matching routes in the table are 10.0.0.0/8 and 10.0.16.0/24,<br />

the latter route is used because it is the longest match.<br />

If no match is found in the routing table, the default route of 0.0.0.0/0 is used if it<br />

exists. If no default route is configured or learned, the traffic is dropped.<br />

246<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!