WO2024001340A1 - Multicast packet duplication method and apparatus, storage medium, and electronic apparatus - Google Patents

Multicast packet duplication method and apparatus, storage medium, and electronic apparatus Download PDF

Info

Publication number
WO2024001340A1
WO2024001340A1 PCT/CN2023/083747 CN2023083747W WO2024001340A1 WO 2024001340 A1 WO2024001340 A1 WO 2024001340A1 CN 2023083747 W CN2023083747 W CN 2023083747W WO 2024001340 A1 WO2024001340 A1 WO 2024001340A1
Authority
WO
WIPO (PCT)
Prior art keywords
multicast
packet
multicast packet
replication
information
Prior art date
Application number
PCT/CN2023/083747
Other languages
French (fr)
Chinese (zh)
Inventor
王璞
刘衡祁
张自渊
唐美芹
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2024001340A1 publication Critical patent/WO2024001340A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • 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/15Flow control; Congestion control in relation to multipoint traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/52Queue scheduling by attributing bandwidth to queues

Definitions

  • Embodiments of the present application relate to the field of communications, and specifically, to a multicast packet copying method and device, a storage medium, and an electronic device.
  • Embodiments of the present application provide a multicast packet copying method and device, a storage medium, and an electronic device to at least solve the problem in related technologies that the multicast table lookup delay is greater than the time it takes to copy the multicast packet once. Achieve full line-speed replication, thereby causing technical problems of bandwidth waste.
  • a method for copying a multicast packet includes: storing the multicast packet to be copied in a multicast packet copy queue; and determining the target pointer from the multicast package copy queue.
  • Point to the first multicast packet to be copied where the above-mentioned multicast packet copy queue includes at least two multicast packets to be copied; search for the multicast member information of the above-mentioned first multicast packet, and obtain the above-mentioned first multicast packet The first multicast copy information of the packet; while waiting to receive the multicast member information of the above-mentioned first multicast packet, point the above-mentioned target pointer to the next second multicast packet to be copied to obtain the above-mentioned second multicast packet.
  • multicast replication information upon receiving all multicast member information of the first multicast packet, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
  • a device for copying multicast packets including: a storage module for storing multicast packets to be copied into a multicast packet copy queue; and a determination module for starting from The first multicast packet to be copied pointed to by the target pointer is determined in the above-mentioned multicast packet copy queue, wherein the above-mentioned multicast packet copy queue includes at least two multicast packets to be copied; the search module is used to find the above-mentioned third multicast packet.
  • Multicast member information of the multicast packet and obtain the first multicast copy information of the above-mentioned first multicast packet;
  • the acquisition module is used to obtain the above-mentioned multicast member information while waiting to receive the multicast member information of the above-mentioned first multicast packet.
  • the target pointer points to the next second multicast packet to be copied to obtain the multicast copy information of the above-mentioned second multicast packet;
  • the removal module is used when all the multicast member information of the above-mentioned first multicast packet is received.
  • the first multicast packet carrying the first multicast replication information is moved out of the multicast packet replication queue.
  • a computer-readable storage medium is also provided, wherein the computer-readable storage medium A computer program is stored in the medium, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
  • an electronic device including a memory and a processor.
  • a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above. Steps in method embodiments.
  • the multicast packets to be copied can query multicast member information in turn, there is no need to wait for the completion of copying the previous packet.
  • Figure 1 is a schematic diagram of the system structure of an optional multicast packet copying method according to an embodiment of the present application
  • Figure 2 is a schematic diagram of an optional multicast packet copying method according to an embodiment of the present application.
  • Figure 3 is a flow chart of an optional multicast packet copying method according to an embodiment of the present application.
  • Figure 4 is a schematic diagram of another optional multicast packet copying method according to an embodiment of the present application.
  • Figure 5 is a structural block diagram of an optional multicast packet copying device according to an embodiment of the present application.
  • the multicast packet copying method can be applied to, but is not limited to, the system structure as shown in Figure 1 .
  • the system includes an "address generation device 101", a “message order preserving device 102", a “message inspection device 103", a “multicast copying device 104" and a "net charge storage device 105".
  • Address generation device 101 manages a set of linked lists of storage addresses, and the storage addresses correspond to the payload storage addresses in the payload storage device.
  • the address generation device 101 allocates an address to the multicast packet and stores the multicast packet payload data in the corresponding address space in the payload storage device 105 .
  • the multicast packet carrying only the necessary packet descriptor information such as the multicast packet storage address and multicast identifier is used instead of the multicast packet for processing in other devices.
  • Message sequence preserving device 102 used to restore the arrangement order between the internal cells of the multicast packet and the multicast packet. In this way, in the subsequent multicast replication device 104, the replication behavior of all cells in the same multicast packet can be guaranteed to be the same, and multicast packets can be avoided. Copy out of order.
  • Message checking device 103 used to check whether the message descriptor information carried in the multicast packet is true and correct. Multicast packets with errors in the check will be discarded directly. In this way, in the subsequent multicast duplication device 104, it can be ensured that the multicast packets participating in the duplication are correct multicast packets, and the duplication of erroneous multicast packets can be avoided to waste bandwidth ineffectively.
  • Payload storage device 105 used to store payload information of multicast packets.
  • the multicast packet needs to extract the storage address allocated by the address generation device 101 and send it to the payload storage device, thereby extracting the multicast packet payload. Subsequently, the complete multicast packet can be output from the system carrying multicast replication information.
  • the multicast replication device 104 includes a multicast replication queue management device 203, a multicast replication table lookup device 202, a multicast replication modification device 201, and a multicast address recovery device 204.
  • the multicast packet to be copied first enters the multicast copy queue management device 203 and is queued to wait for copying.
  • the multicast identifier is extracted from the first cell of the packet and sent to the multicast copy table lookup device 202 to query the multicast copy. information.
  • the multicast packet can carry the multicast replication information and be output to the system where it is located, and participate in multicast replication port scheduling in the lower-level subsystem.
  • the multicast packets that have completed multicast replication port scheduling are returned to the multicast replication address recovery device 204 along the original route, and then the multicast packets are sent to the payload storage device 105 .
  • the multicast address recycling device 204 will determine whether all the multicast packets have been copied. If all the copies have been completed, the payload storage device 105 will be informed that all cell addresses in the multicast packet can be recycled and can be used. Used by other multicast packets to enter this system.
  • FIG. 3 is a flow chart of a method for copying multicast packets according to an embodiment of the present application. The process includes the following steps:
  • Step S302 Store the multicast packet to be copied in the multicast packet copy queue
  • Step S304 Determine the first multicast packet to be copied pointed to by the target pointer from the multicast packet copy queue, where the multicast packet copy queue includes at least two multicast packets to be copied;
  • Step S306 Search for the multicast member information of the first multicast packet and obtain the first multicast replication information of the first multicast packet;
  • Step S308 While waiting to receive the multicast member information of the first multicast packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast replication information of the second multicast packet;
  • Step S310 When all multicast member information of the first multicast packet is received, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
  • a multicast replication queue is set up for the multicast packets to be copied.
  • the multicast replication queue is composed of several registers. The number of registers should be enough to offset the table lookup delay of one multicast packet. .
  • a table lookup pointer is set for the multicast replication queue.
  • the table lookup pointer initially points to the head of the queue.
  • the table lookup pointer starts to extract the multicast packet first flag from the queue head.
  • the lookup pointer gradually moves backward from the head of the queue to extract the first flag of the multicast packet; when there is output from the multicast replication queue, because the data in the shift register continues to move forward, the position of the table lookup pointer does not change. changes, and continuously extracts the packet first flag from the same register.
  • Multicast replication information may include but is not limited to outbound port number and global encapsulation index number.
  • the multicast packet at the head of the queue is the first to obtain multicast member information.
  • the time interval for other multicast packets to obtain multicast member information is consistent with the time interval for initiating table lookup requests.
  • the address of the next table lookup is also returned. If the address of the next table lookup is the same as the address of this table lookup, it indicates that the group returned this time is
  • the broadcast member information is the last multicast member information.
  • each multicast packet when dequeued, it needs to be determined whether all multicast member information has been found. When the multicast packet has found all multicast member information, the replication can be terminated after dequeuing with this copy information.
  • the multicast packet to be copied is stored in the multicast packet copy queue; the first multicast packet to be copied pointed to by the target pointer is determined from the multicast packet copy queue, where, The multicast packet copy queue includes at least two multicast packets to be copied; searches for the multicast member information of the first multicast packet and obtains the first multicast copy information of the first multicast packet; while waiting to receive the first multicast packet While receiving the multicast member information of the packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast copy information of the second multicast packet; after receiving all multicast members of the first multicast packet In the case of information, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
  • searching for the multicast member information of the first multicast packet includes: extracting the multicast identifier of the first multicast packet from the packet header identifier of the first multicast packet; sending a message based on the first multicast packet.
  • the table lookup pointer detects the multicast packet first flag, the multicast identifier can be extracted from the cell descriptor and copied to the multicast information.
  • the table initiates a read request to query multicast member information.
  • One read request queries the information of one multicast member.
  • This multicast packet integrates the found multicast member information into the message descriptor and can be dequeued.
  • the query request is only related to whether the packet first flag in the register pointed to by the lookup table pointer is valid. If the queue is blocked, the table lookup pointer will continue to move backward until it points to the last register at the end of the queue, and then stop.
  • multicast member information is queried based on the multicast identifier, thereby improving the accuracy of the query.
  • the method further includes: when the currently found multicast member information of the first multicast packet is not the last multicast member information , move the target multicast packet carrying the first multicast copy information out of the multicast packet copy queue, and copy and write the packet body data of the target multicast packet into the target cache, where the multicast packets stored in the target cache will be Re-enter the multicast packet into the copy queue.
  • a target cache fifo is defined.
  • the depth of the target cache fifo should be greater than the number of cells contained in the longest multicast packet. Because the next table lookup address obtained by this multicast packet is different from the current table lookup address, it means that this multicast packet has not found the last multicast member information.
  • the multicast packet is dequeued carrying this copy information, a copy of its packet body data needs to be written into the target cache fifo. For the first cell of the multicast packet written to the target cache fifo, the bit field where the multicast identifier is located needs to be replaced with the next table lookup address. Because the multicast packet content during the multicast replication process only contains address information stored in the payload storage device, the total size of the target cache fifo is very small.
  • the target multicast packet carrying the first multicast copy information is removed from the group.
  • the multicast packet copy queue is copied and the packet body data of the target multicast packet is copied and written into the target cache, ensuring the accuracy of multicast copy.
  • the method further includes: if no new multicast packet to be copied is entered into the multicast packet copy queue, The multicast packets stored in the target cache are entered into the multicast packet copy queue. Before the target cache is cleared, the multicast packet copy queue will not enter new multicast packets to be copied.
  • the target The cache fifo can read out the cached multicast packet data to the queue. During the reading process, the queue cannot input new multicast packets from the previous module until the target cache fifo is cleared. If the queue is inputting a new multicast packet to be copied at this time, the target cache fifo needs to wait for the end of the multicast packet to be input to the queue before initiating a read operation.
  • step S401 the multicast packet enters the queue, and the table lookup pointer scans the first flag of the multicast packet one by one; step S402, extracts the multicast flag from the packet first cell and initiates a table lookup; step S403, copy After the information is returned, the corresponding multicast packet can be dequeued; step S404, determine whether the last copy of the multicast packet has been found; if so, jump to step S405; if not, jump to step S406; step S405, the group The copy of the broadcast packet ends; step S406, the multicast packet is written into the target cache; step S407, when no new multicast packet is entered into the queue, the multicast packet is read from the target cache and entered into the queue.
  • the multicast packets stored in the target cache are entered into the multicast packet copy queue, which can ensure that the multicast packets are
  • the continuity of the packet body can also prevent the total copying of a multicast packet from taking too long.
  • obtaining the first multicast replication information of the first multicast packet includes: sending a table lookup request, where the table lookup request is used to request to obtain the multicast replication information based on the table lookup address; using the table lookup address Initiate a read request to the multicast replication information table; obtain one or more multicast replication information entries found in the multicast replication information table; parse the first group of one or more multicast replication information entries The broadcast replication information is packaged and sent to the multicast packet replication queue.
  • the multicast replication queue after the multicast replication queue initiates a table lookup request, it sends the table lookup address to the information table for table lookup.
  • the number of bits occupied by each copy of the information may be different. Limited by the RAM resources of the multicast replication information table, one copy of the information may need to correspond to multiple addresses, that is, multiple entries. In this case, it is necessary to divide the multicast replication information table RAM into multiple blocks according to depth, and configure multiple entries containing a copy of the replication information in different information table RAM blocks to facilitate that these entries can be read at the same time. out.
  • the table lookup address corresponds to the RAM address of the information table where the first entry of each copied information is stored.
  • the table lookup address is used to initiate a read request to the multicast replication information table RAM (if a copy of the replication information is stored in multiple entries, a read request also needs to be initiated to multiple information table RAM blocks). After a fixed RAM read delay, one or more multicast replication information table entries are obtained.
  • one or more multicast replication information table entries are sent to the parsing module for parsing to obtain multicast replication information such as outbound port numbers and global encapsulation index numbers.
  • the multicast replication information is packaged and returned to the multicast replication queue. Because the multicast replication queue may not be dequeued smoothly due to flow control by the downstream module, the multicast replication information needs to be temporarily stored in the parsing module. After waiting for the flow control on the multicast replication queue to be lifted, the parsing module sends the multicast replication information to the multicast replication queue one by one.
  • one or more multicast replication information entries found in the multicast replication information table are obtained; the first multicast obtained by parsing one or more multicast replication information entries
  • the replication information is packaged and sent to the multicast packet replication queue.
  • Multicast replication information can be obtained through parsing.
  • the method further includes: receiving a multicast change write request, wherein the multicast change write request is used to request to perform a change operation on the multicast replication information already stored in the multicast replication information table; temporarily storing the multicast Change the write request and start to monitor the multicast replication process of the multicast packet replication queue in real time; determine whether there is at least one multicast packet participating in the replication in the multicast packet replication queue; if there is at least one multicast packet participating in the replication, record
  • the number of multicast packets that have not yet been sent for table lookup requests for querying multicast member information When all packets are sent table lookup requests, table lookup requests are suspended, and the requested change table entry content is written to the corresponding write address according to the temporarily stored multicast change write request.
  • the contents of the entries in the multicast replication information table are all delivered by the configuration bus.
  • the configuration bus When the configuration bus has a need to add, delete or change the existing multicast replication information, it will send the multicast replication change device to the multicast replication information table. Deliver the multicast change write request, as well as the corresponding write address and write entry content.
  • the multicast copy change device after receiving the multicast change write request, does not directly write the multicast change table entry content into the multicast copy table lookup device, but temporarily stores it first and starts multicast. Copy change preprocessing operations.
  • the multicast copy change device starts to monitor the multicast copy process in the multicast copy queue management device in real time, and determines whether there are still multicast packets in the queue participating in the copy.
  • the number of multicast packets that have not yet initiated a table lookup in the multicast replication queue management device when the multicast change request is issued is recorded (that is, using The number of multicast packets in the multicast replication queue + the number of multicast packets in the target cache fifo - the number of multicast packets that have initiated a table lookup and are waiting for the replication information to be returned).
  • the number of table lookup requests initiated by the multicast replication queue management device starting from the issuance of the multicast change request is equal to the recorded number of table lookup requests that have not yet been initiated.
  • the number of multicast packets in the table That is, it is determined whether table lookup has been initiated for all multicast packets.
  • the paused multicast replication queue management device initiates a table lookup request, and sends the multicast change write request in the cache and the corresponding write address and write entry content to the multicast replication table lookup device.
  • the playback table lookup device writes the content of the changed table entry into the information table.
  • the multicast copy and change device waits for all cached multicast change write requests to be written into the information table, it notifies the multicast copy queue management device of the end of the multicast change process, and the multicast copy queue restarts the table lookup and copy process. .
  • the method when moving the first multicast packet carrying the first multicast replication information out of the multicast packet replication queue, the method further includes: recycling the multicast cell address in the first multicast packet; Determine whether the currently recycled multicast cell address is in the process of waiting for the read return of the multicast cell address with the same total number of copies; in the process of waiting for the read return of the multicast cell address with the same total number of copies, cancel the current Output the multicast cell corresponding to the recycled multicast cell address, and wait for the total number of copies to be read; when it is not in the process of waiting for the read return of the multicast cell address with the same total number of copies, use the currently recycled Use the multicast cell address as the read address to initiate a read request to the total number of copies; use the currently recycled multicast cell address as the write address, initiate a write request to the write address for the total number of copies.
  • the multicast cell address when the multicast cell carrying multicast replication information is output from the multicast queue management module to the lower-level system for port scheduling, the multicast cell address will be sent to the multicast address recycling device, where the port Scheduling is to determine the order in which multicast packets carrying different port numbers are sent to multiple destination hosts based on the priority of the port numbers.
  • two total copy numbers RAM0 and RAM1 of the same size are defined to record the number of copies of each cell address.
  • the write enable, write address and write data of RAM0 and RAM1 are consistent. Determine whether it is in the process of waiting for the read return of the same multicast cell address as the total copy number RAM0.
  • the total copy number RAM0 read request is not initiated for the output of this multicast cell, and the register Record this cancellation behavior and wait for the read return of the same multicast cell address of RAM0, the total number of copies.
  • a read request is initiated to the total copy number RAM0 using the multicast cell address as the read address.
  • the read data of the total copy number RAM0 is the number of copies of the multicast cell.
  • the address of the multicast cell is used as the write address, and (the number of copies of the multicast cell + the number of canceled read requests during the waiting for read return process + 1) is used as the write data, and the address is written to the total address.
  • Copies RAM0 and RAM1 initiate write requests.
  • the currently recycled multicast cell address is used as the write address, and a total copy number write request is initiated to the write address.
  • when recycling the multicast cell address in the first multicast packet it also includes: determining whether the currently recycled multicast cell address is waiting for the same number of multicast cells that have been scheduled. During the read return process of the address; while waiting for the read return of the multicast cell address with the same number of scheduled copies, cancel the output of the multicast cell corresponding to the currently recycled multicast cell address, and initiate the scheduled copy number and the total number of copies; when the read return process is not waiting for the same multicast cell address of the scheduled copies, the currently recycled multicast cell address is used as the read address, and at the same time, the read request to the scheduled copies is and the total number of replicas to initiate a read request.
  • the lower-level system after the lower-level system completes multicast replication outbound port scheduling, it returns the multicast cell content to the multicast replication module and sends it to the multicast address recycling device.
  • a scheduled copy RAM with the same size as the total copy number RAM1 is defined to record the number of times each cell address has participated in scheduling.
  • the read enable and read address of the scheduled copy RAM and the total copied copy RAM1 are consistent. Determine whether it is in the process of waiting for the read return of the same multicast cell address of the scheduled RAM.
  • RAM1 while waiting for the read return of the same multicast cell address of the scheduled copy RAM, the scheduled copy RAM and total copy number are not initiated for the output of this multicast cell.
  • RAM1 reads the request, and uses a register to record the cancellation behavior, waiting for the read return of the same multicast cell address of the scheduled copies RAM and the total number of copies RAM1.
  • the multicast cell address is used as the read address to simultaneously copy the scheduled copy RAM and the total copy address.
  • Copy RAM1 initiates a read request.
  • the read data of the scheduled copies RAM is the number of copies of the multicast cell, and the read data of the total copy RAM1 is the number of times the multicast cell has been scheduled.
  • the multicast cell content is sent back to the payload storage device, and an address recycling flag is given to inform the payload.
  • the cell corresponding to the address of the storage device has completed all copy operations and can be released.
  • the multicast cell address is used as the write address, and 0 is the write data to initiate a write request to the scheduled copy RAM to avoid affecting the recycling of the cell address in the payload storage device.
  • the multicast cell content is sent back to the payload storage device.
  • the address of the multicast cell is used as the write address, and (the number of times the multicast cell has been scheduled + the number of read requests canceled while waiting for read return + 1) is used as the write data, and the number of RAMs that have been scheduled is written. Initiate a write request.
  • the method can be implemented with the help of software plus the necessary general hardware platform. Of course, it can also be implemented through hardware, but in many cases the former is a better implementation method.
  • the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to cause a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of this application.
  • module may be a combination of software and/or hardware that implements a predetermined function.
  • apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
  • Figure 5 is a structural block diagram of a device for replicating multicast packets according to an embodiment of the present application. As shown in Figure 5, the device includes:
  • the storage module 501 is used to store multicast packets to be copied into the multicast packet copy queue
  • the determination module 502 is configured to determine the first multicast packet to be copied pointed by the target pointer from the multicast packet copy queue, where the multicast packet copy queue includes at least two multicast packets to be copied;
  • the search module 503 is used to search for the multicast member information of the first multicast packet and obtain the first multicast replication information of the first multicast packet;
  • the acquisition module 504 is configured to point the target pointer to the next second multicast packet to be copied while waiting to receive the multicast member information of the first multicast packet, so as to obtain the multicast replication information of the second multicast packet;
  • the removal module 505 is configured to remove the first multicast packet carrying the first multicast replication information from the multicast packet replication queue when all multicast member information of the first multicast packet is received.
  • the multicast packet to be copied is stored in the multicast packet copy queue; the first multicast packet to be copied pointed to by the target pointer is determined from the multicast packet copy queue, where, The multicast packet copy queue includes at least two multicast packets to be copied; searches for the multicast member information of the first multicast packet and obtains the first multicast copy information of the first multicast packet; while waiting to receive the first multicast packet While receiving the multicast member information of the packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast copy information of the second multicast packet; after receiving all multicast members of the first multicast packet In the case of information, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
  • each of the above modules can be implemented through software or hardware.
  • it can be implemented in the following ways, but is not limited to this: the above modules are all located in the same processor; or the above modules can be implemented in any combination.
  • the forms are located in different processors.
  • Embodiments of the present application also provide a computer-readable storage medium that stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
  • the computer-readable storage medium may include but is not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
  • ROM read-only memory
  • RAM random access memory
  • mobile hard disk magnetic disk or optical disk and other media that can store computer programs.
  • An embodiment of the present application also provides an electronic device, including a memory and a processor.
  • a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
  • the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
  • modules or steps of the present application can be implemented using general-purpose computing devices, and they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. They may be implemented in program code executable by a computing device, such that they may be stored in a storage device for execution by the computing device, and in some cases may be executed in a sequence different from that shown herein. Or the described steps can be implemented by making them into individual integrated circuit modules respectively, or by making multiple modules or steps among them into a single integrated circuit module. As such, the application is not limited to any specific combination of hardware and software.

