[go: up one dir, main page]

CN119182743A - Network equipment data processing method and network equipment - Google Patents

Network equipment data processing method and network equipment Download PDF

Info

Publication number
CN119182743A
CN119182743A CN202411676168.4A CN202411676168A CN119182743A CN 119182743 A CN119182743 A CN 119182743A CN 202411676168 A CN202411676168 A CN 202411676168A CN 119182743 A CN119182743 A CN 119182743A
Authority
CN
China
Prior art keywords
message
vlan
equipment
network device
processing method
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.)
Granted
Application number
CN202411676168.4A
Other languages
Chinese (zh)
Other versions
CN119182743B (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 Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202411676168.4A priority Critical patent/CN119182743B/en
Publication of CN119182743A publication Critical patent/CN119182743A/en
Application granted granted Critical
Publication of CN119182743B publication Critical patent/CN119182743B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/55Prevention, detection or correction of errors
    • H04L49/557Error correction, e.g. fault recovery or fault tolerance
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • H04L49/111Switch interfaces, e.g. port details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/354Switches specially adapted for specific applications for supporting virtual local area networks [VLAN]

Landscapes

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

Abstract

The embodiment of the invention discloses a network equipment data processing method and network equipment, wherein the network equipment data processing method comprises the steps of receiving a first message from a CPU port of a switching chip, wherein the CPU port is preconfigured to belong to a plurality of VLANs, acquiring identity information of first destination equipment to which the first message is sent according to an analysis result of the first message, sending the first message data to a protocol stack of the network equipment when the first destination equipment represented by the identity information of the first destination equipment is the network equipment, and discarding the first message when the first destination equipment represented by the identity information of the first destination equipment is not the network equipment. The network equipment data processing method solves the technical problem that network equipment management adopting VLAN technology is inflexible in related technologies.

Description

Network equipment data processing method and network equipment
Technical Field
The present invention relates to the field of network device data processing technologies, and in particular, to a network device data processing method and a network device.
Background
‌ VLAN (virtual local area network, english Virtual Local Area Network) technology is a technology that implements virtual workgroups by logically dividing devices within a local area network into individual segments. VLAN technology is widely used in network devices to avoid broadcast storms and to improve data security. In the network device adopting the VLAN technology, a management VLAN is configured to realize the communication and remote management of the network device, the management VLAN is equivalent to the VLAN where the CPU of the network device is located, and after the corresponding IP information is configured, the remote management can be realized, but only the user access in the same VLAN is supported.
The network device managed by the management VLAN has a plurality of inconveniences in actual use, for example, when the management VLAN is required to be modified to other VALNs according to the requirement of a user, the management device needs to be migrated into the modified VLAN together to realize the access to the CPU of the network device, and for example, when the network device fails and a manager cannot be connected to the management VLAN, the CPU of the network device cannot be accessed for failure detection.
As can be seen, the network device adopting VLAN technology in the related art has a technical problem of inflexibility in management, and no effective solution has been proposed at present for the technical problem.
The above information disclosed in the background section is only for enhancement of understanding of the background of the technology described herein. Accordingly, the background art may contain some information that is not otherwise known to those of skill in the art.
Disclosure of Invention
The embodiment of the invention provides a network equipment data processing method and network equipment, which at least solve the technical problem that network equipment management adopting VLAN technology in the related technology is inflexible.
According to one aspect of the embodiment of the invention, a network device data processing method is provided, which comprises the steps of receiving a first message from a CPU port of a switching chip, wherein the CPU port is preconfigured to belong to a plurality of VLANs, acquiring identity information of first destination devices to which the first message is sent according to an analysis result of the first message, sending the first message data to a protocol stack of the network device when the first destination devices represented by the identity information of the first destination devices are the network devices, wherein the first message data is contained in the first message, and discarding the first message when the first destination devices represented by the identity information of the first destination devices are not the network devices.
Optionally, the network device data processing method further comprises the steps of receiving second message data sent by a protocol stack, determining VLAN to which second destination device belongs, wherein the second destination device is a device to which the second message data is to be sent, adding a VLAN tag in the second message according to the VLAN to which the second destination device belongs, wherein the second message data is contained in the second message, the VLAN tag represents the VLAN to which the second destination device belongs, and sending the second message with the VLAN tag to a CPU port.
Optionally, determining the VLAN to which the second destination device belongs includes determining identity information of the second destination device to which the second message is to be sent according to the second message data, and querying a first relation table according to the identity information of the second destination device to determine the VLAN to which the second destination device belongs, wherein the first relation table records the identity information of different devices and mapping relations between the identity information and the VLAN to which the second destination device belongs.
Optionally, after receiving the first message from the CPU port of the switching chip, the network device data processing method further comprises the steps of acquiring the identity information of the source device and the VLAN to which the source device belongs according to the analysis result of the first message, wherein the source device is the initiating device of the first message, and recording or updating the mapping relation between the identity information of the source device and the VLAN to which the source device belongs in a first relation table.
Optionally, the network device data processing method further comprises deleting the identity information of the source device and the VLAN to which the identity information belongs from the first relation table when the source device is not gateway device and the last recorded time from the source device in the first relation table reaches a preset time.
Optionally, the network device data processing method further comprises deleting a record related to the source device in the first relation table when the source device is gateway device and the IP address of the source device changes, and recording the mapping relation between the identity information of the source device and the VLAN to which the source device belongs in the first relation table.
Optionally, before the first message data is sent to the protocol stack of the network device, the network device data processing method further comprises the step of stripping at least part of message headers of the first message, wherein at least part of message headers comprise VLAN tags and/or CPU tags, the VLAN tags represent VLANs (virtual local area networks) to which source devices initiating the first message belong, and the CPU tags represent ingress port information and priority information of the first message.
Optionally, the network device data processing method further comprises the steps of determining whether cascade connection exists in the network device or not under the condition that a target message sending condition is met, wherein the target message is a broadcast message or a multicast message, and controlling the target message to be sent through a designated port on the network device under the condition that cascade connection does not exist in the network device, wherein the target message does not carry a VLAN tag.
Optionally, the network device data processing method further comprises the steps of searching a second relation table of the network device to obtain effective VLANs under the condition that cascade connection exists in the network device, creating the second relation table when the VLAN is divided for the network device, recording mapping relations between different ports of the network device and the VLAN to which the different ports belong, and controlling to send target messages to at least part of the VLANs in the effective VLANs.
Optionally, the control sends the target message to at least part of the VLANs in the effective VLANs, wherein the control comprises obtaining the number of VLANs allowed to pass through by the cascade ports when the ports to be sent are cascade ports, inquiring a third relation table to obtain one or more target VLANs corresponding to the cascade ports when the number of the VLANs allowed to pass through by the cascade ports reaches the preset number, storing the third relation table in a switching chip of the network equipment, recording association relations among different ports, the VLAN and identity information of the connecting equipment, and sending the target message to the target VLAN through the cascade ports.
According to another aspect of the embodiments of the present invention, there is also provided a computer program product comprising computer instructions which, when executed by a processor, implement the above-mentioned network device data processing method.
The embodiment of the invention also provides a nonvolatile storage medium, which comprises a stored program, wherein the device where the nonvolatile storage medium is controlled to execute the network device data processing method when the program runs.
The embodiment of the invention also provides a processor, which is used for running a program, wherein the data processing method of the network equipment is executed when the program runs.
The embodiment of the invention also provides a network device, which comprises a switching chip and a CPU, wherein the CPU is in communication connection with a CPU port of the switching chip, and the switching chip is also provided with a plurality of communication ports for being connected with external devices, wherein the CPU is the processor.
According to the network equipment data processing method, the CPU ports of the switching chip are configured to belong to a plurality of VLANs, so that messages from different VLAN ports can be transmitted to the CPU through the CPU ports, and therefore when the network equipment data processing method is actually used, the CPU of the network equipment can be accessed through the ports belonging to different VLANs, and the flexibility of network equipment management is improved. On the basis, after a first message uploaded by the exchange chip through the CPU port is received, the first message is analyzed, so that identity information of first destination equipment to be sent to is obtained, if the first destination equipment is the network equipment, first message data contained in the first message is sent to a protocol stack for processing, and otherwise, the first message is abandoned. Since the CPU port is designed to allow messages of multiple VLANs to pass through, a large number of irrelevant messages may be uploaded through the CPU port in practical implementation, and by adopting the above-mentioned setting manner, the destination device to which the received first message is to be sent is identified to determine the sending or discarding of the message, so that the number of messages of the sending protocol stack can be effectively limited, and the network device is prevented from being impacted by the message in actual use. The embodiment of the application can access the CPU of the network equipment through a plurality of VLAN ports, thereby realizing the management of the network equipment, effectively improving the flexibility of the management of the network equipment, avoiding the condition of message impact, ensuring the working stability of the network equipment and solving the technical problem of inflexible management of the network equipment adopting VLAN technology in the related technology.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow diagram of an alternative embodiment of a network device data processing method in accordance with the present invention;
FIG. 2 is a schematic diagram of a network device employing VLAN technology in the related art when managing VLAN switching;
FIG. 3 is a schematic diagram of a related art network device employing VLAN technology that fails to access a CPU when it fails;
FIG. 4 is a schematic diagram of an alternative embodiment of a network device employing the network device data processing method of the present invention;
FIG. 5 is a schematic diagram of another alternative embodiment of a network device employing the network device data processing method of the present invention;
FIG. 6 is a schematic diagram of a network device data processing method according to an embodiment of the present invention when processing a message;
Fig. 7 is a schematic diagram of a network device data processing method according to an embodiment of the present invention for transmitting a broadcast message or a multicast message in the presence of concatenation.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and in the drawings are used for distinguishing between different objects and not for limiting a particular order.
As described in the background section, the network device adopting VLAN technology in the related art has a technical problem of inflexibility in management, taking the switch in fig. 2 and 3 as an example.
In fig. 2, in the case where the management VLAN of the switch 1 is VLAN1, the CPU of the switch 1, i.e., the P1 port and the P5 port in fig. 2, can be accessed through the port added to VLAN1, at this time, the PC1 is connected to the P5 port, which can access the CPU of the switch 1 through the P5 port, thereby realizing the management of the switch 1, and the P6 port connected to the PC2 cannot access the CPU of the switch 1 because VLAN2 is added. When the user changes the management VLAN from VLAN1 to VLAN2 according to the own requirement, PC2 can access the CPU of switch 1, but PC1 cannot access it, and if PC1 wants to access the CPU of switch 1, it needs to switch to VLAN2 to realize, which increases the complexity of operation, making network device management inflexible.
In fig. 3, the CPU ports of the switch are divided into VLAN100, and thus access to the CPU needs to be achieved through the ports belonging to VLAN 100. If the switch fails, the upstream network of the switch is not enabled and the panel port of the switch has no VLAN100, even if the operation and maintenance personnel are on site, the CPU cannot be accessed, so that the fault detection cannot be performed, and the technical problem of inflexible management of network equipment is found.
Fig. 1 is a flow chart of a network device data processing method according to an embodiment of the present invention, as shown in fig. 1, in order to solve the above-mentioned technical problem of inflexibility of network device management, the method includes the following steps:
Step S102, receiving a first message from a CPU port of a switching chip, wherein the CPU port is preconfigured to belong to a plurality of VLANs;
Step S104, according to the analysis result of the first message, acquiring the identity information of the first destination equipment to which the first message is to be sent;
Step S106, when the first destination device represented by the identity information of the first destination device is the network device, sending first message data to a protocol stack of the network device, wherein the first message data is contained in the first message;
Step S108, discarding the first message under the condition that the first destination device represented by the identity information of the first destination device is not the own network device.
The network equipment data processing method adopting the scheme comprises the steps of receiving a first message from a CPU port of a switching chip, wherein the CPU port is preconfigured to belong to a plurality of VLANs, acquiring identity information of first destination equipment to which the first message is sent according to an analysis result of the first message, sending first message data to a protocol stack of the network equipment when the first destination equipment represented by the identity information of the first destination equipment is the network equipment, wherein the first message data is contained in the first message, and discarding the first message when the first destination equipment represented by the identity information of the first destination equipment is not the network equipment.
According to the embodiment of the application, the CPU ports of the switching chip are configured to belong to a plurality of VLANs, so that messages from different VLAN ports can be transmitted to the CPU through the CPU ports, and therefore, when in actual use, the CPU of the network equipment can be accessed through the ports belonging to different VLANs, and the flexibility of network equipment management is improved. On the basis, after a first message uploaded by the exchange chip through the CPU port is received, the first message is analyzed, so that identity information of first destination equipment to be sent to is obtained, if the first destination equipment is the network equipment, first message data contained in the first message is sent to a protocol stack for processing, and otherwise, the first message is abandoned. Since the CPU port is designed to allow messages of multiple VLANs to pass through, a large number of irrelevant messages may be uploaded through the CPU port in practical implementation, and by adopting the above-mentioned setting manner, the destination device to which the received first message is to be sent is identified to determine the sending or discarding of the message, so that the number of messages of the sending protocol stack can be effectively limited, and the network device is prevented from being impacted by the message in actual use. The embodiment of the application can access the CPU of the network equipment through a plurality of VLAN ports, thereby realizing the management of the network equipment, effectively improving the flexibility of the management of the network equipment, avoiding the condition of message impact, ensuring the working stability of the network equipment and solving the technical problem of inflexible management of the network equipment adopting VLAN technology in the related technology.
Wherein the network device is a device for forwarding messages, such as switches, routers, etc., that supports VLAN technology. The exchange chip is an integrated circuit component in the network equipment, and is mainly used for realizing the forwarding and routing decision of the data packet in the computer network equipment. It plays a vital role in modern network devices and communication systems, and is responsible for efficiently forwarding data packets, implementing network traffic control, and providing fast data transmission services.
The identity information of the first destination device may be different according to different message types, so long as the identity information of the first destination device can represent the identity of the first destination device. For example, in an alternative embodiment, the first message is a unicast message, and the first destination device identity information is a MAC address of the first destination device. In another alternative embodiment, the first message is an ARP message, and correspondingly, the first destination device identity information is an IP address of the first destination device.
VLAN (Virtual Local Area Network), virtual local area network, is a technique that implements virtual workgroups by logically dividing devices within a local area network into individual segments. The VLAN is proposed for solving the broadcasting problem and security of the Ethernet, and the broadcasting and unicast traffic in one VLAN cannot be forwarded to other VLANs, so that the broadcasting domain is limited, the bandwidth is saved, and the network processing capacity is improved. ‌ A
Optionally, the network device data processing method further comprises the steps of receiving second message data sent by a protocol stack, determining VLAN to which second destination device belongs, wherein the second destination device is a device to which the second message data is to be sent, adding a VLAN tag in the second message according to the VLAN to which the second destination device belongs, wherein the second message data is contained in the second message, the VLAN tag represents the VLAN to which the second destination device belongs, and sending the second message with the VLAN tag to a CPU port.
When the second message is sent outwards, the network device data processing method of the embodiment of the application determines the VLAN to which the second destination device to be sent belongs according to the second message data from the protocol stack, adds the corresponding VLAN label in the second message, then sends the second message added with the label to the exchange chip through the CPU port, and then sends the message to the second destination device through the corresponding port according to the forwarding rule of the exchange chip.
In the implementation, the second message data may be response data of the protocol stack to the first message data, or may be unicast data actively sent out.
In the embodiment, the VLAN to which the second destination device belongs is determined, which comprises determining identity information of the second destination device to which the second message is to be sent according to the second message data, and inquiring a first relation table according to the identity information of the second destination device to determine the VLAN to which the second destination device belongs, wherein the first relation table records the identity information of different devices and mapping relations among the VLAN to which the different devices belong.
In this embodiment, the second message data includes identity information of the second destination device to which the second message data is to be sent, and by querying the first relationship table, a VLAN to which the second destination device belongs can be obtained according to the identity information of the second destination device, so that a subsequent forwarding operation is conveniently implemented.
For example, as shown in fig. 4, in a specific embodiment, the first relation table is a MAC-VLAN table, the table stores mapping relations between different destination devices and VLANs to which the destination devices belong, the second message data includes the MAC address of the second destination device to which the second message data is to be sent, and the VLAN to which the second destination device belongs can be obtained by querying the MAC-VLAN table, so as to add a VLAN tag to the second message.
As shown in fig. 4 and fig. 5, after the network device data processing method in the embodiment of the present application is adopted, the CPU port of the network device is preconfigured to belong to multiple VLANs (in this embodiment, the CPU port is configured to belong to all VLANs, so that messages of all VLANs are allowed to pass through), and when the network device fails, access to the CPU can be realized through the P1 port, the P2 port, the P3 port, and the like, so that failure investigation is facilitated, and flexibility of network device management is improved. Meanwhile, the CPU limits the message data sent to the protocol stack, and only the destination device is allowed to upload the first message data of the network device to the protocol stack, so that even if all ports can access the CPU, message impact on the protocol stack is avoided.
In an alternative embodiment, after receiving the first message from the CPU port of the switching chip, the network device data processing method further includes obtaining the identity information of the source device and the VLAN to which the source device belongs according to the analysis result of the first message, wherein the source device is the initiating device of the first message, and recording or updating the mapping relation between the identity information of the source device and the VLAN to which the source device belongs in the first relation table.
As described above, when adding the VLAN tag to the second packet to be sent, the VLAN to which the second destination device to be sent belongs needs to be obtained by querying the first relationship table, in this embodiment, after receiving the first packet, the first packet is parsed, so as to obtain the identity information of the source device and the corresponding relationship between the source device and the VLAN to which the source device belongs, and the mapping relationship is recorded or updated into the first relationship table. For example, in an embodiment in which the first relationship table is a MAC-VLAN table, after receiving the first packet, the MAC address of the source device and the VLAN to which the source device belongs are obtained by parsing, and then the corresponding relationship between the MAC address of the source device and the VLAN is recorded in the first relationship table.
The network equipment data processing method further comprises the step of deleting the identity information of the source equipment and the VLAN to which the identity information belongs from the first relation table under the condition that the source equipment is not gateway equipment and the last recorded time length from the source equipment in the first relation table reaches the preset time length.
In this embodiment, if the source device is not a gateway device and a certain record is not updated within a time period of a preset duration, the record is deleted, so that the first relationship table is ensured to be concise and effective, and the forwarding efficiency of the network device is improved.
The network equipment data processing method further comprises the steps of deleting records related to the source equipment in the first relation table under the condition that the source equipment is gateway equipment and the IP address of the source equipment changes, and recording mapping relations between identity information of the source equipment and VLANs (virtual local area networks) to which the source equipment belongs in the first relation table.
In the case that the source device is a gateway device, the correspondence between the identity information and the VLAN is relatively stable, so that in order to reduce the operation frequency of the data in the first relationship table and thereby improve the data processing efficiency, in this embodiment, the corresponding record in the first relationship table is kept valid for a long period of time, and the corresponding record is not deleted because of not updating for a long time. When a message from the source device is received and the change of the IP address is found, the original record in the first relation table is deleted, and the corresponding relation between the identity information of the source device and the VLAN to which the source device belongs is re-recorded in the first relation table, so that the update of the data corresponding to the gateway device is realized.
The network device data processing method further comprises the step of stripping at least part of message heads of the first message before the first message data is sent to a protocol stack of the network device, wherein at least part of message heads comprise VLAN labels and/or CPU labels, the VLAN labels represent VLANs (virtual local area networks) of source devices initiating the first message, and the CPU labels represent inlet port information and priority information of the first message.
In this embodiment, before the first packet data is sent to the protocol stack of the present network device, at least part of the packet header in the first packet is stripped, for example, the VLAN tag (VLAN tag) and the CPU tag (CPU tag) in the first packet are stripped, so that the protocol stack is convenient for performing subsequent processing on the first packet data.
When the CPU port of the switch chip sends a message to the CPU, a tag called a CPU tag is inserted into the message. The primary function of the tag is to tell from which device port the message is coming and can instruct the ASIC to which port to send the message to. Specifically, the location of the CPU tag insertion is after the message source MAC address and before the VLAN tag. When a CPU tag is inserted, it typically contains ingress port information identifying from which port the message enters the switch chip, and priority information characterizing the priority of the message processing.
These information help the CPU to properly process and forward messages, ensuring efficient management and control of network traffic. In actual implementation, other information, such as VLAN information, may also be included in the CPU tag.
In an optional embodiment, the network device data processing method further includes determining whether a cascade exists in the network device if a target message sending condition is met, wherein the target message is a broadcast message or a multicast message, and controlling the target message to be sent through a designated port on the network device if the cascade does not exist in the network device, wherein the target message does not carry a VLAN tag.
When the network equipment data processing method of the technical scheme of the application is adopted, different processing schemes can be selected for different scenes when broadcast data or multicast data is transmitted, and when the network equipment has no cascade connection, the broadcast data or the multicast data is transmitted through the local machine, at the moment, a port can be directly designated for transmission, and a VLAN label is not carried in a transmitted destination message.
As shown in fig. 7, the network device data processing method further includes, in the case that the network device has a cascade connection, searching a second relation table of the network device to obtain an effective VLAN, where the second relation table is created when VLAN division is performed for the network device, the second relation table records mapping relations between different ports of the network device and VLANs to which the different ports belong, and controlling to send a target packet to at least some of the effective VLANs.
Under the condition that cascade connection exists in the network equipment, the message needs to carry a VLAN tag in the process of cross-equipment forwarding at the moment, specifically, a second relation table of the network equipment is searched to obtain an effective VLAN, then a target message is sent to part or all of the VLANs in the effective VLAN according to actual requirements, specifically, according to the effective VLAN, different VLAN tags are added to the target message, and the network equipment or the network equipment cascaded with the target message can send the target message to the corresponding VLAN according to own forwarding rules.
The method comprises the steps of obtaining the number of VLANs allowed to pass through by a cascading port when the port to be sent is the cascading port, inquiring a third relation table to obtain one or more target VLANs corresponding to the cascading port under the condition that the number of the VLANs allowed to pass through by the cascading port reaches the preset number, storing the third relation table in a switching chip of the network equipment, recording association relations among different ports, the VLAN and identity information of the connecting equipment, and sending the target message to the target VLAN through the cascading port.
In this embodiment, in the cross-device forwarding process, if a cascade port is encountered and the number of allowed VLANs configured by the cascade port reaches a preset number (for example 128), the destination message is not sent to all VLANs, but a third relation table in the switch chip is further queried, so that a useful VLAN (i.e., a target VLAN) is obtained, an unused VLAN is removed, and then the target message is sent to the target VLAN, so that the range of sending the message can be effectively reduced, and the sending efficiency of the broadcast message or the multicast message is improved.
In practical implementation, identifying the cascade port and identifying the number of VLANs allowed to pass through the cascade port can be realized through a VLAN module and an LLDP module, for example, a certain port is configured as a trunk, and all VLANs are allowed to pass through, so that the port is a cascade port with high probability, and if the neighbor table information is also network equipment after inquiring the LLDP, the port can be determined to be a cascade port.
Fig. 6 is a schematic diagram of a network device when a data processing method of an embodiment of the present application is adopted to process a packet, where a receiving panel of the network device forwards the received packet to a CPU port (i.e., a CPU port), where the CPU port is preconfigured to allow multiple VLANs to pass through, but the CPU filters the received packet, determines a destination device according to an analysis result of the packet, and only unicast and ARP messages of the destination device are sent to a network driver, where the network driver is the CPU receives and processes an original packet, and is located before a kernel protocol stack. The network driver can analyze, add or strip the information such as CPU tag, VLAN tag and the like in the message, and then transmit the message data to the protocol stack for processing. After receiving the response data of the protocol stack, the VLAN to which the second touch device to be sent belongs can be obtained by inquiring the first relation table, so that the VLAN tag is added in the message, the processed message is returned to the exchange chip through the CPU port, and the exchange chip forwards the message from the corresponding port according to the forwarding rule of the exchange chip. Specifically, the switching chip can search the corresponding port by looking up the MAC table, the destination MAC address of the device to be sent and the VLAN information to which the destination MAC address belongs, so as to realize forwarding of the message.
Further, an embodiment of the present invention provides a computer program product, including computer instructions, where the computer instructions, when executed by a processor, implement the network device data processing method described above.
In addition, the embodiment of the invention also provides a nonvolatile storage medium, which comprises a stored program, wherein the device where the nonvolatile storage medium is controlled to execute the network device data processing method when the program runs.
The embodiment of the invention also provides a processor, which is used for running a program, wherein the program runs to execute the network equipment data processing method.
Finally, the embodiment of the invention also provides a network device, which comprises a switching chip and a CPU, wherein the CPU is in communication connection with a CPU port of the switching chip, and the switching chip is also provided with a plurality of communication ports for being connected with external devices, and the CPU is the processor.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention.

Claims (11)

1.A method for processing data of a network device, comprising:
receiving a first message from a CPU port of a switching chip, wherein the CPU port is preconfigured to belong to a plurality of VLANs;
Acquiring identity information of first destination equipment to which the first message is to be sent according to an analysis result of the first message;
if the first destination device represented by the identity information of the first destination device is a network device, sending first message data to a protocol stack of the network device, wherein the first message data is contained in the first message;
and discarding the first message under the condition that the first destination device represented by the identity information of the first destination device is not the network device.
2. The network device data processing method of claim 1, wherein the network device data processing method further comprises:
Receiving second message data sent by the protocol stack;
determining a VLAN to which second destination equipment belongs, wherein the second destination equipment is equipment to which the second message data is to be sent;
Adding a VLAN tag in a second message according to the VLAN to which the second destination device belongs, wherein the second message data is contained in the second message, and the VLAN tag represents the VLAN to which the second destination device belongs;
and sending the second message added with the VLAN tag to the CPU port.
3. The method for processing data of a network device according to claim 2, wherein determining the VLAN to which the second destination device belongs comprises:
Determining identity information of the second destination device to which the second message is to be sent according to the second message data;
And inquiring a first relation table according to the identity information of the second destination equipment to determine the VLAN to which the second destination equipment belongs, wherein the first relation table records the identity information of different equipment and the mapping relation between the identity information of the different equipment and the VLAN to which the different equipment belongs.
4. The network device data processing method of claim 3, wherein after receiving the first message from the CPU port of the switch chip, the network device data processing method further comprises:
Acquiring identity information of source equipment and VLAN (virtual local area network) to which the source equipment belongs according to an analysis result of the first message, wherein the source equipment is initiating equipment of the first message;
and recording or updating the mapping relation between the identity information of the source equipment and the VLAN to which the source equipment belongs in the first relation table.
5. The network device data processing method of claim 4, wherein the network device data processing method further comprises:
And deleting the identity information of the source equipment and the VLAN to which the identity information belongs from the first relation table under the condition that the source equipment is not gateway equipment and the time length which is recorded in the first relation table last time by the source equipment reaches a preset time length.
6. The network device data processing method of claim 4, wherein the network device data processing method further comprises:
deleting records related to the source equipment in the first relation table under the condition that the source equipment is gateway equipment and the IP address of the source equipment is changed;
And recording the mapping relation between the identity information of the source equipment and the VLAN to which the source equipment belongs in the first relation table.
7. The network device data processing method of claim 1, wherein prior to sending the first message data to the protocol stack of the present network device, the network device data processing method further comprises:
And stripping at least part of message heads of the first message, wherein the at least part of message heads comprise VLAN labels and/or CPU labels, the VLAN labels represent VLANs of source equipment initiating the first message, and the CPU labels represent inlet port information and priority information of the first message.
8. The network device data processing method of claim 1, wherein the network device data processing method further comprises:
Under the condition that a target message sending condition is met, determining whether cascade connection exists in the network equipment, wherein the target message is a broadcast message or a multicast message;
and under the condition that cascade connection does not exist in the network equipment, controlling the target message to be sent through a designated port on the network equipment, wherein the target message does not carry a VLAN tag.
9. The network device data processing method of claim 8, wherein the network device data processing method further comprises:
under the condition that cascade connection exists in the network equipment, a second relation table of the network equipment is searched to obtain an effective VLAN, the second relation table is created and generated when VLAN division is carried out on the network equipment, and the second relation table records mapping relations between different ports of the network equipment and VLAN to which the port belongs;
And controlling to send the target message to at least part of the VLAN in the effective VLAN.
10. The network device data processing method of claim 9, wherein controlling the sending of the target message to at least some of the active VLANs comprises:
When the port to be sent is a cascade port, acquiring the VLAN quantity allowed to pass by the cascade port;
Inquiring a third relation table under the condition that the number of VLANs allowed to pass through by the cascade ports reaches a preset number to acquire one or more target VLANs corresponding to the cascade ports, wherein the third relation table is stored in a switching chip of the network equipment and records association relations among different ports, the VLAN and identity information of the connecting equipment;
And sending the target message to the target VLAN through the cascade port.
11. A network device comprising a switching chip and a CPU, said CPU being communicatively connected to a CPU port of said switching chip, said switching chip further having a plurality of communication ports for connection to external devices, wherein said CPU is adapted to perform the network device data processing method of any of claims 1 to 10.
CN202411676168.4A 2024-11-21 2024-11-21 Network equipment data processing method and network equipment Active CN119182743B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411676168.4A CN119182743B (en) 2024-11-21 2024-11-21 Network equipment data processing method and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411676168.4A CN119182743B (en) 2024-11-21 2024-11-21 Network equipment data processing method and network equipment

Publications (2)

Publication Number Publication Date
CN119182743A true CN119182743A (en) 2024-12-24
CN119182743B CN119182743B (en) 2025-03-25

Family

ID=93896395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411676168.4A Active CN119182743B (en) 2024-11-21 2024-11-21 Network equipment data processing method and network equipment

Country Status (1)

Country Link
CN (1) CN119182743B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6570875B1 (en) * 1998-10-13 2003-05-27 Intel Corporation Automatic filtering and creation of virtual LANs among a plurality of switch ports
US7706363B1 (en) * 2003-06-11 2010-04-27 Radlan Computer Communications, Ltd Method and apparatus for managing packets in a packet switched network
CN101741664A (en) * 2009-12-21 2010-06-16 中兴通讯股份有限公司 Realization method and device of Ethernet interface system
WO2011160464A1 (en) * 2010-06-23 2011-12-29 中兴通讯股份有限公司 Method for forwarding message and switch chip
CN105743780A (en) * 2014-12-09 2016-07-06 华为技术有限公司 Message transmission method and device
CN106789536A (en) * 2016-12-29 2017-05-31 杭州迪普科技股份有限公司 The method and system of protocol massages are sent in a kind of VSM systems
CN108011802A (en) * 2017-12-14 2018-05-08 锐捷网络股份有限公司 A kind of file transmitting method and two three-layer network appliances
CN118660024A (en) * 2024-06-25 2024-09-17 中兴通讯股份有限公司 Communication method, network device and board
CN118802804A (en) * 2024-06-28 2024-10-18 苏州元脑智能科技有限公司 A VLAN-based data transmission method, device and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6570875B1 (en) * 1998-10-13 2003-05-27 Intel Corporation Automatic filtering and creation of virtual LANs among a plurality of switch ports
US7706363B1 (en) * 2003-06-11 2010-04-27 Radlan Computer Communications, Ltd Method and apparatus for managing packets in a packet switched network
CN101741664A (en) * 2009-12-21 2010-06-16 中兴通讯股份有限公司 Realization method and device of Ethernet interface system
WO2011160464A1 (en) * 2010-06-23 2011-12-29 中兴通讯股份有限公司 Method for forwarding message and switch chip
CN105743780A (en) * 2014-12-09 2016-07-06 华为技术有限公司 Message transmission method and device
CN106789536A (en) * 2016-12-29 2017-05-31 杭州迪普科技股份有限公司 The method and system of protocol massages are sent in a kind of VSM systems
CN108011802A (en) * 2017-12-14 2018-05-08 锐捷网络股份有限公司 A kind of file transmitting method and two three-layer network appliances
CN118660024A (en) * 2024-06-25 2024-09-17 中兴通讯股份有限公司 Communication method, network device and board
CN118802804A (en) * 2024-06-28 2024-10-18 苏州元脑智能科技有限公司 A VLAN-based data transmission method, device and system

Also Published As

Publication number Publication date
CN119182743B (en) 2025-03-25

Similar Documents

Publication Publication Date Title
EP3734906B1 (en) Method and device for bearing multicast virtual private network
US9225641B2 (en) Communication between hetrogenous networks
US9584568B2 (en) Signal processing apparatus and signal processing method thereof for implementing a broadcast or a multicast communication
US20130250958A1 (en) Communication control system, control server, forwarding node, communication control method, and communication control program
EP2912803B1 (en) Forwarding table optimization with flow data
CN106992915B (en) Message de-encapsulation processing and data writing method and device
US10652142B2 (en) SDN-based ARP implementation method and apparatus
CN108964940B (en) Message sending method and device and storage medium
US7782856B1 (en) Forwarding data packets having tags conforming to different formats
US20130144995A1 (en) Control apparatus, a communication system, a communication method and a recording medium having recorded thereon a communication program
US20090135833A1 (en) Ingress node and egress node with improved packet transfer rate on multi-protocol label switching (MPLS) network, and method of improving packet transfer rate in MPLS network system
EP3253006A1 (en) Mapping server, network system, packet forwarding method and program
US8542679B2 (en) Method of controlling data propagation within a network
CN111711555B (en) Message processing method and device
US8331266B2 (en) LAN topology detection and assignment of addresses
KR20230017324A (en) BIER multicast traffic statistics collection method, device and system
US20130336321A1 (en) Relay forward system, path control device, and edge apparatus
CN118555241B (en) Message processing method, three-layer switch, storage medium and electronic equipment
CN119182743B (en) Network equipment data processing method and network equipment
CN112702254B (en) Message processing method and device and electronic equipment
JP4599429B2 (en) Communication system and communication method
CN116016391B (en) Message forwarding method and system based on NAT gateway
CN105743762A (en) Message forwarding method and equipment in VPLS network
CN116260726A (en) A topology discovery method, device, terminal and storage medium
CN112804130A (en) Message processing method, device, system, storage medium and electronic equipment

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