IP routing
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
|
IP routing is the application of
Networks are separated from each other by specialized hosts, called gateways or
A routing protocol specifies how routers communicate and share information about the topology of the network, and the capabilities of each routing node. Different protocols are often used for different topologies or different application areas. For example, the Open Shortest Path First (OSPF) protocol is generally used within an enterprise and the Border Gateway Protocol (BGP) is used on a global scale.[1] BGP is the de facto standard for worldwide Internet routing.
Protocol classification
Routing protocols may be broadly distinguished by their realm of operation in terms of network scope. Interior gateway protocols are used for routing within autonomous systems, while exterior gateway protocols route traffic between them. The former group is exemplified by the Routing Information Protocol (RIP) and Open Shortest Path First (OSPF), while the Exterior Gateway Protocol (EGP) and the Border Gateway Protocol (BGP) are examples of the exterior type. BGP is the dominant route distribution protocol used on the Internet.
Routing algorithm
The IP forwarding algorithm is a specific implementation of
The IP forwarding algorithm states:[2]
- Given a destination IP address, D, and network prefix, N:
- if ( N matches a directly connected network address )[3][a]
- Deliver datagram to D over that network link;
- else if ( The routing table contains a route for N )
- Send datagram to the next-hop address listed in the routing table;
- else if ( a default route exists )
- Send datagram to the default route;
- else
- Send a forwarding error message to the originator;
When multiple route table entries match, the entry with the longest
When no route is available, an ICMP error message is sent to the originator of the packet,[2] to inform that host that the packet could not be delivered. To avoid unnecessary retransmission to avoid network congestion, the sending host should either stop transmitting or choose another address or route.
Routing table
The following presents a typical
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 71.46.14.1 0.0.0.0 UG 0 0 0 ppp0 10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0 71.46.14.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 172.16.0.0 0.0.0.0 255.240.0.0 U 0 0 0 eth0 192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 192.168.1.0 192.168.96.1 255.255.255.0 UG 0 0 0 eth0 192.168.96.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
The host has several network interfaces. eth0 is the interface name of the
A default route is recognized by the destination 0.0.0.0 and the flag G. A
Flag | Description |
---|---|
G | Use Gateway (gateway filled in) |
H | Target is a Host ( bitmask of 32 bits)
|
U | Route is Up |
Notes
- ^ Many implementations list these directly-connected networks as routing table entries, in which case, this condition is handled by the general route table lookup.
References
- ^ a b Comer, Douglas E. (2000). Internetworking with TCP/IP (4th ed.). Upper Saddle River, NJ: Prentice Hall.
- ^ a b c "IP Routing and Subnets". Retrieved 2022-08-02.
- ^ "Guide to IP Layer Network Administration with Linux - chapter 4.2. Routing to Locally Connected Networks". Retrieved 2022-08-02.