Abstract

The present application discloses a multicast packet duplication method and apparatus, a storage medium, and an electronic apparatus. The method comprises: storing, into a multicast packet duplication queue, a multicast packet to be duplicated; determining, from the multicast packet duplication queue, a first multicast packet to be duplicated at which a target pointer points; searching for multicast member information of the first multicast packet, and acquiring first multicast duplication information of the first multicast packet; while waiting for receiving the multicast member information of the first multicast packet, enabling the target pointer to point at a next second multicast packet to be duplicated, so as to acquire multicast duplication information of the second multicast packet; and when all the multicast member information of the first multicast packet is received, moving the first multicast packet carrying the first multicast duplication information out of the multicast packet duplication queue.

Description

组播包的复制方法及装置、存储介质及电子装置Multicast packet copying method and device, storage medium and electronic device
相关申请Related applications
本申请要求于2022年6月30号申请的、申请号为202210765523.X的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202210765523.X filed on June 30, 2022, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请实施例涉及通信领域,具体而言,涉及一种组播包的复制方法及装置、存储介质及电子装置。Embodiments of the present application relate to the field of communications, and specifically, to a multicast packet copying method and device, a storage medium, and an electronic device.
背景技术Background technique
目前,在网络通讯过程中,存在需要将信息从源主机发送到网络中的其他多个目的主机的需求,为了不将信息发送到不需要该信息的主机导致带宽资源的浪费,需要在所有可能目的地中明确地选择部分目的主机发送,即组播。Currently, in the process of network communication, there is a need to send information from a source host to multiple other destination hosts in the network. In order not to waste bandwidth resources by sending information to hosts that do not need the information, it is necessary to use all possible means to avoid wasting bandwidth resources. Explicitly select some destination hosts in the destination to send, that is, multicast.
相关技术中,在交换芯片中的组播报文查询组播成员并复制时,采用先复制完第一个包再复制下一个包的方式。在小包场景下,受限于组播表查询延时,当组播表查表延时大于该组播包复制一次所用时间时,则无法做到全线速复制,造成带宽的浪费。In the related technology, when multicast messages in a switching chip are queried for multicast members and copied, the first packet is copied first and then the next packet is copied. In the small packet scenario, due to the multicast table lookup delay, when the multicast table lookup delay is greater than the time it takes to copy the multicast packet once, full line-speed replication cannot be achieved, resulting in a waste of bandwidth.
针对相关技术中,目前尚未提出有效的解决方案。Regarding related technologies, no effective solution has yet been proposed.
发明内容Contents of the invention
本申请实施例提供了一种组播包的复制方法及装置、存储介质及电子装置,以至少解决相关技术中,由于组播表查表延时大于该组播包复制一次所用的时间导致无法做到全线速复制,进而造成带宽浪费的技术问题。Embodiments of the present application provide a multicast packet copying method and device, a storage medium, and an electronic device to at least solve the problem in related technologies that the multicast table lookup delay is greater than the time it takes to copy the multicast packet once. Achieve full line-speed replication, thereby causing technical problems of bandwidth waste.
根据本申请的一个实施例,提供了一种组播包的复制方法,包括:将待复制的组播包存入组播包复制队列中;从上述组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,上述组播包复制队列包括至少两个待复制的组播包;查找上述第一组播包的组播成员信息,并获取上述第一组播包的第一组播复制信息;在等待接收上述第一组播包的组播成员信息的同时,将上述目标指针指向下一个待复制的第二组播包,以获取上述第二组播包的组播复制信息;在接收到上述第一组播包的全部组播成员信息的情况下,将携带上述第一组播复制信息的上述第一组播包移出上述组播包复制队列。According to an embodiment of the present application, a method for copying a multicast packet is provided, which includes: storing the multicast packet to be copied in a multicast packet copy queue; and determining the target pointer from the multicast package copy queue. Point to the first multicast packet to be copied, where the above-mentioned multicast packet copy queue includes at least two multicast packets to be copied; search for the multicast member information of the above-mentioned first multicast packet, and obtain the above-mentioned first multicast packet The first multicast copy information of the packet; while waiting to receive the multicast member information of the above-mentioned first multicast packet, point the above-mentioned target pointer to the next second multicast packet to be copied to obtain the above-mentioned second multicast packet. multicast replication information; upon receiving all multicast member information of the first multicast packet, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
根据本申请的另一个实施例,提供了一种组播包的复制装置,包括:存入模块,用于将待复制的组播包存入组播包复制队列中;确定模块,用于从上述组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,上述组播包复制队列包括至少两个待复制的组播包;查找模块,用于查找上述第一组播包的组播成员信息,并获取上述第一组播包的第一组播复制信息;获取模块,用于在等待接收上述第一组播包的组播成员信息的同时,将上述目标指针指向下一个待复制的第二组播包,以获取上述第二组播包的组播复制信息;移出模块,用于在接收到上述第一组播包的全部组播成员信息的情况下,将携带上述第一组播复制信息的上述第一组播包移出上述组播包复制队列。According to another embodiment of the present application, a device for copying multicast packets is provided, including: a storage module for storing multicast packets to be copied into a multicast packet copy queue; and a determination module for starting from The first multicast packet to be copied pointed to by the target pointer is determined in the above-mentioned multicast packet copy queue, wherein the above-mentioned multicast packet copy queue includes at least two multicast packets to be copied; the search module is used to find the above-mentioned third multicast packet. Multicast member information of the multicast packet, and obtain the first multicast copy information of the above-mentioned first multicast packet; the acquisition module is used to obtain the above-mentioned multicast member information while waiting to receive the multicast member information of the above-mentioned first multicast packet. The target pointer points to the next second multicast packet to be copied to obtain the multicast copy information of the above-mentioned second multicast packet; the removal module is used when all the multicast member information of the above-mentioned first multicast packet is received. Next, the first multicast packet carrying the first multicast replication information is moved out of the multicast packet replication queue.
根据本申请的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储 介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium A computer program is stored in the medium, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
根据本申请的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present application, an electronic device is also provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above. Steps in method embodiments.
通过本申请,由于待复制的组播包可以轮流查询组播成员信息,不必再等待前一个包复制完全结束。每一个包复制出队时判断是否复制结束,如果没有复制结束,则继续回到复制队列与其他组播包轮流查询组播成员信息。因此,可以解决由于组播表查表延时大于该组播包复制一次所用的时间导致无法做到全线速复制,进而造成带宽浪费的技术问题,达到提高带宽利用率的技术效果。Through this application, since the multicast packets to be copied can query multicast member information in turn, there is no need to wait for the completion of copying the previous packet. When each packet is copied out of the queue, it is judged whether the copy is completed. If the copy is not completed, it continues to return to the copy queue and takes turns querying the multicast member information with other multicast packets. Therefore, it is possible to solve the technical problem of being unable to replicate at full line speed due to the multicast table lookup delay being greater than the time it takes for the multicast packet to be copied once, thereby causing bandwidth waste, and achieve the technical effect of improving bandwidth utilization.
附图说明Description of drawings
图1是根据本申请实施例的一种可选的组播包的复制方法的系统结构的示意图;Figure 1 is a schematic diagram of the system structure of an optional multicast packet copying method according to an embodiment of the present application;
图2是根据本申请实施例的一种可选的组播包的复制方法的示意图;Figure 2 is a schematic diagram of an optional multicast packet copying method according to an embodiment of the present application;
图3是根据本申请实施例的一种可选的组播包的复制方法的流程图;Figure 3 is a flow chart of an optional multicast packet copying method according to an embodiment of the present application;
图4是根据本申请实施例的另一种可选的组播包的复制方法的示意图;Figure 4 is a schematic diagram of another optional multicast packet copying method according to an embodiment of the present application;
图5是根据本申请实施例的一种可选的组播包的复制装置的结构框图。Figure 5 is a structural block diagram of an optional multicast packet copying device according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those in the technical field to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only These are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of this application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus that encompasses a series of steps or units and need not be limited to those explicitly listed. Those steps or elements may instead include other steps or elements not expressly listed or inherent to the process, method, product or apparatus.
在本申请实施例中,提供了一种上述组播包的复制方法的实施例。作为一种可选的实施方式,该组播包的复制方法可以但不限于应用于如图1所示的系统结构中。In this embodiment of the present application, an embodiment of the above multicast packet copying method is provided. As an optional implementation manner, the multicast packet copying method can be applied to, but is not limited to, the system structure as shown in Figure 1 .
在一实施方式中,如图1所示,该系统包含了“地址生成装置101”、“报文保序装置102”、“报文检查装置103”、“组播复制装置104”以及“净荷存储装置105”。In one implementation, as shown in Figure 1, the system includes an "address generation device 101", a "message order preserving device 102", a "message inspection device 103", a "multicast copying device 104" and a "net charge storage device 105".
地址生成装置101:管理一套存储地址的链表,该存储地址与净荷存储装置中净荷存储地址相对应。当组播报文输入时,地址生成装置101为该组播包分配地址,并将组播包净荷数据存入净荷存储装置105中的对应地址空间。在组播报文从该系统输出之前,均用只携带组播包存储地址、组播标识等必要的报文描述符信息来代替该组播报文在其他装置中进行处理。Address generation device 101: manages a set of linked lists of storage addresses, and the storage addresses correspond to the payload storage addresses in the payload storage device. When a multicast packet is input, the address generation device 101 allocates an address to the multicast packet and stores the multicast packet payload data in the corresponding address space in the payload storage device 105 . Before the multicast packet is output from the system, the multicast packet carrying only the necessary packet descriptor information such as the multicast packet storage address and multicast identifier is used instead of the multicast packet for processing in other devices.
报文保序装置102:用于恢复组播包内部信元和组播包之间的排列顺序。这样在后续组播复制装置中104,可以保证同一组播包内所有信元复制行为相同,并且可以避免组播包间 复制乱序。Message sequence preserving device 102: used to restore the arrangement order between the internal cells of the multicast packet and the multicast packet. In this way, in the subsequent multicast replication device 104, the replication behavior of all cells in the same multicast packet can be guaranteed to be the same, and multicast packets can be avoided. Copy out of order.
报文检查装置103:用于检查组播包所携带报文描述符信息是否真实正确。对于检查错误的组播包,会直接丢弃。这样在后续组播复制装置104中,可以保证参与复制的组播包均为正确的组播包,避免错误组播包的复制无效地浪费带宽。Message checking device 103: used to check whether the message descriptor information carried in the multicast packet is true and correct. Multicast packets with errors in the check will be discarded directly. In this way, in the subsequent multicast duplication device 104, it can be ensured that the multicast packets participating in the duplication are correct multicast packets, and the duplication of erroneous multicast packets can be avoided to waste bandwidth ineffectively.
净荷存储装置105:用于存储组播包的净荷信息。当组播包携带组播复制信息准备从该系统输出时,该组播包需要提取出地址生成装置101分配的存储地址送给净荷存储装置,从而将组播包净荷提取出来。随后,完整的组播包即可携带组播复制信息从该系统输出。Payload storage device 105: used to store payload information of multicast packets. When a multicast packet carries multicast replication information and is ready to be output from the system, the multicast packet needs to extract the storage address allocated by the address generation device 101 and send it to the payload storage device, thereby extracting the multicast packet payload. Subsequently, the complete multicast packet can be output from the system carrying multicast replication information.
组播复制装置104包括组播复制队列管理装置203、组播复制查表装置202、组播复制变更装置201、组播地址回收装置204。如图2所示,待复制的组播包首先进入组播复制队列管理装置203中排队等待复制,同时在包首信元中提取组播标识发往组播复制查表装置202查询组播复制信息。组播复制队列管理装置203接收到返回的组播复制信息后,组播包即可携带组播复制信息输出所在系统,在下级子系统中参与组播复制端口调度。完成组播复制端口调度的组播包原路返回至组播复制地址回收装置204中,随后将组播包送出至净荷存储装置105。与此同时,组播地址回收装置204会判断该组播包是否已经全部复制完毕,如果全部复制完成,则告知净荷存储装置105:该组播包内所有信元地址均可回收,可供其他待进入此系统的组播包使用。The multicast replication device 104 includes a multicast replication queue management device 203, a multicast replication table lookup device 202, a multicast replication modification device 201, and a multicast address recovery device 204. As shown in Figure 2, the multicast packet to be copied first enters the multicast copy queue management device 203 and is queued to wait for copying. At the same time, the multicast identifier is extracted from the first cell of the packet and sent to the multicast copy table lookup device 202 to query the multicast copy. information. After the multicast replication queue management device 203 receives the returned multicast replication information, the multicast packet can carry the multicast replication information and be output to the system where it is located, and participate in multicast replication port scheduling in the lower-level subsystem. The multicast packets that have completed multicast replication port scheduling are returned to the multicast replication address recovery device 204 along the original route, and then the multicast packets are sent to the payload storage device 105 . At the same time, the multicast address recycling device 204 will determine whether all the multicast packets have been copied. If all the copies have been completed, the payload storage device 105 will be informed that all cell addresses in the multicast packet can be recycled and can be used. Used by other multicast packets to enter this system.
在本实施例中提供了一种组播包的复制方法,图3是根据本申请实施例的组播包的复制方法的流程图,该流程包括如下步骤:This embodiment provides a method for copying multicast packets. Figure 3 is a flow chart of a method for copying multicast packets according to an embodiment of the present application. The process includes the following steps:
步骤S302,将待复制的组播包存入组播包复制队列中;Step S302: Store the multicast packet to be copied in the multicast packet copy queue;
步骤S304,从组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,组播包复制队列包括至少两个待复制的组播包;Step S304: Determine the first multicast packet to be copied pointed to by the target pointer from the multicast packet copy queue, where the multicast packet copy queue includes at least two multicast packets to be copied;
步骤S306,查找第一组播包的组播成员信息,并获取第一组播包的第一组播复制信息;Step S306: Search for the multicast member information of the first multicast packet and obtain the first multicast replication information of the first multicast packet;
步骤S308,在等待接收第一组播包的组播成员信息的同时,将目标指针指向下一个待复制的第二组播包,以获取第二组播包的组播复制信息;Step S308: While waiting to receive the multicast member information of the first multicast packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast replication information of the second multicast packet;
步骤S310,在接收到第一组播包的全部组播成员信息的情况下,将携带第一组播复制信息的第一组播包移出组播包复制队列。Step S310: When all multicast member information of the first multicast packet is received, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
在一实施方式中,为待复制的组播报文设置一个组播复制队列,该组播复制队列由数个寄存器构成,寄存器个数应该足够多,能够抵消一个组播包的查表延时。In one embodiment, a multicast replication queue is set up for the multicast packets to be copied. The multicast replication queue is composed of several registers. The number of registers should be enough to offset the table lookup delay of one multicast packet. .
在一实施方式中,为组播复制队列设置查表指针,查表指针最开始指向队列首,当组播报文进入队列时,查表指针即从队列首开始提取组播包首标志。当组播复制队列无输出时,查表指针从队列首逐渐后移,提取组播包首标志;当组播复制队列有输出时,由于移位寄存器中数据不断前移,查表指针位置不变,不断从同一个寄存器中提取包首标志。组播复制信息可以包括但不限于出向端口号、全局封装索引号。In one embodiment, a table lookup pointer is set for the multicast replication queue. The table lookup pointer initially points to the head of the queue. When a multicast packet enters the queue, the table lookup pointer starts to extract the multicast packet first flag from the queue head. When there is no output from the multicast replication queue, the lookup pointer gradually moves backward from the head of the queue to extract the first flag of the multicast packet; when there is output from the multicast replication queue, because the data in the shift register continues to move forward, the position of the table lookup pointer does not change. changes, and continuously extracts the packet first flag from the same register. Multicast replication information may include but is not limited to outbound port number and global encapsulation index number.
在一实施方式中,经过固定的查表延时之后,排在队列首的组播包最先得到组播成员信息。其他组播包得到组播成员信息的时间间隔与之前发起查表请求的时间间隔保持一致。In one implementation, after a fixed table lookup delay, the multicast packet at the head of the queue is the first to obtain multicast member information. The time interval for other multicast packets to obtain multicast member information is consistent with the time interval for initiating table lookup requests.
在一实施方式中,每次查表除了可以得到组播成员信息外,还会返回下一次查表的地址,如果下一次查表地址与此次查表地址相同,则表明此次返回的组播成员信息为最后一份组播成员信息。In one implementation, in addition to obtaining the multicast member information each time the table is looked up, the address of the next table lookup is also returned. If the address of the next table lookup is the same as the address of this table lookup, it indicates that the group returned this time is The broadcast member information is the last multicast member information.
在一实施方式中,每个组播包出队的同时需要判断是否已将所有组播成员信息全部查出, 在该组播包已经查到所有组播成员信息的情况下,携带此份复制信息出队后,即可结束复制。In one implementation, when each multicast packet is dequeued, it needs to be determined whether all multicast member information has been found. When the multicast packet has found all multicast member information, the replication can be terminated after dequeuing with this copy information.
通过本申请实施例提供的方案,将待复制的组播包存入组播包复制队列中;从组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,组播包复制队列包括至少两个待复制的组播包;查找第一组播包的组播成员信息,并获取第一组播包的第一组播复制信息;在等待接收第一组播包的组播成员信息的同时,将目标指针指向下一个待复制的第二组播包,以获取第二组播包的组播复制信息;在接收到第一组播包的全部组播成员信息的情况下,将携带第一组播复制信息的第一组播包移出组播包复制队列。由于待复制的组播包可以轮流查询组播成员信息,不必再等待前一个包复制完全结束,提高了带宽利用率,解决了由于组播表查表延时大于该组播包复制一次所用的时间导致无法做到全线速复制,进而造成带宽浪费的技术问题。Through the solution provided by the embodiment of this application, the multicast packet to be copied is stored in the multicast packet copy queue; the first multicast packet to be copied pointed to by the target pointer is determined from the multicast packet copy queue, where, The multicast packet copy queue includes at least two multicast packets to be copied; searches for the multicast member information of the first multicast packet and obtains the first multicast copy information of the first multicast packet; while waiting to receive the first multicast packet While receiving the multicast member information of the packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast copy information of the second multicast packet; after receiving all multicast members of the first multicast packet In the case of information, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue. Since multicast packets to be copied can query multicast member information in turn, there is no need to wait for the previous packet to be copied completely, which improves bandwidth utilization and solves the problem that the multicast table lookup delay is greater than the time it takes to copy the multicast package once. Time makes it impossible to achieve full line-speed replication, which in turn causes technical problems of wasted bandwidth.
在一个示例性实施例中,查找第一组播包的组播成员信息包括:从第一组播包的包首标志中提取第一组播包的组播标识;发送基于第一组播包的组播标识生成的查询请求,其中,查询请求用于向组播复制信息表发起对组播成员信息的读请求查询;接收查找到的第一组播包的组播成员信息,并将查找到的第一组播包的组播成员信息整合进报文描述符中。In an exemplary embodiment, searching for the multicast member information of the first multicast packet includes: extracting the multicast identifier of the first multicast packet from the packet header identifier of the first multicast packet; sending a message based on the first multicast packet. A query request generated by the multicast identifier, where the query request is used to initiate a read request for multicast member information to the multicast replication information table; receive the found multicast member information of the first multicast packet, and search The multicast member information of the first multicast packet received is integrated into the message descriptor.
在一实施方式中,因为同一组播包内的信元切片复制行为完全相同,当查表指针检测到组播包首标志时即可从信元描述符中提取组播标识向组播复制信息表发起读请求查询组播成员信息,其中,一次读请求查询一个组播成员信息。该组播包将查到的组播成员信息整合进入报文描述符中即可出队。查询请求仅与查表指针所指寄存器中包首标志是否有效有关,如果队列出队被阻塞,查表指针会不断后移直至指向队列尾最后一个寄存器,然后停止。In one embodiment, because the cell slice copy behavior in the same multicast packet is exactly the same, when the table lookup pointer detects the multicast packet first flag, the multicast identifier can be extracted from the cell descriptor and copied to the multicast information. The table initiates a read request to query multicast member information. One read request queries the information of one multicast member. This multicast packet integrates the found multicast member information into the message descriptor and can be dequeued. The query request is only related to whether the packet first flag in the register pointed to by the lookup table pointer is valid. If the queue is blocked, the table lookup pointer will continue to move backward until it points to the last register at the end of the queue, and then stop.
通过本申请实施例提供的方案,基于组播标识查询组播成员信息,提高了查询的准确性。Through the solution provided by the embodiment of this application, multicast member information is queried based on the multicast identifier, thereby improving the accuracy of the query.
在一个示例性实施例中,在查找第一组播包的组播成员信息之后,还包括:在当前查找到的第一组播包的组播成员信息并非最后一个组播成员信息的情况下,将携带第一组播复制信息的目标组播包移出组播包复制队列,并将目标组播包的包体数据复制写入目标缓存中,其中,目标缓存中存储的组播包将被重新输入组播包复制队列中。In an exemplary embodiment, after searching for the multicast member information of the first multicast packet, the method further includes: when the currently found multicast member information of the first multicast packet is not the last multicast member information , move the target multicast packet carrying the first multicast copy information out of the multicast packet copy queue, and copy and write the packet body data of the target multicast packet into the target cache, where the multicast packets stored in the target cache will be Re-enter the multicast packet into the copy queue.
在一实施方式中,定义一个目标缓存fifo,为了保证每个组播包的包体连续性,该目标缓存fifo的深度应该大于一个最长组播包包含的信元个数。因为该组播包查表得到的下一次查表地址与此次查表地址并不相同,说明这个组播包并未查到最后一份组播成员信息。该组播包在携带此次复制信息出队的同时,需要将其包体数据复制一份写入该目标缓存fifo。对于写入目标缓存fifo的组播包包首信元,还需要用下一次查表地址来替换组播标识所在的位段。因为组播复制过程中组播包内容只包含在净荷存储装置中存放的地址信息,因此目标缓存fifo总大小很小。In one embodiment, a target cache fifo is defined. In order to ensure the continuity of the packet body of each multicast packet, the depth of the target cache fifo should be greater than the number of cells contained in the longest multicast packet. Because the next table lookup address obtained by this multicast packet is different from the current table lookup address, it means that this multicast packet has not found the last multicast member information. When the multicast packet is dequeued carrying this copy information, a copy of its packet body data needs to be written into the target cache fifo. For the first cell of the multicast packet written to the target cache fifo, the bit field where the multicast identifier is located needs to be replaced with the next table lookup address. Because the multicast packet content during the multicast replication process only contains address information stored in the payload storage device, the total size of the target cache fifo is very small.
通过本申请实施例提供的方案,在当前查找到的第一组播包的组播成员信息并非最后一个组播成员信息的情况下,将携带第一组播复制信息的目标组播包移出组播包复制队列,并将目标组播包的包体数据复制写入目标缓存中,保证了组播复制的准确性。Through the solution provided by the embodiment of the present application, when the multicast member information of the currently found first multicast packet is not the last multicast member information, the target multicast packet carrying the first multicast copy information is removed from the group. The multicast packet copy queue is copied and the packet body data of the target multicast packet is copied and written into the target cache, ensuring the accuracy of multicast copy.
在一个示例性实施例中,在将目标组播包的包体数据复制写入目标缓存中之后,还包括:在没有新的待复制的组播包输入组播包复制队列的情况下,将目标缓存中存储的组播包输入组播包复制队列,其中,在目标缓存被清空之前,组播包复制队列将不会输入新的待复制的组播包。In an exemplary embodiment, after copying and writing the packet body data of the target multicast packet into the target cache, the method further includes: if no new multicast packet to be copied is entered into the multicast packet copy queue, The multicast packets stored in the target cache are entered into the multicast packet copy queue. Before the target cache is cleared, the multicast packet copy queue will not enter new multicast packets to be copied.
在一实施方式中,若队列此时并未从前一级模块输入一个新的待复制的组播包,则目标 缓存fifo可将其中缓存的组播包数据读出至队列,在读出过程中,队列无法从前一级模块输入新的组播包,一直到目标缓存fifo清空为止。若队列此时正在输入一个新的待复制的组播包,则目标缓存fifo需要等待该组播包包尾输入至队列,才能发起读操作。In one implementation, if the queue does not input a new multicast packet to be copied from the previous module at this time, the target The cache fifo can read out the cached multicast packet data to the queue. During the reading process, the queue cannot input new multicast packets from the previous module until the target cache fifo is cleared. If the queue is inputting a new multicast packet to be copied at this time, the target cache fifo needs to wait for the end of the multicast packet to be input to the queue before initiating a read operation.
例如,如图4所示,步骤S401、组播包进入队列,查表指针逐一扫描组播包包首标志;步骤S402、从包首信元中提取组播标识发起查表;步骤S403、复制信息返回后,对应组播包即可出队;步骤S404、判断组播包是否查到尾份复制信息;若是,跳转到步骤S405,若否,跳转到步骤S406;步骤S405、该组播包结束复制;步骤S406、该组播包写入目标缓存;步骤S407、当队列未输入新的组播包时,从目标缓存读出组播包,并进入队列。For example, as shown in Figure 4, step S401, the multicast packet enters the queue, and the table lookup pointer scans the first flag of the multicast packet one by one; step S402, extracts the multicast flag from the packet first cell and initiates a table lookup; step S403, copy After the information is returned, the corresponding multicast packet can be dequeued; step S404, determine whether the last copy of the multicast packet has been found; if so, jump to step S405; if not, jump to step S406; step S405, the group The copy of the broadcast packet ends; step S406, the multicast packet is written into the target cache; step S407, when no new multicast packet is entered into the queue, the multicast packet is read from the target cache and entered into the queue.
通过本申请实施例提供的方案,在没有新的待复制的组播包输入组播包复制队列的情况下,将目标缓存中存储的组播包输入组播包复制队列,可以保证组播包包体的连续性,还能避免一个组播包复制总耗时过长。Through the solution provided by the embodiment of this application, when there are no new multicast packets to be copied entered into the multicast packet copy queue, the multicast packets stored in the target cache are entered into the multicast packet copy queue, which can ensure that the multicast packets are The continuity of the packet body can also prevent the total copying of a multicast packet from taking too long.
在一个示例性实施例中,获取第一组播包的第一组播复制信息包括:发送查表请求,其中,查表请求用于请求基于查表地址获取组播复制信息;使用查表地址向组播复制信息表发起读请求;获取在组播复制信息表中查找到的一条或多条组播复制信息表项;将对一条或多条组播复制信息表项解析得到的第一组播复制信息打包发送给组播包复制队列。In an exemplary embodiment, obtaining the first multicast replication information of the first multicast packet includes: sending a table lookup request, where the table lookup request is used to request to obtain the multicast replication information based on the table lookup address; using the table lookup address Initiate a read request to the multicast replication information table; obtain one or more multicast replication information entries found in the multicast replication information table; parse the first group of one or more multicast replication information entries The broadcast replication information is packaged and sent to the multicast packet replication queue.
在一实施方式中,组播复制队列发起查表请求后,将查表地址送给信息表进行查表。在不同的组播复制场景下,每份复制信息所占比特数可能不相同,受限于组播复制信息表RAM资源,一份复制信息可能需要对应多个地址,即对应多条表项。对于这种情况,需要将组播复制信息表RAM按深度划分为多块,将包含一份复制信息的多条表项分别配置于不同的信息表RAM块中,以方便这些表项能够同时读出。查表地址即对应于每份复制信息首条表项所存放的信息表RAM地址。In one embodiment, after the multicast replication queue initiates a table lookup request, it sends the table lookup address to the information table for table lookup. In different multicast replication scenarios, the number of bits occupied by each copy of the information may be different. Limited by the RAM resources of the multicast replication information table, one copy of the information may need to correspond to multiple addresses, that is, multiple entries. In this case, it is necessary to divide the multicast replication information table RAM into multiple blocks according to depth, and configure multiple entries containing a copy of the replication information in different information table RAM blocks to facilitate that these entries can be read at the same time. out. The table lookup address corresponds to the RAM address of the information table where the first entry of each copied information is stored.
在一实施方式中,使用查表地址向组播复制信息表RAM发起读请求(如果一份复制信息存放在多条表项中,还需要向多个信息表RAM块发起读请求)。在经历固定的RAM读延时后,得到一条或多条组播复制信息表表项。In one implementation, the table lookup address is used to initiate a read request to the multicast replication information table RAM (if a copy of the replication information is stored in multiple entries, a read request also needs to be initiated to multiple information table RAM blocks). After a fixed RAM read delay, one or more multicast replication information table entries are obtained.
在一实施方式中,将一条或多条组播复制信息表表项送往解析模块进行解析,获得出向端口号以及全局封装索引号等组播复制信息。In one embodiment, one or more multicast replication information table entries are sent to the parsing module for parsing to obtain multicast replication information such as outbound port numbers and global encapsulation index numbers.
在一实施方式中,将组播复制信息打包送还给组播复制队列。因为组播复制队列可能因受到后级模块流控而无法顺利出队,此时组播复制信息需要在解析模块暂存起来。等待组播复制队列所受流控解除后,解析模块再将组播复制信息一份一份地送给组播复制队列。In one implementation, the multicast replication information is packaged and returned to the multicast replication queue. Because the multicast replication queue may not be dequeued smoothly due to flow control by the downstream module, the multicast replication information needs to be temporarily stored in the parsing module. After waiting for the flow control on the multicast replication queue to be lifted, the parsing module sends the multicast replication information to the multicast replication queue one by one.
通过本申请实施例提供的方案,获取在组播复制信息表中查找到的一条或多条组播复制信息表项;将对一条或多条组播复制信息表项解析得到的第一组播复制信息打包发送给组播包复制队列。可以通过解析获得组播复制信息。Through the solution provided by the embodiment of this application, one or more multicast replication information entries found in the multicast replication information table are obtained; the first multicast obtained by parsing one or more multicast replication information entries The replication information is packaged and sent to the multicast packet replication queue. Multicast replication information can be obtained through parsing.
在一个示例性实施例中,还包括:接收组播变更写请求,其中,组播变更写请求用于请求对组播复制信息表中已存的组播复制信息执行变更操作;暂存组播变更写请求,并开始实时监测组播包复制队列的组播复制进程;判断组播包复制队列中是否存在至少一个组播包参与复制;在存在至少一个组播包参与复制的情况下,记录接收到组播变更写请求时,尚未发发送的用于查询组播成员信息的查表请求的组播包的数量;在所述尚未发送的用于查询组播成员信息的查询请求的组播包全部发送查表请求的情况下,暂停发送查表请求,并按照暂存的组播变更写请求,将所请求的变更表项内容写入对应的写入地址。 In an exemplary embodiment, the method further includes: receiving a multicast change write request, wherein the multicast change write request is used to request to perform a change operation on the multicast replication information already stored in the multicast replication information table; temporarily storing the multicast Change the write request and start to monitor the multicast replication process of the multicast packet replication queue in real time; determine whether there is at least one multicast packet participating in the replication in the multicast packet replication queue; if there is at least one multicast packet participating in the replication, record When receiving a multicast change write request, the number of multicast packets that have not yet been sent for table lookup requests for querying multicast member information; When all packets are sent table lookup requests, table lookup requests are suspended, and the requested change table entry content is written to the corresponding write address according to the temporarily stored multicast change write request.
在一实施方式中,组播复制信息表中的表项内容均由配置总线下发,当配置总线对现存组播复制信息有新增、删除或变更的需求时,则向组播复制变更装置下发组播变更写请求,以及对应的写入地址和写入表项内容。In one embodiment, the contents of the entries in the multicast replication information table are all delivered by the configuration bus. When the configuration bus has a need to add, delete or change the existing multicast replication information, it will send the multicast replication change device to the multicast replication information table. Deliver the multicast change write request, as well as the corresponding write address and write entry content.
在一实施方式中,组播复制变更装置接收到组播变更写请求后,并不直接将组播变更表项内容写入组播复制查表装置中,而是先暂存起来,开始组播复制变更预处理操作。In one embodiment, after receiving the multicast change write request, the multicast copy change device does not directly write the multicast change table entry content into the multicast copy table lookup device, but temporarily stores it first and starts multicast. Copy change preprocessing operations.
在一实施方式中,组播变更表项内容暂存起来后,组播复制变更装置开始实时监测组播复制队列管理装置中组播复制进程,判断队列中是否还有组播包参与复制。In one embodiment, after the multicast change entry content is temporarily stored, the multicast copy change device starts to monitor the multicast copy process in the multicast copy queue management device in real time, and determines whether there are still multicast packets in the queue participating in the copy.
在一实施方式中,在队列中还有组播包参与复制的情况下,记录下组播变更请求下发时,组播复制队列管理装置中尚未发起查表组播包的个数(即使用组播复制队列中组播包个数+目标缓存fifo中组播包个数-已发起查表等待复制信息返回的组播包个数)。In one embodiment, when there are still multicast packets in the queue participating in the replication, the number of multicast packets that have not yet initiated a table lookup in the multicast replication queue management device when the multicast change request is issued is recorded (that is, using The number of multicast packets in the multicast replication queue + the number of multicast packets in the target cache fifo - the number of multicast packets that have initiated a table lookup and are waiting for the replication information to be returned).
在一实施方式中,在队列中没有组播包参与复制的情况下,判断从组播变更请求下发开始,组播复制队列管理装置发起查表请求的个数是否等于记录下的尚未发起查表的组播包个数。即判断是否所有组播包均已发起查表。In one embodiment, when there are no multicast packets in the queue participating in the replication, it is determined whether the number of table lookup requests initiated by the multicast replication queue management device starting from the issuance of the multicast change request is equal to the recorded number of table lookup requests that have not yet been initiated. The number of multicast packets in the table. That is, it is determined whether table lookup has been initiated for all multicast packets.
在一实施方式中,暂停组播复制队列管理装置发起查表请求,将缓存中的组播变更写请求以及对应的写入地址和写入表项内容送给组播复制查表装置,由组播复制查表装置将变更表项内容写入信息表。In one embodiment, the paused multicast replication queue management device initiates a table lookup request, and sends the multicast change write request in the cache and the corresponding write address and write entry content to the multicast replication table lookup device. The playback table lookup device writes the content of the changed table entry into the information table.
在一实施方式中,组播复制变更装置等待缓存的组播变更写请求全部写入信息表后,即向组播复制队列管理装置告知组播变更流程结束,组播复制队列重启查表复制流程。In one embodiment, after the multicast copy and change device waits for all cached multicast change write requests to be written into the information table, it notifies the multicast copy queue management device of the end of the multicast change process, and the multicast copy queue restarts the table lookup and copy process. .
通过本申请实施例提供的方案,在没有组播包参与复制的情况下,暂停发送查表请求,并按照暂存的组播变更写请求,将所请求的变更表项内容写入对应的写入地址。确保了查表的准确性。Through the solution provided by the embodiment of the present application, when no multicast packet participates in the replication, the sending of the table lookup request is suspended, and the requested change table entry content is written into the corresponding write request according to the temporarily stored multicast change write request. Enter the address. Ensure the accuracy of table lookup.
在一个示例性实施例中,在将携带第一组播复制信息的第一组播包移出组播包复制队列时,还包括:对第一组播包中的组播信元地址进行回收;判断当前回收的组播信元地址是否处于等待总复制份数相同组播信元地址的读返回过程中;在处于等待总复制份数相同组播信元地址的读返回过程中,取消对当前回收的组播信元地址对应的组播信元的输出,并等待总复制份数读请求;在并未处于等待总复制份数相同组播信元地址的读返回过程中,以当前回收的组播信元地址为读地址向总复制份数发起读请求;以当前回收的组播信元地址为写地址,向写地址发起总复制份数写请求。In an exemplary embodiment, when moving the first multicast packet carrying the first multicast replication information out of the multicast packet replication queue, the method further includes: recycling the multicast cell address in the first multicast packet; Determine whether the currently recycled multicast cell address is in the process of waiting for the read return of the multicast cell address with the same total number of copies; in the process of waiting for the read return of the multicast cell address with the same total number of copies, cancel the current Output the multicast cell corresponding to the recycled multicast cell address, and wait for the total number of copies to be read; when it is not in the process of waiting for the read return of the multicast cell address with the same total number of copies, use the currently recycled Use the multicast cell address as the read address to initiate a read request to the total number of copies; use the currently recycled multicast cell address as the write address, initiate a write request to the write address for the total number of copies.
在一实施方式中,组播信元携带组播复制信息从组播队列管理模块输出到下级系统进行端口调度的同时,会将组播信元地址送到组播地址回收装置中,其中,端口调度即是根据端口号的优先级确定向多个目的主机发送携带不同端口号的组播包的顺序。In one embodiment, when the multicast cell carrying multicast replication information is output from the multicast queue management module to the lower-level system for port scheduling, the multicast cell address will be sent to the multicast address recycling device, where the port Scheduling is to determine the order in which multicast packets carrying different port numbers are sent to multiple destination hosts based on the priority of the port numbers.
在一实施方式中,定义两块大小相同的总复制份数RAM0和RAM1,用于记录每个信元地址的复制份数,RAM0和RAM1写使能、写地址以及写数据保持一致。判断此时是否处于等待总复制份数RAM0相同组播信元地址的读返回过程中。In one embodiment, two total copy numbers RAM0 and RAM1 of the same size are defined to record the number of copies of each cell address. The write enable, write address and write data of RAM0 and RAM1 are consistent. Determine whether it is in the process of waiting for the read return of the same multicast cell address as the total copy number RAM0.
在一实施方式中,在处于等待总复制份数RAM0相同组播信元地址的读返回过程中的情况下,不为此次组播信元的输出发起总复制份数RAM0读请求,并用寄存器记录此次取消行为,等待总复制份数RAM0相同组播信元地址的读返回。In one embodiment, while waiting for the read return of the same multicast cell address as the total copy number RAM0, the total copy number RAM0 read request is not initiated for the output of this multicast cell, and the register Record this cancellation behavior and wait for the read return of the same multicast cell address of RAM0, the total number of copies.
在一实施方式中,在未处于等待总复制份数RAM0相同组播信元地址的读返回过程中的情况下,以该组播信元地址为读地址向总复制份数RAM0发起读请求。 In one embodiment, when the read return process of the same multicast cell address as the total copy number RAM0 is not in progress, a read request is initiated to the total copy number RAM0 using the multicast cell address as the read address.
在一实施方式中,总复制份数RAM0的读出数据即为该组播信元已复制的份数。In one embodiment, the read data of the total copy number RAM0 is the number of copies of the multicast cell.
在一实施方式中,以该组播信元地址为写地址,以(该组播信元已复制的份数+等待读返回过程中取消读请求的个数+1)为写数据,向总复制份数RAM0和RAM1发起写请求。In one implementation, the address of the multicast cell is used as the write address, and (the number of copies of the multicast cell + the number of canceled read requests during the waiting for read return process + 1) is used as the write data, and the address is written to the total address. Copies RAM0 and RAM1 initiate write requests.
通过本申请实施例提供的方案,以当前回收的组播信元地址为写地址,向写地址发起总复制份数写请求。可以记录下从组播队列管理模块输出到下级系统进行端口调度的组播包的数量。Through the solution provided by the embodiment of this application, the currently recycled multicast cell address is used as the write address, and a total copy number write request is initiated to the write address. You can record the number of multicast packets output from the multicast queue management module to the lower-level system for port scheduling.
在一个示例性实施例中,在对第一组播包中的组播信元地址进行回收时,还包括:判断当前回收的组播信元地址是否处于等待已调度份数相同组播信元地址的读返回过程中;在处于等待已调度份数相同组播信元地址的读返回过程中,取消对当前回收的组播信元地址对应的组播信元的输出,并发起已调度份数和总复制份数的读请求;在并未处于等待已调度份数相同组播信元地址的读返回过程中,以当前回收的组播信元地址为读地址,同时向已调度份数和总复制份数发起读请求。In an exemplary embodiment, when recycling the multicast cell address in the first multicast packet, it also includes: determining whether the currently recycled multicast cell address is waiting for the same number of multicast cells that have been scheduled. During the read return process of the address; while waiting for the read return of the multicast cell address with the same number of scheduled copies, cancel the output of the multicast cell corresponding to the currently recycled multicast cell address, and initiate the scheduled copy number and the total number of copies; when the read return process is not waiting for the same multicast cell address of the scheduled copies, the currently recycled multicast cell address is used as the read address, and at the same time, the read request to the scheduled copies is and the total number of replicas to initiate a read request.
在一实施方式中,下级系统完成组播复制出向端口调度后,将组播信元内容原路返回至组播复制模块,送入组播地址回收装置。In one embodiment, after the lower-level system completes multicast replication outbound port scheduling, it returns the multicast cell content to the multicast replication module and sends it to the multicast address recycling device.
在一实施方式中,定义一块与总复制份数RAM1大小相同的已调度份数RAM,用于记录每个信元地址已参与调度的次数。该已调度份数RAM和总复制份数RAM1读使能、读地址均保持一致。判断此时是否处于等待已调度份数RAM相同组播信元地址的读返回过程中。In one embodiment, a scheduled copy RAM with the same size as the total copy number RAM1 is defined to record the number of times each cell address has participated in scheduling. The read enable and read address of the scheduled copy RAM and the total copied copy RAM1 are consistent. Determine whether it is in the process of waiting for the read return of the same multicast cell address of the scheduled RAM.
在一实施方式中,在处于等待已调度份数RAM相同组播信元地址的读返回过程中的情况下,不为此次组播信元的输出发起已调度份数RAM和总复制份数RAM1读请求,并用寄存器记录此次取消行为,等待已调度份数RAM和总复制份数RAM1相同组播信元地址的读返回。In one embodiment, while waiting for the read return of the same multicast cell address of the scheduled copy RAM, the scheduled copy RAM and total copy number are not initiated for the output of this multicast cell. RAM1 reads the request, and uses a register to record the cancellation behavior, waiting for the read return of the same multicast cell address of the scheduled copies RAM and the total number of copies RAM1.
在一实施方式中,在未处于等待已调度份数RAM相同组播信元地址的读返回过程中的情况下,以该组播信元地址为读地址同时向已调度份数RAM和总复制份数RAM1发起读请求。In one embodiment, when the read return process of the same multicast cell address of the scheduled copy RAM is not in the process, the multicast cell address is used as the read address to simultaneously copy the scheduled copy RAM and the total copy address. Copy RAM1 initiates a read request.
在一实施方式中,已调度份数RAM的读出数据即为该组播信元已复制的份数,总复制份数RAM1的读出数据即为该组播信元已完成调度的次数。In one embodiment, the read data of the scheduled copies RAM is the number of copies of the multicast cell, and the read data of the total copy RAM1 is the number of times the multicast cell has been scheduled.
在一实施方式中,写完一次之后判断已复制份数是否等于(已完成调度的次数+1)。In one implementation, after writing once, it is determined whether the number of copied copies is equal to (the number of times scheduling has been completed + 1).
在一实施方式中,在已复制份数等于(已完成调度的次数+1)的情况下,将该组播信元内容送回给净荷存储装置,同时给出地址回收标志,告知净荷存储装置该地址对应的信元已完成全部复制操作,可以释放。同时以该组播信元地址为写地址,0为写数据向已调度份数RAM发起写请求,避免影响该信元地址在净荷存储装置中的循环利用。In one embodiment, when the number of copied copies is equal to (the number of times scheduling has been completed + 1), the multicast cell content is sent back to the payload storage device, and an address recycling flag is given to inform the payload. The cell corresponding to the address of the storage device has completed all copy operations and can be released. At the same time, the multicast cell address is used as the write address, and 0 is the write data to initiate a write request to the scheduled copy RAM to avoid affecting the recycling of the cell address in the payload storage device.
在一实施方式中,在已复制份数不等于(已完成调度的次数+1)的情况下,将该组播信元内容送回给净荷存储装置。同时,以该组播信元地址为写地址,以(该组播信元已完成调度的次数+等待读返回过程中取消读请求的个数+1)为写数据,向已调度份数RAM发起写请求。In one implementation, when the number of copied copies is not equal to (number of times of completed scheduling + 1), the multicast cell content is sent back to the payload storage device. At the same time, the address of the multicast cell is used as the write address, and (the number of times the multicast cell has been scheduled + the number of read requests canceled while waiting for read return + 1) is used as the write data, and the number of RAMs that have been scheduled is written. Initiate a write request.
通过本申请实施例提供的方案,通过向已调度份数和总复制份数发起读请求,可以判断总的调度份数是否等于总的复制份数,即可以判断完成调度返回的组播包的份数是否等于进行端口调度的组播包的份数。Through the solution provided by the embodiments of this application, by initiating read requests to the number of scheduled copies and the total number of copies, it can be judged whether the total number of scheduled copies is equal to the total number of copies, that is, it can be judged whether the number of multicast packets returned after completing the scheduling is Whether the number of copies is equal to the number of multicast packets for port scheduling.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方 法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand the methods according to the above embodiments. The method can be implemented with the help of software plus the necessary general hardware platform. Of course, it can also be implemented through hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to cause a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of this application.
在本实施例中还提供了一种组播包的复制装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a device for copying multicast packets, which is used to implement the above embodiments and preferred implementations. What has already been described will not be described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
图5是根据本申请实施例的一种组播包的复制装置的结构框图,如图5所示,该装置包括:Figure 5 is a structural block diagram of a device for replicating multicast packets according to an embodiment of the present application. As shown in Figure 5, the device includes:
存入模块501,用于将待复制的组播包存入组播包复制队列中;The storage module 501 is used to store multicast packets to be copied into the multicast packet copy queue;
确定模块502,用于从组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,组播包复制队列包括至少两个待复制的组播包;The determination module 502 is configured to determine the first multicast packet to be copied pointed by the target pointer from the multicast packet copy queue, where the multicast packet copy queue includes at least two multicast packets to be copied;
查找模块503,用于查找第一组播包的组播成员信息,并获取第一组播包的第一组播复制信息;The search module 503 is used to search for the multicast member information of the first multicast packet and obtain the first multicast replication information of the first multicast packet;
获取模块504,用于在等待接收第一组播包的组播成员信息的同时,将目标指针指向下一个待复制的第二组播包,以获取第二组播包的组播复制信息;The acquisition module 504 is configured to point the target pointer to the next second multicast packet to be copied while waiting to receive the multicast member information of the first multicast packet, so as to obtain the multicast replication information of the second multicast packet;
移出模块505,用于在接收到第一组播包的全部组播成员信息的情况下,将携带第一组播复制信息的第一组播包移出组播包复制队列。The removal module 505 is configured to remove the first multicast packet carrying the first multicast replication information from the multicast packet replication queue when all multicast member information of the first multicast packet is received.
通过本申请实施例提供的方案,将待复制的组播包存入组播包复制队列中;从组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,组播包复制队列包括至少两个待复制的组播包;查找第一组播包的组播成员信息,并获取第一组播包的第一组播复制信息;在等待接收第一组播包的组播成员信息的同时,将目标指针指向下一个待复制的第二组播包,以获取第二组播包的组播复制信息;在接收到第一组播包的全部组播成员信息的情况下,将携带第一组播复制信息的第一组播包移出组播包复制队列。由于待复制的组播包可以轮流查询组播成员信息,不必再等待前一个包复制完全结束,提高了带宽利用率,解决了由于组播表查表延时大于该组播包复制一次所用的时间导致无法做到全线速复制,进而造成带宽浪费的技术问题。Through the solution provided by the embodiment of this application, the multicast packet to be copied is stored in the multicast packet copy queue; the first multicast packet to be copied pointed to by the target pointer is determined from the multicast packet copy queue, where, The multicast packet copy queue includes at least two multicast packets to be copied; searches for the multicast member information of the first multicast packet and obtains the first multicast copy information of the first multicast packet; while waiting to receive the first multicast packet While receiving the multicast member information of the packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast copy information of the second multicast packet; after receiving all multicast members of the first multicast packet In the case of information, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue. Since multicast packets to be copied can query multicast member information in turn, there is no need to wait for the previous packet to be copied completely, which improves bandwidth utilization and solves the problem that the multicast table lookup delay is greater than the time it takes to copy the multicast package once. Time makes it impossible to achieve full line-speed replication, which in turn causes technical problems of wasted bandwidth.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that each of the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but is not limited to this: the above modules are all located in the same processor; or the above modules can be implemented in any combination. The forms are located in different processors.
本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。Embodiments of the present application also provide a computer-readable storage medium that stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the computer-readable storage medium may include but is not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
本申请的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。 An embodiment of the present application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the above-mentioned embodiments and exemplary implementations, and details will not be described again in this embodiment.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented using general-purpose computing devices, and they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. They may be implemented in program code executable by a computing device, such that they may be stored in a storage device for execution by the computing device, and in some cases may be executed in a sequence different from that shown herein. Or the described steps can be implemented by making them into individual integrated circuit modules respectively, or by making multiple modules or steps among them into a single integrated circuit module. As such, the application is not limited to any specific combination of hardware and software.
以上所述仅为本申请的可选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 The above are only optional embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the principles of this application shall be included in the protection scope of this application.

