CN113328963A - Routing table entry issuing and message forwarding method, device and network equipment - Google Patents

Routing table entry issuing and message forwarding method, device and network equipment Download PDF

Info

Publication number
CN113328963A
CN113328963A CN202110703858.4A CN202110703858A CN113328963A CN 113328963 A CN113328963 A CN 113328963A CN 202110703858 A CN202110703858 A CN 202110703858A CN 113328963 A CN113328963 A CN 113328963A
Authority
CN
China
Prior art keywords
routing table
table entry
forwarded
message
chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202110703858.4A
Other languages
Chinese (zh)
Inventor
游君平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202110703858.4A priority Critical patent/CN113328963A/en
Publication of CN113328963A publication Critical patent/CN113328963A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/252Store and forward routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Abstract

The embodiment of the invention provides a method, a device and network equipment for issuing and forwarding a routing table item, which relate to the technical field of communication and are applied to a master control CPU (central processing unit), wherein the method for issuing the routing table item comprises the following steps: issuing a first routing table item and a first default routing table item to an interface exchange chip configured by the network equipment, wherein the first routing table item is as follows: a part of routing table entries in a routing table maintained by a master control CPU, where a first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in the network equipment; issuing a second routing table item and a second default routing table item to the switching network chip, wherein the second routing table item is as follows: routing table entries in the routing table other than the first routing table entry, the second default routing table entry being for indicating: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU. The scheme provided by the embodiment of the invention can reduce the storage space of the interface exchange chip occupied by the routing table entry.

Description

