CN111327546B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN111327546B
CN111327546B CN202010117679.8A CN202010117679A CN111327546B CN 111327546 B CN111327546 B CN 111327546B CN 202010117679 A CN202010117679 A CN 202010117679A CN 111327546 B CN111327546 B CN 111327546B
Authority
CN
China
Prior art keywords
interface
bit
bitmap
slot
slot position
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.)
Active
Application number
CN202010117679.8A
Other languages
Chinese (zh)
Other versions
CN111327546A (en
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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202010117679.8A priority Critical patent/CN111327546B/en
Publication of CN111327546A publication Critical patent/CN111327546A/en
Application granted granted Critical
Publication of CN111327546B publication Critical patent/CN111327546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method and a device for forwarding a message. In the application, the main control board modifies the slot position number in the interface pair list into the bit position ID with less digits, so that the digits of the output interface information in the output interface list are correspondingly reduced, and simultaneously, the corresponding relation between the slot position number and the bit position ID is recorded by using a bitmap. Therefore, the service board can identify the interface by using the number of bits less than the identification number of the interface, and can also find the slot position number corresponding to the bit position ID according to the bitmap, so that the table entry is forwarded according to the bitmap and the interface after the message is received.

Description

Message forwarding method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
A conventional network device usually includes a plurality of slots, wherein each slot may be inserted with a board. In order to implement the processing of the packet, the network device needs to transmit the received packet between the boards.
The service board may control the transmission direction of the packet according to the interface pair list issued by the main control board of the network device. Specifically, the main control board issues an interface pair list including the ingress interface information and the corresponding egress interface information to the service board. The service board determines the interface according to the interface pair entry after receiving the message from the input interface, and forwards the message from the determined output interface.
In the service board, the number of bits used to identify the interfaces in the interface pair list is limited, e.g., 10 bits as is common. Such a 10-bit service board may be identified by up to 1024 (i.e., 2)10) When the service board identifies the interface, the high 5 bit can be used for identifying the slot position number, and the low 5 bit can be used for identifying the interface number in the slot. For example, if the outbound interface is slot 32, the outbound interface identification is represented as 1111111111.
However, as the technology develops, the number of interfaces of the network device increases, and the number of bits of the outbound interface identifier in the interface pair list also increases, so that the number of bits of the outbound interface identifier exceeds the number of bits that the service board can use to characterize the interface. In order to avoid increasing the number of bits used by the service board to identify the interface, a new method for forwarding a packet is urgently needed.
Disclosure of Invention
In view of the above technical problems, the present application provides a method and an apparatus for forwarding a packet, so that a service board of a network device does not need to increase the number of bits for identifying interface information.
According to a first aspect of the present application, a method for forwarding a packet is provided, where the method is applied to a main control board of a network device, the main control board has a preset interface pair list, and each interface pair entry in the interface pair list includes: the method comprises the steps that interface entering information and interface exiting information are obtained, wherein the interface exiting information comprises a slot position number of a slot position where an interface exits;
the method comprises the following steps:
generating a bitmap based on the number of all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
acquiring slot numbers of slot positions where all the output interfaces in the interface pair list are located, marking all bits corresponding to the slot numbers in the bitmap as valid bits, and distributing bit IDs for the marked valid bits in the bitmap; the number of bits of the bit ID is less than that of the slot position number;
for each interface pair table entry, modifying the slot position number of the slot position where the output interface of the interface pair table entry is positioned into the bit position ID of the effective bit corresponding to the slot position number;
and issuing the modified bitmap and the modified interface pair list to each service board so that the service board forwards the message based on the issued bitmap and the interface pair list.
According to a second aspect of the present application, a method for forwarding a packet is provided, where the method is applied to a service board of a network device, and the method includes:
receiving a bitmap and an interface pair list sent by a main control board;
forwarding the message to the list based on the bitmap and the interface;
the bitmap is generated by all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
each interface pair entry in the list of interface pairs comprises: ingress interface information and egress interface information;
the outgoing interface information comprises a bit ID used for representing the slot position number of the slot position where the outgoing interface is located and a slot interface number in the slot position; the number of bits of the bit ID is less than the number of bits of the slot number.
According to a third aspect of the present application, an apparatus for forwarding a packet is provided, where the apparatus is applied to a main control board of a network device, and the main control board presets an interface pair list, where each interface pair entry in the interface pair list includes: the method comprises the steps that interface entering information and interface exiting information are obtained, wherein the interface exiting information comprises a slot position number of a slot position where an interface exits;
the device includes:
the bitmap generation unit is used for generating a bitmap based on the number of all the slots of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
the bitmap marking unit is used for acquiring slot numbers of slot positions where all the outgoing interfaces are located in the interface pair list, marking all bits corresponding to the slot numbers in the bitmap as valid bits, and distributing bit ID (identity) for each valid bit marked in the bitmap; the number of bits of the bit ID is less than that of the slot position number;
the interface modification unit is used for modifying the slot position number of the slot position where the output interface of each interface pair table entry is positioned into the bit position ID of the effective bit corresponding to the slot position number aiming at each interface pair table entry;
and the information issuing unit is used for issuing the modified bitmap and the modified interface pair list to each service board so that the service board forwards the message based on the issued bitmap and the interface pair list.
According to a fourth aspect of the present application, there is provided a message forwarding apparatus, which is applied to a service board of a network device, and includes:
the information receiving unit is used for receiving the bitmap and the interface pair list sent by the main control board;
the message forwarding unit is used for forwarding the message to the list based on the bitmap and the interface;
the bitmap is generated by all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
each interface pair entry in the list of interface pairs comprises: ingress interface information and egress interface information;
the outgoing interface information comprises a bit ID used for representing the slot position number of the slot position where the outgoing interface is located and a slot interface number in the slot position; the number of bits of the bit ID is less than the number of bits of the slot number.
In the application, the main control board generates a bitmap, each bit on the bitmap corresponds to each slot position of the network device, then slot positions of all output interfaces are obtained from the interface pair list, the bit corresponding to the slot position number in the bitmap is marked as an effective bit, and then bit ID is distributed to all the effective bits. And aiming at each interface pair table entry, modifying the slot position number in the interface pair table entry into a corresponding bit position ID, and finally issuing the modified bitmap and the interface pair list to a service board. Therefore, after receiving the message, the service board can determine the output interface of the message according to the input interface, the interface pair list and the bitmap of the received message, and forward the message based on the output interface.
The master control board modifies the slot position number in the interface pair list into a bit position ID with less digits, so the digits of the outlet interface information in the outlet interface list are correspondingly reduced, and simultaneously, the bitmap is used for recording the corresponding relation between the slot position number and the bit position ID, so the service board can identify the interface by using the digits less than the outlet interface identification, and can also find the slot position number corresponding to the bit position ID according to the bitmap, thereby the message is forwarded to the table entry according to the bitmap and the interface after the message is received.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be 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 described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1-a is a slot schematic diagram of a network device according to an exemplary embodiment of the present application;
1-b is a slot schematic diagram of another network device shown in an example embodiment of the present application;
fig. 2 is a block diagram of a method for forwarding a packet according to an exemplary embodiment of the present application;
FIG. 3-a is a schematic diagram of a bitmap shown in an exemplary embodiment of the present application;
3-b is a schematic diagram of another bitmap shown in an exemplary embodiment of the present application;
fig. 4 is a block diagram of another method for forwarding a packet according to an exemplary embodiment of the present application
FIG. 5 is a diagram illustrating a hardware configuration of a network device according to an exemplary embodiment of the present application;
fig. 6 is a block diagram of an apparatus for forwarding a packet according to an exemplary embodiment of the present application;
fig. 7 is a block diagram of another apparatus for forwarding a packet according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
A conventional network device usually includes a plurality of slots, wherein each slot can be inserted with a board.
The network device shown in fig. 1-a includes 32 slots, the slots are connected to each other by internal cables (not shown in the figure), and each slot is reserved with 32 interfaces. Suppose that the network device is inserted with at least three service boards, wherein, the slot 1 is inserted with the service board a, the slot 2 is inserted with the service board B, the slot 32 is inserted with the service board C, and each service board occupies all the interfaces of the corresponding slot. Of course, other slots may be inserted with other boards with different numbers of interfaces, or may be left unused, which is not limited herein.
In order to implement the processing of the packet, the network device needs to transmit the received packet between the boards.
The service board controls the transmission direction of the message according to the interface pair list issued by the main control board of the network equipment. Specifically, the main control board issues an interface pair list including the ingress interface information and the corresponding egress interface information to the service board. The service board determines the interface according to the interface pair list after receiving the message from the input interface, and forwards the message from the determined output interface.
Still taking the network device shown in fig. 1-a as an example, since the network device includes 32 slot positions, the main control board of the network device uses 5 bits to represent the slot position number of each slot position, that is, the value range of the slot position number is 00000-11111; for the same reason, since each slot includes 32 interfaces, the network device also represents the slot interface number in the slot as 5 bits, i.e., the slot interface number has a value ranging from 00000 to 11111.
The main control board needs to issue the interface pair list to each service board, so that the service board can query the corresponding output interface in the interface pair table entry according to the input interface after receiving the message. However, the number of bits in the service board used to characterize the interface information in the list of interface pairs is limited, e.g., 10 bits is common. Such a 10-bit service board may be identified by up to 1024 (i.e., 2)10) When the service board identifies an interface, it needs to identify the slot position number of the slot position where the interface is located and the slot interface number of the interface in the slot position. Still taking fig. 1-a as an example, the number of bits used for representing the interface information in the service board is 10 bits, when an interface is identified, the high 5 bits are used for identifying the slot number, and the low 5 bits are used for identifying the in-slot interface number.
For example, in the network device shown in fig. 1-a, it is assumed that the interface pair list on the network device includes an interface pair entry for slot 1, as shown in table 1:
groove position Input interface Outlet interface
1 00000 1111111111
TABLE 1
It will be appreciated that the interface pair list represents: for the slot 1, when the incoming interface of the message is the 1 st interface, the outgoing interface of the message is the 32 nd interface of the 32 nd slot. Wherein, the high 5 bits in the out-interface identification are used for representing the slot number 32 and are represented as 111111 by binary; the lower 5 bits are used to represent the in-slot interface number 32, which is represented in binary as 111111. The identification of the outbound interface is 1111111111.
However, as the number of interfaces provided on the network device increases with the development of technology, the master control board also uses a more-digit identifier to identify the slot number and the interface number in the slot.
Taking fig. 1-b as an example, the number of slot positions and the number of in-slot interfaces of the network device are both 64, and the main control board at least needs to use 6 bits to identify the slot position number of each slot position, that is, the value range of the slot position number is 000000 — 111111; the interface number in the slot is identified by 6 bits, i.e. the value range of the interface number in the slot is 000000-111111.
However, the number of bits used for identifying the interfaces in the interface pair list in the service board cannot be expanded, and when the number of bits of the interface identification exceeds the number of bits used for representing the interfaces in the service board, the service board cannot distinguish the interfaces in the interface pair list.
In view of this, in order not to increase the number of bits used by the service board to identify the interface, the present application provides a new method for forwarding a packet.
Referring to fig. 2, fig. 2 is a method for forwarding a packet, shown in an exemplary embodiment of the present application, and applied to a main control board in a network device, where the main control board presets an interface pair list, and each interface pair entry in the interface pair list includes: the interface access method comprises the following steps of inputting interface information and outputting interface information, wherein the outputting interface information comprises a slot number of a slot position where the outputting interface is located.
As shown in fig. 2, the method comprises the following steps:
step S201: the main control board generates a bitmap based on the number of all the slot positions of the equipment; each bit in the bitmap corresponds to a slot number of each slot.
Firstly, a main control board of the network equipment obtains the number of the slot positions of the equipment, and determines the number of bits for representing the slot position number of the equipment based on the number of the slot positions. Generally, if the number of slots preset by the network device is N times of 2 (N is an integer greater than 0), the main control board determines that the device uses N bits to represent the slot number.
Taking the network device shown in fig. 1-b as an example, the network device includes 64 (i.e., 2)6) And each slot, the master control board can use 6 bits to characterize the slot number.
Then, the main control board splits the number of bits into a high-order section and a low-order section.
Taking the example that the number of bits used for representing the slot number is 6 bits, 6 bits may be split into 1 high-order interval and 5 low-order intervals, or 6 bits may be split into 3 high-order intervals and 3 low-order intervals, and the number of bits may be unpacked into two integer intervals according to actual requirements.
And finally, the main control board determines a bitmap according to the high-order region and the low-order region, wherein the horizontal axis of the bitmap is used for representing the high-order region, and the vertical axis of the bitmap is used for representing the low-order region.
Specifically, the horizontal axis and the vertical axis include bit numbers, which are different numbers of values that can be represented by the interval length. For example, when the length of the lower interval is 3 bits, 3 bits can represent 8 (i.e. 2)3) A different value. The vertical axis characterizing the lower interval comprises 8 bits.
Still taking the network device shown in fig. 1-b as an example, the 6 bits are unpacked into 3 high-order sections and 3 low-order sections, and the horizontal axis of the bitmap includes 8 (i.e. 2) for identifying the high 3 bits of the slot position3) The vertical axis of the bit map identifies the inclusion of 8 bits (i.e., 2 bits) with the slot number 3 lower3) And a bit.
Thus, the main control board may determine a bitmap as shown in fig. 3-a for the network device, where the bitmap includes 64 bits, and the 64 bits correspond to the 64 slot numbers on the network device one to one. For convenience of representation, the horizontal and vertical coordinate bits in the bitmap are both represented as 10-ary numerical values. For example, the bit having the coordinate of (7,1) represents a slot having a slot number of 111 as the upper 3 bits and 001 as the lower 3 bits, that is, a 58 th slot having a slot number of 111001.
Of course, in the present application, the horizontal axis of the bitmap may be used to represent the low-order region, and the vertical axis of the bitmap may be used to represent the low-order region, as long as the main control board and the service board uniformly represent the relationship, which is only an exemplary illustration and is not limited herein.
Step S202: the master control board obtains slot numbers of slot positions where all the output interfaces in the interface pair list are located, marks all bits corresponding to the slot numbers in the bitmap as valid bits, and distributes bit IDs for the marked valid bits in the bitmap; the number of bits of the bit ID is less than the number of bits of the slot number.
In this application, a master control board of a network device is preconfigured with an interface pair list, where each interface pair table entry includes: the interface access device comprises interface input information and interface output information, wherein the interface output information comprises a slot number of a slot where the interface output is located.
The master control board obtains all the outgoing interface information contained in the interface pair list and determines the slot position number of the slot position where the outgoing interface in the outgoing interface information is located; and then searching the bit corresponding to the slot position number of the slot position where the output interface is located one by one in the bitmap, and marking the searched bit as an effective bit. After bit marking corresponding to the slot position numbers of the slot positions of all the output interfaces in the interface pair list is completed, the main control board distributes bit ID for each effective bit marked in the bitmap, and the number of bits of the bit ID is less than that of the slot position numbers.
As an alternative embodiment, the main control board may first sort the valid bits in the bitmap according to a preset order, and then, for each valid bit, use the sequence number of the valid bit in the sort as the bit ID of the valid bit.
The preset sequence can follow the sequence from top to bottom and then from left to right; the sequence from left to right and then from top to bottom can be followed, and is not particularly limited.
It can be understood that, because the network device not only has a service board that needs to forward a packet, but also includes a large number of other board cards that do not involve packet forwarding, such as a main control board, a switch board, and the like, the slot number of the outgoing interface in the interface-to-entry is far smaller than the number of all slots on the network device. Therefore, in the present application, the number of valid bits is much smaller than the total number of bits, and when the serial number of a valid bit is used as the bit ID, the number of bits of the bit ID may also be smaller than the number of bits of the slot number.
The method of step S202 is specifically described below using the bitmap shown in fig. 3-a as an example.
Assume that the interface pair list preset by the main control board includes two interface pair entries, as shown in table 2:
groove position Input interface Outlet interface
1 000000 000001000000
1 000001 111111000001
TABLE 2
Wherein, the two interfaces can respectively represent the table entries for the slot 1: when the input interface of the message is the 1 st interface, the output interface of the message is the 1 st interface of the 2 nd slot position; and when the input interface of the message is the 2 nd interface, the output interface of the message is the 2 nd interface of the 64 th slot position.
In this embodiment, the method comprises the following steps:
first, the main control board obtains slot numbers of the slots in which all the output interfaces in table 2 are located, including slot number 000001 (i.e., the slot number of slot 2) and slot number 111111 (i.e., the slot number of slot 64).
Then, the main control board searches the bit corresponding to the two slot numbers in the bitmap, and marks the searched bit as the effective bit. Specifically, the high 3 bits of the slot number 000001 are 000, and the low 3 bits are 001, then the coordinates of the bit corresponding to the slot number in the bitmap are (0, 1); the high 3 bits of the slot 111111 are 111, and the low 3 bits are 111, then the coordinates of the bit corresponding to the slot number in the bitmap are (7, 7). The marked bitmap is shown in fig. 3-b.
And finally, the main control board allocates bit IDs for all valid bits in the bitmap after marking is completed. Specifically, two valid bits in the figure are sorted from top to bottom and from left to right, and the serial number of the valid bit in the sorting is used as the bit ID thereof. Bit ID 0000 is allocated to the 1 st significant bit (i.e., the bit corresponding to the slot number 000001); the 2 nd significant bit (i.e., the bit corresponding to the slot number 111111) is allocated with a bit ID of 0001.
It will be appreciated that the number of bits of the bit ID may be determined based on the number of bits available in the service board to identify the interface slot number. In this embodiment, the number of bits used by the service board to characterize the outbound interface is 10 bits, where 6 bits are used to characterize the interface number of the outbound interface in the slot, and therefore, the remaining 4 bits may be used to characterize the slot number of the slot in which the outbound interface is located.
Step S203: and the main control board modifies the slot number of the slot position where the output interface of each interface pair table entry is located into the bit ID of the valid bit corresponding to the slot number aiming at each interface pair table entry.
In this application, the main control board modifies the slot number of the slot where the output interface is located in the interface pair entry into the bit ID allocated in step S202, so that, in the modified interface pair entry, the output interface information includes the bit ID of the slot where the output interface is located and the slot interface number of the output interface in the slot.
Still taking table 2 as an example, the modified interface pair list is shown in table 3.
Groove position Input interface Outlet interface
1 000000 0000000000
1 000001 0001000001
TABLE 3
Wherein, the first output interface information 0000000000 indicates that the bit ID of the slot where the interface is located is 0000, and the slot interface number of the output interface in the slot is 000000; the second output interface is also represented in a similar way, and will not be described in detail here.
Step S204: and the main control board transmits the modified bitmap and the modified interface pair list to each service board, so that the service board performs message forwarding on the basis of the transmitted bitmap and the modified interface pair list.
The main control board issues the interface pair list modified in step S203 and the bitmap marked in step S202 to each service board, so that the service board can forward the message according to the information issued by the main control board. The specific method for forwarding the packet by the service board is described in fig. 4 below, and is not described herein again.
Optionally, the interface pair list issued by the main control board to each service board may include interface pair entries of all slot positions; or include, for each service board, the interface pair entry corresponding to the slot in which the service board is located.
Thus, the flow shown in fig. 2 is completed.
In the application, the main control board generates a bitmap, each bit on the bitmap corresponds to each slot position of the network device, then slot positions of all output interfaces are obtained from the interface pair list, the bit corresponding to the slot position number in the bitmap is marked as an effective bit, and then bit ID is distributed to all the effective bits. And aiming at each interface pair table entry, modifying the slot position number in the interface pair table entry into a corresponding bit position ID, and finally issuing the modified bitmap and the interface pair list to a service board. Therefore, after receiving the message, the service board can determine the output interface of the message according to the input interface, the interface pair list and the bitmap of the received message, and forward the message based on the output interface.
The master control board modifies the slot position number in the interface pair list into a bit position ID with less digits, so the digits of the outlet interface information in the outlet interface list are correspondingly reduced, and simultaneously, the bitmap is used for recording the corresponding relation between the slot position number and the bit position ID, so the service board can identify the interface by using the digits less than the outlet interface identification, and can also find the slot position number corresponding to the bit position ID according to the bitmap, thereby the message is forwarded to the table entry according to the bitmap and the interface after the message is received.
It should be noted that, in addition to the above method, the main control board may also compress the outbound interface identifier as a whole. Specifically, the master control board generates a bitmap based on the number of all interfaces included in the network device, each bit in the bitmap corresponds to one interface on the network device, and then the outgoing interface identifier is replaced with a bit ID as a whole by using a method similar to that shown in fig. 2. Therefore, the service board can determine the interface identifier according to the bitmap issued by the main control board and the bit ID in the interface pair list.
Compared with the method in which the slot number part in the interface identifier is only modified, the method compresses the interface identifier as a whole, so that the working efficiency of the network equipment is higher, and the resource waste is reduced for the following reasons:
on one hand, the table entry is changed frequently by the interface in the network equipment, if the outlet interface identifier is modified as a whole, when any table entry is changed, the bitmap and the table entry of the interface pair are required to be modified in a full amount; the method only modifies the slot number part in the outgoing interface identifier, and only needs to issue or modify the interface to the table entry and the bitmap in increments without carrying out full change when the interface in the slot is changed under the condition that the network equipment does not change the slot number, thereby ensuring higher working efficiency of the network equipment.
On the other hand, because the number of bits of the slot position number is less than the number of bits of the whole interface identifier, obviously, the bitmap corresponding to the slot position one by one in the method is smaller than the bitmap corresponding to the interface one by one in the method, so the storage space occupied by the bitmap can be reduced, and the waste of memory resources in the network equipment is reduced.
Referring to fig. 4, fig. 4 is a flowchart illustrating another method for forwarding a packet according to an exemplary embodiment of the present application, where the method is applied to a service board in a network device.
As shown in fig. 4, the method comprises the following steps:
step S401: and the service board receives the bitmap and the interface pair list sent by the main control board.
In this application, the service board receives the bitmap and the interface pair list issued by the main control board in step S204.
The bitmap is generated by the number of all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position; each interface pair entry in the list of interface pairs comprises: ingress interface information and egress interface information; the outgoing interface information comprises a bit ID used for representing the slot number of the slot where the outgoing interface is located and a slot interface number in the slot, and the number of bits of the bit ID is less than that of the slot number.
Step S402: and the service board forwards the message to the list on the basis of the bitmap and the interface.
Specifically, the service board may forward the packet according to the following steps.
The first step is as follows: the service board receives the message;
the second step is that: and the service board searches an interface pair table item matched with the incoming interface of the message in the interface pair list and acquires the bit ID in the interface pair table item.
After the service board receives the message, determining an input interface on the service board for receiving the message; and then searching an interface pair table item matched with the input interface in the interface pair list, and acquiring the output interface information in the interface pair table item. The outbound interface information comprises a bit ID used for representing the slot position number of the outbound interface and the slot interface number in the slot position.
The third step: and the service board searches the bit corresponding to the bit ID in the second step in the bitmap.
As an alternative embodiment, the bitmap received by the service board includes a bit marked as a valid bit, and the valid bit is a bit corresponding to the slot number of the slot in which all the outgoing interfaces in the interface pair list are located. Meanwhile, the bit ID is a valid bit sequence number of each valid bit in the sequence after all valid bits are sequenced according to a preset sequence.
In this embodiment, the service board firstly sorts the valid bits in the bitmap according to a preset sequence, where the preset sequence may be a sequence from top to bottom, and then from left to right; the sequence from left to right and then from top to bottom can also be followed, which is only exemplary, and the sequence in step S202 is not limited specifically as long as it corresponds to the sequence. Then, the service board determines the valid bit corresponding to the valid bit sequence number in the sequence, wherein the valid bit is the bit corresponding to the bit ID. The fourth step: and the service board generates the slot position number of the slot position where the output interface of the message is located based on the position coordinate of the bit position in the bitmap in the third step.
As an optional embodiment, if the horizontal axis in the bitmap is used to represent the high-order section of the slot number, and the vertical axis is used to represent the low-order section of the slot number, the service board may determine the high-order section and the low-order section of the slot number according to the position coordinates of the bit in the bitmap, so as to combine the slot number of the slot where the egress interface is located.
For example, in the bitmap shown in fig. 3-b, the bit of the position coordinate (0,1) has a high range of 000 and a low range of 001, and thus the corresponding slot number is 000001.
Based on the same method, if the horizontal axis in the bitmap is used to represent the low-order section of the slot number and the vertical axis is used to represent the high-order section of the slot number, the slot number corresponding to the position coordinate can also be obtained, which is not described herein again.
The fifth step: and the service board determines the outbound interface identifier of the message based on the slot position number generated in the fourth step and the in-slot interface number in the outbound interface information searched in the second step, and forwards the message through the outbound interface indicated by the outbound interface identifier.
The flow shown in fig. 4 is completed.
The following describes in detail a method for forwarding a packet by a service board by using a specific example.
Assume that the bitmap sent by the main control board received by the service board in slot 1 is shown in fig. 3-b, and the interface pair list is shown in table 3. When the service board receives the message from the 2 nd interface, the message is forwarded according to the following steps.
Firstly, the service board receives a message and determines that the input interface information of the received message is '000001'.
Next, the service board searches the interface pair list shown in table 3 for an interface pair entry corresponding to the incoming interface, and determines that the interface information is "0001000001". According to a predefined rule, the service board may determine that "0001" is the bit ID of the slot number of the slot where the egress interface is located, and "000001" is the slot interface number of the egress interface in the slot.
Then, the service board sorts all the effective bits in the bitmap shown in fig. 3-b according to a preset sequence, and the coordinates of each effective bit in the bitmap are used for representing, and the queue after sorting is obtained as follows: (0,1) and (7, 7).
Then, the service board determines bit ID "0001" as the 2 nd bit in the queue, i.e., the significant bit with coordinates of (7,7) in the ordering.
Finally, the service board determines the slot number of the slot where the interface is located to be "111111" according to the coordinates (7,7), and determines the interface identifier to be "111111000001" by combining with the in-slot interface number "000001" of the outgoing interface in the slot. Therefore, the service board forwards the received message from the 2 nd interface in the 64 th slot.
At this point, the service board completes the message forwarding process.
Corresponding to the embodiment of the message forwarding method, the application also provides an embodiment of a message forwarding device.
The embodiment of the message forwarding device can be applied to network equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the network device where the software implementation is located as a logical means. In terms of hardware, as shown in fig. 5, the present application is a hardware structure diagram of a network device where a device for forwarding a packet is located, except for the main control board and the service board shown in fig. 5, the network device where the device is located in the embodiment may also include other hardware according to the actual function of the network device, which is not described again.
Referring to fig. 6, fig. 6 is a block diagram illustrating an apparatus for forwarding a packet according to an exemplary embodiment of the present application. The device can be applied to a main control board of a network device, the main control board presets an interface pair list, and each interface pair item in the interface pair list comprises: the interface input information and the interface output information comprise the slot position number of the slot position of the interface output;
the device includes:
a bitmap generation unit 601 configured to generate a bitmap based on the number of all slots of the present apparatus; each bit in the bitmap corresponds to the slot position number of each slot position;
a bitmap marking unit 602, configured to obtain slot numbers of slot locations where all the outgoing interfaces in the interface pair list are located, mark all bits in the bitmap corresponding to the slot numbers as valid bits, and allocate a bit ID to each valid bit marked in the bitmap; the number of bits of the bit ID is less than that of the slot position number;
an interface modification unit 603, configured to modify, for each interface pair entry, a slot position number of a slot position where an output interface of the interface pair entry is located into a bit ID of an effective bit corresponding to the slot position number;
and an information issuing unit 604, configured to issue the modified bitmap and the modified interface pair list to each service board, so that the service board forwards the message based on the issued bitmap and the interface pair list.
Optionally, allocating a bit ID to each valid bit marked in the bitmap includes:
sorting the effective bits in the bitmap according to a preset sequence;
for each valid bit, the serial number of the valid bit in the sequence is used as the bit ID of the valid bit.
Optionally, generating a bitmap based on all slot numbers of the device includes:
determining the number of bits for representing the slot position number of the equipment based on the number of all slot positions of the equipment;
splitting the digit into a high-order interval and a low-order interval;
determining a bitmap based on the high-order interval and the low-order interval; the horizontal axis of the bitmap is used for representing the high-order region, and the vertical axis of the bitmap is used for representing the low-order region.
Thus, the block diagram of the apparatus shown in fig. 6 is completed.
Referring to fig. 7, fig. 7 is a block diagram illustrating another apparatus for forwarding a packet according to an exemplary embodiment of the present application. The apparatus can be applied to a service board of a network device, and the apparatus can include:
an information receiving unit 701, configured to receive a bitmap and an interface pair list sent by a main control board;
a message forwarding unit 702, configured to forward a message to the list based on the bitmap and the interface;
the bitmap is generated by all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
each interface pair entry in the list of interface pairs comprises: ingress interface information and egress interface information;
the outgoing interface information comprises a bit ID used for representing the slot position number of the slot position where the outgoing interface is located and a slot interface number in the slot position; the number of bits of the bit ID is less than the number of bits of the slot number.
Optionally, the forwarding the packet to the list based on the bitmap and the interface includes:
receiving a message;
searching an interface pair table item matched with the input interface of the message in the interface pair list, acquiring a bit ID in the interface pair table item, searching a bit corresponding to the bit ID in the received bitmap, and generating a slot position number of a slot position where the output interface of the message is located based on a position coordinate of the bit in the bitmap;
and determining an outlet interface identifier of the message based on the slot position number and the in-slot interface number, and forwarding the message through an outlet interface indicated by the outlet interface identifier.
Optionally, the bitmap includes a bit marked as a valid bit, where the valid bit is a bit corresponding to a slot number of a slot where all the outgoing interfaces in the interface pair list are located;
the bit ID is a valid bit sequence number of each valid bit in the sequence after all valid bits are sequenced according to a preset sequence;
the searching for the bit corresponding to the bit ID in the received bitmap includes:
sorting the effective bits in the bitmap according to a preset sequence;
in the sorting, the significant bit corresponding to the significant bit sequence number is determined.
Thus, the block diagram of the apparatus shown in fig. 7 is completed.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (12)