Claims (11)

  1. 一种组播包的复制方法,包括:A method for copying multicast packets, including:
    将待复制的组播包存入组播包复制队列中;Store the multicast packets to be copied in the multicast packet copy queue;
    从所述组播包复制队列中确定出目标指针所指向的待复制的第一组播包,其中,所述组播包复制队列包括至少两个待复制的组播包;Determine the first multicast packet to be copied pointed to by the target pointer from the multicast packet copy queue, where the multicast packet copy queue includes at least two multicast packets to be copied;
    查找所述第一组播包的组播成员信息,并获取所述第一组播包的第一组播复制信息;Search for the multicast member information of the first multicast packet, and obtain the first multicast replication information of the first multicast packet;
    在等待接收所述第一组播包的组播成员信息的同时,将所述目标指针指向下一个待复制的第二组播包,以获取所述第二组播包的组播复制信息;While waiting to receive the multicast member information of the first multicast packet, point the target pointer to the next second multicast packet to be copied to obtain the multicast replication information of the second multicast packet;
    在接收到所述第一组播包的全部组播成员信息的情况下,将携带所述第一组播复制信息的所述第一组播包移出所述组播包复制队列。When all multicast member information of the first multicast packet is received, the first multicast packet carrying the first multicast replication information is removed from the multicast packet replication queue.
  2. 根据权利要求1所述的方法,其中,所述查找所述第一组播包的组播成员信息包括:The method according to claim 1, wherein the finding the multicast member information of the first multicast packet includes:
    从所述第一组播包的包首标志中提取所述第一组播包的组播标识;Extract the multicast identifier of the first multicast packet from the packet header identifier of the first multicast packet;
    发送基于所述第一组播包的组播标识生成的查询请求,其中,所述查询请求用于向组播复制信息表发起对组播成员信息的读请求查询;Send a query request generated based on the multicast identifier of the first multicast packet, wherein the query request is used to initiate a read request query for multicast member information to the multicast replication information table;
    接收查找到的所述第一组播包的组播成员信息,并将查找到的所述第一组播包的组播成员信息整合进报文描述符中。Receive the found multicast member information of the first multicast packet, and integrate the found multicast member information of the first multicast packet into a message descriptor.
  3. 根据权利要求1所述的方法,其中,在所述查找所述第一组播包的组播成员信息之后,还包括:The method according to claim 1, wherein after searching for the multicast member information of the first multicast packet, it further includes:
    在当前查找到的所述第一组播包的组播成员信息并非最后一个组播成员信息的情况下,将携带所述第一组播复制信息的所述目标组播包移出所述组播包复制队列,并将所述目标组播包的包体数据复制写入目标缓存中,其中,所述目标缓存中存储的组播包将被重新输入所述组播包复制队列中。When the currently found multicast member information of the first multicast packet is not the last multicast member information, the target multicast packet carrying the first multicast copy information is moved out of the multicast The packet copy queue is configured to copy and write the packet body data of the target multicast packet into the target cache, where the multicast packets stored in the target cache will be re-entered into the multicast packet copy queue.
  4. 根据权利要求3所述的方法,其中,在将所述目标组播包的包体数据复制写入目标缓存中之后,还包括:The method according to claim 3, wherein after copying and writing the packet body data of the target multicast packet into the target cache, it further includes:
    在没有新的待复制的组播包输入所述组播包复制队列的情况下,将所述目标缓存中存储的组播包输入所述组播包复制队列,其中,在所述目标缓存被清空之前,所述组播包复制队列将不会输入新的待复制的组播包。In the case where no new multicast packet to be copied is entered into the multicast packet copy queue, the multicast packet stored in the target cache is entered into the multicast packet copy queue, wherein, when the target cache is Before clearing, the multicast packet copy queue will not input new multicast packets to be copied.
  5. 根据权利要求2所述的方法,其中,所述获取所述第一组播包的第一组播复制信息包括:The method according to claim 2, wherein said obtaining the first multicast replication information of the first multicast packet includes:
    发送查表请求,其中,所述查表请求用于请求基于查表地址获取组播复制信息;Send a table lookup request, where the table lookup request is used to request to obtain multicast replication information based on the table lookup address;
    使用所述查表地址向组播复制信息表发起读请求;Use the table lookup address to initiate a read request to the multicast replication information table;
    获取在所述组播复制信息表中查找到的一条或多条组播复制信息表项;Obtain one or more multicast replication information entries found in the multicast replication information table;
    将对所述一条或多条组播复制信息表项解析得到的所述第一组播复制信息打包发送给所 述组播包复制队列。The first multicast replication information obtained by parsing the one or more multicast replication information entries is packaged and sent to all The multicast packet replication queue.
  6. 根据权利要求5所述的方法,还包括:The method of claim 5, further comprising:
    接收组播变更写请求,其中,所述组播变更写请求用于请求对所述组播复制信息表中已存的组播复制信息执行变更操作;Receive a multicast change write request, wherein the multicast change write request is used to request to perform a change operation on the multicast replication information already stored in the multicast replication information table;
    暂存所述组播变更写请求,并开始实时监测所述组播包复制队列的组播复制进程;Temporarily store the multicast change write request, and start monitoring the multicast replication process of the multicast packet replication queue in real time;
    判断所述组播包复制队列中是否存在至少一个组播包参与复制;Determine whether there is at least one multicast packet participating in the replication in the multicast packet replication queue;
    在存在至少一个组播包参与复制的情况下,记录接收到所述组播变更写请求时,尚未发送的用于查询组播成员信息的查表请求的组播包的数量;In the case where at least one multicast packet participates in replication, record the number of multicast packets that have not yet been sent for table lookup requests for querying multicast member information when the multicast change write request is received;
    在所述尚未发送的用于查询组播成员信息的查询请求的组播包全部发送查表请求的情况下,暂停发送所述查表请求,并按照暂存的所述组播变更写请求,将所请求的变更表项内容写入对应的写入地址。When all the multicast packets of the query request for querying multicast member information that have not yet been sent are sent to the table lookup request, suspend sending the table lookup request, and write the multicast change request according to the temporary storage, Write the requested change entry content to the corresponding write address.
  7. 根据权利要求1所述的方法,其中,在将携带所述第一组播复制信息的所述第一组播包移出所述组播包复制队列时,还包括:The method according to claim 1, wherein when moving the first multicast packet carrying the first multicast replication information out of the multicast packet replication queue, it further includes:
    对所述第一组播包中的组播信元地址进行回收;Recycle the multicast cell address in the first multicast packet;
    判断当前回收的组播信元地址是否处于等待总复制份数相同组播信元地址的读返回过程中;Determine whether the currently recycled multicast cell address is in the process of waiting for the read return of the multicast cell address with the same total number of copies;
    在处于等待所述总复制份数相同组播信元地址的读返回过程中,取消对所述当前回收的组播信元地址对应的组播信元的输出,并等待所述总复制份数读请求;While waiting for the read return of the multicast cell address with the same total number of copies, cancel the output of the multicast cell corresponding to the currently recycled multicast cell address, and wait for the total number of copies. read request;
    在并未处于等待所述总复制份数相同组播信元地址的读返回过程中,以所述当前回收的组播信元地址为读地址向总复制份数发起读请求;While not in the process of waiting for the read return of the multicast cell address with the same total number of copies, use the currently recycled multicast cell address as the read address to initiate a read request to the total number of copies;
    以所述当前回收的组播信元地址为写地址,向所述写地址发起总复制份数写请求。Using the currently recycled multicast cell address as a write address, initiate a write request for the total number of copies to the write address.
  8. 根据权利要求7所述的方法,其中,在对所述第一组播包中的组播信元地址进行回收时,还包括:The method according to claim 7, wherein when recycling the multicast cell address in the first multicast packet, it further includes:
    判断当前回收的组播信元地址是否处于等待已调度份数相同组播信元地址的读返回过程中;Determine whether the currently recycled multicast cell address is in the process of waiting for the read return of the same number of scheduled multicast cell addresses;
    在处于等待已调度份数相同组播信元地址的读返回过程中,取消对所述当前回收的组播信元地址对应的组播信元的输出,并发起已调度份数和总复制份数的读请求;While waiting for the read return of the multicast cell address with the same number of scheduled copies, cancel the output of the multicast cell corresponding to the currently recycled multicast cell address, and initiate the number of scheduled copies and total copies. number of read requests;
    在并未处于等待已调度份数相同组播信元地址的读返回过程中,以所述当前回收的组播信元地址为读地址,同时向已调度份数和总复制份数发起读请求。While not waiting for the read return of the multicast cell address with the same number of scheduled copies, use the currently recycled multicast cell address as the read address, and simultaneously initiate a read request to the scheduled number of copies and the total number of copies. .
  9. 一种组播包的复制装置,包括:A device for replicating multicast packets, including:
    存入模块,设置为将待复制的组播包存入组播包复制队列中;The storage module is set to store multicast packets to be copied into the multicast packet copy queue;
    确定模块,设置为从所述组播包复制队列中确定出目标指针所指向的待复制的第一组播 包,其中,所述组播包复制队列包括至少两个待复制的组播包;Determining module, configured to determine the first multicast to be copied pointed to by the target pointer from the multicast packet copy queue. packet, wherein the multicast packet copy queue includes at least two multicast packets to be copied;
    查找模块,设置为查找所述第一组播包的组播成员信息,并获取所述第一组播包的第一组播复制信息;A search module configured to search for the multicast member information of the first multicast packet and obtain the first multicast replication information of the first multicast packet;
    获取模块,设置为在等待接收所述第一组播包的组播成员信息的同时,将所述目标指针指向下一个待复制的第二组播包,以获取所述第二组播包的组播复制信息;The acquisition module is configured to point the target pointer to the next second multicast packet to be copied while waiting to receive the multicast member information of the first multicast packet, so as to obtain the information of the second multicast packet. Multicast replication information;
    移出模块,设置为在接收到所述第一组播包的全部组播成员信息的情况下,将携带所述第一组播复制信息的所述第一组播包移出所述组播包复制队列。A removal module configured to remove the first multicast packet carrying the first multicast copy information out of the multicast packet copy when all multicast member information of the first multicast packet is received. queue.
  10. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至8任一项中所述的方法。A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the method described in any one of claims 1 to 8 when running. .
  11. 一种电子装置,包括存储器和处理器,其中,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至8任一项中所述的方法。 An electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform the method described in any one of claims 1 to 8. method.
