Chapter 10 Dynamic Calling Agreement
Chapter IX tells how an IP is retinalized to the network, how the router finds the correct path and sends it to the location. The router looks for the host item in the routing table, and if you find it, you will send it. If you can't find it, you can find the network item that matches this IP. If you find it to this network, the router of this network is responsible for forwarding to the correct location. If the network item is not found, it is sent to the default route. The default routing generally has more routing tables to find more destinations. If the default route cannot be processed, it retains IP data to its default route. This process has continued until the correct host is found, or if it receives an ICMP error "The host is not reached". In the process of forwarding the datagram, the router may issue an ICMP redirection message to help form a more efficient transmission path.
Chapter 10 discusses the passage between routes between routers in more detail. The agreement mentioned is: RIPv1, RIPv2, OSPF, BGP, CIDR.
The Internet is organized in a group of autonomous systems (AS, AutoMous System), and each autonomous system is usually managed by a single entity.
Each autonomous system can select the selection protocol between the various routers in the autonomous system. This protocol we call it the internal gateway protocol IGP (Interior Gateway Protocol) or an IntrAdomain Routing Protocol.
The most commonly used IGP is the routing information protocol RIP. A new IGP is an open shortest path priority OSPF (Open Shortest Path First) protocol. It is intended to replace RIP.
RIP, the Routing Information Protocol (Routing Infromation Protocol). The protocol format is:
- 20 bytes - - 8 bytes - ----------
IP Header UDP HEADER RIP DATA
----------- ---------- --------
The entire RIP data is set in the UDP datagram.
The RIPv1 protocol format is:
0 7 8 15 16 31
------ -------- --------------
COMMAND VER 0
------ -------- ---------------- -
AddR Type (2) 0
----------------------------------
IP Addr (32 BITS)
----------------------------------
0
----------------------------------
0
----------------------------------
Metric (1..16)
---------------------------------- --- 20 Bytes Each
Other 24 (Up to) Routing Info ----------------------------------
The command command is divided into two: 1 for the request, 2 is an answer. There is also discarded commands (3 and 4), informal commands (5 and 6).
VER version, V1 is 1, V2 is 2.
Behind is followed by specific routing information, each route accounts for 20 bytes.
The Addr Type address type, the IP address is 2.
From the above protocol format, each message can carry up to 25 routing information. So if the routing table is relatively large, multiple messages need to be transmitted.
Restricting the basis for only 25 routing information per time is the total size of the datagram. If all are finished, 25 * 20 4 = 504 <512.
Use process:
Broadcast messages to all interfaces are broadcast each time you start.
The nearby router receives its routing information back after receiving the request message.
Every 30 seconds, the router broadcasts its own routing to other routers.
If there is a routing metric (HOP), only this routing information is sent.
Each route has a timer associated with it. If the system running the RIP discovers that a route is not updated within 3 minutes, the measurement of the route is set to infinity (16), and is marked as delete. This means that there is no update to the router of the route in 6 30 seconds. After another 60 seconds, the route will be removed from the local routing table to ensure that the failure of the route has been propagated.
The measurement information included in RIP is calculated by hip (HOP), and each router is jumped. When the same host has multiple routing information, the router selects the least hop number, and ignores others.
The provisions 16 are the upper limit of the number of hops, which is equivalent to "irreparable". Therefore, in RIPv1, each routing message can be 15 hops. If an AS range is superior to this hop, RIP use will have a limit. In addition, there is no subnet mask in the routing information of the RIP, so I don't know that an address is a host address or a network address. If the link fails, routing information takes a long time to stabilize. In a stable process, it is likely to form a routing loop and need to be careful.
RIPv2 is basically used in the format of RIPv1, but bytes must be 0 in V1. Use these bytes to indicate additional information, such as subnet mask, routing flag, next station IP address, etc. Can be compatible with RIP.
Another IGP protocol is open to the shortest path priority OSPF, overcoming all the shortcomings of the RIP protocol, and there are many advantages, therefore widely used. Basic thinking is that the router actively checks the link state of the neighboring router, and sends status information to other routers, and other routers can create a complete routing table based on this information. OSPF uses the IP protocol directly.
BGP is used for the boundary of the AS autonomous system, exchange routing information between other autonomous systems. Unlike RIP, BGP uses TCP connections to exchange routing information and checks once a connection every 30 seconds. If there is a routing information update, the other router is immediately notified.
Another kind of CIDR (no type of inter-domain routing) for autonomous system boundary is CIDR. Basic ideas are routed to subnet, more specific circuit resolution. The required subnet mask must determine the specific route by the operation of the subnet mask. This method can reduce the number of routing information.