1. A method for forwarding a message is characterized in that the method is applied to a main control board of a network device, the main control board is preset with an interface pair list, and each interface pair entry in the interface pair list comprises: the method comprises the steps that interface entering information and interface exiting information are obtained, wherein the interface exiting information comprises a slot position number of a slot position where an interface exits;
the method comprises the following steps:
generating a bitmap based on the number of all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
acquiring slot numbers of slot positions where all the output interfaces in the interface pair list are located, marking all bits corresponding to the slot numbers in the bitmap as valid bits, and distributing bit IDs for the marked valid bits in the bitmap; the number of bits of the bit ID is less than that of the slot position number;
for each interface pair table entry, modifying the slot position number of the slot position where the output interface of the interface pair table entry is positioned into the bit position ID of the effective bit corresponding to the slot position number;
and issuing the modified bitmap and the modified interface pair list to each service board so that the service board forwards the message based on the issued bitmap and the interface pair list.
2. The method of claim 1, wherein the assigning a bit ID to each significant bit marked in the bitmap comprises:
sorting the effective bits in the bitmap according to a preset sequence;
for each valid bit, the serial number of the valid bit in the sequence is used as the bit ID of the valid bit.
3. The method of claim 1, wherein generating the bitmap based on all slot numbers of the device comprises:
determining the number of bits for representing the slot position number of the equipment based on the number of all slot positions of the equipment;
splitting the digit into a high-order interval and a low-order interval;
determining a bitmap based on the high-order interval and the low-order interval; the horizontal axis of the bitmap is used for representing the high-order region, and the vertical axis of the bitmap is used for representing the low-order region.
4. A message forwarding method is applied to a service board of a network device, and the method comprises the following steps:
receiving a bitmap and an interface pair list sent by a main control board;
forwarding the message to the list based on the bitmap and the interface;
the bitmap is generated by all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
each interface pair entry in the list of interface pairs comprises: ingress interface information and egress interface information;
the outgoing interface information comprises a bit ID used for representing the slot position number of the slot position where the outgoing interface is located and a slot interface number in the slot position; the number of bits of the bit ID is less than the number of bits of the slot number.
5. The method of claim 4, wherein the forwarding the list based on the bitmap and the interface comprises:
receiving a message;
searching an interface pair table item matched with the input interface of the message in the interface pair list, acquiring a bit ID in the interface pair table item, searching a bit corresponding to the bit ID in the received bitmap, and generating a slot position number of a slot position where the output interface of the message is located based on a position coordinate of the bit in the bitmap;
and determining an outlet interface identifier of the message based on the slot position number and the in-slot interface number, and forwarding the message through an outlet interface indicated by the outlet interface identifier.
6. The method according to claim 5, wherein the bitmap includes a bit marked as a valid bit, and the valid bit is a bit corresponding to a slot number of a slot in which all outgoing interfaces in the interface pair list are located;
the bit ID is a valid bit sequence number of each valid bit in the sequence after all valid bits are sequenced according to a preset sequence;
the searching for the bit corresponding to the bit ID in the received bitmap includes:
sorting the effective bits in the bitmap according to a preset sequence;
in the sorting, the significant bit corresponding to the significant bit sequence number is determined.
7. The device for forwarding the message is applied to a main control board of a network device, wherein an interface pair list is preset in the main control board, and each interface pair entry in the interface pair list includes: the method comprises the steps that interface entering information and interface exiting information are obtained, wherein the interface exiting information comprises a slot position number of a slot position where an interface exits;
the device comprises:
the bitmap generation unit is used for generating a bitmap based on the number of all the slots of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
the bitmap marking unit is used for acquiring slot numbers of slot positions where all the outgoing interfaces are located in the interface pair list, marking all bits corresponding to the slot numbers in the bitmap as valid bits, and distributing bit ID (identity) for each valid bit marked in the bitmap; the number of bits of the bit ID is less than that of the slot position number;
the interface modification unit is used for modifying the slot position number of the slot position where the output interface of each interface pair table entry is positioned into the bit position ID of the effective bit corresponding to the slot position number aiming at each interface pair table entry;
and the information issuing unit is used for issuing the modified bitmap and the modified interface pair list to each service board so that the service board forwards the message based on the issued bitmap and the interface pair list.
8. The apparatus of claim 7, wherein the assigning a bit ID to each significant bit marked in the bitmap comprises:
sorting the effective bits in the bitmap according to a preset sequence;
for each valid bit, the serial number of the valid bit in the sequence is used as the bit ID of the valid bit.
9. The apparatus of claim 7, wherein the generating the bitmap based on all slot numbers of the device comprises:
determining the number of bits for representing the slot position number of the equipment based on the number of all slot positions of the equipment;
splitting the digit into a high-order interval and a low-order interval;
determining a bitmap based on the high-order interval and the low-order interval; the horizontal axis of the bitmap is used for representing the high-order region, and the vertical axis of the bitmap is used for representing the low-order region.
10. A message forwarding apparatus, applied to a service board of a network device, the apparatus comprising:
the information receiving unit is used for receiving the bitmap and the interface pair list sent by the main control board;
the message forwarding unit is used for forwarding the message to the list based on the bitmap and the interface;
the bitmap is generated by all the slot positions of the equipment; each bit in the bitmap corresponds to the slot position number of each slot position;
each interface pair entry in the list of interface pairs comprises: ingress interface information and egress interface information;
the outgoing interface information comprises a bit ID used for representing the slot position number of the slot position where the outgoing interface is located and a slot interface number in the slot position; the number of bits of the bit ID is less than the number of bits of the slot number.
11. The apparatus of claim 10, wherein the bitmap and interface based message forwarding for the list comprises:
receiving a message;
searching an interface pair table item matched with the input interface of the message in the interface pair list, acquiring a bit ID in the interface pair table item, searching a bit corresponding to the bit ID in the received bitmap, and generating a slot position number of a slot position where the output interface of the message is located based on a position coordinate of the bit in the bitmap;
and determining an outlet interface identifier of the message based on the slot position number and the in-slot interface number, and forwarding the message through an outlet interface indicated by the outlet interface identifier.
12. The apparatus according to claim 11, wherein the bitmap includes a bit marked as a valid bit, and the valid bit is a bit corresponding to a slot number of a slot in which all outgoing interfaces in the interface pair list are located;
the bit ID is a valid bit sequence number of each valid bit in the sequence after all valid bits are sequenced according to a preset sequence;
the searching for the bit corresponding to the bit ID in the received bitmap includes:
sorting the effective bits in the bitmap according to a preset sequence;
in the sorting, the significant bit corresponding to the significant bit sequence number is determined.
CN202010117679.8A 2020-02-25 2020-02-25 Message forwarding method and device Active CN111327546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010117679.8A CN111327546B (en) 2020-02-25 2020-02-25 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010117679.8A CN111327546B (en) 2020-02-25 2020-02-25 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN111327546A CN111327546A (en) 2020-06-23
CN111327546B true CN111327546B (en) 2022-01-28

