CN117499307A - Message forwarding method and device, FPGA and voice communication equipment - Google Patents
Message forwarding method and device, FPGA and voice communication equipment Download PDFInfo
- Publication number
- CN117499307A CN117499307A CN202210886272.0A CN202210886272A CN117499307A CN 117499307 A CN117499307 A CN 117499307A CN 202210886272 A CN202210886272 A CN 202210886272A CN 117499307 A CN117499307 A CN 117499307A
- Authority
- CN
- China
- Prior art keywords
- mac address
- message
- voice communication
- udp port
- ethernet message
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/10—Architectures or entities
- H04L65/1016—IP multimedia subsystem [IMS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/80—Responding to QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the technical field of communication and provides a message forwarding method, a message forwarding device, an FPGA and voice communication equipment. The FPGA in the voice communication equipment is electrically continuous with the exchange chip, and the FPGA analyzes the received Ethernet message sent by the exchange chip to obtain the VLAN number and the UDP port number of the Ethernet message; starting a message sending flow, and modifying VLAN numbers and MAC addresses of the Ethernet messages according to VLAN numbers and UDP port numbers before sending the messages; and then the modified Ethernet message is sent to the switching chip so as to enable the switching chip to forward. The address modification is completed in the interval of the Ethernet message transmission, and no extra time is needed for data processing, so that delay is avoided, and the efficient forwarding of the message is realized.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for forwarding a message, an FPGA, and a voice communication device.
Background
In voice communication devices based on voice over IP (Voice Over Internet Protocol, VOIP), the voice data is typically transmitted using ethernet and Real-time transport protocol (Real-time Transport Protocol, RTP), which may involve the forwarding of RTP messages. At present, the existing voice communication equipment has the problems of data delay and low forwarding efficiency.
Disclosure of Invention
In view of the above, the present invention aims to provide a method, a device, an FPGA and a voice communication apparatus for forwarding a message.
In order to achieve the above object, the technical scheme adopted by the embodiment of the invention is as follows:
in a first aspect, the present invention provides a method for forwarding a message, which is applied to an FPGA in a voice communication device, where the voice communication device further includes a switching chip electrically connected to the FPGA, and the method includes:
analyzing the received Ethernet message sent by the switching chip to obtain the VLAN number and UDP port number of the Ethernet message;
starting a message sending flow, and modifying VLAN numbers and MAC addresses of the Ethernet message according to the VLAN numbers and the UDP port numbers in the starting process;
and sending the modified Ethernet message to the switching chip so as to enable the switching chip to forward.
In an optional embodiment, the step of analyzing the received ethernet packet sent by the switch chip to obtain a VLAN number and a UDP port number of the ethernet packet includes:
performing serial-parallel conversion on the received Ethernet message;
and analyzing the Ethernet message after serial-parallel conversion to obtain the VLAN number and UDP port number of the Ethernet message.
In an alternative embodiment, the MAC address includes a source MAC address and a destination MAC address;
the step of modifying the VLAN number and the MAC address of the ethernet packet according to the VLAN number and the UDP port number includes:
when the VLAN number comprises a sending identifier, respectively modifying the VLAN number and the source MAC address of the Ethernet message into a designated sending port number of the voice communication equipment and the MAC address of the voice communication equipment.
In an alternative embodiment, the MAC address includes a source MAC address and a destination MAC address;
the step of modifying the VLAN number and the MAC address of the ethernet packet according to the VLAN number and the UDP port number includes:
when the VLAN number comprises a receiving identifier, according to the UDP port number, respectively modifying the VLAN number and the destination MAC address of the Ethernet message into the VLAN number and the MAC address corresponding to the destination digital processing unit in the voice communication equipment.
In an optional implementation manner, the FPGA pre-stores correspondence between a plurality of UDP port number intervals, where each correspondence includes a VLAN number of a switch port of a switch chip connected to a destination digital processing unit corresponding to each UDP port number interval and a MAC address of the destination digital processing unit;
the step of respectively modifying the VLAN number and the destination MAC address of the ethernet packet to the VLAN number and the MAC address corresponding to the address of the destination digital processing unit in the voice communication device according to the UDP port number includes:
determining a target UDP port number interval to which the UDP port number belongs;
modifying the VLAN number of the Ethernet message into the VLAN number of the switching port of the switching chip connected with the target digital processing unit corresponding to the target UDP port number interval;
and modifying the destination MAC address of the Ethernet message into the MAC address of the destination digital processing unit corresponding to the target UDP port number interval.
In an alternative embodiment, the MAC address includes a source MAC address and a destination MAC address;
the step of sending the modified ethernet message to the switch chip to enable the switch chip to forward includes:
if the VLAN number and the source MAC address are modified, the modified Ethernet message is subjected to parallel-serial conversion and then sent to the switching chip, so that the switching chip forwards the modified Ethernet message to other voice communication equipment corresponding to the destination MAC address of the Ethernet message.
In an alternative embodiment, the MAC address includes a source MAC address and a destination MAC address;
the step of sending the modified ethernet message to the switch chip to enable the switch chip to forward includes:
if the VLAN number and the destination MAC address are modified, the modified Ethernet message is subjected to parallel-serial conversion and then sent to the switching chip, so that the switching chip forwards the modified Ethernet message to a digital processing unit corresponding to the modified VLAN number and the modified destination MAC address in the voice communication equipment.
In a second aspect, the present invention provides a message forwarding apparatus, applied to an FPGA in a voice communication device, where the voice communication device further includes a switching chip electrically connected to the FPGA, the apparatus includes:
the analyzing module is used for analyzing the received Ethernet message sent by the switching chip to obtain the VLAN number and the UDP port number of the Ethernet message;
the conversion module is used for starting a message sending flow and modifying the VLAN number and the MAC address of the Ethernet message according to the VLAN number and the UDP port number before sending the message;
and the sending module is used for sending the modified Ethernet message to the switching chip so as to enable the switching chip to forward.
In a third aspect, the present invention provides an FPGA for implementing the method of any of the preceding embodiments.
In a fourth aspect, the present invention provides a voice communication device, where the voice communication device includes a switch chip and the FPGA described in the foregoing embodiment.
According to the message forwarding method, the message forwarding device, the FPGA and the voice communication equipment, the FPGA in the voice communication equipment is electrically continuous with the exchange chip, and the FPGA analyzes the received Ethernet message sent by the exchange chip to obtain the VLAN number and the UDP port number of the Ethernet message; starting a message sending flow, and modifying VLAN numbers and MAC addresses of the Ethernet messages according to VLAN numbers and UDP port numbers before sending the messages; and then the modified Ethernet message is sent to the switching chip so as to enable the switching chip to forward. Compared with the prior art, the address modification is completed in the interval of the Ethernet message transmission, and no extra time is needed for data processing, so that delay is avoided, and the efficient forwarding of the message is realized.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows an exemplary diagram of an application scenario provided by an embodiment of the present invention;
FIG. 2 is a block diagram of a voice communication device according to an embodiment of the present invention;
fig. 3 shows one of flow diagrams of a message forwarding method according to an embodiment of the present invention;
fig. 4 is a diagram illustrating an example of a message structure of an ethernet message according to an embodiment of the present invention;
fig. 5 shows a second flowchart of a message forwarding method according to an embodiment of the present invention;
fig. 6 illustrates one example diagram of a message forwarding method provided by an embodiment of the present invention;
fig. 7 shows a second exemplary diagram of a message forwarding method according to an embodiment of the present invention;
fig. 8 is a functional block diagram of a packet forwarding device according to an embodiment of the present invention.
Icon: 110-a processor; 120-memory; 130-a communication module; 140-FPGA; 150-switching chips; 300-message forwarding device; 310-a parsing module; 330 a conversion module; 350-a transmitting module.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
It is noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Fig. 1 is an exemplary diagram of an application scenario provided in an embodiment of the present invention, where the application scenario includes two communication connected voice communication devices. It should be understood that fig. 1 is only an example, and that the application scenario may also include a plurality of voice communication devices.
The voice communication device may be a VOIP device, and the Real-time transmission of voice data is achieved through ethernet and a Real-time transmission protocol (Real-time Transport Protocol, RTP), which generally involves the forwarding of RTP messages. At present, a CPU is used to process voice data and forward messages, but the performance requirement of the CPU is high. There are also ways to process voice data using a dedicated chip, such as a DSP, which requires modification of the media access control (Media Access Control, MAC) address.
The inventor researches and discovers that the related technology adopts a plurality of buffer areas to realize the modification of the MAC address, and the problems of data delay and low forwarding efficiency exist because the transmission of voice data has high requirements on real-time property. Furthermore, the embodiment of the invention provides a message forwarding method to solve the problems.
Fig. 2 is a block diagram of a voice communication device according to an embodiment of the present invention. The voice communication device includes a processor 110, a memory 120, a communication module 130, an FPGA140, and a switch chip 150, where the elements are directly or indirectly electrically connected to each other to implement data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The processor 110 is configured to read/write data or programs stored in the memory, and perform corresponding functions.
The memory 120 is used to store programs or data. The Memory 120 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM).
The communication module 130 is used for communicating signaling or data with other node devices.
The FPGA140 is configured to implement the message forwarding method provided by the embodiment of the present invention, and may implement MAC address modification.
The switch chip 150 is configured to forward the modified message.
Optionally, the voice communication device may also include a plurality of voice processing chips, such as a DSP, each including a plurality of digital processing units, such as a core of the DSP.
It will be appreciated that the configuration shown in fig. 2 is merely a schematic diagram of a voice communication device, and that the voice communication device may also include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
Referring to fig. 3, fig. 3 is a flow chart of a forwarding method according to an embodiment of the present invention.
Step S202, analyzing the received Ethernet message sent by the exchange chip to obtain VLAN number and UDP port number of the Ethernet message;
wherein VLAN is Virtual Local Area Network, virtual local area network. UDP, user Datagram Protocol, user datagram protocol, UDP port number indicates the destination port.
In this embodiment, the FPGA is electrically connected to the switching chip, the switching chip sends an ethernet packet to the FPGA, and the FPGA receives and parses the ethernet packet to obtain a VLAN number and a UDP port number in the ethernet packet.
Step S204, a message sending flow is started, and the VLAN number and the MAC address of the Ethernet message are modified according to the VLAN number and the UDP port number before the message is sent;
it can be understood that the ethernet message is periodically sent at a set interval, so as to avoid delay caused by modification of the MAC address, in this embodiment, after the ethernet message is parsed, a message sending flow is started, and address modification is completed before the message is sent, that is, the VLAN number and the MAC address in the ethernet message are modified according to the VLAN number and the UDP port number at the tail of the same message data.
It can be understood that the message sending flow and the address modification are two threads, and the embodiment of the invention uses the interval of message sending to implement the address modification, so that no extra delay is caused.
Step S206, the modified Ethernet message is sent to the exchange chip to make the exchange chip forward;
in this embodiment, the modified ethernet packet is obtained after the VLAN number and the MAC address are modified, and then the modified ethernet packet is sent to the switch chip, so that the switch chip forwards the modified ethernet packet.
Based on the steps, the FPGA in the voice communication equipment is electrically continuous with the exchange chip, and the FPGA analyzes the received Ethernet message sent by the exchange chip to obtain the VLAN number and the UDP port number of the Ethernet message; starting a message sending flow, and modifying VLAN numbers and MAC addresses of the Ethernet messages according to VLAN numbers and UDP port numbers before sending the messages; and then the modified Ethernet message is sent to the switching chip so as to enable the switching chip to forward. Compared with the prior art, the address modification is completed in the interval of the Ethernet message transmission, and no extra time is needed for data processing, so that delay is avoided, and the efficient forwarding of the message is realized.
Optionally, in order to further improve forwarding efficiency, for the step S202 described above, a possible implementation manner is provided in an embodiment of the present invention.
Step S202-1, serial-parallel conversion is carried out on a received Ethernet message;
and S202-3, analyzing the Ethernet message after serial-parallel conversion to obtain the VLAN number and the UDP port number of the Ethernet message.
In this embodiment, the FPGA may perform serial-parallel conversion on the received ethernet packet, that is, converting serial ethernet packet data into internal parallel data; and then analyzing the Ethernet message after serial-parallel conversion to obtain a start mark and an end mark, namely a data head and a data tail of the message data.
The VLAN number and UDP port number in the Ethernet message can be extracted according to the initial mark; the VLAN number and the UDP port number may also be extracted from the corresponding locations according to the packet structure of the ethernet packet.
It can be understood that if the ethernet message is input to the FPGA to be converted in parallel, the FPGA needs to convert the ethernet message in parallel and then send the converted ethernet message to the switching chip.
It can be seen that the VLAN number and the UDP port number of the ethernet packet are obtained by performing serial-to-parallel conversion on the received ethernet packet and then analyzing the ethernet packet after serial-to-parallel conversion.
Optionally, the MAC address includes a source MAC address and a destination MAC address, where the source MAC address represents a MAC address of the message sender, and the destination MAC address represents a MAC address of the message receiver. Further, the embodiment of the invention provides a message structure example diagram of the Ethernet message.
Referring to fig. 4, the message structure of the ethernet message provided in the embodiment of the present invention includes a start identifier, voice data, a UDP port number, a VLAN number, a source MAC address, a destination MAC address, and an end flag. The message forwarding method provided by the embodiment of the present invention will be described below based on the message structure shown in fig. 4.
Alternatively, for the step S204, two possible implementations are provided in the embodiment of the present invention, and referring to fig. 5, the first implementation is described first.
Step S204A, when VLAN number includes sending identification, VLAN number and source MAC address of Ethernet message are modified to appointed sending port number of voice communication equipment and MAC address of voice communication equipment respectively;
in this embodiment, a transmission flag may be set in advance, for example, the transmission flag is denoted by a. It should be understood that the transmission identifier may be set according to practical applications, and embodiments of the present invention are not limited.
If the VLAN number in the ethernet packet includes a transmission identifier, i.e., a, indicating that the current voice communication device is a packet transmitting end, the VLAN number and the source MAC address need to be modified, i.e., the VLAN number is modified to a designated transmitting port number of the voice communication device, and the source MAC address is modified to the MAC address of the voice communication device.
Based on the VLAN number and source MAC address modified in step S204A, one possible implementation is provided for the above-described step S206 embodiment of the present invention.
In step S206A, if the modified VLAN number and the source MAC address are modified, the modified ethernet packet is parallel-to-serial converted and then sent to the switch chip, so that the switch chip forwards the ethernet packet to other voice communication devices corresponding to the destination MAC address of the ethernet packet.
In this embodiment, if the VLAN number and the source MAC address are modified, which indicates that the current voice communication device is a message transmitting end, that is, an ethernet message needs to be transmitted to other voice communication devices, the FPGA performs parallel-serial conversion on the modified ethernet message (converts internal parallel data into ethernet serial data) and then transmits the ethernet serial data to the switch chip; and then the exchange chip forwards the target MAC address in the Ethernet message to other voice communication equipment corresponding to the target MAC address.
For ease of understanding, an exemplary diagram is provided, with reference to FIG. 6. Including a voice communication device 1 and a voice communication device 2. The above-described step S204A and step 206A will be described below based on the voice communication apparatus 1.
The FPAG of the voice communication apparatus 1 parses the ethernet packet received from the exchange chip of the apparatus to obtain the VLAN number therein, and discovers that the VLAN number is the preset transmission identifier a, which indicates that the current voice communication apparatus 1 is a packet transmitting end, that is, the voice communication apparatus 1 transmits the ethernet packet to the voice communication apparatus 2.
At this time, the destination MAC address in the ethernet packet received by the FPAG is the MAC address of the voice communication device 2, and the source MAC address is the MAC address of a certain digital processing unit in the voice communication device 1, so that the FPGA needs to modify the VLAN number into the designated transmission port number of the voice communication device 1, so as to send the packet from the designated transmission port number to the voice communication device 2; and modifies the source MAC address to the MAC address of the voice communication device 1 so that the voice communication device 2 knows that the ethernet message was sent by the voice communication device 1.
The FPAG converts the modified ethernet message in parallel and serial, and sends the converted ethernet message to the switching chip, and the switching chip forwards the message according to the destination MAC address in the ethernet message, i.e. forwards the message to the voice communication device 2.
Referring to fig. 5, a second implementation of the step S204 is described below.
Step S204B, when the VLAN number comprises a receiving identifier, according to the UDP port number, respectively modifying the VLAN number and the destination MAC address of the Ethernet message into the VLAN number and the MAC address corresponding to the destination digital processing unit in the voice communication equipment;
in this embodiment, the reception identifier may be set in advance, for example, the reception identifier is denoted by B. It should be understood that the receiving identifier may be set according to practical applications, and embodiments of the present invention are not limited.
If the VLAN number in the Ethernet message comprises a receiving identifier, namely B, which indicates that the current voice communication equipment is a message receiving end, the VLAN number and the destination MAC address need to be modified, namely, the VLAN number and the destination MAC address of the Ethernet message are respectively modified into the VLAN number and the MAC address corresponding to the destination digital processing unit in the voice communication equipment according to the UDP port number.
The embodiment of the invention provides a possible implementation way for modifying the VLAN number and the destination MAC address of the Ethernet message according to the UDP port number.
Step S204B-1, determining a target UDP port number interval to which the UDP port number belongs;
in this embodiment, the FPGA configures an address conversion table in advance based on a start UDP port number, a section length, a VLAN number, and a destination MAC address provided by the CPU, where the address conversion table includes a correspondence between a designated transmission port number of the voice communication device, a MAC address of the voice communication device, and a plurality of UDP port number sections, and each correspondence includes a VLAN number of a switch port of a switch chip to which a destination digital processing unit corresponding to each UDP port number section is connected and a MAC address of the destination digital processing unit.
And the FPGA selects a target UDP port number interval to which the FPGA belongs from all UDP port number intervals according to the UDP port number in the received Ethernet message.
Step S204B-3, modifying the VLAN number of the Ethernet message into the VLAN number of the switching port of the switching chip connected with the destination digital processing unit corresponding to the destination UDP port number interval;
step S204B-5, the destination MAC address of the Ethernet message is modified to the MAC address of the destination digital processing unit corresponding to the destination UDP port number interval.
In this embodiment, the FPGA obtains the VLAN number and the MAC address corresponding to the target UDP port number interval based on the obtained target UDP port number interval, modifies the VLAN number in the ethernet packet to the VLAN number corresponding to the target UDP port number interval, and modifies the destination MAC address in the ethernet packet to the MAC address corresponding to the target UDP port number interval.
Based on the VLAN number and destination MAC address modified in step S204B, one possible implementation is provided for the above-described step S206 embodiment of the present invention.
In step S206B, if the modified VLAN number and the destination MAC address are modified, the modified ethernet packet is parallel-to-serial converted and then sent to the switch chip, so that the switch chip forwards the modified ethernet packet to the digital processing unit in the voice communication device corresponding to the modified VLAN number and the modified destination MAC address.
In this embodiment, if the modified VLAN number and the destination MAC address indicate that the current voice communication device is a message receiving end, that is, receives an ethernet message sent by another voice communication device, the FPGA performs parallel-serial conversion on the modified ethernet message (converts internal parallel data into ethernet serial data) and sends the ethernet message to the switch chip; and then the exchange chip forwards the modified VLAN number and the modified destination MAC address in the Ethernet message to a digital processing unit corresponding to the modified VLAN number and the modified destination MAC address in the voice communication equipment.
For ease of understanding, an exemplary diagram is provided, with reference to FIG. 7. Including a voice communication device 1 and a voice communication device 2. The above-described steps S204B-1 to S204B-5 and step 206B will be described below based on the voice communication apparatus 1.
The FPAG of the voice communication apparatus 1 analyzes the received ethernet message to obtain a VLAN number therein, and discovers that the VLAN number is a preset receiving identifier B, which indicates that the current voice communication apparatus 1 is a message receiving end, that is, the voice communication apparatus 1 receives the ethernet message sent by the voice communication apparatus 2.
At this time, the source MAC address in the ethernet packet received by the FPAG is the MAC address of the voice communication device 2, and the destination MAC address is the MAC address of the voice communication device 1, so that the FPGA needs to modify the VLAN number and the destination MAC address according to the UDP port number, so as to send the voice data in the ethernet packet to the corresponding digital processing unit in the voice communication device 1 for processing.
As shown in the following table, embodiments of the present invention provide an example of an address translation table.
It will be appreciated that multiple UDP port number intervals may correspond to one VLAN number, with each UDP port number interval corresponding to a unique MAC address.
The FPGA determines a target UDP port number interval to which the UDP port number belongs according to the UDP port number in the Ethernet message and all UDP port number intervals in the table. For example, if the UDP port number belongs to the section [ K1, K2] that is, 1 segment, the VLAN number and the MAC address corresponding to the 1 segment, that is, VLAN1 and MAC address 1 are acquired.
The FPGA modifies the VLAN number in the Ethernet message into VLAN1, and modifies the destination MAC address into MAC address 1. It will be understood that VLAN1 represents the VLAN number of the switch port of the switch chip to which the destination digital processing unit is connected, and MAC address 1 represents the MAC address of the destination digital processing unit.
The FPAG sends the modified ethernet message to the exchange chip, and the exchange chip forwards the message according to the modified VLAN number and the modified destination MAC address in the ethernet message, that is, forwards the message to a digital processing unit, such as a core of the DSP, in the voice communication device 1, corresponding to the VLAN1 and the MAC address 1.
In order to perform the corresponding steps in the above embodiments and in each possible manner, an implementation of the message forwarding apparatus is given below. Referring to fig. 8, fig. 8 is a functional block diagram of a message forwarding apparatus 300 according to an embodiment of the present invention. It should be noted that, the basic principle and the technical effects of the message forwarding apparatus 300 provided in this embodiment are the same as those of the foregoing embodiment, and for brevity, reference should be made to the corresponding contents of the foregoing embodiment. The message forwarding apparatus 300 includes:
the parsing module 310 is configured to parse the ethernet packet sent by the received switching chip to obtain a VLAN number and a UDP port number of the ethernet packet;
the conversion module 330 is configured to start a packet sending flow, and modify a VLAN number and a MAC address of the ethernet packet according to the VLAN number and the UDP port number before sending the packet;
and the sending module 350 is configured to send the modified ethernet packet to the switching chip, so that the switching chip forwards the ethernet packet.
Optionally, the parsing module 310 is specifically configured to: performing serial-parallel conversion on the received Ethernet message; and analyzing the Ethernet message after serial-parallel conversion to obtain the VLAN number and UDP port number of the Ethernet message.
Optionally, the MAC address includes a source MAC address and a destination MAC address, and the conversion module 330 is further configured to: when the VLAN number comprises a sending identifier, respectively modifying the VLAN number and a source MAC address of the Ethernet message into a designated sending port number of the voice communication equipment and an MAC address of the voice communication equipment;
optionally, the MAC address includes a source MAC address and a destination MAC address, and the conversion module 330 is further configured to: when the VLAN number comprises a receiving identifier, according to the UDP port number, the VLAN number and the destination MAC address of the Ethernet message are respectively modified into the VLAN number and the MAC address corresponding to the destination digital processing unit in the voice communication equipment.
Optionally, the FPGA pre-stores correspondence between a plurality of UDP port number intervals, where each correspondence includes a VLAN number of a switch port of the switch chip connected to the destination digital processing unit corresponding to each UDP port number interval and a MAC address of the destination digital processing unit; the conversion module 330 is further configured to: determining a target UDP port number interval to which the UDP port number belongs; modifying the VLAN number of the Ethernet message into the VLAN number of the exchange port of the exchange chip connected with the target digital processing unit corresponding to the target UDP port number interval; and modifying the destination MAC address of the Ethernet message into the MAC address of the destination digital processing unit corresponding to the destination UDP port number interval.
Optionally, the MAC address includes a source MAC address and a destination MAC address, and the conversion module 330 is further configured to: if the VLAN number and the source MAC address are modified, the modified Ethernet message is subjected to parallel-serial conversion and then sent to the exchange chip, so that the exchange chip forwards the modified Ethernet message to other voice communication equipment corresponding to the destination MAC address of the Ethernet message.
Optionally, the MAC address includes a source MAC address and a destination MAC address, and the conversion module 330 is further configured to: if the modified VLAN number and the destination MAC address are modified, the modified Ethernet message is subjected to parallel-serial conversion and then sent to the exchange chip, so that the exchange chip is internally sent to a digital processing unit in the voice communication equipment, wherein the digital processing unit corresponds to the modified VLAN number and the modified destination MAC address.
The embodiment of the invention also provides an FPGA for realizing the message forwarding method provided by the embodiment of the invention.
The embodiment of the invention also provides voice communication equipment which comprises the exchange chip and the FPGA provided by the embodiment of the invention.
The embodiment of the invention also provides a storage medium, on which a computer program is stored, which when executed, implements the message forwarding method disclosed by the embodiment of the invention.
In summary, the method, the device, the FPGA and the voice communication device for forwarding the message provided by the embodiment of the invention are provided. Compared with the prior art, the method reduces the occupation of resources, and modifies the MAC address by utilizing the time interval of message transmission, thereby avoiding delay, meeting the real-time requirement of voice data transmission and realizing the efficient forwarding of the message. And the identification is adopted to characterize the sending and receiving of the data, so as to modify the VLAN number and the corresponding MAC address based on the identification, thereby realizing the address modification, avoiding the need of a special exchange chip supporting the function and reducing the cost.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. The message forwarding method is characterized by being applied to an FPGA in voice communication equipment, wherein the voice communication equipment further comprises a switching chip electrically connected with the FPGA, and the method comprises the following steps:
analyzing the received Ethernet message sent by the switching chip to obtain the VLAN number and UDP port number of the Ethernet message;
starting a message sending flow, and modifying the VLAN number and the MAC address of the Ethernet message according to the VLAN number and the UDP port number before sending the message;
and sending the modified Ethernet message to the switching chip so as to enable the switching chip to forward.
2. The method of claim 1, wherein the step of parsing the received ethernet packet sent by the switch chip to obtain a VLAN number and a UDP port number of the ethernet packet includes:
performing serial-parallel conversion on the received Ethernet message;
and analyzing the Ethernet message after serial-parallel conversion to obtain the VLAN number and UDP port number of the Ethernet message.
3. The method of claim 1, wherein the MAC address comprises a source MAC address and a destination MAC address;
the step of modifying the VLAN number and the MAC address of the ethernet packet according to the VLAN number and the UDP port number includes:
when the VLAN number comprises a sending identifier, respectively modifying the VLAN number and the source MAC address of the Ethernet message into a designated sending port number of the voice communication equipment and the MAC address of the voice communication equipment.
4. The method of claim 1, wherein the MAC address comprises a source MAC address and a destination MAC address;
the step of modifying the VLAN number and the MAC address of the ethernet packet according to the VLAN number and the UDP port number includes:
when the VLAN number comprises a receiving identifier, according to the UDP port number, respectively modifying the VLAN number and the destination MAC address of the Ethernet message into the VLAN number and the MAC address corresponding to the destination digital processing unit in the voice communication equipment.
5. The method according to claim 4, wherein the FPGA pre-stores correspondence between a plurality of UDP port number intervals, each correspondence including a VLAN number of a switch port of a switch chip to which a destination digital processing unit corresponding to each UDP port number interval is connected and a MAC address of the destination digital processing unit;
the step of respectively modifying the VLAN number and the destination MAC address of the ethernet packet to the VLAN number and the MAC address corresponding to the destination digital processing unit in the voice communication device according to the UDP port number includes:
determining a target UDP port number interval to which the UDP port number belongs;
modifying the VLAN number of the Ethernet message into the VLAN number of the switching port of the switching chip connected with the target digital processing unit corresponding to the target UDP port number interval;
and modifying the destination MAC address of the Ethernet message into the MAC address of the destination digital processing unit corresponding to the target UDP port number interval.
6. The method of claim 1, wherein the MAC address comprises a source MAC address and a destination MAC address;
the step of sending the modified ethernet message to the switch chip to enable the switch chip to forward includes:
if the VLAN number and the source MAC address are modified, the modified Ethernet message is subjected to parallel-serial conversion and then sent to the switching chip, so that the switching chip forwards the modified Ethernet message to other voice communication equipment corresponding to the destination MAC address of the Ethernet message.
7. The method of claim 1, wherein the MAC address comprises a source MAC address and a destination MAC address;
the step of sending the modified ethernet message to the switch chip to enable the switch chip to forward includes:
if the VLAN number and the destination MAC address are modified, the modified Ethernet message is subjected to parallel-serial conversion and then sent to the switching chip, so that the switching chip forwards the modified Ethernet message to a digital processing unit corresponding to the modified VLAN number and the modified destination MAC address in the voice communication equipment.
8. The message forwarding device is characterized by being applied to an FPGA in voice communication equipment, wherein the voice communication equipment further comprises a switching chip electrically connected with the FPGA, and the device comprises:
the analyzing module is used for analyzing the received Ethernet message sent by the switching chip to obtain the VLAN number and the UDP port number of the Ethernet message;
the conversion module is used for starting a message sending flow and modifying the VLAN number and the MAC address of the Ethernet message according to the VLAN number and the UDP port number before sending the message;
and the sending module is used for sending the modified Ethernet message to the switching chip so as to enable the switching chip to forward.
9. An FPGA for implementing the method of any one of claims 1 to 7.
10. A voice communication device comprising a switching chip and the FPGA of claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210886272.0A CN117499307A (en) | 2022-07-26 | 2022-07-26 | Message forwarding method and device, FPGA and voice communication equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210886272.0A CN117499307A (en) | 2022-07-26 | 2022-07-26 | Message forwarding method and device, FPGA and voice communication equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117499307A true CN117499307A (en) | 2024-02-02 |
Family
ID=89671381
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210886272.0A Pending CN117499307A (en) | 2022-07-26 | 2022-07-26 | Message forwarding method and device, FPGA and voice communication equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117499307A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117792484A (en) * | 2024-02-26 | 2024-03-29 | 南京典格通信科技有限公司 | 5G satellite communication ground terminal service message transmission method |
-
2022
- 2022-07-26 CN CN202210886272.0A patent/CN117499307A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117792484A (en) * | 2024-02-26 | 2024-03-29 | 南京典格通信科技有限公司 | 5G satellite communication ground terminal service message transmission method |
CN117792484B (en) * | 2024-02-26 | 2024-05-10 | 南京典格通信科技有限公司 | 5G satellite communication ground terminal service message transmission method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113364686B (en) | Method for generating forwarding table item, controller and network equipment | |
CN110636001B (en) | Method for sending network performance parameters and calculating network performance and network node | |
US11258698B2 (en) | Multicast forwarding method and related device | |
WO2017054576A1 (en) | Unicast tunnel building method, apparatus and system | |
CN1326281A (en) | Multipoint communication method and device | |
US10791051B2 (en) | System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment | |
CN104022936B (en) | A kind of tunnel establishing method and device | |
US12199867B2 (en) | Method and apparatus for processing DetNet data packet | |
EP2765743A1 (en) | Layer 2 inter-connecting method, apparatus and system based on ipv6 | |
CN110519009B (en) | Data packet transmission method and device | |
CN101631075A (en) | Method for processing message and device thereof | |
CN109587082B (en) | Message asynchronous forwarding system and method based on Linux operating system | |
CN117499307A (en) | Message forwarding method and device, FPGA and voice communication equipment | |
JP2024504466A (en) | Packet forwarding methods, packet processing methods, and devices | |
CN107070719B (en) | Equipment management method and device | |
CN103327129A (en) | Domain name analyticmethod for multi-WAN-port gateway device | |
CN104796340A (en) | Multicast data transmission method and device | |
EP3503484B1 (en) | Message transmission methods and devices | |
CN103401788B (en) | A kind of SPT method for building up and equipment | |
CN111600798B (en) | Method and equipment for sending and obtaining assertion message | |
CN114301993B (en) | Data transmission method, device, terminal equipment and storage medium | |
CN114189721B (en) | Video stream forwarding system and method for converter station | |
CN108809795A (en) | Transparent shunt method and device in a kind of LAN environment | |
WO2014169590A1 (en) | Data service communication method, device, and system | |
US11251993B2 (en) | Gateway apparatus, message transmission method, and program |
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 |