CN113612963A - Data forwarding method and device, computer equipment and storage medium - Google Patents

Data forwarding method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113612963A
CN113612963A CN202110849794.9A CN202110849794A CN113612963A CN 113612963 A CN113612963 A CN 113612963A CN 202110849794 A CN202110849794 A CN 202110849794A CN 113612963 A CN113612963 A CN 113612963A
Authority
CN
China
Prior art keywords
data packet
address
rule
forwarding
data
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.)
Pending
Application number
CN202110849794.9A
Other languages
Chinese (zh)
Inventor
全鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ifreecomm Technology Co ltd
Original Assignee
Ifreecomm 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 Ifreecomm Technology Co ltd filed Critical Ifreecomm Technology Co ltd
Priority to CN202110849794.9A priority Critical patent/CN113612963A/en
Publication of CN113612963A publication Critical patent/CN113612963A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/15Conference systems
    • H04N7/152Multipoint control units therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames

Landscapes

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

Abstract

The application relates to a data forwarding method, a data forwarding device, computer equipment and a storage medium. The method comprises the following steps: receiving a first data packet sent by a media processor; determining whether the first data packet conforms to a preset forwarding rule; if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet; and sending the second data packet to a target terminal. By adopting the method, the performance of the service processor can be improved, and the data forwarding delay can be relieved.

Description