Routing table entry issuing and message forwarding method, device and network equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a network device for routing table entry issuing and packet forwarding.
Background
The network device such as the frame-type distributed switch includes an interface board and a main control board, and switch chips are respectively configured on the interface board and the main control board, where the switch chip configured on the interface board may be referred to as an interface switch chip, and the switch chip configured on the main control board may be referred to as a switch network chip. The CPU provided on the main control board may be referred to as a main control CPU.
In the prior art, all routing table entries for forwarding a message are stored in the interface switching chip, and based on this, after receiving a message to be forwarded, the interface switching chip searches for a routing table entry matching the message, and then forwards the message based on the searched routing table entry. However, if there are many network devices in the network and the networking complexity is high, in order to smoothly complete message forwarding, there are many routing table entries stored in the interface switching chip and occupy more storage space of the interface switching chip, but the storage space of the interface switching chip is limited, and the problem that the storage space of the interface switching chip is insufficient may occur.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device and network equipment for issuing routing table items and forwarding messages, so as to reduce the storage space of an interface switching chip occupied by the routing table items. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for issuing a routing table entry, where the method is applied to a master CPU of a network device, and the method includes:
issuing a first routing table entry and a first default routing table entry to an interface switching chip configured by the network device, wherein the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
issuing a second routing table item and a second default routing table item to the switching network chip, wherein the second routing table item is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
In a second aspect, an embodiment of the present invention provides a packet forwarding method, which is applied to an interface switch chip of a network device, where the method includes:
receiving and storing a first routing table and a first default routing table issued by a main control CPU, wherein the first default routing table is used for indicating: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
obtaining a message to be forwarded;
searching a routing table item matched with the message to be forwarded in the first routing table item;
if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry, so that when the switching network chip receives the first identifier, the message to be forwarded is forwarded based on a second routing table entry locally stored in the switching network chip, and the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
if the first routing table entry is hit, a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded are sent to the switching network chip, so that the switching network chip can forward the message to be forwarded based on the target interface identifier after obtaining the second identifier.
In a third aspect, an embodiment of the present invention provides a packet forwarding method, which is applied to a network device, where the network device includes: the main control CPU, the interface exchange chip and the exchange network chip;
the main control CPU issues a first routing table item and a first default routing table item to the interface switching chip, and issues a second routing table item and a second default routing table item to the switching network chip, wherein the first routing table item is as follows: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to the switching network chip, and the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU;
the interface switching chip receives and stores a first routing table and a first default routing table issued by the main control CPU to obtain a message to be forwarded; searching a routing table item matched with the message to be forwarded in the first routing table item; if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry; if the first routing table entry is hit, sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded to the switching network chip, wherein the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
the switching network chip receives and stores a second routing table item and a second default routing table item issued by the main control CPU; receiving data sent by the interface exchange chip; if the data comprises a first identifier, searching a routing table entry matched with the message to be forwarded in the second routing table entry, if the second routing table entry is hit, forwarding the message to be forwarded according to the searched routing table entry, and if the second routing table entry is not hit, forwarding the message to be forwarded to the main control CPU according to the second default routing table entry; if the data comprises a second identifier, forwarding the message to be forwarded according to a destination interface identifier included in the data;
and the main control CPU forwards the message to be forwarded based on a software protocol under the condition of receiving the message to be forwarded.
In a fourth aspect, an embodiment of the present invention provides a routing table entry issuing device, which is applied to a main control CPU of a network device, where the device includes:
a first table entry issuing module, configured to issue a first routing table entry and a first default routing table entry to an interface switch chip configured by the network device, where the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
a second table entry issuing module, configured to issue a second routing table entry and a second default routing table entry to the switching network chip, where the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
In a fifth aspect, an embodiment of the present invention provides a packet forwarding apparatus, which is applied to an interface switching chip of a network device, where the apparatus includes:
the table entry receiving module is configured to receive and store a first routing table entry and a first default routing table entry issued by a main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
the message obtaining module is used for obtaining a message to be forwarded;
a table item searching module, configured to search, in the first routing table item, a routing table item that matches the packet to be forwarded;
a first data sending module, configured to send, according to the first default routing table entry, a descriptor field carrying a first identifier and the to-be-forwarded packet to the switch fabric chip if the first routing table entry is not hit, so that when the switch fabric chip receives the first identifier, the to-be-forwarded packet is forwarded based on a second routing table entry locally stored in the switch fabric chip, where the descriptor field is used to record an action that needs to be executed in a process of forwarding the to-be-forwarded packet by the network device;
and the second data sending module is used for sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table item and the message to be forwarded to the switching network chip if the first routing table item is hit, so that the switching network chip forwards the message to be forwarded based on the target interface identifier after obtaining the second identifier.
In a sixth aspect, an embodiment of the present invention provides a network device, where the network device includes: the main control CPU, the interface exchange chip and the exchange network chip;
the main control CPU is configured to issue a first routing table entry and a first default routing table entry to the interface switch chip, and issue a second routing table entry and a second default routing table entry to the interface switch chip, where the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to the switching network chip, and the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU;
the interface switching chip is used for receiving and storing a first routing table entry and a first default routing table entry issued by the main control CPU to obtain a message to be forwarded; searching a routing table item matched with the message to be forwarded in the first routing table item; if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry; if the first routing table entry is hit, sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded to the switching network chip, wherein the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
the switching network chip is used for receiving and storing a second routing table item and a second default routing table item issued by the main control CPU; receiving data sent by the interface exchange chip; if the data comprises a first identifier, searching a routing table entry matched with the message to be forwarded in the second routing table entry, if the second routing table entry is hit, forwarding the message to be forwarded according to the searched routing table entry, and if the second routing table entry is not hit, forwarding the message to be forwarded to the main control CPU according to the second default routing table entry; if the data comprises a second identifier, forwarding the message to be forwarded according to a destination interface identifier included in the data;
and the main control CPU is used for forwarding the message to be forwarded based on a software protocol under the condition of receiving the message to be forwarded.
In a seventh aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the first aspect or the second aspect.
In an eighth aspect, embodiments of the present invention also provide a computer program product including instructions, which, when executed on a computer, cause the computer to perform the method steps of any one of the first or second aspects.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a routing table item issuing method applied to a master control CPU (central processing unit). the master control CPU issues a first routing table item and a first default routing table item to an interface switching chip configured by network equipment, wherein the first routing table item is as follows: the main control CPU maintains part of the routing list items in the routing list, and the first default routing list item indicates that the message to be forwarded which hits the first routing list item is sent to the switching network chip in the network equipment. Issuing a second routing table item and a second default routing table item to the switching network chip, wherein the second routing table item is as follows: routing table entries in the routing table other than the first routing table entry, the second default routing table entry being for indicating: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the main control CPU issues the routing table entries in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entries respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. If the message to be forwarded misses the first routing table entry stored in the interface switching chip, the routing table entry matched with the message to be forwarded may be stored in the switching network chip, the interface switching chip may send the message to be forwarded to the switching network chip according to the first default routing table entry, and the switching network chip may continue to match the routing table entry. Therefore, the routing table items are respectively issued to the interface switching chip and the switching network chip, so that the normal forwarding of the message to be forwarded cannot be influenced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a method for issuing a routing table entry according to an embodiment of the present invention;
fig. 2 is a schematic logical structure diagram of a network device according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a first message forwarding method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a second packet forwarding method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a packet forwarding path according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a network device according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a message forwarding method applied to a network device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a routing table entry issuing device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to solve the problem that a large number of routing table entries need to be stored in an interface switching chip in the prior art, and the storage space of the interface switching chip occupied by the stored routing table entries is large, embodiments of the present invention provide a method, an apparatus, and a network device for routing table entry issuing and packet forwarding.
The embodiment of the invention provides a routing table item issuing method, which is applied to a main control CPU of network equipment and comprises the following steps:
issuing a first routing table entry and a first default routing table entry to an interface switching chip configured by the network device, where the first routing table entry is: the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in the network equipment;
issuing a second routing table entry and a second default routing table entry to the switching network chip, wherein the second routing table entry is: the second default routing table entry is used to indicate that: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the main control CPU issues the routing table entries in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entries respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. If the message to be forwarded misses the first routing table entry stored in the interface switching chip, the routing table entry matched with the message to be forwarded may be stored in the switching network chip, the interface switching chip may send the message to be forwarded to the switching network chip according to the first default routing table entry, and the switching network chip may continue to match the routing table entry. Therefore, the routing table items are respectively issued to the interface switching chip and the switching network chip, so that the normal forwarding of the message to be forwarded cannot be influenced.
Referring to fig. 1, a flow diagram of a method for issuing a routing table entry according to an embodiment of the present invention is applied to a main control CPU of a network device, where the main control CPU may be configured on a main control board or a network board of the network device. The network device may be a switch or a router, etc.
Specifically, the method includes the following steps S101-S102.
S101: and issuing a first routing table item and a first default routing table item to an interface exchange chip configured by the network equipment.
Wherein, the first routing table entry is: and a part of routing table entries in the routing table maintained by the main control CPU. The first default routing table entry is used to indicate: and the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in the network equipment.
Specifically, the first routing table entry may be any table entry in the routing table, where each first routing table entry records a corresponding relationship between an IP address and an identifier of an interface of the network device, and indicates that a to-be-forwarded packet whose destination address is the IP address may be forwarded out of the network device from the interface.
In addition, when the destination address of the message to be forwarded is not matched with any first routing table entry, it indicates that the message to be forwarded does not hit the first routing table entry, and then hits the first default routing table entry. The IP address recorded in the first default routing table entry may be x.x.x.x/0.
In addition, the interface switching chip is configured on an interface board of the network device, each interface board corresponds to an interface of the network device, and each network device may include a plurality of interfaces, that is, a plurality of interface switching chips are configured in the network device. The main control CPU may issue the same first routing table entry for each interface switching chip. The interface switch chip may be an ASIC (Application Specific Integrated Circuit) chip.
S102: and issuing a second routing table item and a second default routing table item to the switching network chip.
Wherein, the second routing table entry is: routing table entries in the routing table other than the first routing table entry. The second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
Specifically, the second routing table entry may be different from the first routing table entry, or may include a part of the same routing table entry. Each second routing table entry records a corresponding relationship between an IP address and an identifier of an interface of the network device, and indicates that a message to be forwarded, whose destination address is the IP address, can be forwarded out of the network device from the interface.
In addition, when the destination address of the message to be forwarded is not matched with any second routing table entry, it indicates that the message to be forwarded does not hit the second routing table entry, and then hits the second default routing table entry. The IP address recorded in the second default routing table entry may be x.x.x.x/0.
In addition, the switching network chip is configured on a main control board or a network board of the network device, and can be installed on the same board as the main control CPU. The network device may include one or more boards configured with a switch network chip, and the boards are connected to each other to form a switch network. The switching network chip may be an ASIC chip.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the main control CPU issues the routing table entries in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entries respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. If the message to be forwarded misses the first routing table entry stored in the interface switching chip, the routing table entry matched with the message to be forwarded may be stored in the switching network chip, the interface switching chip may send the message to be forwarded to the switching network chip according to the first default routing table entry, and the switching network chip may continue to match the routing table entry. Therefore, the routing table items are respectively issued to the interface switching chip and the switching network chip, so that the normal forwarding of the message to be forwarded cannot be influenced.
In an embodiment of the present invention, the first routing table entry and the second routing table entry may be determined through the following step a or step B.
Step A: and according to the preset subnet mask length, dividing a first routing table entry and a second routing table entry from the routing table maintained by the main control CPU.
Specifically, the routing table entry whose subnet mask length of the IP address recorded in the routing table maintained by the main control CPU is greater than or equal to the preset subnet mask length may be used as the first routing table entry.
And taking the routing table entry of which the subnet mask length of the recorded IP address is smaller than the preset subnet mask length as a second routing table entry.
For example, the preset subnet mask length may be 8, 16, 24, etc
And B: according to a preset proportion, a first routing table entry and a second routing table entry are divided from a routing table maintained by the main control CPU.
Specifically, the number of the first routing table entries may be calculated by multiplying the preset ratio by the total number of the routing table entries recorded in the routing table maintained by the main control CPU. And taking any routing table entry in the routing table with the total number of the routing table entries being the calculated number as the first routing table entry. And taking the rest routing table entries as second routing table entries.
In another embodiment of the present invention, a routing table entry in the routing table, in which the recorded IP address belongs to a preset subnet, may also be used as the first routing table entry, and the remaining routing table entries may be used as the second routing table entries.
In addition, the relationship among the main control CPU, the interface switching chip, and the switching network chip in the above network device can be described by the following fig. 2. Referring to fig. 2, a schematic diagram of a logic structure of a network device according to an embodiment of the present invention is provided.
As shown in fig. 2, the logical structure of the network device can be divided into three layers, namely a support system, a control plane and a forwarding plane.
The support system may include units of a software layer, including an apparatus monitoring unit configured to monitor an operation condition of the network apparatus, a power management unit configured to manage a power supply of the network apparatus, a temperature management unit configured to manage a temperature of the network apparatus, an online detection unit configured to detect the network apparatus, and a system monitoring unit configured to monitor an operation condition of another unit in the support system. The arrows between the system monitoring unit and the other units indicate that the system monitoring unit can monitor the other units. The functions of the units in the support system may be implemented by a main control CPU on a main control board in the network device.
The control plane includes 4 interface boards CPU, the interface boards CPU are respectively configured on the 4 interface boards, each interface board corresponds to an interface, that is, the network device includes 4 interfaces. The control plane also comprises 1 main control CPU, the main control CPU is configured on the main control board or the network board, and each main control board or the network board is configured with a switching network chip. The arrow between the main control CPU and the interface board CPU indicates that the main control CPU can control the interface board CPU.
The forwarding plane includes 4 interface switching chips corresponding to the interface board CPUs, respectively, and a dotted arrow between the interface board CPU and the interface switching chip indicates that the interface board CPU can control the interface switching chip. The forwarding plane also includes 2 switching network chips, the double-headed arrow between each switching network chip and the interface switching chip indicates that the two ends of the arrow can send data to each other, and the switching network chips shown in the figure form a switching network.
Specifically, the logic structure of the network device shown in fig. 2 is only an example, in the embodiment of the present invention, the number and the connection relationship of the interface board, the main control board, the interface switching chip, and the switching network chip included in the network device are not limited to the embodiment shown in fig. 2, and the units included in the support system are not limited to the embodiment shown in fig. 2.
Referring to fig. 3, a schematic flow chart of the first message forwarding method provided in the embodiment of the present invention is applied to an interface switch chip of a network device, and specifically, the description of the interface switch chip may refer to the above, which is not described herein again. The above method includes the following steps S301 to S305.
S301: and receiving and storing a first routing table item and a first default routing table item issued by the main control CPU.
Wherein, the first default routing table entry is used to indicate: and the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in the network equipment.
Specifically, the main control CPU may refer to the embodiment of the routing table entry issuing method described above, and issue the first routing table entry and the first default routing table entry to the interface switching chip. The detailed description of the main control CPU and the switching network chip can be referred to above, and is not repeated here.
S302: and obtaining the message to be forwarded.
Specifically, the message to be forwarded may be a message received by an interface corresponding to an interface board configured with the interface switch chip.
S303: and searching a routing table item matched with the message to be forwarded in the first routing table item.
Specifically, the destination address of the to-be-forwarded message may be matched with the IP address recorded in the first routing table entry, and the routing table entry matched with the to-be-forwarded message may be searched.
Specifically, the above step S303 can be realized by the following step C.
And C: and searching the routing table entry of the subnet represented by the recorded IP address, to which the destination address of the message to be forwarded belongs, in the first routing table entry.
In an embodiment of the present invention, it may be sequentially determined whether the subnet indicated by the IP address recorded in each first routing table entry includes the destination address, until the routing table entry of the subnet indicated by the IP address recorded in the subnet to which the destination address belongs is found.
Specifically, the routing table entry may be searched according to LPM (Longest Prefix Match). That is, according to the sequence from small to large of the subnet mask length of the recorded IP address, the IP address and the destination address in each first routing table entry are sequentially matched by bit, and the first routing table entry which is matched with the recorded IP address and has the longest subnet mask is found and used as the found routing table entry. The finding of the routing table entry according to the LPM belongs to the prior art, and is not described in detail herein.
S304: and if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry, so that the switching network chip forwards the message to be forwarded based on a second routing table entry locally stored in the switching network chip when receiving the first identifier.
The descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment.
Specifically, the descriptor field may further include forwarding decision information, such as message processing priority.
In an embodiment of the present invention, if the first routing table entry is not hit, it indicates that the interface for forwarding the to-be-forwarded packet cannot be determined according to the first routing table entry stored in the interface switching chip, so that a descriptor field carrying a first identifier may be sent to the switching network chip, so that the switching network chip forwards the to-be-forwarded packet based on the second routing table entry stored in the switching network chip when it is determined that the interface for forwarding the to-be-forwarded packet is not determined by the interface switching chip. The first identifier may be represented in the form of a number, a character, or the like. For example, the first flag may be 1.
In addition, the first default routing table entry may record an IP address x.x.x.x/0 and an identifier of the switching network chip, and when the first routing table entry is not matched with the message to be forwarded, the first default routing table entry may be hit, so that the descriptor field carrying the first identifier and the message to be forwarded may be sent to the switching network chip corresponding to the identifier recorded in the first default routing table entry.
In addition, the interface switching chip may record a corresponding relationship between the switching network chip and an output interface of the interface switching chip, and may determine which output interface of the interface switching chip sends the descriptor field and the message to be forwarded according to the corresponding relationship, so that the descriptor field and the message to be forwarded may be transmitted to the switching network chip corresponding to the first default routing table entry.
Specifically, the switching network chip may search for a routing table entry matching the to-be-forwarded message in the second routing table entry, where a manner of searching for the routing table entry by the switching network chip is similar to the manner of searching for the routing table entry in the first routing table entry by the interface switching chip in step S303, and details of this embodiment of the present invention are not repeated.
S305: if the first routing table entry is hit, a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded are sent to the switching network chip, so that the switching network chip can forward the message to be forwarded based on the target interface identifier after obtaining the second identifier.
Specifically, the second identifier is different from the first identifier, and the second identifier may indicate that the packet to be forwarded hits the first routing table entry. For example, the first flag may be 1, and the second flag may be 2.
In an embodiment of the present invention, if the first routing table entry is hit, an interface represented by the destination interface identifier recorded in the hit first routing table entry may be determined as an interface for forwarding the packet to be forwarded, and the switching network chip does not need to search the routing table entry to determine the destination interface identifier. Therefore, the interface switching chip may send the descriptor field carrying the second identifier and the destination interface identifier to the switching network chip, and the switching network chip may determine that the packet to be forwarded hits the first routing table entry after receiving the second identifier, and may directly forward the packet to be forwarded based on the received destination interface identifier.
In addition, the interface exchange chip may record a corresponding relationship between an interface of the network device and an output interface of the interface exchange chip, and according to the corresponding relationship, after determining the destination interface identifier, it may determine which output interface of the interface exchange chip sends the descriptor field, the destination interface identifier and the message to be forwarded to the exchange chip, and may transmit the message to be forwarded to the interface represented by the destination interface identifier.
Furthermore, the above-mentioned switching network chip may also record the corresponding relationship between the interface of the network device and the output interface of the switching network chip, and according to the above-mentioned corresponding relationship, it can be determined from which output interface of the switching network chip the message to be forwarded is sent, and the message to be forwarded can be transmitted to the interface represented by the destination interface identifier.
As can be seen from the above, if the message to be forwarded misses the first routing table entry, it means that the interface of the network device for forwarding the message to be forwarded cannot be determined only by the first routing table entry. Therefore, the descriptor field carrying the first identifier and the message to be forwarded can be sent to the switching network chip, and the switching network chip can continue to forward the message to be forwarded based on the second routing table entry stored in the switching network chip. If the message to be forwarded hits the first routing table entry, the descriptor field carrying the second identifier, the found destination interface identifier and the message to be forwarded may be sent to the switching network chip, and the switching network chip may directly send the message to be forwarded based on the destination interface identifier. Therefore, the scheme provided by the embodiment of the invention can complete the forwarding of the message. And the interface switching chip only needs to store the first routing table item in the routing table maintained by the switching network CPU, so that the storage space of the interface switching chip occupied by the routing table item is less.
Referring to fig. 4, which is a flowchart illustrating a second message forwarding method according to an embodiment of the present invention, when the subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to a preset subnet mask length, compared with the embodiment shown in fig. 3, the step S303 may be implemented by the following steps S303A-S303C.
S303A: and determining whether the first subnet mask length of the destination address of the message to be forwarded is greater than or equal to the preset subnet mask length.
Specifically, if the first subnet mask length is greater than or equal to the preset subnet mask length, the destination address of the to-be-forwarded message may belong to the subnet indicated by the IP address recorded in the first routing table entry, so that the to-be-forwarded message may hit the first routing table entry, and step S303B may be executed.
If the first subnet mask length is smaller than the preset subnet mask length, the destination address of the to-be-forwarded message does not belong to the subnet indicated by the IP address recorded in the first routing table entry, so that the to-be-forwarded message does not hit the first routing table entry, and step S303C may be executed.
S303B: and searching a routing table item matched with the message to be forwarded in the first routing table item.
If the routing table entry is found, it is determined that the first routing table entry is hit, step S305 may be executed, and if the routing table entry is not found, it is determined that the first routing table entry is not hit, step S304 may be executed.
Specifically, the method for searching for the routing table entry matching the message to be forwarded is similar to the foregoing step S303, and details thereof are not repeated in the embodiment of the present invention.
S303C: and determining that the first routing table entry is missed.
Specifically, since it is determined that the first routing table entry is not hit, step S304 may be executed to continue forwarding the packet to be forwarded.
As can be seen from the above, the subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to the preset subnet mask length, and if the subnet mask length of the destination address of the to-be-forwarded message is smaller than the preset subnet mask length, the routing table entry matched with the to-be-forwarded message cannot be found in the first routing table entry theoretically, and the to-be-forwarded message cannot hit the first routing table entry, so that the routing table entry may not be matched in the first routing table entry, it may be directly determined that the first routing table entry is not hit, and the forwarding process of the to-be-forwarded message is continuously executed.
In an embodiment of the present invention, entry 1 in the first routing entry records a corresponding relationship between the IP address 172.1.2.x/24 and the interface identifier slot2, and entry 2 in the second routing entry records a corresponding relationship between the IP address 172.1.x.x/16 and the interface identifier slot 3. There are two messages 1 to be forwarded and two messages 2 to be forwarded, where the destination address of the message 1 to be forwarded is 172.1.2.3, and the destination address of the message 2 to be forwarded is 172.1.100.1.
After receiving the packet 1 to be forwarded, the interface switching chip 1 corresponding to the interface 1 determines that the table entry 1 in the first routing table entry matches the packet 1 to be forwarded, and then the interface switching chip 1 may send the second identifier, the interface identifier slot2 recorded in the table entry 1, and the packet 1 to be forwarded to the switching network chip, and the switching network chip may directly forward the packet 1 to be forwarded to the interface switching chip 2 corresponding to the interface 2 indicated by the interface identifier slot2, and the interface switching chip 2 sends the packet 1 to be forwarded out of the network device from the interface 2, thereby completing forwarding of the packet 1 to be forwarded.
In addition, after the corresponding interface switching chip 1 receives the message 2 to be forwarded, if the message 2 to be forwarded does not hit the first routing table entry, the interface switching chip 1 may send the first identifier and the message 2 to be forwarded to the switching network chip, and the switching network chip determines that the table entry 2 in the second routing table entry matches the packet 2 to be forwarded, and then the switching network chip may determine the interface identifier slot3 included in the table entry 2, and forward the message 2 to be forwarded to the interface switching chip 3 corresponding to the interface 3 indicated by the interface identifier slot3, and the interface switching chip 3 sends the message 2 to be forwarded out of the network device from the interface 3, thereby completing forwarding of the message 2 to be forwarded.
Referring to fig. 5, a schematic diagram of a packet forwarding path according to an embodiment of the present invention is provided.
Corresponding to the foregoing embodiments, fig. 5 includes interface switching chips 1 to 3 and a switching network chip, where solid arrows shown in the figure represent forwarding paths of the message 1 to be forwarded, and dashed arrows represent forwarding paths of the message 2 to be forwarded.
Corresponding to the aforementioned message forwarding method applied to the interface switch chip, referring to fig. 6, a schematic structural diagram of a network device provided in an embodiment of the present invention is shown, where the network device includes a main control CPU601, an interface switch chip 602, and a switch network chip 603.
Fig. 7 is a schematic flowchart of a message forwarding method applied to a network device according to an embodiment of the present invention.
S701: the main control CPU601 issues a first routing table entry and a first default routing table entry to the interface switch chip 602.
Wherein, the first routing table entry is: the first default routing table entry is used to indicate: and the message to be forwarded which does not hit the first routing table entry is sent to the switching network chip.
S702: the main control CPU601 issues a second routing table entry and a second default routing table entry to the switch fabric chip 603.
Wherein, the second routing table entry is: routing table entries in the routing table other than the first routing table entry. The second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
S703: the interface switching chip 602 receives and stores the first routing table and the first default routing table issued by the main control CPU 601.
S704: the interface switch chip 602 obtains a packet to be forwarded.
S705: the interface switching chip 602 searches for a routing table entry matching the to-be-forwarded message in the first routing table entry.
S706: if the interface switching chip 602 determines that the first routing table entry is missed, a descriptor field carrying a first identifier and the message to be forwarded are sent to the switching network chip according to the first default routing table entry.
The descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment.
S707: if the interface switching chip 602 determines that the first routing table entry is hit, it sends a descriptor field carrying a second identifier, a destination interface identifier in the found routing table entry, and the to-be-forwarded packet to the switching network chip.
S708: the switching network chip 603 receives and stores the second routing table entry and the second default routing table entry issued by the main control CPU.
S709: if the switching network chip 603 determines that the data includes the first identifier, a routing table entry matching the message to be forwarded is searched in the second routing table entry.
S710: if the switching network chip 603 determines that the second routing table entry is hit, the message to be forwarded is forwarded according to the found routing table entry.
S711: if the switching network chip 603 determines that the second routing table entry is not hit, the message to be forwarded is forwarded to the main control CPU601 according to the second default routing table entry.
S712: if the switching network chip 603 determines that the data includes the second identifier, the message to be forwarded is forwarded according to the destination interface identifier included in the data.
S713: and the main control CPU601 forwards the message to be forwarded based on a software protocol when receiving the message to be forwarded.
In an embodiment of the present invention, the main control CPU may forward the packet to be forwarded based on a software layer protocol in the prior art, which is not limited in the embodiment of the present invention.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the main control CPU issues the routing table entries in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entries respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. And if the message to be forwarded does not hit the first routing table entry, it means that the interface of the network device for forwarding the message to be forwarded cannot be determined only by the first routing table entry. Therefore, the descriptor field carrying the first identifier and the message to be forwarded can be sent to the switching network chip, and the switching network chip can continue to forward the message to be forwarded based on the second routing table entry stored in the switching network chip. If the message to be forwarded hits the first routing table entry, the descriptor field carrying the second identifier, the found destination interface identifier and the message to be forwarded may be sent to the switching network chip, and the switching network chip may directly send the message to be forwarded based on the destination interface identifier. Therefore, the scheme provided by the embodiment of the invention can complete the forwarding of the message.
In an embodiment of the present invention, the main control CPU601 determines the first routing table entry by:
according to a preset subnet mask code length, a first routing table entry and a second routing table entry are divided from a routing table maintained by the master control CPU 601;
or
According to a preset proportion, a first routing table entry and a second routing table entry are divided from a routing table maintained by the main control CPU 601.
In an embodiment of the present invention, when a subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to a preset subnet mask length, the interface switch chip 602:
determining whether the first subnet mask length of the destination address of the message to be forwarded is greater than or equal to the preset subnet mask length;
if the first subnet mask length is greater than or equal to the preset subnet mask length, searching a routing table entry matched with the message to be forwarded in the first routing table entry, if the routing table entry is searched, determining that the first routing table entry is hit, and if the routing table entry is not searched, determining that the first routing table entry is not hit;
and if the first subnet mask length is smaller than the preset subnet mask length, determining that the first routing table entry is missed.
As can be seen from the above, the subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to the preset subnet mask length, and if the subnet mask length of the destination address of the to-be-forwarded message is smaller than the preset subnet mask length, the routing table entry matched with the to-be-forwarded message cannot be found in the first routing table entry theoretically, and the to-be-forwarded message cannot hit the first routing table entry, so that the routing table entry may not be matched in the first routing table entry, it may be directly determined that the first routing table entry is not hit, and the forwarding process of the to-be-forwarded message is continuously executed.
In an embodiment of the present invention, the interface switch chip 602:
searching the routing table item of the subnet represented by the IP address recorded in the first routing table item, wherein the destination address of the message to be forwarded belongs to the first routing table item;
and/or
The switch fabric chip 603:
and searching the routing table entry of the subnet represented by the IP address recorded in the second routing table entry, wherein the destination address of the message to be forwarded belongs to the second routing table entry.
Specifically, the embodiment of the message forwarding method applied to the network device is similar to the embodiment of the message forwarding method applied to the interface switching chip, and details of the embodiment of the present invention are not repeated here.
Corresponding to the foregoing method for issuing a routing table entry applied to a master CPU, referring to fig. 8, a schematic structural diagram of a routing table entry issuing device provided in an embodiment of the present invention is applied to a master CPU of a network device, where the device includes:
a first table entry issuing module 801, configured to issue a first routing table entry and a first default routing table entry to an interface switch chip configured by the network device, where the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
a second table entry issuing module 802, configured to issue a second routing table entry and a second default routing table entry to the switch fabric chip, where the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the main control CPU issues the routing table entries in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entries respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. If the message to be forwarded misses the first routing table entry stored in the interface switching chip, the routing table entry matched with the message to be forwarded may be stored in the switching network chip, the interface switching chip may send the message to be forwarded to the switching network chip according to the first default routing table entry, and the switching network chip may continue to match the routing table entry. Therefore, the routing table items are respectively issued to the interface switching chip and the switching network chip, so that the normal forwarding of the message to be forwarded cannot be influenced.
Corresponding to the aforementioned message forwarding method applied to the interface switch chip, referring to fig. 9, a schematic structural diagram of a message forwarding apparatus provided in an embodiment of the present invention is applied to an interface switch chip of a network device, where the apparatus includes:
the table entry receiving module 901 is configured to receive and store a first routing table entry and a first default routing table entry issued by a main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
a message obtaining module 902, configured to obtain a message to be forwarded;
a table item searching module 903, configured to search, in the first routing table item, a routing table item that matches the packet to be forwarded;
a first data sending module 904, configured to send, according to the first default routing table entry, a descriptor field carrying a first identifier and the to-be-forwarded message to the switch fabric chip if the first routing table entry is not hit, so that when the switch fabric chip receives the first identifier, the to-be-forwarded message is forwarded based on a second routing table entry locally stored in the switch fabric chip, where the descriptor field is used to record an action that needs to be executed in a process of forwarding the to-be-forwarded message by the network device;
a second data sending module 905, configured to send, if the first routing table entry is hit, a descriptor field carrying a second identifier, a destination interface identifier in the found routing table entry, and the to-be-forwarded packet to the switching network chip, so that after the switching network chip obtains the second identifier, the to-be-forwarded packet is forwarded based on the destination interface identifier.
As can be seen from the above, if the message to be forwarded misses the first routing table entry, it means that the interface of the network device for forwarding the message to be forwarded cannot be determined only by the first routing table entry. Therefore, the descriptor field carrying the first identifier and the message to be forwarded can be sent to the switching network chip, and the switching network chip can continue to forward the message to be forwarded based on the second routing table entry stored in the switching network chip. If the message to be forwarded hits the first routing table entry, the descriptor field carrying the second identifier, the found destination interface identifier and the message to be forwarded may be sent to the switching network chip, and the switching network chip may directly send the message to be forwarded based on the destination interface identifier. Therefore, the scheme provided by the embodiment of the invention can complete the forwarding of the message. The interface exchange chip only needs to store the first routing table item in the routing table maintained by the CPU of the exchange network, so that the storage space of the interface exchange chip occupied by the routing table item is less
Corresponding to the foregoing message forwarding method applied to the network device, an embodiment of the present invention further provides a network device, where the network device includes: the main control CPU, the interface exchange chip and the exchange network chip.
Specifically, the structure of the network device may be the structure shown in fig. 6.
The main control CPU is configured to issue a first routing table entry and a first default routing table entry to the interface switch chip, and issue a second routing table entry and a second default routing table entry to the interface switch chip, where the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to the switching network chip, and the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU;
the interface switching chip is used for receiving and storing a first routing table entry and a first default routing table entry issued by the main control CPU to obtain a message to be forwarded; searching a routing table item matched with the message to be forwarded in the first routing table item; if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry; if the first routing table entry is hit, sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded to the switching network chip, wherein the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
the switching network chip is used for receiving and storing a second routing table item and a second default routing table item issued by the main control CPU; receiving data sent by the interface exchange chip; if the data comprises a first identifier, searching a routing table entry matched with the message to be forwarded in the second routing table entry, if the second routing table entry is hit, forwarding the message to be forwarded according to the searched routing table entry, and if the second routing table entry is not hit, forwarding the message to be forwarded to the main control CPU according to the second default routing table entry; if the data comprises a second identifier, forwarding the message to be forwarded according to a destination interface identifier included in the data;
and the main control CPU is used for forwarding the message to be forwarded based on a software protocol under the condition of receiving the message to be forwarded.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the main control CPU issues the routing table entries in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entries respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. And if the message to be forwarded does not hit the first routing table entry, it means that the interface of the network device for forwarding the message to be forwarded cannot be determined only by the first routing table entry. Therefore, the descriptor field carrying the first identifier and the message to be forwarded can be sent to the switching network chip, and the switching network chip can continue to forward the message to be forwarded based on the second routing table entry stored in the switching network chip. If the message to be forwarded hits the first routing table entry, the descriptor field carrying the second identifier, the found destination interface identifier and the message to be forwarded may be sent to the switching network chip, and the switching network chip may directly send the message to be forwarded based on the destination interface identifier. Therefore, the scheme provided by the embodiment of the invention can complete the forwarding of the message.
In an embodiment of the present invention, the main control CPU is further configured to: determining the first routing table entry and the second routing table entry by:
according to the preset subnet mask code length, dividing a first routing table item and a second routing table item from a routing table maintained by the master control CPU;
or
And according to a preset proportion, dividing a first routing table item and a second routing table item from a routing table maintained by the main control CPU.
In an embodiment of the present invention, when a subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to a preset subnet mask length, the interface switch chip is specifically configured to:
the interface switching chip determines whether the first subnet mask length of the destination address of the message to be forwarded is greater than or equal to the preset subnet mask length;
if the first subnet mask length is greater than or equal to the preset subnet mask length, searching a routing table entry matched with the message to be forwarded in the first routing table entry, if the routing table entry is searched, determining that the first routing table entry is hit, and if the routing table entry is not searched, determining that the first routing table entry is not hit;
and if the first subnet mask length is smaller than the preset subnet mask length, determining that the first routing table entry is missed.
As can be seen from the above, the subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to the preset subnet mask length, and if the subnet mask length of the destination address of the to-be-forwarded message is smaller than the preset subnet mask length, the routing table entry matched with the to-be-forwarded message cannot be found in the first routing table entry theoretically, and the to-be-forwarded message cannot hit the first routing table entry, so that the routing table entry may not be matched in the first routing table entry, it may be directly determined that the first routing table entry is not hit, and the forwarding process of the to-be-forwarded message is continuously executed.
In an embodiment of the present invention, the interface exchange chip is specifically configured to:
searching the routing table item of the subnet represented by the IP address recorded in the first routing table item, wherein the destination address of the message to be forwarded belongs to the first routing table item;
and/or
The switching network chip is specifically configured to:
and searching the routing table entry of the subnet represented by the IP address recorded in the second routing table entry, wherein the destination address of the message to be forwarded belongs to the second routing table entry.
Specifically, the functions of the main control CPU, the interface switching chip, and the switching network chip in the network device are the same as the steps executed by the main control CPU, the interface switching chip, and the switching network chip in the message forwarding method applied to the network device, and details thereof are not repeated in the embodiments of the present invention.
In another embodiment of the present invention, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements any of the above steps of the routing table entry issuing method applied to the master CPU.
When executing the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention to issue the routing table entry, the main control CPU issues the routing table entry in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entry respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. If the message to be forwarded misses the first routing table entry stored in the interface switching chip, the routing table entry matched with the message to be forwarded may be stored in the switching network chip, the interface switching chip may send the message to be forwarded to the switching network chip according to the first default routing table entry, and the switching network chip may continue to match the routing table entry. Therefore, the routing table items are respectively issued to the interface switching chip and the switching network chip, so that the normal forwarding of the message to be forwarded cannot be influenced.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the message forwarding methods applied to the interface switch chip.
When the computer program stored in the computer-readable storage medium provided in the embodiment of the present invention is executed to forward a message, if the message to be forwarded misses the first routing table entry, it indicates that an interface of the network device for forwarding the message to be forwarded cannot be determined only by the first routing table entry. Therefore, the descriptor field carrying the first identifier and the message to be forwarded can be sent to the switching network chip, and the switching network chip can continue to forward the message to be forwarded based on the second routing table entry stored in the switching network chip. If the message to be forwarded hits the first routing table entry, the descriptor field carrying the second identifier, the found destination interface identifier and the message to be forwarded may be sent to the switching network chip, and the switching network chip may directly send the message to be forwarded based on the destination interface identifier. Therefore, the scheme provided by the embodiment of the invention can complete the forwarding of the message. The interface exchange chip only needs to store the first routing table item in the routing table maintained by the CPU of the exchange network, so that the storage space of the interface exchange chip occupied by the routing table item is less
In another embodiment of the present invention, a computer program product containing instructions is further provided, which when run on a computer, causes the computer to execute any of the steps of the routing table entry issuing method applied to the master CPU in the foregoing embodiments.
When executing the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention to issue the routing table entry, the main control CPU issues the routing table entry in the routing table maintained by the main control CPU to the interface switching chip and the switching network chip, and the interface switching chip and the switching network chip store a part of the routing table entry respectively. That is, the interface switching chip will not store all the routing table entries, so that the storage space of the interface switching chip occupied by the routing table entries can be reduced. If the message to be forwarded misses the first routing table entry stored in the interface switching chip, the routing table entry matched with the message to be forwarded may be stored in the switching network chip, the interface switching chip may send the message to be forwarded to the switching network chip according to the first default routing table entry, and the switching network chip may continue to match the routing table entry. Therefore, the routing table items are respectively issued to the interface switching chip and the switching network chip, so that the normal forwarding of the message to be forwarded cannot be influenced.
In another embodiment of the present invention, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the steps of any of the message forwarding methods applied to the interface switch chip in the above embodiments.
When the computer program stored in the computer-readable storage medium provided in the embodiment of the present invention is executed to forward a message, if the message to be forwarded misses the first routing table entry, it indicates that an interface of the network device for forwarding the message to be forwarded cannot be determined only by the first routing table entry. Therefore, the descriptor field carrying the first identifier and the message to be forwarded can be sent to the switching network chip, and the switching network chip can continue to forward the message to be forwarded based on the second routing table entry stored in the switching network chip. If the message to be forwarded hits the first routing table entry, the descriptor field carrying the second identifier, the found destination interface identifier and the message to be forwarded may be sent to the switching network chip, and the switching network chip may directly send the message to be forwarded based on the destination interface identifier. Therefore, the scheme provided by the embodiment of the invention can complete the forwarding of the message. The interface exchange chip only needs to store the first routing table item in the routing table maintained by the CPU of the exchange network, so that the storage space of the interface exchange chip occupied by the routing table item is less
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the message forwarding method, apparatus, network device, computer-readable storage medium and computer program product applied to the network device, since they are substantially similar to the method embodiments, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (16)

