1. The router is also called the IP gateway, and the Gateway Protocol is the protocol for exchanging routing information between gateways.
2. Autonomous systems:
(1) Autonomous system is connected by the homogeneous gateway of the Internet, autonomous system within the gateway to perform internal Gateway Protocol (IGP), mutual exchange of routing information
(2) The IGP is dedicated within the autonomous system, serves for a particular application, is not valid outside the autonomous system;
(3) An Internet may also be interconnected by different autonomous systems, such as in the case of a number of campus networks interconnected by a WAN; the use of an external gateway Protocol (EGP) to exchange routing information between different autonomous systems
3. External Gateway Protocol:
(1) EGP to the autonomous system as a node, notify each gateway to which systems
(2) The latest external gateway protocol, called BGP,BGP4, has been widely applied to different ISP networks, and becomes the de facto Internet external gateway protocol.
(3) BGP4 is a dynamic routing Discovery protocol, and the main function of supporting Classless Inter-domain routing CIDR;BGP is to control the routing strategy, such as whether to forward the crossing packet, etc.
(4) 4 types of BGP messages, forwarded via TCP (179 port) connection:
① Open Establish neighbor relationship
② Update sends new routing information
③ maintain active response to open/periodic confirmation of neighbor relationships
④ Notification reports detected errors
(5) Establishing a neighbor relationship: Two routers located in different autonomous systems first to establish a neighbor relationship, and then to exchange information periodically; The process of establishing a neighbor is to send an open message from one router, and the other router to answer the keepalive message if it is willing to accept it. The open message contains the sender's IP address and the identity of the autonomous system, plus a hold-time parameter, which is the time interval for exchanging information on a regular basis;
(6) Neighbor Accessibility: This process to maintain the effectiveness of the neighbor relationship, through the periodic transmission of keepalive messages, both sides know each other's activity status;
(7) Network accessibility: Each router maintains a database that records all of its reachable subnets, and updates the latest information to other BGP routers in a timely manner when the situation changes, and the update message contains two types of information:
① class is the list of routers to be deprecated
The ② class is the attribute information for new routes:
Network layer reachable information (NLRI)
Passed autonomous System (AS_PATH)
Next hop (next-hop)
(8) BGP messages have a fixed-length header of 19 bytes, which includes 16-byte tokens (for authentication and synchronization), two-byte message lengths, and a byte-type field
(9) BGP routing update message, field:
① Unavailable route Length (two bytes): Indicates the length of the reclaimed field;
② Recycle route (variable length): Contains a list of IP address prefixes for routes revoked from the service;
Total length of ③ Path property (two bytes)
④ Path Property (variable length): Contains a list of attributes associated with the IP address prefix in the Network Layer Accessibility information field, such as the source of routing information, route priority, BGP entities that implement route aggregation, and routing information that is lost when routing aggregation;
⑤ Network layer Accessibility information (variable length)
4. Internal Gateway Protocol: Gateway Protocol, also known as routing Protocol, is a mechanism for sharing routing information between routers, which allows routers to exchange routing information to maintain their respective routing tables;
(1) Common internal routing protocols: RIP (Information Protocol), OSPF (Open Shortest Path Protocol), Is-is (intermediate system to intermediate System), IGRP (Internal Gateway Routing protocol), and enhanced IGRP Protocol (EIGRP)
(2) Routing Information Protocol: RIP uses a distance vector routing algorithm, suitable for small networks, because it allows no more than 15 steps of the number of hops;
(3) RIPv1:
①RIPV1 uses the local broadcast address 255.255.255.255 to publish routing information, the default route update cycle is 30s, holding time is 180s, that is, the RIP router sends a route update message to all neighbors every 30s
② If the routing update message is not received from a neighbor within 180s, it is assumed that the neighbor does not exist, and if a routing update message is received from another neighbor about the same target, the new routing information is replaced with the invalid routing table entry, otherwise the corresponding routing table entry is deleted;
③rip the number of hops to measure the cost of routing, in the RIP protocol, 15 hops is the maximum hop count, 16 hops is unreachable network, after 16 hops any packet will be discarded by the router;
④RIPV1 is a class protocol, which means that the A,b,c class IP address and subnet mask must be used when configuring RIPV1
⑤ for the same target, RIP routing table entries can have up to 6 of the cost of the path, although the default is 4, RIP can achieve the same cost path load balancing, this mechanism provides the link redundancy function. To deal with a possible connection failure;
(4) RIPv2: Basic or a distance vector routing protocol, but there are 3 improvements
① uses multicast instead of broadcasts to propagate routing update messages. And the trigger update mechanism is adopted to speed up the routing convergence, that is, the routing update message is sent to the neighbor immediately when the routing change occurs, without waiting for the update period to arrive;
②ripv2 is an classless protocol that can be used with variable eldest-son netmask, and also supports classless Inter-domain Routing (CIDR)
③ripv2 supports authentication and uses hashed password words to limit the propagation of updated information
(5) Route convergence and horizontal segmentation:
① Routing Convergence: the latter two of each routing table are learned by exchanging routing information
② distance vector algorithm requires the neighboring routers to periodically exchange routing tables, and through the gradual exchange of routing information spread to all the routers in the network, this gradual exchange process if not restricted, will form a routing loop, so that each router can not be consistent with the accessibility of the network;
The ③ solves the routing loop problem by using the horizontal segmentation method, which specifies that the router must selectively send information from the routing table to the neighbor, rather than the entire routing table, simply that a routing information is not sent to the source of that information
④ a horizontal split scheme with anti-poisoning: Set the routing cost learned from the neighbor to infinity and send it to the neighbor immediately; the anti-poisoning scheme is more secure, it can interrupt the loop immediately;
(6) RIP message format: RIPV2 protocol encapsulated in the UDP datagram sent, occupy Port 520, the message contains 4 bytes of the header, and then a number of routing records, RIP messages can carry a maximum of 25 route records, each route records 20 bytes:
① command: Used to differentiate request and response messages
② version: Can be the first or second version of RIP, two versions of the same message format
③ Address Family identifier: For IP protocol, this field is 2
④ route tag: used to differentiate between internal or external routes, using 16-bit as numbers to distinguish routes learned from other autonomous systems
⑤ Network Address: Indicates the destination IP address
⑥ Subnet Mask: For RIPv2, this field is the subnet mask for the corresponding network address, and for RIPV1, the field is 0. Because RIPV1 uses the A,b,c class address mask by default;
⑧ Next Hop Router address: The address that represents the next hop
⑨ Distance: Indicates the number of hops to reach the target
5.OSPF protocol: A link-state protocol for exchanging routing information among autonomous routers; OSPF has the advantages of supporting large-scale networks, consuming less network resources, and fast routing convergence.
(1) The distance vector protocol publishes its own routing table, the routing information of the interchange is very large; The link state protocol differs from each router by collecting link state information, constructing network topology diagram, and using Dijkstra's shortest path priority algorithm to calculate the best route to each target;
(2) The link state protocol and the distance vector protocol publish routing information in different ways, the distance vector protocol is the periodic release routing information, and the link state protocol is the routing information released when the network topology changes, and OSPF uses TCP to send the paper, each message needs to be answered, so the communication is more reliable;
(3) The OSPF protocol introduces the concept of "layered routing". The typical link state protocol divides the network into smaller regions, thus restricting the scope of the router's information transmission; Each region is like a separate network, and the routers in the region only hold the link state information of the area, so that the router's link state database can be saved to a reasonable size. The time and the number of messages in the routing calculation are not too large; the OSPF backbone is responsible for propagating routing information between regions;
(4) OSPF area: Each OSPF area is assigned a 32-bit area identifier, which can be expressed in dotted decimal notation; the OSPF area is divided into 5 types:
① Standard Zone: The standard zone can receive any link update information and routing summary information;
② Backbone area: The backbone area is a transport network connected to each region, and the other regions Exchange routing information through the backbone area, and the backbone area has all the properties of the standard area;
③ stub zone: does not receive routing information outside of the local autonomous system and uses the default route for targets other than autonomous systems 0.0.0.0
④ full stub zone: does not receive routing information other than the autonomous system, nor does it receive routing summary information for other areas within the autonomous system, and messages sent outside the local zone use the default route 0.0.0.0., which is the Cisco standard
⑤ incomplete stub zone: similar to Stub zone, but allows to receive external routing information sent with link-state announcements of type 7;
(5) OSPF network type: OSPF divides the physical network connected by the router into 4 types
* * Point-to-point network: A pair of routers with a 64Kb serial line connection, is a point-to-point network, in such a network, two routers can exchange routing information directly;
* * Broadcast Multiple access network: Ethernet or other LAN with shared media belongs to this network, in which a network of information can be broadcast to all routers;
* * Non-broadcast Multiple access Network (NBMA): For example, the X. Packet switching network belongs to this network, in which the routing information can be distributed by multicast
* * Point to Multipoint Network: The non-broadcast network can be used as a multi-point-to-point network, so that a routing information sent to different targets;
(6) In a broadcast network or NBMA network to choose a designated router (DR), the other routers are established adjacent to the DR, the link state information of their own to submit to Dr, by Dr representative of the network to the outside world release;
(7) OSPF routers: In a multi-area network, OSPF routers can be divided into the following 4 types of functions:
* * Internal router: All routers within the same region, maintaining only one link state database
* * Backbone Router: A router with a connection to the backbone area;
* * Regional Border router ABR: A router that connects multiple regions, usually as an exit of an area, the ABR establishes a link state database for each connected area, which is responsible for sending the routing summary information of the connected zone to the backbone area, while the ABR on the backbone area is responsible for sending the information to each region;
* * Autonomous System Border routers: at least one router connected to an external autonomous system interface, responsible for routing information from the external non-OSPF network into the OSPF network;
(8) Link status announcement (LSA): Network topology information is exchanged between OSPF routers through link state announcements;
LSA Type: Sender: Propagation Range: Description:
1. Router LSA; The link state of the routers within the zone of an OSPF router in an area;
2. Network LSA, Dr; designated routers in the region each router connected within the zone
3. Network rollup LSA ABR backbone area The link state in the local area of the ABR connection
4.ASBR Summary LSA ABR Backbone Region Autonomous system boundary Router ASBR accessibility
5. External LSA ASBR routing information other than stub outside the autonomous system of the zone
6. Multicast LSA for establishing multicast distribution tree
7.NSSA LSA connected to NSSA asbr incomplete stub zone to reach destinations outside the autonomous system the route can be converted by the ABR to the LSA of type 5
(9) OSPF 5 kinds of messages: sent through a TCP connection, flooding the hello message at a fixed time interval, using the destination address 224.0.0.5 represents all OSPF routers;
1.Hello for discovering neighboring routers
2. Database description DBD represents the sender's link state database content
3. Link status request the LSR requests link state information to the other side
4. Link status update LSU sends link status announcements to neighbor routers
5. Link state Response lsack response to link status update messages
(ten) The format of the OSPF message header:
1. Version: Use version 2 now;
2. Type: 5 types of messages;
3. Packet Length: The length of the entire OSPF message;
4. Router ID: Use the Router Loop interface (Loopback) IP address as the identity of the router, if there is no loop interface IP address, then select the largest interface IP address as the router identity;
5. Zone ID: In a multi-zone network, specify a zone ID for each region
6. Authentication type: OSPF supports different authentication methods, the Hello packet sent to the multicast address 224.0.0.5 is authenticated to be received;
(one) Advantages of OSPF:
1. The link state protocol uses a layered network structure that reduces the spread of LSA and reduces the likelihood that network topology changes affect all routers;
2. The link-State protocol uses multicast to share routing information, and it publishes incremental update messages;
3. The link state protocol supports classless routing and routing summarization, using VLSM and CIDR technology, and routing rollups reduce the link state database, reducing the CPU cycles required to run the SPF algorithm and updating the routing table, as well as reducing the storage requirements in the router
4. Using the SPF algorithm does not present a loop in the routing table, which is a difficult problem to be handled by the distance vector routing protocol.
2016.8.14 Network Engineer's Gateway Protocol