Family

ID=71169098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010117679.8A Active CN111327546B (en) 2020-02-25 2020-02-25 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN111327546B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112003960B (en) * 2020-08-06 2022-11-15 杭州安恒信息技术股份有限公司 Network interface management method and device of industrial control equipment and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011118566A1 (en) * 2010-03-24 2011-09-29 日本電気株式会社 Packet transfer system, control apparatus, transfer apparatus, method of creating processing rules, and program
WO2014086041A1 (en) * 2012-12-07 2014-06-12 华为技术有限公司 Stream forwarding method for message, and message forwarding device
CN106330553A (en) * 2016-08-30 2017-01-11 杭州迪普科技有限公司 Message forwarding method and device
CN107846357A (en) * 2017-12-22 2018-03-27 杭州迪普科技股份有限公司 A kind of message forwarding method and device based on stream definition

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003018214A (en) * 2001-07-02 2003-01-17 Hitachi Ltd Packet communication device, communication method for multicast packet in packet communication device, and setting method for packet communication device
US7299236B2 (en) * 2004-06-15 2007-11-20 Industry-Academic Cooperation Foundation, Yonsei University Test data compression and decompression method using zero-detected run-length code in system-on-chip
CN100502365C (en) * 2006-10-26 2009-06-17 杭州华三通信技术有限公司 Interplate communicating method
CN101267331A (en) * 2008-04-23 2008-09-17 华为技术有限公司 A search method and device for multicast forward table
CN102148746A (en) * 2010-02-05 2011-08-10 中兴通讯股份有限公司 Message classification method and system
CN102136996B (en) * 2010-08-10 2014-11-05 华为技术有限公司 Route information updating method, node and system used for rapid rerouting binding
CN102148751B (en) * 2010-12-16 2014-04-23 福建星网锐捷网络有限公司 Method and device as well as network equipment for managing logical interface
CN102780605B (en) * 2011-05-13 2015-05-06 中国科学院声学研究所 Inter-area exit route dynamic selection method and system
JP6070863B2 (en) * 2013-01-29 2017-02-01 ▲ホア▼▲ウェイ▼技術有限公司Huawei Technologies Co.,Ltd. Packet processing method and forwarding element
CN105681229B (en) * 2014-11-20 2019-05-10 华为技术有限公司 The method and interchanger of ECP Extended Capabilities Port number
CN106131086B (en) * 2016-08-31 2019-10-11 迈普通信技术股份有限公司 A kind of matching process and device of accesses control list
CN107342958B (en) * 2017-06-29 2020-06-09 迈普通信技术股份有限公司 Distributed communication equipment and inter-board communication method
CN109818861B (en) * 2017-11-21 2021-04-16 迈普通信技术股份有限公司 Method and device for realizing message flooding
CN107896169B (en) * 2017-12-28 2021-12-24 杭州迪普科技股份有限公司 ACL management method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011118566A1 (en) * 2010-03-24 2011-09-29 日本電気株式会社 Packet transfer system, control apparatus, transfer apparatus, method of creating processing rules, and program
WO2014086041A1 (en) * 2012-12-07 2014-06-12 华为技术有限公司 Stream forwarding method for message, and message forwarding device
CN106330553A (en) * 2016-08-30 2017-01-11 杭州迪普科技有限公司 Message forwarding method and device
CN107846357A (en) * 2017-12-22 2018-03-27 杭州迪普科技股份有限公司 A kind of message forwarding method and device based on stream definition