Data forwarding method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data forwarding method and apparatus, a computer device, and a storage medium.
Background
A video conference MCU (Multi Control Unit) is a core component of a video conference system, and multiple sets of processors work cooperatively to provide a large-capacity access capability. Each group of processors comprises a service processor and a plurality of media processors, wherein the service processor is responsible for receiving and sending data to the outside and receiving and dispatching data to the inside; the media processor is responsible for processing the data assigned by the service processor and feeding back the processed data to the service processor.
In the conventional technology, the external data transmission of the service processor is realized through a network protocol stack, that is, a series of packing processing is performed on the data fed back by the media processor according to the network protocol stack, so that the data can be forwarded.
However, each data transceiving requires network protocol stack intervention, which degrades the performance of the service processor and also increases the delay of data forwarding.
Disclosure of Invention
Therefore, it is necessary to provide a data forwarding method, an apparatus, a computer device, and a storage medium that do not require network protocol stack access, improve performance of a service processor, and alleviate data forwarding delay, for solving the above technical problems.
A data forwarding method is applied to a service processor, and comprises the following steps:
receiving a first data packet sent by a media processor;
determining whether the first data packet conforms to a preset forwarding rule;
if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet;
and sending the second data packet to the target terminal.
In one embodiment, the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port Port filtering rules; the determining whether the first data packet conforms to a preset forwarding rule includes:
and sequentially filtering the first data packet according to the MAC address filtering rule, the IP address filtering rule and the Port filtering rule to determine whether the first data packet conforms to the forwarding rule.
In one embodiment, the sequentially filtering the first data packet according to the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule to determine whether the first data packet conforms to the forwarding rule includes:
performing MAC address filtering processing on the first data packet according to the MAC address filtering rule;
if the first data packet is determined to accord with the MAC address filtering rule, carrying out IP address filtering processing on the first data packet according to the IP address filtering rule;
if the first data packet is determined to accord with the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule;
and if the first data packet is determined to accord with the Port filtering rule, determining that the first data packet accords with the forwarding rule.
In one embodiment, the method further comprises:
and if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port filtering rule, forwarding the first data packet to a network protocol stack for processing.
In one embodiment, the performing address verification processing on the first data packet to obtain a second data packet includes:
and modifying the source address of the first data packet, and carrying out sum check and cyclic redundancy check on the first data packet to obtain a second data packet.
In one embodiment, before receiving the first data packet sent by the media processor, the method further includes:
acquiring address information corresponding to a target terminal; wherein, the address information comprises at least one of a target MAC address, a target IP address, a target Port and a target transmission protocol;
and adding a forwarding rule in a preset forwarding rule list according to the address information.
In one embodiment, the method further comprises:
and sending the address information to a media processor for the media processor to carry out address setting according to the address information and process data to be sent according to the address setting to obtain a first data packet.
In one embodiment, the media processor performs address setting according to the address information, and processes data to be transmitted according to the address setting to obtain a first data packet, including:
the media processor adds routing information in a preset host routing table according to the target IP address; the routing information comprises a corresponding relation between a target IP address and a network port of the intranet switch; the intranet switch is a switch between the media processor and the service processor;
the media processor adds an arp message in a preset arp table according to the target MAC address and the target IP address; the arp information includes a correspondence between a target MAC address and a target IP address;
packing the data to be sent according to the routing information and the arp information to obtain a first data packet; in the header of the first data packet, the destination IP address is a target IP address, and the destination MAC address is a target MAC address.
A data forwarding device is applied to a service processor, and the device comprises:
the data receiving module is used for receiving a first data packet sent by the media processor;
the rule determining module is used for determining whether the first data packet conforms to a preset forwarding rule or not;
the verification processing module is used for carrying out address verification processing on the first data packet to obtain a second data packet if the first data packet is determined to accord with the forwarding rule;
and the data sending module is used for sending the second data packet to the target terminal.
In one embodiment, the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port Port filtering rules; the rule determining module is specifically configured to filter the first data packet in sequence according to the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule, and determine whether the first data packet conforms to the forwarding rule.
In one embodiment, the rule determining module is specifically configured to perform MAC address filtering processing on the first data packet according to a MAC address filtering rule; if the first data packet is determined to accord with the MAC address filtering rule, carrying out IP address filtering processing on the first data packet according to the IP address filtering rule; if the first data packet is determined to accord with the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule; and if the first data packet is determined to accord with the Port filtering rule, determining that the first data packet accords with the forwarding rule.
In one embodiment, the apparatus further comprises:
and the protocol stack processing module is used for forwarding the first data packet to a network protocol stack for processing if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port Port filtering rule.
In one embodiment, the check processing module is specifically configured to modify a source address of the first data packet, and perform a sum check and a cyclic redundancy check on the first data packet to obtain the second data packet.
In one embodiment, the apparatus further comprises:
the address acquisition module is used for acquiring address information corresponding to the target terminal; wherein, the address information comprises at least one of a target MAC address, a target IP address, a target Port and a target transmission protocol;
and the rule adding module is used for adding the forwarding rule in a preset forwarding rule list according to the address information.
In one embodiment, the apparatus further comprises:
and the address forwarding module is used for sending the address information to the media processor so that the media processor can carry out address setting according to the address information and process the data to be sent according to the address setting to obtain a first data packet.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a first data packet sent by a media processor;
determining whether the first data packet conforms to a preset forwarding rule;
if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet;
and sending the second data packet to the target terminal.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a first data packet sent by a media processor;
determining whether the first data packet conforms to a preset forwarding rule;
if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet;
and sending the second data packet to the target terminal.
The service processor receives a first data packet sent by the media processor; determining whether the first data packet conforms to a preset forwarding rule; if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet; and sending the second data packet to the target terminal. In the embodiment of the disclosure, the service processor sets a forwarding rule in advance according to the address information of the target terminal, and if it is determined that the first data packet meets the forwarding rule, the second data packet obtained after the source address is modified can be sent to the target terminal without intervention of a network protocol stack.
Drawings
FIG. 1a is a diagram of an application environment of a data forwarding method in one embodiment;
FIG. 1b is a second diagram illustrating an application environment of the data forwarding method in an embodiment;
FIG. 2 is a flow diagram illustrating a data forwarding method according to one embodiment;
FIG. 3 is a flow diagram illustrating steps in one embodiment for filtering a first packet;
FIG. 4 is a second flowchart of a data forwarding method according to an embodiment;
fig. 5 is a schematic flow chart of a data forwarding method in another embodiment;
FIG. 6 is a flowchart illustrating steps performed by the media processor to obtain a first packet based on address information according to an embodiment;
FIG. 7 is a block diagram of a traffic processor in one embodiment;
FIG. 8 is a block diagram showing the structure of a data transfer device according to an embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data forwarding method provided by the present application can be applied to the application environment shown in fig. 1 a. The application environment includes a video conference MCU101 and a plurality of terminals 102, and the video conference MCU101 communicates with the terminals 102 through a network. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. As shown in fig. 1b, the video conference MCU101 includes a service processor 1011 and a plurality of media processors 1012, and the service processor 1011 communicates with the media processors 1012 through the intranet switch 1013.
In one embodiment, as shown in fig. 2, a data forwarding method is provided, which is described by taking the method as an example applied to the service processor in fig. 1, and includes the following steps:
step 201, receiving a first data packet sent by a media processor.
And the service processor dispatches the data to the media processor, and the media processor processes the dispatched data to obtain a first data packet. And then, the media processor sends a first data packet to the service processor, and correspondingly, the service processor receives the first data packet sent by the media processor.
In practical applications, the traffic processor may employ a chip 66AK2L06, and the media processor may employ a chip HI 3531D. The embodiment of the present disclosure does not limit the service processor and the media processor.
Step 202, determining whether the first data packet conforms to a preset forwarding rule.
Wherein the forwarding rule is set according to address information of a target terminal receiving the first data packet.
And a forwarding rule is preset in the service processor, and after the first data packet is received, the service processor judges whether the destination address of the first data packet is the address of the target terminal. And if the destination address of the first data packet is consistent with the address of the target terminal, determining that the first data packet conforms to the forwarding rule. And if the destination address of the first data packet is inconsistent with the address of the target terminal, determining that the first data packet is not in accordance with the forwarding rule.
In practical applications, the service processor 66AK2L06 is provided with a network coprocessor, and the forwarding rule may be stored in a memory of the network coprocessor in advance, and then the network coprocessor determines whether the first packet conforms to the forwarding rule.
Step 203, if it is determined that the first data packet conforms to the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet.
And if the first data packet is determined to accord with the forwarding rule, the service processor modifies the source address of the first data packet, and performs sum Check (checksum) and Cyclic Redundancy Check (CRC) on the first data packet to obtain a second data packet. The source Address includes at least one of a source MAC (Media Access Control Address) and a source IP (Internet Protocol) Address.
In practical applications, source address modification, checksum and cyclic redundancy check may be performed by a network coprocessor in the traffic processor.
And step 204, sending the second data packet to the target terminal.
The service processor may send the second packet to the destination terminal according to the destination address of the second packet after the second packet.
In the data forwarding method, a service processor receives a first data packet sent by a media processor; determining whether the first data packet conforms to a preset forwarding rule; if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet; and sending the second data packet to the target terminal. In the embodiment of the disclosure, the service processor sets a forwarding rule in advance according to the address information of the target terminal, and if it is determined that the first data packet meets the forwarding rule, the second data packet obtained after the source address is modified can be sent to the target terminal without intervention of a network protocol stack.
In one embodiment, the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port Port filtering rules; the step of determining whether the first data packet conforms to the preset forwarding rule may include: and sequentially filtering the first data packet according to the MAC address filtering rule, the IP address filtering rule and the Port filtering rule to determine whether the first data packet conforms to the forwarding rule.
As shown in fig. 3, sequentially performing filtering processing on the first data packet may include the following steps:
step 301, performing MAC address filtering processing on the first data packet according to the MAC address filtering rule.
Wherein the MAC address filtering rule includes a target MAC address of the target terminal.
In practical application, the network coprocessor may perform MAC address filtering processing on the first data packet according to the MAC address filtering rule, that is, determine whether a destination MAC address in the first data packet is consistent with a destination MAC address of the destination terminal. If the destination MAC address in the first data packet is consistent with the destination MAC address of the destination terminal, go to step 302; and if the destination MAC address in the first data packet is inconsistent with the destination MAC address of the destination terminal, determining that the first data packet is not in accordance with the forwarding rule.
Step 302, if it is determined that the first data packet conforms to the MAC address filtering rule, performing IP address filtering processing on the first data packet according to the IP address filtering rule.
Wherein the IP address filtering rule comprises a target IP address of the target terminal.
In practical application, the network coprocessor may perform IP address filtering processing on the first data packet according to an IP address filtering rule, that is, determine whether a destination IP address in the first data packet is consistent with a destination IP address of the destination terminal. If the destination IP address in the first data packet is consistent with the destination IP address of the destination terminal, execute step 303; and if the destination IP address in the first data packet is inconsistent with the destination IP address of the destination terminal, determining that the first data packet is not in accordance with the forwarding rule.
Step 303, if it is determined that the first data packet conforms to the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule.
Wherein, the Port filtering rule comprises a target Port corresponding to the target terminal.
In practical application, the network coprocessor may perform Port filtering processing on the first data packet according to a Port filtering rule, that is, determine whether a destination Port in the first data packet is consistent with a target Port corresponding to a target terminal. If the destination Port in the first data packet is consistent with the target Port corresponding to the target terminal, go to step 304; and if the destination Port in the first data packet is not consistent with the destination Port of the destination terminal, determining that the first data packet is not in accordance with the forwarding rule.
Step 304, if the first data packet is determined to conform to the Port filtering rule, the first data packet is determined to conform to the forwarding rule.
In the above embodiment, the network coprocessor in the service processor sequentially filters the first data packet according to the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule, and determines whether the first data packet conforms to the forwarding rule. If the first data packet is determined to be in accordance with the forwarding rule, the data can be directly forwarded without intervention of a network protocol stack, so that the data can be quickly forwarded, and the data forwarding efficiency is improved.
In an embodiment, as shown in fig. 4, on the basis of the above embodiment, an embodiment of the present disclosure may further include:
step 205, if it is determined that the first data packet does not comply with one of the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule, forwarding the first data packet to the network protocol stack for processing.
In practical application, the network coprocessor may perform MAC address filtering processing on the first data packet according to the MAC address filtering rule, that is, determine whether a destination MAC address in the first data packet is consistent with a destination MAC address of the destination terminal. And if the destination MAC address in the first data packet is inconsistent with the destination MAC address of the destination terminal, determining that the first data packet is not in accordance with the forwarding rule.
And if the destination MAC address in the first data packet is consistent with the destination MAC address of the destination terminal, the network coprocessor carries out IP address filtering processing on the first data packet according to the IP address filtering rule and determines whether the destination IP address in the first data packet is consistent with the destination IP address of the destination terminal. And if the destination IP address in the first data packet is inconsistent with the destination IP address of the destination terminal, determining that the first data packet is not in accordance with the forwarding rule.
If the destination IP address in the first data packet is consistent with the destination IP address of the destination terminal, the network coprocessor performs Port filtering processing on the first data packet according to a Port filtering rule to determine whether the destination Port in the first data packet is consistent with the destination Port corresponding to the destination terminal. And if the destination Port in the first data packet is not consistent with the destination Port of the destination terminal, determining that the first data packet is not in accordance with the forwarding rule.
And after determining that the first data packet does not accord with the forwarding rule, forwarding the first data packet to a network protocol stack, repackaging the data in the first data packet by the network protocol stack to obtain a third data packet, and sending the third data packet to the target terminal by the service processor.
In the above embodiment, if it is determined that the first packet does not comply with one of the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule, the first packet is forwarded to the network protocol stack for processing. By the embodiment of the disclosure, under the condition that the first data packet does not conform to the forwarding rule, the network protocol stack performs data packaging, and normal data forwarding can still be ensured.
In one embodiment, as shown in fig. 5, a data forwarding method is provided, which is described by taking the service processor in fig. 1 as an example, and includes the following steps:
step 401, address information corresponding to the target terminal is obtained.
Wherein the address information includes at least one of a target MAC address, a target IP address, a target Port, and a target transport protocol.
The service processor acquires a target MAC address, a target IP address, a target Port and a target transmission protocol of a target terminal, and configures the target MAC address, the target IP address, the target Port and the target transmission protocol into the network coprocessor.
Step 402, adding a forwarding rule in a preset forwarding rule list according to the address information.
In a network coprocessor of a service processor, a forwarding rule list is preset, and a plurality of forwarding rules are stored in the forwarding rule list. After the service processor configures the target MAC address, the target IP address, the target Port and the target transmission protocol into the network coprocessor, the network coprocessor adds a new forwarding rule in the forwarding rule list according to the target MAC address, the target IP address, the target Port and the target transmission protocol.
The network coprocessor may maintain a list of forwarding rules, such as periodically cleaning the list of forwarding rules, deleting duplicate forwarding rules, ordering forwarding rules, and so forth. The embodiments of the present disclosure do not limit this.
Step 403, sending the address information to the media processor, so that the media processor performs address setting according to the address information, and processes the data to be sent according to the address setting to obtain a first data packet.
After the service processor acquires the address information of the target terminal, the service processor can also send the address information to the media processor. And the media processor receives the address information and then performs address setting, so that when the media processor needs to feed back data to the service processor, the data to be transmitted can be processed according to the address setting to obtain a first data packet.
As shown in fig. 6, the process of performing, by the media processor, address setting according to the address information and processing the data to be transmitted according to the address setting to obtain the first data packet may include:
step 4031, the media processor adds routing information in a preset host routing table according to the target IP address.
The routing information includes a corresponding relationship between the target IP address and a network port of the intranet switch. As shown in fig. 1, the intranet switch is disposed between the media processor and the service processor, and provides data exchange service for the media processor and the service processor.
The media processor is preset with a host routing table. After receiving the target IP address sent by the service processor, the media processor generates routing information according to the corresponding relation between the target IP address and the network port of the intranet switch, and adds the routing information into a host routing table.
Step 4032, the media processor adds an arp message in a pre-set arp (Address Resolution Protocol) table according to the target MAC Address and the target IP Address.
Wherein, the arp information comprises the corresponding relation between the target MAC address and the target IP address.
An arp table is preset in the media processor. After receiving the target MAC address and the target IP address sent by the service processor, generating routing information according to the corresponding relation between the target MAC address and the target IP address, and adding the routing information into a host routing table.
Step 4033, the data to be sent is packaged according to the routing information and the arp information to obtain a first data packet.
When the media processor needs to feed back data to the service processor, the data to be transmitted can be packaged according to the reason information and the arp information, and a first data packet is obtained. In the header of the first packet, the destination IP address is a destination IP address, and the destination MAC address is a destination MAC address.
In one embodiment, the service processor periodically sends an arp reply packet to the media processor. Wherein, the arp reply packet is used for updating the MAC address table in the intranet switch.
In practical application, an intranet switch is provided with an MAC address table, the MAC address stored in the MAC address table is provided with an aging time period, and an expired MAC address can be cleared. If the MAC address is cleared, data forwarding failures may result. Therefore, the service processor sends an arp response packet to the media processor periodically, and when the arp response packet passes through the intranet switch, the intranet switch can learn the target MAC address of the target terminal according to the arp response packet, so that the MAC address table is updated, and data forwarding failure caused by the fact that the target MAC address is cleared is avoided.
Step 404, receiving the first data packet sent by the media processor.
As shown in fig. 7, a network coprocessor is disposed in the service processor, a coprocessor internal switch is disposed in the network coprocessor, and the coprocessor internal switch is provided with a plurality of forwarding ports. The media processor sends a first data packet to the service processor, and the service processor receives the first data packet sent by the media processor through a port 2 of the coprocessor internal switch.
Step 405, determining whether the first data packet conforms to a preset forwarding rule.
As shown in fig. 7, the network coprocessor further includes a filtering module, the switch in the coprocessor sends the first data packet from the Port 0 to the filtering module, and the filtering module sequentially filters the first data packet according to the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule. If the first data packet is determined to conform to the forwarding rule, go to step 406; if it is determined that the first packet does not comply with the forwarding rule, step 408 is performed.
And step 406, if the first data packet is determined to meet the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet.
As shown in fig. 7, an acceleration module may also be disposed in the service processor. After determining that the first data packet conforms to the forwarding rule, the network coprocessor sends the first data packet to the acceleration module, and the acceleration module determines whether to send the first data packet back to the network coprocessor.
And if the acceleration module determines to send the first data packet back to the network coprocessor, the network coprocessor modifies the source address, performs sum check and cyclic redundancy check on the first data packet to obtain a second data packet.
As shown in fig. 7, an application program is further installed in the service processor, and the acceleration module may generate first packet information according to the first data packet, send the first packet information to the application program, and notify the first packet information to the user by the application program. The notification manner may include presentation prompt information, playing prompt information, and the like, and the notification manner is not limited in the embodiment of the disclosure.
Step 407, the second data packet is sent to the target terminal.
As shown in fig. 7, the network coprocessor transfers the second data packet obtained after the address check processing to port 0 of the coprocessor internal switch, and then the coprocessor internal switch sends the second data packet to the target terminal through port 1.
Step 408, if it is determined that the first data packet does not comply with one of the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule, forwarding the first data packet to the network protocol stack for processing.
As shown in fig. 7, the service processor further includes a network card driver module and a network protocol stack. And if the filtering module of the network coprocessor determines that the first data packet does not conform to the forwarding rule, the first data packet is sent to the network card driving module, then the network card driving module sends the first data packet to the network protocol stack, and the network protocol stack repacks the first data packet to obtain a third data packet.
The network protocol stack may also generate second packet information from the third data packet, and then send the second packet information to the application program of the service processor, and the application program notifies the user of the second packet information.
In the above embodiment, the service processor acquires the address information corresponding to the target terminal, adds the forwarding rule in the preset forwarding rule list according to the address information, and sends the address information to the media processor, so that the media processor can perform address setting according to the address information and process the data to be sent according to the address setting to obtain the first data packet. Then, the service processor receives a first data packet sent by the media processor; determining whether the first data packet conforms to a preset forwarding rule; if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet; sending the second data packet to the target terminal; and if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port filtering rule, forwarding the first data packet to a network protocol stack for processing. Through the embodiment of the disclosure, the service processor can forward data according to the forwarding rule, thereby improving the forwarding efficiency and the performance of the service processor, and can also forward data by using a network protocol stack, thereby ensuring that the data forwarding is normally performed.
It should be understood that, although the steps in the flowcharts of fig. 2 to 6 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 to 6 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 8, there is provided a data forwarding apparatus applied to a service processor, the apparatus including:
a data receiving module 501, configured to receive a first data packet sent by a media processor;
a rule determining module 502, configured to determine whether the first data packet meets a preset forwarding rule;
the verification processing module 503 is configured to, if it is determined that the first data packet meets the forwarding rule, perform address verification processing on the first data packet to obtain a second data packet;
and a data sending module 504, configured to send the second data packet to the target terminal.
In one embodiment, the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port Port filtering rules; the rule determining module 502 is specifically configured to filter the first data packet in sequence according to the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule, and determine whether the first data packet meets the forwarding rule.
In one embodiment, the rule determining module 502 is specifically configured to perform MAC address filtering processing on the first data packet according to a MAC address filtering rule; if the first data packet is determined to accord with the MAC address filtering rule, carrying out IP address filtering processing on the first data packet according to the IP address filtering rule; if the first data packet is determined to accord with the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule; and if the first data packet is determined to accord with the Port filtering rule, determining that the first data packet accords with the forwarding rule.
In one embodiment, the apparatus further comprises:
and the protocol stack processing module is used for forwarding the first data packet to a network protocol stack for processing if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port Port filtering rule.
In one embodiment, the check processing module 503 is specifically configured to modify a source address of the first data packet, and perform a sum check and a cyclic redundancy check on the first data packet to obtain a second data packet.
In one embodiment, the apparatus further comprises:
the address acquisition module is used for acquiring address information corresponding to the target terminal; wherein, the address information comprises at least one of a target MAC address, a target IP address, a target Port and a target transmission protocol;
and the rule adding module is used for adding the forwarding rule in a preset forwarding rule list according to the address information.
In one embodiment, the apparatus further comprises:
and the address forwarding module is used for sending the address information to the media processor so that the media processor can carry out address setting according to the address information and process the data to be sent according to the address setting to obtain a first data packet.
For specific limitations of the data forwarding apparatus, reference may be made to the above limitations of the data forwarding method, which is not described herein again. The respective modules in the data forwarding apparatus may be implemented wholly or partially by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data forwarding data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data forwarding method.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a first data packet sent by a media processor;
determining whether the first data packet conforms to a preset forwarding rule;
if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet;
and sending the second data packet to the target terminal.
In one embodiment, the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port filtering rules, and the processor when executing the computer program further performs the steps of:
and sequentially filtering the first data packet according to the MAC address filtering rule, the IP address filtering rule and the Port filtering rule to determine whether the first data packet conforms to the forwarding rule.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
performing MAC address filtering processing on the first data packet according to the MAC address filtering rule;
if the first data packet is determined to accord with the MAC address filtering rule, carrying out IP address filtering processing on the first data packet according to the IP address filtering rule;
if the first data packet is determined to accord with the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule;
and if the first data packet is determined to accord with the Port filtering rule, determining that the first data packet accords with the forwarding rule.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port filtering rule, forwarding the first data packet to a network protocol stack for processing.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and modifying the source address of the first data packet, and carrying out sum check and cyclic redundancy check on the first data packet to obtain a second data packet.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring address information corresponding to a target terminal; wherein, the address information comprises at least one of a target MAC address, a target IP address, a target Port and a target transmission protocol;
and adding a forwarding rule in a preset forwarding rule list according to the address information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and sending the address information to a media processor for the media processor to carry out address setting according to the address information and process data to be sent according to the address setting to obtain a first data packet.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a first data packet sent by a media processor;
determining whether the first data packet conforms to a preset forwarding rule;
if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet;
and sending the second data packet to the target terminal.
In one embodiment, the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port filtering rules, and the computer program when executed by the processor further performs the steps of:
and sequentially filtering the first data packet according to the MAC address filtering rule, the IP address filtering rule and the Port filtering rule to determine whether the first data packet conforms to the forwarding rule.
In one embodiment, the computer program when executed by the processor further performs the steps of:
performing MAC address filtering processing on the first data packet according to the MAC address filtering rule;
if the first data packet is determined to accord with the MAC address filtering rule, carrying out IP address filtering processing on the first data packet according to the IP address filtering rule;
if the first data packet is determined to accord with the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule;
and if the first data packet is determined to accord with the Port filtering rule, determining that the first data packet accords with the forwarding rule.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port filtering rule, forwarding the first data packet to a network protocol stack for processing.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and modifying the source address of the first data packet, and carrying out sum check and cyclic redundancy check on the first data packet to obtain a second data packet.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring address information corresponding to a target terminal; wherein, the address information comprises at least one of a target MAC address, a target IP address, a target Port and a target transmission protocol;
and adding a forwarding rule in a preset forwarding rule list according to the address information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and sending the address information to a media processor for the media processor to carry out address setting according to the address information and process data to be sent according to the address setting to obtain a first data packet.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A data forwarding method applied to a service processor, the method comprising:
receiving a first data packet sent by a media processor;
determining whether the first data packet conforms to a preset forwarding rule;
if the first data packet is determined to accord with the forwarding rule, performing address verification processing on the first data packet to obtain a second data packet;
and sending the second data packet to a target terminal.
2. The method of claim 1, wherein the forwarding rules include MAC address filtering rules, IP address filtering rules, and Port filtering rules; the determining whether the first data packet conforms to a preset forwarding rule includes:
and sequentially filtering the first data packet according to the MAC address filtering rule, the IP address filtering rule and the Port filtering rule to determine whether the first data packet conforms to the forwarding rule.
3. The method of claim 2, wherein said sequentially filtering the first packet according to the MAC address filtering rule, the IP address filtering rule, and the Port filtering rule to determine whether the first packet complies with the forwarding rule comprises:
performing MAC address filtering processing on the first data packet according to the MAC address filtering rule;
if the first data packet is determined to accord with the MAC address filtering rule, carrying out IP address filtering processing on the first data packet according to the IP address filtering rule;
if the first data packet is determined to accord with the IP address filtering rule, performing Port filtering processing on the first data packet according to the Port filtering rule;
if the first data packet is determined to accord with the Port filtering rule, determining that the first data packet accords with the forwarding rule.
4. The method of claim 3, further comprising:
and if the first data packet is determined not to accord with one of the MAC address filtering rule, the IP address filtering rule and the Port filtering rule, forwarding the first data packet to a network protocol stack for processing.
5. The method of claim 1, wherein performing the address check processing on the first packet to obtain a second packet comprises:
and modifying the source address of the first data packet, and carrying out sum check and cyclic redundancy check on the first data packet to obtain the second data packet.
6. The method of claim 1, wherein prior to receiving the first packet transmitted by the media processor, the method further comprises:
acquiring address information corresponding to the target terminal; wherein the address information comprises at least one of a target MAC address, a target IP address, a target Port and a target transport protocol;
and adding the forwarding rule in a preset forwarding rule list according to the address information.
7. The method of claim 6, further comprising:
and sending the address information to the media processor, so that the media processor can carry out address setting according to the address information and process data to be sent according to the address setting to obtain the first data packet.
8. A data forwarding apparatus, characterized in that the apparatus comprises:
the data receiving module is used for receiving a first data packet sent by the media processor;
a rule determining module, configured to determine whether the first data packet meets a preset forwarding rule;
the verification processing module is used for carrying out address verification processing on the first data packet to obtain a second data packet if the first data packet is determined to accord with the forwarding rule;
and the data sending module is used for sending the second data packet to a target terminal.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110849794.9A 2021-07-27 2021-07-27 Data forwarding method and device, computer equipment and storage medium Pending CN113612963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110849794.9A CN113612963A (en) 2021-07-27 2021-07-27 Data forwarding method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110849794.9A CN113612963A (en) 2021-07-27 2021-07-27 Data forwarding method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113612963A true CN113612963A (en) 2021-11-05

