Standard Routing Tables
1. The Basic Concept of Next-Hop Routing
The routing table only specifies the next step on the path from this router to the destination, without knowing the complete path to the destination.
2. A Standard IP Routing Table Contains Many (N, R) Pairs
N: IP address of the destination network
R: IP address of the next router on the path to N.
Basic Next-Hop Routing Algorithm:
RouteDatagram(Datagram, RoutingTable)
{
Extract the destination IP address D from the Datagram, and calculate the network number N;
if N matches the network address of a network directly connected to the router
Then deliver directly on that network (encapsulation, physical address binding, transmission, etc.)
ElseIf RoutingTable contains a route to N
Then send the Datagram to the next hop specified in the RoutingTable
Else routing error
}
Static Routing and Dynamic Routing
Static routing is established and managed manually, does not change automatically, and must be manually updated to reflect changes in the internet topology or connection methods.
Characteristics of Static Routing:
Advantages: Secure, reliable, simple, and intuitive, avoiding the overhead of dynamic routing selection.
Disadvantages: Not suitable for complex internet structures; involves heavy establishment and maintenance workloads and is prone to routing loops.
When an internet failure occurs, static routing does not automatically make changes.
Applicable Environment: Less complex internet structures
Dynamic routing can learn by itself and automatically modify and refresh the routing table. Dynamic routing requires routers to continuously exchange routing information with each other.
Characteristics of Dynamic Routing:
Advantages: More autonomy and flexibility
Disadvantages: Exchanging routing information consumes network bandwidth; the dynamic modification and refreshing of routing tables consume the router’s memory and CPU processing time, using up the router’s resources.
Applicable Environment: Internet structures with complex topologies and large network scales, automatically eliminating erroneous paths and automatically selecting paths with better performance.
Path Metric Value (metric)
The metric is a value representing the quality of a path; the smaller the metric, the better the path.
The calculation of the metric can be based on one characteristic of the path or on multiple characteristics of the path.
Hop Count: The number of routers an IP datagram must pass through to reach the destination.
Bandwidth: The data capacity of the link.
Delay: The time required to send data from the source to the destination.
Load: The amount of information flow activity in the network (such as in routers or links).
Reliability: The error rate during data transmission.
Cost: A variable value, usually specified by the network administrator based on factors such as bandwidth, construction costs, maintenance costs, and usage fees.
Routing Protocols:
1. Basic Conditions for Using Dynamic Routing
Routers must run the same routing protocol and execute the same routing algorithm.
2. Widely Adopted Routing Protocols
Routing Information Protocol (RIP): Uses the vector-distance algorithm.
Open Shortest Path First (OSPF) Protocol: Uses the link-state algorithm.
3. Routing Convergence
Meaning: All routers in the internet are running the same, accurate routing information that sufficiently reflects the current internet topology.
Fast convergence is the most desirable characteristic of a routing protocol.
Routing Algorithms:
1. Vector-Distance Routing Algorithm
Basic Idea: A router periodically broadcasts its known routing information to its neighboring routers to inform them of the networks it can reach and the distance to those networks. Neighboring routers can then modify and refresh their own routing tables based on the received routing information.
Advantages: Simple algorithm, easy to implement
Disadvantages: Slow convergence problem: Path changes in routers need to propagate like waves from neighboring routers, which is a slow process.
Requires a large amount of information