Also Published As

Publication number Publication date
CN111327546A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN108769146B (en) Data transmission method and device based on block chain and block chain system
KR101858715B1 (en) Management System for Service Resource and Method thereof
CN107040393B (en) Route management method and equipment
JP2012164333A (en) Table search method
CN111107173B (en) IP address planning method and system of IP bearing network
CN108259334A (en) A kind of equivalent route item establishing method and device
CN115361360B (en) Method and system for realizing 64-bit refined address behind IPv6 address
CN103853500A (en) Method, device and system for distributing mass data
CN111327546B (en) Message forwarding method and device
CN111522772A (en) Method and device for configuring service board
CN111182043A (en) Hash value distribution method and device
CN109740789B (en) Wiring management method, device, equipment and storage medium
CN112650692A (en) Heap memory allocation method, device and storage medium
CN108965093B (en) VLAN (virtual local area network) distribution method and device
CN111679918B (en) Message transmission method and device
CN111666257A (en) File fragment storage method, device, equipment and storage medium
CN108124285B (en) Message transmission method and device
CN107491270B (en) Resource access method and device of multi-control storage system
CN113194107B (en) Internet-based regional characteristic addressing method and device
CN108173689B (en) Output system of load balancing data
CN113835862B (en) Task processing method and device
JP4671041B2 (en) Modular physical resource group identification method, apparatus and program thereof
CN115866579B (en) Smart card writing method, smart card writing system, terminal and storage medium
KR100264859B1 (en) Method for assignmentting id network element
CN111104970B (en) Face clustering 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
GR01 Patent grant
GR01 Patent grant