PCT/CN2023/083747 2022-06-30 2023-03-24 Multicast packet duplication method and apparatus, storage medium, and electronic apparatus WO2024001340A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210765523.XA CN117376274A (en) 2022-06-30 2022-06-30 Multicast packet copying method and device, storage medium and electronic device
CN202210765523.X 2022-06-30

Publications (1)

Publication Number Publication Date
WO2024001340A1 true WO2024001340A1 (en) 2024-01-04

Family

ID=89382618

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/083747 WO2024001340A1 (en) 2022-06-30 2023-03-24 Multicast packet duplication method and apparatus, storage medium, and electronic apparatus

Country Status (2)

Country Link
CN (1) CN117376274A (en)
WO (1) WO2024001340A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7263099B1 (en) * 2002-08-14 2007-08-28 Juniper Networks, Inc. Multicast packet replication
CN101340389A (en) * 2008-08-29 2009-01-07 华为技术有限公司 Multicast packet copy method and apparatus
CN102821045A (en) * 2012-08-03 2012-12-12 中兴通讯股份有限公司 Method and device for copying multicast message
CN108055211A (en) * 2017-12-22 2018-05-18 盛科网络(苏州)有限公司 A kind of method of multicast replication, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7263099B1 (en) * 2002-08-14 2007-08-28 Juniper Networks, Inc. Multicast packet replication
CN101340389A (en) * 2008-08-29 2009-01-07 华为技术有限公司 Multicast packet copy method and apparatus
CN102821045A (en) * 2012-08-03 2012-12-12 中兴通讯股份有限公司 Method and device for copying multicast message
CN108055211A (en) * 2017-12-22 2018-05-18 盛科网络(苏州)有限公司 A kind of method of multicast replication, equipment and storage medium