1. A method for issuing a routing table entry is characterized in that the method is applied to a main control CPU of network equipment, and the method comprises the following steps:
issuing a first routing table entry and a first default routing table entry to an interface switching chip configured by the network device, wherein the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
issuing a second routing table item and a second default routing table item to the switching network chip, wherein the second routing table item is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
2. The method of claim 1, wherein the first routing table entry and the second routing table entry are determined by:
according to the preset subnet mask code length, dividing a first routing table item and a second routing table item from a routing table maintained by the master control CPU;
or
And according to a preset proportion, dividing a first routing table item and a second routing table item from a routing table maintained by the main control CPU.
3. A message forwarding method is applied to an interface switching chip of a network device, and the method comprises the following steps:
receiving and storing a first routing table and a first default routing table issued by a main control CPU, wherein the first default routing table is used for indicating: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
obtaining a message to be forwarded;
searching a routing table item matched with the message to be forwarded in the first routing table item;
if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry, so that when the switching network chip receives the first identifier, the message to be forwarded is forwarded based on a second routing table entry locally stored in the switching network chip, and the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
if the first routing table entry is hit, a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded are sent to the switching network chip, so that the switching network chip can forward the message to be forwarded based on the target interface identifier after obtaining the second identifier.
4. The method according to claim 3, wherein, in a case that a subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to a preset subnet mask length, searching for a routing table entry matching the packet to be forwarded in the first routing table entry includes:
determining whether the first subnet mask length of the destination address of the message to be forwarded is greater than or equal to the preset subnet mask length;
if the first subnet mask length is greater than or equal to the preset subnet mask length, searching a routing table entry matched with the message to be forwarded in the first routing table entry, if the routing table entry is searched, determining that the first routing table entry is hit, and if the routing table entry is not searched, determining that the first routing table entry is not hit;
and if the first subnet mask length is smaller than the preset subnet mask length, determining that the first routing table entry is missed.
5. The method according to claim 3 or 4, wherein the searching for the routing table entry matching the packet to be forwarded in the first routing table entry comprises:
and searching the routing table entry of the subnet represented by the recorded IP address, to which the destination address of the message to be forwarded belongs, in the first routing table entry.
6. A message forwarding method is applied to a network device, and the network device includes: the main control CPU, the interface exchange chip and the exchange network chip;
the main control CPU issues a first routing table item and a first default routing table item to the interface switching chip, and issues a second routing table item and a second default routing table item to the switching network chip, wherein the first routing table item is as follows: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to the switching network chip, and the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU;
the interface switching chip receives and stores a first routing table and a first default routing table issued by the main control CPU to obtain a message to be forwarded; searching a routing table item matched with the message to be forwarded in the first routing table item; if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry; if the first routing table entry is hit, sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded to the switching network chip, wherein the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
the switching network chip receives and stores a second routing table item and a second default routing table item issued by the main control CPU; receiving data sent by the interface exchange chip; if the data comprises a first identifier, searching a routing table entry matched with the message to be forwarded in the second routing table entry, if the second routing table entry is hit, forwarding the message to be forwarded according to the searched routing table entry, and if the second routing table entry is not hit, forwarding the message to be forwarded to the main control CPU according to the second default routing table entry; if the data comprises a second identifier, forwarding the message to be forwarded according to a destination interface identifier included in the data;
and the main control CPU forwards the message to be forwarded based on a software protocol under the condition of receiving the message to be forwarded.
7. The method of claim 6, wherein the master CPU determines the first routing table entry and the second routing table entry by:
according to the preset subnet mask code length, dividing a first routing table item and a second routing table item from a routing table maintained by the master control CPU;
or
And according to a preset proportion, dividing a first routing table item and a second routing table item from a routing table maintained by the main control CPU.
8. The method according to claim 7, wherein, in a case that a subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to a preset subnet mask length, the interface switching chip searches for a routing table entry matching the packet to be forwarded in the first routing table entry, including:
the interface switching chip determines whether the first subnet mask length of the destination address of the message to be forwarded is greater than or equal to the preset subnet mask length;
if the first subnet mask length is greater than or equal to the preset subnet mask length, searching a routing table entry matched with the message to be forwarded in the first routing table entry, if the routing table entry is searched, determining that the first routing table entry is hit, and if the routing table entry is not searched, determining that the first routing table entry is not hit;
and if the first subnet mask length is smaller than the preset subnet mask length, determining that the first routing table entry is missed.
9. The method according to any of claims 7-8, wherein the interface switching chip searches for a routing table entry matching the message to be forwarded in the first routing table entry, including:
the interface exchange chip searches for the routing table entry of the subnet represented by the IP address recorded by the interface exchange chip, wherein the destination address of the message to be forwarded belongs to the first routing table entry;
and/or
The said switching network chip searches the route list item matched with the said message to be forwarded in the said second route list item, including:
and the switching network chip searches the routing table item of the subnet represented by the IP address recorded by the switching network chip, wherein the destination address of the message to be forwarded belongs to the second routing table item.
10. A routing table item issuing device is characterized in that the device is applied to a main control CPU of a network device, and the device comprises:
a first table entry issuing module, configured to issue a first routing table entry and a first default routing table entry to an interface switch chip configured by the network device, where the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
a second table entry issuing module, configured to issue a second routing table entry and a second default routing table entry to the switching network chip, where the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: and the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU.
11. A message forwarding apparatus, applied to an interface switching chip of a network device, the apparatus comprising:
the table entry receiving module is configured to receive and store a first routing table entry and a first default routing table entry issued by a main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to a switching network chip in network equipment;
the message obtaining module is used for obtaining a message to be forwarded;
a table item searching module, configured to search, in the first routing table item, a routing table item that matches the packet to be forwarded;
a first data sending module, configured to send, according to the first default routing table entry, a descriptor field carrying a first identifier and the to-be-forwarded packet to the switch fabric chip if the first routing table entry is not hit, so that when the switch fabric chip receives the first identifier, the to-be-forwarded packet is forwarded based on a second routing table entry locally stored in the switch fabric chip, where the descriptor field is used to record an action that needs to be executed in a process of forwarding the to-be-forwarded packet by the network device;
and the second data sending module is used for sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table item and the message to be forwarded to the switching network chip if the first routing table item is hit, so that the switching network chip forwards the message to be forwarded based on the target interface identifier after obtaining the second identifier.
12. A network device, characterized in that the network device comprises: the main control CPU, the interface exchange chip and the exchange network chip;
the main control CPU is configured to issue a first routing table entry and a first default routing table entry to the interface switch chip, and issue a second routing table entry and a second default routing table entry to the interface switch chip, where the first routing table entry is: a part of routing table entries in a routing table maintained by the main control CPU, where the first default routing table entry is used to indicate: the message to be forwarded which does not hit the first routing table entry is sent to the switching network chip, and the second routing table entry is: routing table entries in the routing table other than the first routing table entry, wherein the second default routing table entry is used to indicate: the message to be forwarded which does not hit the second routing table entry is sent to the main control CPU;
the interface switching chip is used for receiving and storing a first routing table entry and a first default routing table entry issued by the main control CPU to obtain a message to be forwarded; searching a routing table item matched with the message to be forwarded in the first routing table item; if the first routing table entry is not hit, sending a descriptor field carrying a first identifier and the message to be forwarded to the switching network chip according to the first default routing table entry; if the first routing table entry is hit, sending a descriptor field carrying a second identifier, a target interface identifier in the searched routing table entry and the message to be forwarded to the switching network chip, wherein the descriptor field is used for recording actions required to be executed in the process of forwarding the message to be forwarded by the network equipment;
the switching network chip is used for receiving and storing a second routing table item and a second default routing table item issued by the main control CPU; receiving data sent by the interface exchange chip; if the data comprises a first identifier, searching a routing table entry matched with the message to be forwarded in the second routing table entry, if the second routing table entry is hit, forwarding the message to be forwarded according to the searched routing table entry, and if the second routing table entry is not hit, forwarding the message to be forwarded to the main control CPU according to the second default routing table entry; if the data comprises a second identifier, forwarding the message to be forwarded according to a destination interface identifier included in the data;
and the main control CPU is used for forwarding the message to be forwarded based on a software protocol under the condition of receiving the message to be forwarded.
13. The network device of claim 12, wherein the master CPU is further configured to: determining the first routing table entry and the second routing table entry by:
according to the preset subnet mask code length, dividing a first routing table item and a second routing table item from a routing table maintained by the master control CPU;
or
And according to a preset proportion, dividing a first routing table item and a second routing table item from a routing table maintained by the main control CPU.
14. The network device according to claim 12, wherein, in a case that a subnet mask length of the IP address recorded in the first routing table entry is greater than or equal to a preset subnet mask length, the interface switching chip is specifically configured to:
the interface switching chip determines whether the first subnet mask length of the destination address of the message to be forwarded is greater than or equal to the preset subnet mask length;
if the first subnet mask length is greater than or equal to the preset subnet mask length, searching a routing table entry matched with the message to be forwarded in the first routing table entry, if the routing table entry is searched, determining that the first routing table entry is hit, and if the routing table entry is not searched, determining that the first routing table entry is not hit;
and if the first subnet mask length is smaller than the preset subnet mask length, determining that the first routing table entry is missed.
15. The network device of any one of claims 12-14,
the interface exchange chip is specifically configured to:
searching the routing table item of the subnet represented by the IP address recorded in the first routing table item, wherein the destination address of the message to be forwarded belongs to the first routing table item;
and/or
The switching network chip is specifically configured to:
and searching the routing table entry of the subnet represented by the IP address recorded in the second routing table entry, wherein the destination address of the message to be forwarded belongs to the second routing table entry.
16. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1-2 or 3-5.
CN202110703858.4A 2021-06-24 2021-06-24 Routing table entry issuing and message forwarding method, device and network equipment Withdrawn CN113328963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110703858.4A CN113328963A (en) 2021-06-24 2021-06-24 Routing table entry issuing and message forwarding method, device and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110703858.4A CN113328963A (en) 2021-06-24 2021-06-24 Routing table entry issuing and message forwarding method, device and network equipment