Family

ID=78338422

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110849794.9A Pending CN113612963A (en) 2021-07-27 2021-07-27 Data forwarding method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113612963A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924050A (en) * 2018-06-29 2018-11-30 优刻得科技股份有限公司 Data forwarding method and its device, storage medium and network card equipment
CN110519009A (en) * 2019-08-05 2019-11-29 视联动力信息技术股份有限公司 A kind of data pack transmission method and device
CN110650092A (en) * 2019-09-24 2020-01-03 网易(杭州)网络有限公司 Data processing method and device
CN111756636A (en) * 2019-03-29 2020-10-09 杭州海康威视数字技术股份有限公司 Data packet processing method, device and equipment and storage medium
CN112383801A (en) * 2020-11-10 2021-02-19 重庆紫光华山智安科技有限公司 Media stream distribution method, device, distribution server and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924050A (en) * 2018-06-29 2018-11-30 优刻得科技股份有限公司 Data forwarding method and its device, storage medium and network card equipment
CN111756636A (en) * 2019-03-29 2020-10-09 杭州海康威视数字技术股份有限公司 Data packet processing method, device and equipment and storage medium
CN110519009A (en) * 2019-08-05 2019-11-29 视联动力信息技术股份有限公司 A kind of data pack transmission method and device
CN110650092A (en) * 2019-09-24 2020-01-03 网易(杭州)网络有限公司 Data processing method and device
CN112383801A (en) * 2020-11-10 2021-02-19 重庆紫光华山智安科技有限公司 Media stream distribution method, device, distribution server and storage medium

