CN110912797B - Method and device for forwarding broadcast message - Google Patents
Method and device for forwarding broadcast message Download PDFInfo
- Publication number
- CN110912797B CN110912797B CN201911127042.0A CN201911127042A CN110912797B CN 110912797 B CN110912797 B CN 110912797B CN 201911127042 A CN201911127042 A CN 201911127042A CN 110912797 B CN110912797 B CN 110912797B
- Authority
- CN
- China
- Prior art keywords
- mdc
- vlan
- node
- nodes
- bitmap
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/185—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with management of multicast group membership
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present disclosure provides a method and an apparatus for forwarding a broadcast packet, where when a network device receives a broadcast packet through a local shared port, a first VLAN ID to which the broadcast packet belongs is obtained, a plurality of MDC nodes corresponding to the shared port are determined, then, according to a correspondence between MDCs and VLAN IDs, a first MDC node corresponding to the first VLAN ID among the MDC nodes is determined, and the broadcast packet is sent to the first MDC node. The method and the device can enable the network equipment to only send the broadcast message to the MDC node corresponding to the VLAN ID to which the broadcast message belongs, but not to send the broadcast message to all MDC nodes, so that the copy number of the broadcast message can be reduced, and the workload of a CPU (central processing unit) is reduced.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a broadcast packet.
Background
An MDC (multi tenant Device Context) node is a logical Device that divides a network Device by a virtualization technology. Each MDC node has own exclusive software and hardware resources, operates independently, forwards independently and provides services independently. One physical port on a network device may be shared by multiple MDC nodes, and thus the physical port is also referred to as a shared port.
When receiving a broadcast message, a shared port of a network device usually directly copies the broadcast message and sends the broadcast message to all MDC nodes sharing the physical port, and the larger the number of MDC nodes sharing the physical port is, the larger the broadcast message amount that the network device needs to copy is, which may cause a violent increase in CPU utilization and cause a system jam.
Disclosure of Invention
In view of this, the present disclosure provides a method and an apparatus for forwarding a broadcast packet, so as to solve the problem of an excessive broadcast packet duplication amount.
Specifically, the present disclosure is realized by the following technical solutions:
in a first aspect, the present disclosure provides a method for forwarding a broadcast packet, where the method is applied to a network device, and the method includes:
when a broadcast message is received through a local shared port, acquiring a first VLAN ID to which the broadcast message belongs;
determining a plurality of MDC nodes corresponding to the shared port;
and determining a first MDC node corresponding to the first VLAN ID in the MDC nodes according to the corresponding relation between the MDC and the VLAN ID, and sending the broadcast message to the first MDC node.
In a second aspect, the present disclosure provides a forwarding apparatus for broadcast packets, where the apparatus is applied to a network device, and the apparatus includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first VLAN ID to which a broadcast message belongs when the broadcast message is received through a local shared port;
a determining unit, configured to determine multiple MDC nodes corresponding to the shared port;
a sending unit, configured to determine, according to a correspondence between the MDC and the VLAN ID, a first MDC node corresponding to the first VLAN ID among the MDC nodes, and send the broadcast packet to the first MDC node.
In a third aspect, the present disclosure further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any step of the foregoing method for forwarding a broadcast packet.
In a fourth aspect, the present disclosure also provides a network device comprising a memory, a processor, a communication interface, and a communication bus; the memory, the processor and the communication interface are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory, and when the processor executes the computer program, any step of the broadcast packet forwarding method is implemented.
Therefore, according to the present disclosure, when receiving a broadcast message through a local shared port, a network device may obtain a first VLAN ID to which the broadcast message belongs, determine a plurality of MDC nodes corresponding to the shared port, then determine, according to a correspondence between MDCs and VLAN IDs, a first MDC node corresponding to the first VLAN ID among the plurality of MDC nodes, and send the broadcast message to the first MDC node. The method and the device can enable the network equipment to only send the broadcast message to the MDC node corresponding to the VLAN ID to which the broadcast message belongs, but not to send the broadcast message to all MDC nodes, so that the copy number of the broadcast message can be reduced, and the workload of a CPU (central processing unit) is reduced.
Drawings
Fig. 1 is a schematic diagram of a multiple MDC networking architecture in an exemplary embodiment in the related art;
fig. 2 is a processing flow diagram of a method for forwarding a broadcast packet in an exemplary embodiment of the present disclosure;
fig. 3 is a schematic diagram of a message format in an exemplary embodiment of the present disclosure;
FIG. 4-1 is a schematic diagram of data organization for a shared port in an exemplary embodiment of the present disclosure;
FIG. 4-2 is a hash representation in an exemplary embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a bitmap in an exemplary embodiment of the present disclosure;
fig. 6 is a flow chart of message forwarding in an exemplary embodiment of the present disclosure;
fig. 7 is a logic structure diagram of a forwarding apparatus for broadcast messages in an exemplary embodiment of the present disclosure;
fig. 8 is a hardware block diagram of a network device in an exemplary embodiment of the disclosure.
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 implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure 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 disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Referring to fig. 1, a multi MDC networking architecture in an exemplary embodiment of the related art includes a Network device (e.g., a firewall device), a plurality of two-layer switches, such as switch 1, switch 2, switch 3, and the like, and a LAN (Local Area Network) is connected below each switch.
A LAN can be divided into multiple logical LANs, that is, VLANs, by using a VLAN (Virtual Local Area Network) technique, hosts in the same VLAN can directly communicate with each other, and hosts in different VLANs cannot directly communicate with each other. In fig. 1, the LAN is illustratively divided into a plurality of VLANs, VLAN 1, VLAN 2, VLAN 3, etc., which are connected to the external network through the same network device. Through the virtualization technology, one network device can be used as two, three or more devices. Taking three devices as an example, specifically, three MDC nodes are created on a network device: the MDC1, MDC2 and MDC3 are respectively used as network access devices of VLAN 1, VLAN 2 and VLAN 3, and are responsible for network access and control of VLAN 1, VLAN 2 and VLAN 3. Network administrators of VLAN 1, VLAN 2 and VLAN 3 can log in the access devices of the networks where the administrators are located respectively to perform configuration, storage, restart and other operations, and mutual noninterference is avoided.
When there are multiple VLANs in a network, since a physical port on a network device cannot allocate a port to each VLAN, a shared port is needed, that is, multiple VLANs share a port.
In the related art, when a message received by a shared port is a unicast message, the shared port can determine which MDC node the message belongs to specifically through a destination MAC address of the unicast message, and then perform table lookup and forwarding on the unicast message; when the message received by the shared port is a broadcast message, the shared port will copy one broadcast message to each MDC node sharing the shared port, and since copying the broadcast message consumes CPU performance and violates the original purpose of VLAN-restricted broadcast domain, this results in a sudden increase in the blocking and CPU utilization of the network device in a short time, which affects the availability of services.
Please refer to fig. 2, which is a flowchart illustrating a method for forwarding a broadcast packet according to an exemplary embodiment of the present disclosure, where the method is applied to a network device and includes steps 201 and 203.
In this embodiment, when the network device receives the broadcast packet through the local shared port, because the VLAN can be used as a broadcast domain of the broadcast packet, the broadcast packet carries the VLAN ID corresponding to the VLAN to which the broadcast packet belongs. Therefore, the network device can obtain the VLAN ID carried by the broadcast packet, that is, the first VLAN ID to which the broadcast packet belongs.
For example, the format of the broadcast packet may be as shown in fig. 3, where DA is a destination MAC address and SA is a source MAC address; VLAN Tag is VLAN label; type is Type, Data is Data, FCS is Frame Check Sequence (Frame Check Sequence), also called Frame tail; as shown in fig. 3, the VLAN Tag includes four fields, which are a TPID (Tag Protocol Identifier), Priority, CFI (Canonical Format Indicator) and a VLAN ID, respectively, and the VLAN ID is used to indicate the number of the VLAN to which the packet belongs. When the network device receives the broadcast message through the local shared port, the VLAN ID may be obtained from the VLAN Tag field of the broadcast message, so as to determine the ID of the VLAN network to which the broadcast message belongs, that is, the first VLAN ID.
In this embodiment, the network device may determine a plurality of MDC nodes corresponding to the shared port, where the plurality of MDC nodes corresponding to the shared port share the shared interface. Specifically, the network device may query a correspondence between the shared port number and the MDC node by using the port number of the shared port as an index, so as to determine a plurality of MDC nodes corresponding to the shared port. As shown in fig. 4-1, a data organization diagram for a shared port, that is, from the perspective of the shared port, the organization and use of data, one physical port in fig. 4-1 may be shared by multiple MDC nodes, when a port is shared by one MDC node, the type of the physical port may be changed to the shared port, and the corresponding relationship between the shared port and the MDC node sharing the shared port is recorded. In order to save space, the corresponding relationship may only store a pointer of the MDC node, where the pointer is used to point to a memory corresponding to the MDC node, and the memory is used to store configuration information corresponding to the MDC node, such as information such as a VLAN ID corresponding to the MDC node and a physical port number used by the MDC node. In this application, the VLAN ID corresponding to an MDC node refers to the VLAN ID of the VLAN network to which the MDC node belongs.
In another example, the network device may also store a correspondence table that includes the correspondence of the shared port to the MDC node sharing the shared port, for example, if port 1 is shared by MDC1 and MDC2, the correspondence table includes the correspondence of port 1 to MDC1 and MDC 2.
In order to improve the searching efficiency, the corresponding relation between the shared port and the MDC node may be stored in the hash table by using the shared port number as an index, and the hash table may be queried by using the shared port number as an index during forwarding, so as to determine all MDC nodes sharing the shared port number.
As shown in the hash table structure of fig. 4-2, in the case of many ports, the hash table corresponding to the port may be stored in a hash chain as a hash node (as shown in fig. 4-2, hash table indexes 1 to N respectively correspond to one hash chain), and the hash table index may be obtained by taking a port number as a dividend, taking N (N is a positive integer) as a divisor, and performing remainder calculation. Specifically, when N is 100, and the number of hash chains is 100, calculating the hash chain corresponding to the hash table of the port 1, and obtaining a remainder of 1 by taking 1 and 100, so that the hash table index of the port 1 is 1; calculating a hash chain corresponding to the hash table of the port 101, and obtaining a remainder of 1 by remainder of 100 through 101, so that the hash table index of the port 101 is 1. Therefore, it can be known that the hash tables of port 1 and port 101 are hash nodes corresponding to hash table index 1. In addition, the hash chain also stores the corresponding relation between the port number and the hash node.
As described above, the port number is used as the dividend, N (N is a positive integer) is used as the divisor, and the remainder is taken to obtain the hash table index, which is the hash chain in which the port is located. After the hash chain where the port is located is determined, the hash node corresponding to the shared port can be further searched through the correspondence between the port number stored in the hash chain and the hash node. For example, when the shared port is port 1, the hash node corresponding to port 1 may be searched in the correspondence between the port number and the hash node stored in the hash chain, so as to obtain the hash table corresponding to the shared port. The hash table corresponding to the shared port stores an MDC chain corresponding to the shared port, and the MDC chain stores a plurality of MDC nodes sharing the shared port. Therefore, as shown in table 4-2, the hash table corresponding to the shared port may be queried by using the shared port number of the shared port as an index, so as to determine all MDC nodes sharing the shared port.
In this embodiment, the network device may determine, according to the correspondence between the MDC and the VLAN ID, a first MDC node corresponding to the first VLAN ID in the MDC nodes. Specifically, the network device may determine, for any MDC node in the MDC nodes, whether the VLAN ID corresponding to the MDC node includes the first VLAN ID, if so, determine that the MDC node is the first MDC node, and traverse another MDC node except the MDC node in the MDC nodes; if not, traversing other MDC nodes except the MDC in the multiple MDC nodes; then, the process of determining whether the VLAN ID corresponding to the other MDC node includes the first VLAN ID and the traversal is repeated until all MDC nodes in the multiple MDC nodes are traversed. The first MDC node, which is ultimately determined from the multiple MDC nodes sharing the shared port, may be one or more MDC nodes.
In an embodiment, before receiving a broadcast packet through a local shared port, a network device may create a bitmap in advance in each MDC node, where each bit of the bitmap corresponds to one VLAN ID, and a value of each bit in the bitmap is used to indicate whether the VLAN ID corresponding to the bit is set; and aiming at any MDC node, acquiring a second VLAN ID corresponding to a VLAN network configured by the MDC node, and taking a position bit corresponding to the second VLAN ID in the bitmap as a first value representing the set VLAN ID.
The structure of the bitmap is shown in fig. 5, wherein each bit of the bitmap corresponds to a VLAN ID, and the VLAN ID is a VLAN ID corresponding to a virtual port used by an MDC node; for example, the VLAN ID value corresponding to the first bit is 1, the VLAN ID value corresponding to the second bit is 2, the VLAN ID value corresponding to the third bit is 3, the VLAN ID value corresponding to the fourth bit is 4, and so on. Fig. 5 shows only a sixteen-bit bitmap, which can be adjusted in size according to the number of actual VLANs. For any MDC node, a second VLAN ID corresponding to the VLAN set in the MDC node may be acquired, a position bit in the bitmap corresponding to the second VLAN ID is a first value representing a set VLAN ID, for example, "1", and if the VLAN is deleted from the MDC node, a bit corresponding to the second VLAN ID in the bitmap may be correspondingly modified to a second value representing an unset VLAN ID, for example, "0".
By means of the bitmap, it can be determined which VLAN IDs the MDC node corresponds to, and thus which VLANs the MDC node belongs to. As shown in fig. 5, at this time, the bitmap is 0110 (only the first row is shown, and the other bits are all 0), wherein the second bit and the third bit are set to 1, it may be determined that the VLAN ID corresponding to the MDC node (i.e., the VLAN ID of the VLAN network to which the MDC node belongs) includes VLAN ID2 and VLAN ID3, and if a port belonging to VLAN ID3 is deleted from the MDC node, then "1" of the third bit in the bitmap in fig. 5 may be changed to "0" to indicate that the MDC node does not belong to the VLAN identified by VLAN ID3, and then the bitmap is 0100 at this time (only the first row is shown, and the other bits are all 0), i.e., the second bit is set to 1, and it may be determined that the MDC node belongs to the VLAN identified by VLAN ID 2.
Therefore, when determining whether the VLAN ID corresponding to the MDC node includes the first VLAN ID, it may be determined whether the VLAN ID corresponding to the MDC node includes the first VLAN ID based on the bitmap obtained from the MDC node.
In an embodiment, it may be specifically determined whether a bit corresponding to the first VLAN ID in the bitmap is set to the first value, and if so, it is determined that the VLAN ID corresponding to the MDC node includes the first VLAN ID; if not, determining that the VLAN ID corresponding to the MDC node does not contain the first VLAN ID.
When the bit corresponding to the first VLAN ID in the bitmap is determined, the bitmap created by the MDC node may be specifically found, a bitmap storage area pointer stored in the MDC node is obtained, the pointer points to an initial bit in the bitmap which is 0, and then the value of the first VLAN ID is used as a variable of the pointer to control the pointer to move to the bit corresponding to the first VLAN ID, thereby determining the bit corresponding to the first VLAN ID in the bitmap. For example, when the first VLAN ID is VLAN 3, the pointer variable is 3, and the pointer is moved three bits to the third bit in the first row in fig. 5, thereby determining that the bit is the bit corresponding to the first VLAN ID.
The method can store the VLAN ID in the MDC node through the bitmap, thereby reducing the occupation of storage space, the bitmap is a binary chart, whether the VLAN ID is set or not can be marked through setting, the VLAN ID is convenient to update and manage, and the searching efficiency of the VLAN ID can be improved.
After the network device has traversed all the MDC nodes sharing the shared port, the broadcast packet may be sent to the first MDC node belonging to the first VLAN, that is, the broadcast packet is sent to the first MDC node corresponding to the first VLAN ID. After receiving the broadcast message, the first MDC node performs corresponding processing, such as responding or ignoring, on the broadcast message.
Compared with the prior art, the network device disclosed by the invention can store the corresponding VLAN ID in the MDC node, and when the sharing port receives the broadcast message, based on the VLAN ID stored by the MDC node, the network device judges which VLAN ID corresponding to the MDC node contains the first VLAN ID of the broadcast message in the MDC node sharing and using the sharing port, and sends the broadcast message to the MDC node containing the first VLAN ID, so that the network device can be prevented from copying the broadcast message to the MDC node which is not corresponding to the first VLAN ID in the sharing port, the burden of a CPU is reduced, and the purpose of limiting the broadcast domain by the VLAN is realized.
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the solution of the present disclosure is further described in detail below with reference to fig. 6.
In an embodiment, when a port of a network device receives a message, the message may be sent to a CPU of the network device for processing, where the processing flow shown in fig. 6 includes:
If yes, go to step 602. If not, go to step 609.
If yes, go to step 603. If not, go to step 609.
If yes, go to step 607. If not, go to step 608.
If yes, the flow is ended.
If not, go to step 605 to traverse the next MDC node until all the MDC nodes sharing the port are traversed.
The normal message forwarding process is to search the MAC address table entry based on the destination MAC address of the message, find the corresponding output interface, and forward the message.
The broadcast packet forwarding process of this embodiment only sends the broadcast packet to the MDC node corresponding to the VLAN ID to which the broadcast packet belongs (i.e., the broadcast packet is copied to the MDC node corresponding to the VLAN ID to which the broadcast packet belongs, and the broadcast packet is sent to the MDC node corresponding to the VLAN ID to which the broadcast packet belongs), so that the broadcast packet is prevented from being sent to the MDC node not corresponding to the VLAN ID to which the broadcast packet belongs, the broadcast packet is prevented from being copied unnecessarily, the number of copies of the broadcast packet is reduced, and the network device load is reduced.
Corresponding to the foregoing embodiment of the method for forwarding a broadcast packet, the present disclosure further provides an embodiment of a device for forwarding a broadcast packet.
Referring to fig. 7, a schematic structural diagram of a forwarding apparatus for broadcast packets in an exemplary embodiment of the present disclosure is shown, where the apparatus is applied to a network device, and the apparatus 70 includes:
an obtaining unit 701, configured to obtain a first VLAN ID to which a broadcast packet belongs when the broadcast packet is received through a local shared port;
a determining unit 702, configured to determine multiple MDC nodes corresponding to the shared port;
a sending unit 703, configured to determine, according to a correspondence between MDCs and VLAN IDs, a first MDC node corresponding to the first VLAN ID in the multiple MDC nodes, and send the broadcast packet to the first MDC node.
As an embodiment, the sending unit 703 includes a determining subunit 7031;
the determining subunit 7031 is configured to determine, for any MDC node in the multiple MDC nodes, whether a VLAN ID corresponding to the MDC node includes the first VLAN ID, if yes, determine that the MDC node is the first MDC node, and traverse another MDC node except the MDC node in the multiple MDC nodes; if not, traversing other MDC nodes except the MDC in the multiple MDC nodes; and repeating the process of judging whether the VLAN ID corresponding to the other MDC node comprises the first VLAN ID and the traversal until all MDC nodes in the plurality of MDC nodes are traversed.
As an embodiment, the apparatus further comprises:
a creating unit 704, configured to create bitmaps in each MDC node in advance before receiving a broadcast packet through a local shared port, where each bit of the bitmaps corresponds to one VLAN ID, and a value of each bit of the bitmaps is used to indicate whether the VLAN ID corresponding to the bit is set; and aiming at any MDC node, acquiring a second VLAN ID corresponding to a VLAN network set in the MDC node, and taking a position bit corresponding to the second VLAN ID in the bitmap as a first value representing the set VLAN ID.
As an embodiment, the determining subunit 7031 is specifically configured to acquire a bitmap in the MDC node, and determine, based on the bitmap, whether the VLAN ID corresponding to the MDC node includes the first VLAN ID.
As an embodiment, the operation performed by the determining subunit 7031, based on the bitmap, of determining whether the VLAN ID corresponding to the MDC node includes the first VLAN ID includes specifically:
judging whether a bit corresponding to the first VLAN ID in the bitmap is set as the first value or not, if so, determining that the VLAN ID corresponding to the MDC node comprises the first VLAN ID; if not, determining that the VLAN ID corresponding to the MDC node does not contain the first VLAN ID.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
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 disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
Corresponding to the foregoing embodiment of the method for forwarding a broadcast packet, the present disclosure further provides an embodiment of a network device implementing the method for forwarding a broadcast packet.
As shown in fig. 8, the network device includes a memory 81, a processor 82, a communication interface 83, and a communication bus 84; wherein, the memory 81, the processor 82 and the communication interface 83 communicate with each other through the communication bus 84;
the memory 81 is used for storing computer programs;
the processor 82 is configured to execute the computer program stored in the memory 81, and when the processor 82 executes the computer program, any step of the broadcast packet forwarding method provided in the embodiment of the present disclosure is implemented.
The present disclosure also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements any step of the forwarding method of broadcast packet provided in the embodiments of the present disclosure.
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, for embodiments of the network device and the computer-readable storage medium, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some portions of the description of the method embodiments.
In summary, the present disclosure may enable a network device to obtain a first VLAN ID to which a broadcast packet belongs when receiving the broadcast packet through a local shared port, determine a plurality of MDC nodes corresponding to the shared port, then determine, according to a correspondence between MDCs and the VLAN ID, a first MDC node corresponding to the first VLAN ID among the MDC nodes, and send the broadcast packet to the first MDC node. The method and the device can enable the network equipment to only send the broadcast message to the MDC node corresponding to the VLAN ID to which the broadcast message belongs, but not to send the broadcast message to all MDC nodes, so that the copy number of the broadcast message can be reduced, and the workload of a CPU (central processing unit) is reduced.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.
Claims (12)
1. A method for forwarding a broadcast message is characterized in that the method is applied to a network device, a plurality of multi-tenant device environment MDC nodes are created on the network device, and each MDC node is respectively in one-to-one correspondence to serve as a network access device of a plurality of VLANs and is responsible for network access and control of each VLAN, and the method comprises the following steps:
when a broadcast message is received through a local shared port, acquiring a first Virtual Local Area Network Identifier (VLANID) to which the broadcast message belongs;
determining a plurality of multi-tenant equipment environment MDC nodes corresponding to the shared port;
and determining a first MDC node corresponding to the first VLANID in the MDC nodes according to the corresponding relation between the MDC and the VLANID, and sending the broadcast message to the first MDC node.
2. The method according to claim 1, wherein the determining a first MDC node corresponding to the first VLAN ID among the MDC nodes according to a correspondence between MDCs and VLAN IDs comprises:
for any MDC node in the MDC nodes, judging whether the VLAN ID corresponding to the MDC node contains the first VLAN ID, if so, determining that the MDC node is the first MDC node, and traversing other MDC nodes except the MDC in the MDC nodes; if not, traversing other MDC nodes except the MDC in the multiple MDC nodes;
and repeating the process of judging whether the VLAN ID corresponding to the other MDC node comprises the first VLAN ID and the traversal until all MDC nodes in the plurality of MDC nodes are traversed.
3. The method according to claim 1 or 2, wherein before receiving the broadcast message through the local shared port, the method further comprises:
creating a bitmap in each MDC node in advance, wherein each bit of the bitmap corresponds to one VLANID, and the value of each bit in the bitmap is used for indicating whether the VLAN ID corresponding to the bit is set or not;
and aiming at any MDC node, acquiring a second VLAN ID corresponding to a VLAN network set in the MDC node, and taking a position bit corresponding to the second VLAN ID in the bitmap as a first value representing the set VLAN ID.
4. The method according to claim 3, wherein determining whether the VLAN ID corresponding to the MDC node includes the first VLAN ID comprises:
and acquiring a bitmap in the MDC node, and determining whether the VLAN ID corresponding to the MDC node contains the first VLAN ID or not based on the bitmap.
5. The method of claim 4, wherein determining whether the first vlan id is included in the vlan id corresponding to the MDC node based on the bitmap comprises:
judging whether a bit corresponding to the first VLAN ID in the bitmap is set as the first value or not, if so, determining that the VLAN ID corresponding to the MDC node comprises the first VLAN ID; if not, determining that the first VLAN ID is not contained in the VLANID corresponding to the MDC node.
6. A forwarding device of broadcast messages is characterized in that the device is applied to a network device, a plurality of multi-tenant device environment MDC nodes are created on the network device, and each MDC node is respectively in one-to-one correspondence to serve as a network access device of a plurality of VLANs and is responsible for network access and control of each VLAN, and the device comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first VLAN ID to which a broadcast message belongs when the broadcast message is received through a local shared port;
a determining unit, configured to determine multiple MDC nodes corresponding to the shared port;
a sending unit, configured to determine, according to a correspondence between MDCs and vlan ids, a first MDC node corresponding to the first vlan id in the MDC nodes, and send the broadcast packet to the first MDC node.
7. The apparatus of claim 6, wherein the sending unit comprises a determining subunit;
the determining subunit is configured to determine, for any MDC node in the MDC nodes, whether the vlan id corresponding to the MDC node includes the first vlan id, if yes, determine that the MDC node is the first MDC node, and traverse another MDC node except the MDC node in the MDC nodes; if not, traversing other MDC nodes except the MDC in the multiple MDC nodes; and repeating the process of judging whether the VLAN ID corresponding to the other MDC node comprises the first VLAN ID and the traversal until all MDC nodes in the plurality of MDC nodes are traversed.
8. The apparatus of claim 6 or 7, further comprising:
a creating unit, configured to create a bitmap in each MDC node in advance before receiving a broadcast packet through a local shared port, where each bit of the bitmap corresponds to one VLAN ID, and a value of each bit in the bitmap is used to indicate whether the VLAN ID corresponding to the bit is set; and aiming at any MDC node, acquiring a second VLAN ID corresponding to a VLAN network set in the MDC node, and taking a position bit corresponding to the second VLAN ID in the bitmap as a first value representing the set VLAN ID.
9. The apparatus of claim 8,
the judging subunit is specifically configured to acquire a bitmap in the MDC node, and determine, based on the bitmap, whether the VLAN ID corresponding to the MDC node includes the first VLAN ID.
10. The apparatus according to claim 9, wherein the operation performed by the determining subunit to determine whether the VLAN ID corresponding to the MDC node includes the first VLAN ID based on the bitmap specifically includes:
judging whether a bit corresponding to the first VLAN ID in the bitmap is set as the first value or not, if so, determining that the VLAN ID corresponding to the MDC node comprises the first VLAN ID; if not, determining that the first VLAN ID is not contained in the VLANID corresponding to the MDC node.
11. A network device, comprising a memory, a processor, a communication interface, and a communication bus; the memory, the processor and the communication interface are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor for executing the computer program stored in the memory, the processor implementing any of the steps of the method of claims 1-5 when executing the computer program.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out any of the steps of the method of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911127042.0A CN110912797B (en) | 2019-11-18 | 2019-11-18 | Method and device for forwarding broadcast message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911127042.0A CN110912797B (en) | 2019-11-18 | 2019-11-18 | Method and device for forwarding broadcast message |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110912797A CN110912797A (en) | 2020-03-24 |
CN110912797B true CN110912797B (en) | 2021-12-24 |
Family
ID=69817829
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911127042.0A Active CN110912797B (en) | 2019-11-18 | 2019-11-18 | Method and device for forwarding broadcast message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110912797B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112187484B (en) * | 2020-09-17 | 2022-07-01 | 苏州浪潮智能科技有限公司 | Method and device for sending network broadcast flow for reducing occupied broadband and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103259727A (en) * | 2012-08-31 | 2013-08-21 | 杭州华三通信技术有限公司 | Packet forwarding method and device |
CN105099779A (en) * | 2015-07-29 | 2015-11-25 | 北京京东尚科信息技术有限公司 | Multi-tenant cloud platform architecture |
CN107454132A (en) * | 2016-03-31 | 2017-12-08 | 阿里巴巴集团控股有限公司 | The method and apparatus for supporting the network transmission of multi-tenant |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8943000B2 (en) * | 2012-01-20 | 2015-01-27 | Cisco Technology, Inc. | Connectivity system for multi-tenant access networks |
US8832820B2 (en) * | 2012-06-25 | 2014-09-09 | International Business Machines Corporation | Isolation and security hardening among workloads in a multi-tenant networked environment |
US9049115B2 (en) * | 2012-12-13 | 2015-06-02 | Cisco Technology, Inc. | Enabling virtual workloads using overlay technologies to interoperate with physical network services |
CN103731351B (en) * | 2013-12-16 | 2017-09-15 | 新华三技术有限公司 | A kind of broadcasting packet retransmission method and equipment |
US9313044B2 (en) * | 2014-07-17 | 2016-04-12 | Cisco Technology, Inc. | Multiple mobility domains with VLAN translation in a multi-tenant network environment |
CN104320267B (en) * | 2014-10-29 | 2017-11-17 | 武汉绿色网络信息服务有限责任公司 | VxLAN ARP broadcast suppression systems and method is realized based on SDN frameworks |
CN107800549B (en) * | 2016-08-30 | 2020-01-03 | 新华三技术有限公司 | Method and device for realizing multi-tenant equipment environment MDC (media data center) based on port of switching equipment |
-
2019
- 2019-11-18 CN CN201911127042.0A patent/CN110912797B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103259727A (en) * | 2012-08-31 | 2013-08-21 | 杭州华三通信技术有限公司 | Packet forwarding method and device |
CN105099779A (en) * | 2015-07-29 | 2015-11-25 | 北京京东尚科信息技术有限公司 | Multi-tenant cloud platform architecture |
CN107454132A (en) * | 2016-03-31 | 2017-12-08 | 阿里巴巴集团控股有限公司 | The method and apparatus for supporting the network transmission of multi-tenant |
Also Published As
Publication number | Publication date |
---|---|
CN110912797A (en) | 2020-03-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11895154B2 (en) | Method and system for virtual machine aware policy management | |
US11151163B2 (en) | Scalable spine nodes with partial replication of routing information in a network environment | |
CN108781185B (en) | System and method for providing a programmable packet classification framework for network devices | |
EP3057270A1 (en) | Technologies for modular forwarding table scalability | |
US20160212048A1 (en) | Openflow service chain data packet routing using tables | |
EP1779605B1 (en) | Forwarding database in a network switch device | |
US10608866B2 (en) | Forwarding Ethernet packets | |
US8989193B2 (en) | Facilitating insertion of device MAC addresses into a forwarding database | |
CN107113241B (en) | Route determining method, network configuration method and related device | |
US6907469B1 (en) | Method for bridging and routing data frames via a network switch comprising a special guided tree handler processor | |
US10187293B2 (en) | Apparatus and method for multicast data packet forwarding | |
US10397116B1 (en) | Access control based on range-matching | |
CN107395508B (en) | Method and device for forwarding message | |
CN107493222B (en) | VXLAN message forwarding method and device | |
US10652142B2 (en) | SDN-based ARP implementation method and apparatus | |
US8615015B1 (en) | Apparatus, systems and methods for aggregate routes within a communications network | |
US10547547B1 (en) | Uniform route distribution for a forwarding table | |
US10397340B2 (en) | Multicast migration | |
CN112202674B (en) | Method, device, equipment and storage medium for forwarding multicast message | |
US9762489B2 (en) | Local packet switching at a satellite device | |
CN110912797B (en) | Method and device for forwarding broadcast message | |
KR102001487B1 (en) | Method for controlling software defined networking and computing device performing the same | |
CN105915471B (en) | Message forwarding method and device | |
WO2022049751A1 (en) | Number-of-connections measuring device, method, and program | |
EP4395246A1 (en) | Data forwarding method and system, electronic device, and storage medium |
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 |