Publications (1)

Publication Number Publication Date
CN113328963A true CN113328963A (en) 2021-08-31

Family

ID=77424574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110703858.4A Withdrawn CN113328963A (en) 2021-06-24 2021-06-24 Routing table entry issuing and message forwarding method, device and network equipment

Country Status (1)

Country Link
CN (1) CN113328963A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314159A (en) * 2022-08-02 2022-11-08 成都爱旗科技有限公司 Inter-chip data transmission method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314159A (en) * 2022-08-02 2022-11-08 成都爱旗科技有限公司 Inter-chip data transmission method and device
CN115314159B (en) * 2022-08-02 2023-08-04 成都爱旗科技有限公司 Method and device for transmitting data between chips

Similar Documents

Publication Publication Date Title
KR102162730B1 (en) Technologies for distributed routing table lookup
EP2314027B1 (en) Switching table in an ethernet bridge
CN104090897B (en) Method, server and the system of accesses meta-data
CN108848034B (en) Network equipment and table entry learning method
CN108566296B (en) Network device layering method, network management device and computer readable storage medium
JP5594171B2 (en) Communication processing apparatus, address learning program, and address learning method
JP2016149757A (en) Technologies for modular forwarding table scalability
US7609705B2 (en) Determination of a plurality of paths before selection of one path of the plurality of paths for transmission of one or more packets
KR20150076118A (en) Packet forwarding method and system
CN106789859B (en) Message matching method and device
CN113438329A (en) MAC address sending method, device and system
CN107749826B (en) Data packet forwarding method and system
CN113328963A (en) Routing table entry issuing and message forwarding method, device and network equipment
CN113641869B (en) Digital object access method and system in man-machine-object fusion environment
US10025859B2 (en) Method and system for second-degree friend query
US20100010961A1 (en) Distributed directories
CN110213365B (en) User access request processing method based on user partition and electronic equipment
CN113347084B (en) Message forwarding method and device
CN113918504A (en) Method and device for realizing isolation group
US7159019B2 (en) Information collection apparatus and method
CN106878176B (en) message forwarding method and device
CN102413038B (en) Processing method and system for inaccessibility of next hop of route
WO2015029321A1 (en) Communication system, controller, communication method, and storage medium
CN114007152B (en) Port convergence processing method and device for optical fiber switch
CN113438158B (en) Message forwarding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20210831

WW01 Invention patent application withdrawn after publication