Routing methods, devices and storage media
By redirecting routes to a second line card with larger storage capacity when routing fails in network devices, the problem of poor routing performance caused by insufficient storage capacity in existing technologies is solved, and efficient routing performance is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2023-06-29
- Publication Date
- 2026-07-31
AI Technical Summary
In existing technologies, the routing performance of network devices is limited by line cards with low storage capacity, resulting in high replacement costs and low efficiency, making it difficult to effectively improve routing performance in large-scale network deployments.
When the first line card receives a route addition failure, the target second line card is identified, and a route request message is sent to it. The failed route is then redirected to the second line card with larger storage capacity for forwarding. By utilizing the differences in storage capacity among multiple line cards, the overall performance of the routing device is improved.
This technology improves the routing performance of network devices without increasing hardware costs, avoids performance degradation caused by insufficient storage capacity, and enhances the routing capabilities and competitiveness of the devices.
Smart Images

Figure CN116760760B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, and in particular relates to a routing method, apparatus and storage medium. Background Technology
[0002] The routing table entries configured on multiple line cards of network devices (such as routers and switches) typically need to be consistent. To improve the routing performance of network devices, the number of routing table entries configured on these multiple line cards needs to be increased.
[0003] However, different line cards have different storage capacities. Therefore, the routing performance of network devices generally depends on line cards with lower storage capacities. Currently, the main approach is to replace line cards with lower storage capacities with newer line cards with higher storage capacities. When dealing with a large number of network devices, this approach can easily lead to high network deployment and maintenance costs, and is time-consuming, labor-intensive, and inefficient. Summary of the Invention
[0004] This application provides a routing method, apparatus, and storage medium for conveniently improving the routing performance of network devices and avoiding the problems of high cost and low efficiency.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] In a first aspect, a routing method is provided, applied to a first line card, the first line card belonging to a routing device including the first line card, multiple second line cards and a main control board; the method includes: receiving a first message from the main control board for requesting to add a route; when adding a route fails, determining a target second line card; and sending a second message to the target second line card for requesting to add a route.
[0007] Optionally, the first line card is configured with redirection rules pointing to the redirection address; when adding a route fails, the method for determining the target second line card specifically includes: when adding a route fails, reading the redirection rules; and determining the second line card corresponding to the redirection address as the target second line card.
[0008] Optionally, the main control board is used to send port information of other second line cards to the first line card when the bandwidth utilization of the target second line card is greater than or equal to a first preset threshold; the other second line cards are second line cards other than the target second line card among a plurality of second line cards, and whose bandwidth utilization is less than or equal to the second preset threshold; the method further includes: receiving port information of other second line cards from the main control board; and updating the redirection address to the port information of other second line cards.
[0009] Optionally, the second message includes the virtual route forwarding (VRF) corresponding to the route, as well as the destination Internet Protocol (IP) address and service data packets.
[0010] In a second aspect, a routing device is provided, applied to a first line card, the first line card belonging to a routing device including the first line card, multiple second line cards and a main control board; the device includes: a receiving unit, a determining unit and a transmitting unit;
[0011] The receiving unit is used to receive the first message from the main control board requesting the addition of a route;
[0012] The determination unit is used to determine the target second-line card when adding a route fails;
[0013] The sending unit is used to send a second message to the target second line card determined by the determining unit to request the addition of a route.
[0014] Optionally, the first line card is configured with redirection rules pointing to the redirection address; the determining unit is specifically used for:
[0015] If adding a route fails, read the redirection rules;
[0016] The second line card corresponding to the redirected address is identified as the target second line card.
[0017] Optionally, the main control board is used to send port information of other second line cards to the first line card when the bandwidth utilization of the target second line card is greater than or equal to the first preset threshold; the other second line cards are second line cards other than the target second line card among a plurality of second line cards, and whose bandwidth utilization is less than or equal to the second preset threshold; the device further includes: an update unit;
[0018] The receiving unit is also used to receive port information from other second line cards on the main control board;
[0019] The update unit is used to update the redirected address with the port information of other second-line cards.
[0020] Optionally, the second message includes the VRF corresponding to the route, as well as a data packet containing the destination IP address and service data.
[0021] Thirdly, a routing device is provided, including a memory and a processor; the memory is used to store computer-executed instructions, and the processor is connected to the memory via a bus; when the routing device is running, the processor executes the computer-executed instructions stored in the memory to cause the routing device to perform the routing method as described in the first aspect.
[0022] The routing device can be a network device or a component of a network device, such as a chip system within the network device. The chip system supports the network device in implementing the functions involved in the first aspect and any of its possible implementations, such as receiving, determining, and routing the data and / or information involved in the aforementioned routing method. The chip system includes a chip, but may also include other discrete devices or circuit structures.
[0023] Fourthly, a computer-readable storage medium is provided, including computer-executable instructions that, when executed on a computer, cause the computer to perform the routing method as described in the first aspect.
[0024] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on the first computer-readable storage medium. The first computer-readable storage medium may be packaged together with the processor of the routing device, or it may be packaged separately from the processor of the routing device; this application does not impose any limitation on this.
[0025] In this application, the names of the aforementioned routing devices do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear under other names. As long as the functions of each device or functional module are similar to those in this application, they fall within the scope of the claims of this application and their equivalents.
[0026] These or other aspects of this application will become more readily apparent in the following description.
[0027] The technical solution provided in this application brings at least the following beneficial effects:
[0028] Based on any of the above aspects, in this application, after receiving a first message from the main control board requesting the addition of a route, the first line card can, if adding the route fails, determine the target second line card and further send a second message requesting the addition of a route to the target second line card. Based on this, this application can redirect routes that failed to be added by the first line card to the target second line card, which has a larger number of stored routing table entries, even when the first line card has a small number of stored routing table entries, thereby achieving route forwarding and avoiding the problem of low routing device performance caused by insufficient routing table entries configured on the first line card. That is, the routing performance of the routing device in this application depends on the second line card with a larger storage capacity, which can possess higher routing capabilities and device competitiveness. Therefore, this application can be used to conveniently improve the routing performance of network devices, avoiding the problems of high cost and low efficiency. Attached Figure Description
[0029] Figure 1 A schematic diagram of the structure of a routing device provided in an embodiment of this application. Figure 1 ;
[0030] Figure 2 A schematic diagram of the structure of a routing device provided in an embodiment of this application. Figure 2 ;
[0031] Figure 3 This is a schematic diagram of the hardware structure of a routing device provided in an embodiment of this application;
[0032] Figure 4 A flowchart illustrating a routing method provided in this application embodiment. Figure 1 ;
[0033] Figure 5 A flowchart illustrating a routing method provided in this application embodiment. Figure 2 ;
[0034] Figure 6 A flowchart illustrating a routing method provided in this application embodiment. Figure 3 ;
[0035] Figure 7 A schematic diagram of a routing and forwarding process provided in this application embodiment. Figure 1 ;
[0036] Figure 8 A schematic diagram illustrating a rule update process provided in an embodiment of this application;
[0037] Figure 9 A schematic diagram of a routing and forwarding process provided in this application embodiment. Figure 2 ;
[0038] Figure 10 This is a schematic diagram of the structure of a routing device provided in an embodiment of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0041] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.
[0042] Furthermore, the terms "comprising" and "having" in the embodiments, claims, and drawings of this application are not exclusive. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but may also include steps or modules not listed.
[0043] To facilitate understanding of this application, the relevant elements involved in this application are described below.
[0044] To increase port density, network devices such as routers and switches are typically configured with multiple line cards. The routing table entries configured across these multiple line cards need to be consistent. To improve the routing performance of the network devices, the number of routing table entries configured across these multiple line cards needs to be increased.
[0045] However, different line cards have different storage capacities. Therefore, the routing performance of network devices generally depends on the line cards with lower storage capacity, that is, the line cards that store fewer routing table entries across multiple line cards.
[0046] Currently, the main approach is to replace line cards with lower storage capacity with newer line cards with higher storage capacity. However, when dealing with a large number of network devices, this approach can easily lead to high network deployment and maintenance costs, and is time-consuming, labor-intensive, and inefficient.
[0047] To address the aforementioned issues, this application provides a routing method. In this application, after receiving a first message from the main control board requesting the addition of a route, the first line card, if route addition fails, can determine a target second line card and further send a second message requesting the addition of a route to the target second line card. Based on this, this application can redirect routes that failed to be added by the first line card to the target second line card, which has a larger number of stored routing table entries, even when the first line card has a limited number of routing table entries. This achieves route forwarding and avoids the problem of low routing device performance caused by insufficient routing table entries configured on the first line card. In other words, the routing performance of the routing device in this application depends on the second line card with a larger storage capacity, thus possessing higher routing capabilities and device competitiveness. Therefore, this application can be used to conveniently improve the routing performance of network devices, avoiding the problems of high cost and low efficiency.
[0048] This routing method is applicable to routing devices. Figure 1 One structure of the routing device 100 is shown. For example... Figure 1 As shown, the routing device 100 may include: a first line card 101, multiple second line cards 102, and a main control board 103. The first line card 101 can be connected to the multiple second line cards 102, and the main control board 103 can be connected to each other. The main control board 103 can be connected to the multiple second line cards 102.
[0049] Optional, Figure 1 The routing device 101 in the text can be a router, a switch, or other electronic devices with data routing capabilities.
[0050] In one possible way, Figure 1 The first line card 101 and multiple second line cards 102 can each be configured with a routing table containing multiple routing entries, and the routing tables configured for the first line card 101 and the multiple second line cards 102 can be different. For example, the routing table configured for the first line card 101 can include 100,000 routing entries. In addition to including the same 100,000 routing entries as the first line card 101, the routing tables configured for the second line cards 102 can also include an additional 150,000 routing entries.
[0051] In practical applications, the routing device 100 may include multiple first line cards 101. For ease of understanding, this application uses the example of the routing device 100 including one first line card 101 for illustration.
[0052] Optional, Figure 1 The first line card 101, multiple second line cards 102, and main control board 103 can be functional modules integrated within the same device, or they can be multiple independently configured devices. This disclosure does not impose any limitations on this.
[0053] It is easy to understand that when the first line card 101, multiple second line cards 102, and the main control board 103 are multiple independently configured devices, the communication method between the first line card 101, multiple second line cards 102, and the main control board 103 is device-to-device communication. In this case, the communication process between these multiple independently configured devices is the same as the communication process between multiple modules when the first line card 101, multiple second line cards 102, and the main control board 103 are integrated into the same functional module within the same device.
[0054] For ease of understanding, this disclosure mainly uses the example of a first line card 101, multiple second line cards 102, and a main control board 103 integrated into the same device for illustration.
[0055] In one possible way, such as Figure 2The diagram shows another structure of the routing device 100. The first line card 101, multiple second line cards 102, and the main control board 103 can all include a central processing unit (CPU) and a switching chip.
[0056] The first line card 101, multiple second line cards 102, and the CPU of the main control board 103 can be connected via an internal bus. The switching chips of the first line card 101, multiple second line cards 102, and the main control board 103 can be configured with internal cascading ports, so that they can be connected via internal cascading cables.
[0057] The CPU of the main control board 103 can be used to send a route addition request (i.e., a first message) to the first line card 101 and the second line card 102. Correspondingly, the CPUs of the first line card 101 and the second line card 102 can be used to receive the route addition request.
[0058] Furthermore, the CPUs of the first line card 101 and the second line card 102 can also be used to detect the bandwidth utilization of the configured internal cascade port and loopback port, and send it to the CPU of the main control board 103, so as to realize the load monitoring of the first line card 101 and the second line card 102 by the CPU of the main control board 103.
[0059] The switching chips of the first line card 101 and the second line card 102 can be used to store routing tables and to implement packet routing and forwarding.
[0060] like Figure 3 The diagram shown is a hardware structure schematic of a routing device 100 provided in an embodiment of this application. The routing device 100 includes a processor 21, a memory 22, a communication interface 23, and a bus 24. The processor 21, the memory 22, and the communication interface 23 are connected via the bus 24.
[0061] Processor 21 is the control center of routing device 100. It can be a single processor or a collective term for multiple processing elements. For example, processor 21 can be a CPU or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0062] As one embodiment, processor 21 may include one or more CPUs, for example Figure 3 CPU0 and CPU1 are shown in the diagram.
[0063] The memory 22 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0064] In one possible implementation, the memory 22 can exist independently of the processor 21. The memory 22 can be connected to the processor 21 via a bus 24 and is used to store instructions or program code. When the processor 21 calls and executes the instructions or program code stored in the memory 22, it can implement the routing method provided in the following embodiments of this application.
[0065] In another possible implementation, the memory 22 can also be integrated with the processor 21.
[0066] Communication interface 23 is used for routing device 100 to connect with other devices via a communication network, which may be Ethernet, wireless access network, wireless local area network (WLAN), etc. Communication interface 23 may include a receiving unit for receiving data and a sending unit for sending data.
[0067] Bus 24 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0068] It should be pointed out that, Figure 3 The structure shown does not constitute a limitation on the routing device 100, except Figure 3 In addition to the components shown, the routing device 100 may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0069] like Figure 4 The diagram shown is a flowchart illustrating a routing method provided in an embodiment of this application. This routing method can be applied to... Figure 4 The first line card 101 in the routing device 100 shown. The routing method includes: S401-S403.
[0070] S401, The first line card receives the first message from the main control board requesting the addition of a route.
[0071] In one possible approach, the first message may include a data packet containing a destination Internet Protocol (IP) address and service data. The service data may be text data, image data, or audio data, etc. Furthermore, routing may be a process for sending data packets containing service data to the destination IP address.
[0072] In one possible approach, the main control board of the routing device can send a first message to the first line card when a scheduled task is triggered. This scheduled task can be used to command the transmission of data packets containing service data to the destination IP address. Alternatively, the main control board of the routing device can also send a first message to the first line card upon receiving a data transmission request from an external device. This data transmission request can be used to request the transmission of data packets containing service data to the destination IP address.
[0073] Furthermore, to improve data transmission efficiency, the main control board of the routing device can split service data into multiple data packets and simultaneously send route addition requests, including different data packets, to the first line card and multiple second line cards to achieve parallel transmission across multiple line cards. Specifically, the main control board of the routing device can send route addition requests to the CPUs of the first line card and multiple second line cards through its configured CPU. In this case, the first message is the route addition request sent by the main control board of the routing device to the first line card.
[0074] Correspondingly, the first line card can receive the first message from the main control board. Specifically, the CPU of the first line card can receive the first message from the CPU of the main control board, parse the first message to obtain the destination IP address and the data packet of service data, and determine the route that needs to be added for the data packet to send service data to the destination IP address.
[0075] S402. When adding a route fails on the first line card, determine the target second line card.
[0076] In one possible approach, the CPU of the first line card can send a data packet containing the destination IP address and service data to the switching chip of the first line card. Correspondingly, the switching chip of the first line card can receive the data packet containing the destination IP address and service data from the CPU of the first line card, and further determine whether a routing table entry matching the destination IP address exists in its stored routing table.
[0077] If the switching chip of the first line card determines that there is a routing table entry in the stored routing table that matches the destination IP address, the switching chip of the first line card can add a route based on the routing table entry that matches the destination IP address, so as to send data packets of service data to the destination IP address through the added route.
[0078] If the switching chip of the first line card determines that there is no routing table entry matching the destination IP address in its stored routing table, the switching chip of the first line card cannot add a route for sending data packets to the destination IP address; that is, route addition fails. In this case, the first line card can determine the target second line card to send data packets to the destination IP address through the target second line card, thereby improving the stability of data transmission. The target second line card can be any one of multiple second line cards.
[0079] In one possible approach, the switching chip of the first line card can generate a virtual routing forwarding (VRF). This VRF can be used to determine whether there is a routing table entry in the stored routing table that matches the destination IP address, and if a routing table entry matching the destination IP address exists in the stored routing table, it can add a route for sending data packets to the destination IP address.
[0080] In one possible approach, the target second line card is configured with a switching chip that has a larger storage capacity than the first line card, allowing it to store more routing table entries. For example, the first line card's switching chip can support a routing table with 250,000 entries, while the target second line card's switching chip can support a routing table with 500,000 entries.
[0081] S403, The first line card sends a second message to the target second line card to request the addition of a route.
[0082] The second message may include the VRF corresponding to the route, as well as the data packet containing the destination IP address and service data. The VRF corresponding to the route is the VRF generated by the first line card, used to determine whether to add a route to send data packets containing service data to the destination IP address.
[0083] In one possible approach, after identifying the target second line card, the first line card can add the VRF corresponding to the route to the header of the second message and add a data packet containing the destination IP address and service data to the body of the second message to further send the second message to the target second line card. Correspondingly, the target second line card can receive the second message from the first line card, parse the second message to determine the VRF corresponding to the route, as well as the data packet containing the destination IP address and service data.
[0084] Furthermore, the target second line card can add routes for data packets sending service data to the destination IP address through its configured switching chip, thereby enabling data transmission. The switching chip configured on the target second line card can also add routes based on received VRFs, saving the time required to create VRFs and improving data transmission efficiency.
[0085] In one embodiment, combined with Figure 4 In S402 above, when the first line card fails to add a route, when determining the target, as follows: Figure 5 As shown, this application embodiment provides an optional implementation method, including: S501-S502.
[0086] S501, when adding a route fails, the first line card reads the redirection rules.
[0087] In one possible approach, the first line card can be configured with redirection rules pointing to a redirection address. The redirection address can be the port address of any loopback port of the second line card. The redirection rule can be an access control list (ACL) rule.
[0088] In one possible approach, the redirection rules can be pre-configured by staff in the switching chip of the first line card. Furthermore, to prevent congestion and packet loss on the second line card corresponding to the redirection address, the CPU of the main control board can monitor the bandwidth utilization of the second line card in real time. When the bandwidth utilization of the second line card corresponding to the redirection address is high, a new redirection address is sent to the CPU of the first line card. Correspondingly, the CPU of the first line card can update the redirection rules stored in the switching chip of the first line card based on the received new redirection address.
[0089] Specifically, when adding a route fails, the switching chip of the first line card can read the stored redirection rules to determine the redirection address (i.e., the target second line card), thereby realizing route redirection.
[0090] S502. The first line card will determine the second line card corresponding to the redirection address as the target second line card.
[0091] In one possible approach, the first line card can identify the second line card corresponding to the redirected address as the target second line card, so as to further send a second message to the second line card.
[0092] In one embodiment, such as Figure 6 As shown, the routing method provided in this application embodiment further includes: S601-S602.
[0093] S601, the first line card receives port information from other second line cards on the main control board.
[0094] In one possible approach, the main control board can be used to send port information of other second line cards to the first line card when the bandwidth utilization of the target second line card is greater than or equal to a first preset threshold. The first preset threshold can be pre-set in the main control board by the operator. For example, the first preset threshold could be 80%.
[0095] Specifically, the CPU of the second line card can measure its bandwidth utilization and send the measured bandwidth utilization to the CPU of the main control board in real time or periodically. The bandwidth utilization of the second line card can include the bandwidth utilization of the configured loopback port and the bandwidth utilization of the internal cascade ports. Based on this, the CPU of the main control board can obtain the bandwidth utilization of each second line card. Furthermore, the main control board can store the redirection addresses pointed to by the redirection rules in the first line card.
[0096] Furthermore, in order to avoid congestion and packet loss issues on the second line card corresponding to the redirected address, the CPU of the main control board can compare the bandwidth utilization of the second line card (i.e., the target second line card) corresponding to the redirected address with a first preset threshold in real time or periodically.
[0097] If the bandwidth utilization of the target second line card is less than the first preset threshold, it indicates that the load of the target second line card is low, and it can support the implementation of routes that failed to be added to the first line card.
[0098] If the bandwidth utilization of the target second line card is greater than or equal to the first preset threshold, it indicates that the target second line card is under high load and prone to congestion and packet loss, making it difficult to support routing when the first line card fails to add a route. In this case, the main control board can identify other second line cards with bandwidth utilization less than or equal to the second preset threshold from among multiple second line cards and send the port information of these other second line cards to the first line card. Correspondingly, the first line card can receive the port information from the other second line cards on the main control board.
[0099] In one possible approach, if the main control board determines that the bandwidth utilization of the loopback port of the target second line card is greater than or equal to the first preset threshold, or the bandwidth utilization of the internal cascade port of the target second line card is greater than or equal to the first preset threshold, then the main control board can determine that the bandwidth utilization of the target second line card is greater than or equal to the first preset threshold.
[0100] In one possible approach, if the main control board determines that the bandwidth utilization of the loopback port of the other second line card is less than or equal to the second preset threshold, and the bandwidth utilization of the internal cascade port of the other second line card is less than or equal to the second preset threshold, then the main control board can determine that the bandwidth utilization of the other second line cards is less than or equal to the second preset threshold.
[0101] In one possible approach, the second preset threshold can be pre-set by the operator on the main control board. For example, the second preset threshold could be 50%. Alternatively, the second preset threshold can also be adjusted by the main control board in real time or periodically to the minimum bandwidth utilization among multiple second line cards.
[0102] S602, the first line card updates the redirection address to the port information of the other second line cards.
[0103] In one possible approach, after receiving port information from other second-line cards on the main control board, the first line card can update the redirection address pointed to by the redirection rule to the port information of the other second-line cards.
[0104] Specifically, after receiving port information from other second line cards on the main control board, the CPU of the first line card can send an update instruction message carrying the port information of the other second line cards to the switching chip of the first line card. Correspondingly, the switching chip of the first line card can receive the update instruction message from the CPU of the first line card, parse the update instruction message to obtain the port information of the other second line cards, and further update the redirection address pointed to by the redirection rule to the port information of the other second line cards.
[0105] In one embodiment, such as Figure 7 The diagram shown illustrates a routing and forwarding process provided in this application. When a command or transmission request is triggered, the CPU of the main control board of the routing device can send a route addition request to the CPUs of each line card via the internal bus. That is, the CPU of the main control board can trigger route addition after receiving a command from a timed task, or it can trigger route addition after receiving a transmission request based on a network protocol. Furthermore, after triggering route addition, the CPU of the main control board can send route addition requests to the CPUs of the first line card and multiple second line cards via the internal bus.
[0106] The CPUs of each line card (i.e., the first line card and multiple second line cards) can send route addition instructions to their respective switching chips. The switching chips of each line card can add routes based on the configured routing table and the destination IP address. When adding a route fails, and this occurs on the first line card (i.e., when adding a route fails on the first line card), the CPU of the first line card can redirect the route addition failure message to the loopback port of the destination second line card based on redirection rules.
[0107] In one embodiment, such as Figure 8 The diagram illustrates a rule update process provided in this application. The CPU of the main control board can monitor the bandwidth utilization of the loopback ports of each second line card and the bandwidth utilization of the internal cascade ports. When the bandwidth utilization of the loopback port or internal cascade port of the target second line card exceeds a first preset threshold, the CPU of the main control board can initiate a preset algorithm to determine the second line card with lower bandwidth utilization from among multiple second line cards. For example, the second line card with lower bandwidth utilization can be other second line cards with bandwidth utilization less than or equal to the second preset threshold. The CPU of the main control board can send port information of other second line cards to the first line card to adjust the redirection rules of the first line card. The CPU of the first line card can receive the port information of other second line cards from the CPU of the main control board and adjust the redirection rules in the switching chip to balance internal traffic, thereby achieving load sharing among line cards.
[0108] In one embodiment, such as Figure 9 The diagram illustrates another routing and forwarding process provided in this application. The switching chip of the first line card can receive a route addition instruction from the CPU of the first line card. This route addition instruction may include the data packet of service data and the destination IP address, also known as the message to be transmitted. Based on the configured routing table, the switching chip of the first line card determines the routing table entry that matches the message to be transmitted. If a routing table entry matching the message to be transmitted exists in the configured routing table of the first line card's switching chip, the switching chip can forward the message according to the matching routing table entry.
[0109] If the routing table configured in the first line card's switching chip does not contain a matching entry for the packet to be transmitted, the first line card's switching chip can send a second message to the target second line card according to the configured redirection rules. This redirects the packet to be transmitted via the internal cascading port to the loopback port of the target second line card. The header of the second message may include the VRF corresponding to the route generated by the first line card, and the body of the second message may include the data packet containing the service data and the destination IP address. Upon receiving the second message, the target second line card can forward the packet according to the VRF corresponding to the route and the destination IP address in the second message.
[0110] In this application, after receiving a first message from the main control board requesting the addition of a route, the first line card can, if the route addition fails, determine the target second line card and further send a second message requesting the addition of a route to the target second line card. Based on this, this application can redirect routes that failed to be added by the first line card to the target second line card, which has a larger number of stored routing table entries, even when the first line card has a limited number of stored routing table entries. This achieves route forwarding and avoids the problem of low routing device performance caused by insufficient routing table entries configured on the first line card. In other words, the routing performance of the routing device in this application depends on the second line card with a larger storage capacity, thus possessing higher routing capabilities and device competitiveness. Therefore, this application can be used to conveniently improve the routing performance of network devices, avoiding the problems of high cost and low efficiency.
[0111] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0112] This application embodiment can divide the first line card into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0113] like Figure 10 The diagram shown is a structural schematic of a routing device provided in an embodiment of this application. This routing device can be applied to a first line card, which belongs to a routing device comprising the first line card, multiple second line cards, and a main control board. This routing device can be used to perform actions such as... Figures 4-6 The routing method shown is illustrated. The apparatus includes: a receiving unit 701, a determining unit 702, and a transmitting unit 703.
[0114] Receiving unit 701 is used to receive a first message from the main control board requesting the addition of a route; for example, combined with Figure 4 The receiving unit 701 can be used to execute S401.
[0115] Determining unit 702 is used to determine the target second line card when adding a route fails; for example, in conjunction with Figure 4 Unit 702 can be used to execute S402.
[0116] The sending unit 703 is used to send a second message requesting the addition of a route to the target second line card determined by the determining unit 702. For example, combined with Figure 4 The sending unit 703 can be used to execute S403.
[0117] Optionally, the first line card is configured with redirection rules pointing to the redirection address; the determining unit 702 is specifically used for:
[0118] When adding a route fails, read the redirection rules; for example, combine... Figure 5 Unit 702 can be used to execute S501.
[0119] The second-line card corresponding to the redirected address is identified as the target second-line card. For example, combined with... Figure 5 The determination unit 702 can be used to execute S502.
[0120] Optionally, the main control board is used to send port information of other second line cards to the first line card when the bandwidth utilization of the target second line card is greater than or equal to the first preset threshold; the other second line cards are second line cards other than the target second line card among a plurality of second line cards, and whose bandwidth utilization is less than or equal to the second preset threshold; the device further includes: an update unit 704;
[0121] The receiving unit 701 is also used to receive port information from other second line cards on the main control board; for example, in combination with Figure 6 The receiving unit 701 can be used to execute S601.
[0122] Update unit 704 is used to update the redirected address with the port information of other second-line cards. For example, combined with... Figure 6 The update unit 704 can be used to execute S602.
[0123] Optionally, the second message includes the VRF corresponding to the route, as well as a data packet containing the destination IP address and service data.
[0124] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer-readable storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and other division methods may exist in actual implementation. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate; components shown as units may be one physical unit or multiple physical units, i.e., they may be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0127] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A routing method characterized by, The method is applied to a first line card, which belongs to a routing device comprising the first line card, multiple second line cards, and a main control board; the method includes: The system receives a first message from the main control board requesting the addition of a route; the first message includes a destination IP address and service data. If the switching chip of the first line card determines that there is no routing table entry in the stored routing table that matches the destination IP address, it reads the redirection rule; the first line card is configured with the redirection rule pointing to the redirection address, and the redirection address is the port address of any loopback port of the second line card; The second line card corresponding to the redirected address is identified as the target second line card; Send a second message to the target second line card to request the addition of the route, so as to redirect the packet to be transmitted to the loopback port of the target second line card through the internal concatenation port; The main control board is used to send port information of other second line cards to the first line card when the bandwidth utilization rate of the target second line card is greater than or equal to a first preset threshold; the other second line cards are second line cards other than the target second line card among the plurality of second line cards, and whose bandwidth utilization rate is less than or equal to the second preset threshold; the method further includes: Receive port information from the other second line cards on the main control board; Update the redirected address with the port information of the other second line card.
2. The routing method of claim 1, wherein, The second message includes the Virtual Router Forwarding (VRF) corresponding to the route, as well as the destination Internet Protocol (IP) address and service data packets.
3. A routing device, characterized in that, It is applied to the first line card, which belongs to a routing device including the first line card, multiple second line cards and a main control board; The storage capacity of the first line card is smaller than that of the second line card; the device includes: a receiving unit, a determining unit, and a sending unit; The receiving unit is used to receive a first message from the main control board requesting the addition of a route; the first message includes a destination IP address and service data; The determining unit is configured to read a redirection rule if the switching chip of the first line card determines that there is no routing table entry in the stored routing table that matches the destination IP address; the first line card is configured with the redirection rule pointing to the redirection address, the redirection address being the port address of any loopback port of the second line card; and to determine the second line card corresponding to the redirection address as the target second line card; The sending unit is used to send a second message to the target second line card determined by the determining unit to request the addition of the route, so as to redirect the message to be transmitted to the loopback port of the target second line card through the internal concatenation port; The main control board is used to send port information of other second line cards to the first line card when the bandwidth utilization rate of the target second line card is greater than or equal to a first preset threshold; the other second line cards are second line cards other than the target second line card among the plurality of second line cards, and whose bandwidth utilization rate is less than or equal to the second preset threshold; the device further includes: an update unit; The receiving unit is also used to receive port information from the other second line cards of the main control board; The update unit is used to update the redirection address with the port information of the other second line card.
4. The routing device according to claim 3, characterized in that, The second message includes the VRF corresponding to the route, as well as a data packet containing the destination IP address and service data.
5. A routing device, characterized in that, It includes a memory and a processor; the memory is used to store computer execution instructions, and the processor is connected to the memory via a bus; when the routing device is running, the processor executes the computer execution instructions stored in the memory to cause the routing device to perform the routing method as described in claim 1 or 2.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer-executable instructions that, when executed on a computer, cause the computer to perform the routing method as described in claim 1 or 2.