Network Routing Tables and Datagram Forwarding
Classified in Language
Written on in
English with a size of 4.52 KB
Types of Network Routing
There are three primary types of routing defined in a routing table:
- Direct Routing: The destination machine is located within the same local network (access network). The IP address and subnet mask are known. The IP datagram is transmitted directly to the destination or an adjacent neighbor (whose address is registered in the routing table's route field). The machine itself is capable of performing this routing without involving an intermediate router. A neighbor is another machine connected to the same network segment.
- Indirect Routing: The target machine is not in the same access network. The network address of the target machine is known, and the datagram must be forwarded through a neighboring router (the next hop).
- Default Routing (By Default): The target machine is not connected to the same access network, and its specific network address is unknown. The IP datagram must be delivered to a designated neighboring router, typically the default gateway.
Router Functions and IP Comparison
Each router maintains a routing table containing the IP addresses of neighboring routers and information about all reachable networks and subnets that form the overall network topology. A router performs numerous functions, corresponding to the number of networks it is connected to.
By comparing the destination IP address with entries in its table, the router determines if the destination is on the same network segment. If it is, the data is transmitted directly; otherwise, it is routed indirectly or via the default route.
The comparison process uses the Logical AND operation. The subnet mask is applied to the destination IP address to determine the network address. If the resulting network address matches a known entry, the route is used. If no specific route is known, the default route (represented by the entry 0.0.0.0) is utilized.
Subnet Design Principles
When designing subnets, network administrators should aim to:
- Assign the highest possible number of available host IP addresses to each subnet based on requirements.
- Ensure the subnet mask covers the minimum necessary number of bits required to uniquely distinguish that subnet's network ID from other used IP subnets.
Router Role and User Transparency
A router forwards IP datagrams based on the destination network address or subnet. The amount of routing information stored within a router is directly proportional to the number of networks it is connected to or knows about.
Crucially, the router is transparent to the end user. Users do not need to know or identify the addresses of intermediate routers or systems every time they connect to the internet, as the routing process handles this automatically.
Routing Table Configuration and Hierarchy
When configuring a router, the routing table must contain entries for all numerical addresses and subnets that are formed within its domain.
It is common to use multiple routers for complex routing tasks. Each router will maintain specific and relevant information in its table, including addresses and subnets known via direct access, indirect routes, or default routes.
In a hierarchical network, outermost routers (those connecting to external networks like the internet) typically hold more comprehensive information than innermost routers (internal to a local network). The outermost router often utilizes a single default address (0.0.0.0) for any destination outside the known internal network.
Routing Table Entry Priority
The order and specificity of entries in the routing table are crucial for determining the correct route (often referred to as the Longest Prefix Match).
The routing process prioritizes entries as follows:
- The first entry checked should correspond to the highest priority route (most specific network match).
- The last entry checked is typically the most general route, which in most cases corresponds to the default route (
0.0.0.0/0).
When comparing a destination address against the table, the router starts by looking for the most specific match. Addresses are often conceptually sorted by specificity. The comparison proceeds bit by bit, from left to right, until a distinguishing bit is found between the destination address and the network address entry.