TCP/IP Note 2. Network Layer (2) -- ICMP, RIP, OSPF, BGP

Source: Internet
Author: User

TCP/IP Note 2. Network Layer (2) -- ICMP, RIP, OSPF, BGP 1. ICMPICMP (Internet Control Message Protocol): improves the chances of successful IP datagram delivery. 1.1 features ICMP allows the host or router to report errors and reports exceptions. ICMP is not a high-level protocol, but an IP layer protocol. An ICMP packet is used as the data of an IP-layer datagram, And the header of the datagram is added to send an IP datagram. 1.2 format 1.3 packet type Value Type Error Message 3 destination cannot reach 4 Origin Site suppression 11 time exceeds 12 Parameter Problem 5 change route (redirection) 8 or 0 of the Inquiry message will send a request or answer a 13 or 14 timestamp request or answer 1.4 Application (1) Ping (Packet InterNet Groper) ping can be said to be the most famous application of ICMP, when a website cannot be accessed. Usually ping this website. Ping will display some useful information. The general information is as follows: Reply from 10.4.24.1: bytes = 32 time <1 ms TTL = 255 Reply from 10.4.24.1: bytes = 32 time <1 ms TTL = 255 Reply from 10.4.24.1: bytes = 32 time <1 ms TTL = 255 Reply from 10.4.24.1: bytes = 32 time <1 ms TTL = 255 Ping statistics for 10.4.24.1: Packets: Sent = 4, Received = 4, lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0 ms, Maximum = 0 ms, Average = 0msping the word is derived from sonar location, and the role of this program is indeed so, it benefits Use an ICMP packet to detect whether another host is reachable. The principle is to request ICMP requests with a type code of 0, and the requested host responds with an ICMP response with a type code of 8. Ping the program to calculate the interval and the number of packets delivered. You can determine the network conditions. We can see that ping provides the data of the transfer time and TTL. The example I gave is not very good. Because there are few routes, You can ping a foreign website, such as sf.net, if you are interested. Then you can see packet loss, the program runs for a longer time. Ping also gives us a chance to view the route from the host to the target host. This is because, when the ICMP ping request datagram passes through a vro, The vro will put its own ip address in the report. The target host will copy the ip address list to the host in response to the icmp packet. However, in any case, the list of routes that the ip header can record is very limited. To observe routing, we still need to use a better tool, that is, Traceroute (tracert in windows ). 2. Router selection Protocol (1) Internal Gateway Protocol IGP (Interior Gateway Protocol) is the routing selection Protocol used inside an autonomous system. Currently, this type of routing is used most frequently, such as RIP and OSPF. (2) If the External Gateway Protocol EGP (External Gateway Protocol) is in a different autonomous system, when the datagram is transmitted to the boundary of an autonomous system, you need to use one protocol to transmit route selection information to another autonomous system. This Protocol is the external gateway protocol EGP. BGP-4 is currently the most used in external gateway protocols. 2.1 RIP (Routing Information Protocol) 2.1.1 working principle RIP is the most widely used Protocol in the IGP of the Internal Gateway Protocol. It is a distributed Distance Vector-based Routing Protocol, each vro in the network must maintain a distance record from itself to each other's destination network. (1) Send a rip request packet to each known router, requiring other routers to provide a complete route table. The command field of this type of message is 1, the address field is 0, and the measurement area is 16 (equivalent to infinity ). (2) accept the request. If you receive the request just now, submit your complete route table to the requester. If not, process the IP request table items and add some of the table items to the number of hops, while others to the number of hops. Then send it to the requester. (3) Accept the response. Update your route table. Use a small hop number rule. (4) Update the route table on a regular basis. Generally, the route table is updated for 30 s (which is really frequent) to inspire the adjacent Route table. This form can make the broadcast form. Distance: the distance in the RIP Protocol is also called the hop count, because each time a router passes through, the hop count is increased by 1. RIP allows a maximum of 15 routers in a single path. RIP is only applicable to small Internet 2.1.2. Advantages and disadvantages (1) one problem with RIP is that when the network fails, it takes a long time to transmit this information to all routers. (2) The biggest advantage of the RIP Protocol is its simplicity and low overhead. (3) RIP limits the network size. The maximum distance it can use is 15 (16 indicates inaccessible ). (4) The route information exchanged between routers is the complete route table in the router. As the network grows, the overhead increases. disadvantage: The good news spread fast, while the bad messages spread slowly. It usually takes a long time (for example, several minutes) to transmit network faults ). This is a major drawback of RIP. 2.1.3 RIP2 packet format 2.2 Basic Features of the Internal Gateway Protocol OSPFOSPF (Open Shortest Path First) 2.2.1 (1) "Open" indicates that the OSPF protocol is not controlled by a vendor, but published publicly. (2) "Shortest Path First" is because the shortest path algorithm SPF (3) proposed by Dijkstra is only a protocol name, it does not indicate that other routing protocols are not "Shortest Path First ". (4) Distributed Link Status Protocol. 2.2.2 three key points (1) send information to all vrouters in the autonomous system. The flood method is used here. (2) The sent information is the link status of all routers adjacent to the current vro, but this is only part of the information that the vro knows. "Link status" indicates which routers are adjacent to the vro and the "metric" of the link ). (3) The router sends this information to all routers in flood mode only when the link status changes. Note the difference with RIP Protocol 2.2.3 region OSPF divides an autonomous system into several smaller ranges, called regional benefits: (1) limit the scope of link state information exchange by flood to every region rather than the entire Autonomous System, which reduces the traffic on the entire network. (2) A vro in a region only knows the complete network topology of the region, but does not know the network topology of other regions, in this way, link-state database2.2.4 OSPF is directly transmitted using IP datagram (1) OSPF is directly transmitted using IP datagram instead of UDP. It can be seen that OSPF is located at the network layer. (2) OSPF datagram is short. This reduces the traffic of route information. (3) Another advantage of a very short datagram is that it does not necessarily have to transmit long datagram fragments. As long as one piece of data is lost, it cannot be assembled into the original data, and the whole data packet must be re-transmitted. 2.3 BGPBGP is a protocol used to exchange route information between vrouters of different Autonomous Systems. 2.3.1 each AS (Autonomous System) Administrator of the Spokesperson should select at least one router AS the "BGP spokesman" for the autonomous system ". Communication between different AS instances is achieved through the "spokesman" Exchange of information (through TCP connections ). 2.3.2 BGP-4 packet (1) Open packet, used to establish a relationship with another adjacent BGP spokesman. (2) Update messages are used to send information about a route and list multiple routes to be withdrawn. (3) Keepalive messages are used to confirm the Enable message and periodically confirm the relationship between neighboring sites. (3) A notification message used to send detected errors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.