Also Published As

Publication number Publication date
CN117376274A (en) 2024-01-09

Similar Documents

Publication Publication Date Title
KR101407743B1 (en) Method for processing data packets in flow-aware network nodes
WO2021088466A1 (en) Method for improving message storage efficiency of network chip, device, and storage medium
CN101551736B (en) Cache management device and method based on address pointer linked list
CN110737536B (en) Message storage method and message reading method based on shared memory
CN110134648A (en) Log processing method, device, equipment, system and computer readable storage medium
CN110555001B (en) Data processing method, device, terminal and medium
WO2020199760A1 (en) Data storage method, memory and server
CN111475759A (en) Message pushing platform, method, device, server and storage medium
WO2020157594A1 (en) Handling an input/output store instruction
CN110457305B (en) Data deduplication method, device, equipment and medium
WO2022237695A1 (en) High-concurrency protocol stack offloading method and device based on host-side large-capacity memory, and medium
WO2014180397A1 (en) Network data packet sending method and device
CN107493309B (en) File writing method and device in distributed system
WO2024001340A1 (en) Multicast packet duplication method and apparatus, storage medium, and electronic apparatus
CN113377288A (en) Hardware queue management system and method, solid state disk controller and solid state disk
CN116483738B (en) Data access method and device, storage medium and electronic device
CN110445580B (en) Data transmission method and device, storage medium, and electronic device
CN116155828B (en) Message order keeping method and device for multiple virtual queues, storage medium and electronic equipment
CN114567614B (en) Method and device for realizing ARP protocol processing based on FPGA
JP2010004262A (en) Information reception device and information reception method
CN109992447A (en) Data copy method, device and storage medium
CN111399753B (en) Method and device for writing pictures
CN114157619A (en) Message cache management method and device and network processor
CN114089912A (en) Data processing method and device based on message middleware and storage medium
CN107615259A (en) A kind of data processing method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23829531

Country of ref document: EP

Kind code of ref document: A1