Similar Documents

Publication Publication Date Title
US7529242B1 (en) Routing network packets for multi-processor network flow analysis
CN106878194B (en) Message processing method and device
WO2019075978A1 (en) Data transmission method and apparatus, computer device, and storage medium
CN108768866B (en) Cross-card forwarding method and device for multicast message, network equipment and readable storage medium
CN110020043B (en) Page crawling method, device, storage medium and processor
US8539089B2 (en) System and method for vertical perimeter protection
CN109088957B (en) NAT rule management method, device and equipment
WO2023050933A1 (en) Method and apparatus for determining lost host
CN112491659A (en) Flow playback test method and device, computer equipment and storage medium
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
US11070614B2 (en) Load balancing method and related apparatus
CN108389124B (en) Data processing method, data processing device, computer equipment and storage medium
CN108259348A (en) A kind of message transmitting method and device
CN113452778A (en) Session keeping method, device, equipment, system and storage medium
CN113612963A (en) Data forwarding method and device, computer equipment and storage medium
CN116846669A (en) Network traffic processing method, device, computer equipment, storage medium and product
CN108173892B (en) Cloud mirror image operation method and device
CN114979090A (en) IPv6 data packet processing method, device, computer equipment and storage medium
JP2023522785A (en) Harmony Comprehensive Proxy Service
US20050125539A1 (en) Multi-threaded accept mechanism in a vertical perimeter communication environment
CN115102805B (en) Virtual tunnel processing method, device, computer equipment and storage medium
CN114793217B (en) Intelligent network card, data forwarding method and device and electronic equipment
CN114285661B (en) Private network access method, device, equipment and storage medium
CN113098954B (en) Message forwarding method and device, computer equipment and storage medium
CN107943539A (en) Five application page starts methods and applications page starter

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