WO2014019511A1 - 多播报文复制方法及装置 - Google Patents

多播报文复制方法及装置 Download PDF

Info

Publication number
WO2014019511A1
WO2014019511A1 PCT/CN2013/080512 CN2013080512W WO2014019511A1 WO 2014019511 A1 WO2014019511 A1 WO 2014019511A1 CN 2013080512 W CN2013080512 W CN 2013080512W WO 2014019511 A1 WO2014019511 A1 WO 2014019511A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
queue
message
module
copied
Prior art date
Application number
PCT/CN2013/080512
Other languages
English (en)
French (fr)
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 中兴通讯股份有限公司
Priority to EP13825867.8A priority Critical patent/EP2869503B1/en
Priority to US14/418,980 priority patent/US9407447B2/en
Publication of WO2014019511A1 publication Critical patent/WO2014019511A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/189Arrangements for providing special services to substations for broadcast or conference, e.g. multicast in combination with wireless systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/20Support for services
    • H04L49/201Multicast operation; Broadcast operation

Definitions

  • the present invention relates to a multicast message copying technology, and in particular to a multicast message copying method and apparatus. Background technique
  • Multicast is a single-point to multi-point data transmission method in the network, which can save network bandwidth, reduce network load, and improve network transmission efficiency.
  • the replication of multicast messages is performed by the upstream side and the downstream side.
  • the uplink side implements replication between different line cards, which is implemented by the switching network, and the number of copies is limited; while the downstream side performs copying in the line card, a large amount of data is required to be copied.
  • multicast replication is performed on the downstream line card, if the traditional method is used, the packets are directly queued in the output port after the message is copied, which consumes a large amount of storage resources, which is not conducive to large data volume replication. At the same time, its structure is not conducive to the expansion of the number of ports, and the replication between ports will also interfere with each other. Summary of the invention
  • the embodiment of the invention provides a method and a device for copying multicast messages, which solves the problem that a large amount of storage resources are consumed when performing multicast replication in a downlink side line card in the related art.
  • a multicast message copying method including:
  • Step 1 The received packet is stored in the packet buffering module, and the inter-port copying module obtains the cached address of the packet, the inter-port copy information of the packet, and the intra-port copy information of the packet. And copying the cache address according to the inter-port copy information, and sending the copied cache address and the corresponding intra-port copy information to the port queue module for saving;
  • Step 2 The port scheduling module schedules a cache address of the port queue module, and the port queue module outputs a cache for packet replication according to the stored intra-port copy information under the scheduling of the port scheduling module. address;
  • Step 3 The packet buffering module reads the corresponding packet according to the cache address output by the port queue module, and outputs the corresponding packet.
  • the step of obtaining, by the inter-port copy module, the cache address of the packet, the inter-port copy information of the packet, and the copying information in the port of the “3 ⁇ 4 text” includes:
  • the inter-port copy module obtains, from the packet buffering module, a cache address of the packet and a multicast identifier ID of the message;
  • the intra-port copy information includes: a port to which each cache address needs to be copied; the intra-port copy information includes: the number of copies of the packet to be copied according to each cache address in each port.
  • the step of the port queue module, in the scheduling of the port scheduling module, outputting a cache address that needs to be copied according to the corresponding intra-port copy information includes:
  • Step 21 The port queue module outputs, according to the scheduling of the port scheduling module, a cache address corresponding to the currently required packet, and updates the corresponding intra-port copy information in the port queue module.
  • Step 22 The port queue module determines, according to the intra-port copy information, whether the packet to be copied in the port corresponding to the cache address is copied, and if not, continues to output the cache address corresponding to the packet that needs to be copied. , until the copy of the message that needs to be copied is completed; if yes, go to step 23;
  • Step 23 If the port queue module determines that the currently copied packet has been copied, go to Step 21-23 until the packets of all ports are copied.
  • the port queue module is configured with mutually independent port queues corresponding to the respective ports, and the port queue module uses a linked list structure to store a cache address received by the corresponding port queue and needs to copy the report according to the cache address.
  • the port number module includes: a queue head, a queue body, and a queue tail; wherein, the queue first stores a head pointer of each port queue, a cache address corresponding to a packet that needs to be copied, and According to the cache address, the number of copies of the packet needs to be copied, and the queue head pointer is used to store the address of the next cache address in the queue of the local port; the queue body stores the cache address corresponding to the packet that needs to be copied currently.
  • the step of sending the copied cache address and the corresponding in-port copy information to the port queue module for saving includes:
  • the port queue module first writes the queue head pointer of each port queue, the cache address corresponding to the packet that needs to be copied, and the number of copies of the packet that needs to be copied according to the cache address to the queue header. Writing a tail pointer of each port queue to the tail of the queue, and according to the write address indicated by the tail pointer, the received other cache address of each port queue and the copy required to be copied according to the cache address The number is written to the queue body.
  • the step of the port queue module, in the scheduling of the port scheduling module, outputting a cache address corresponding to the currently required packet, and updating the corresponding intra-port copy information in the port queue module includes:
  • the port queue module reads, according to the scheduling of the port scheduling module, the cache address corresponding to the current packet to be copied stored in the port queue, and outputs the buffer address, and the cached address is updated once.
  • the number of copies of the packet to be copied is determined by the number of copies of the packet to be copied according to the number of copies of the packet to be copied.
  • the head pointer of the port queue reads the next cache address from the queue body and copies the number of copies according to the cache address, and writes it into the port queue of the queue head.
  • the method further includes:
  • the cache address recovery module obtains the total number of copies of the packets corresponding to each cache address through the inter-port copy module, and the number of copies of the copied packets is updated every time the cache address is sent out;
  • a multicast packet replication apparatus includes a message cache module, an inter-port copy module, a port queue module, and a port scheduling module, where:
  • the message buffering module is configured to: store the received message, and read the corresponding message according to the cache address output by the port queue module, and output the message;
  • the inter-port copy module is configured to: obtain a cache address of the packet, copy information between the packets of the packet, and intra-port copy information of the packet, and use the inter-port copy information to The cache address is copied, and the copied cache address and the corresponding intra-port copy information are sent to the port queue module;
  • the port queue module is configured to: save the received cache address and the corresponding intra-port copy information, and output, according to the stored intra-port copy information, a buffer that needs to be copied by the port scheduling module. Address
  • the port scheduling module is configured to: schedule a cache address of the port queue module.
  • the inter-port copy module is configured to obtain, according to the manner, a cache address of the packet, an inter-port copy information of the message, and an in-port copy information of the message: Obtaining, by the packet buffering module, a cache address of the packet and a multicast identifier ID of the packet; acquiring, according to the multicast ID, the inter-port copy information and the port from a preset multicast replication table. Copy information internally;
  • the multicast replication table includes inter-port copy information and intra-port copy information corresponding to each multicast ID.
  • the inter-port copy information includes: a port to which each cache address needs to be copied;
  • the intra-port copy information includes: the number of copies of the packet that need to be copied according to each cache address in each port.
  • the port queue module includes an output sub-module and a judging sub-module, where: the output sub-module is configured to: output, according to the scheduling of the port scheduling module, a cache address corresponding to a packet that needs to be copied currently. And updating the corresponding intra-port copy information in the port queue module;
  • the determining sub-module is configured to: determine, according to the copy information, whether the packet that needs to be copied on the port corresponding to the cache address is copied, and if not, continue to invoke the cache corresponding to the output sub-module for the packet that needs to be copied. The address is output until the copy of the message that needs to be copied is completed. If the determination is yes, the output sub-module and the judging sub-module are called until the packets of all the ports are copied.
  • the port queue module is configured with mutually independent port queues corresponding to the respective ports, and the port queue module uses a linked list structure to store a cache address received by the corresponding port queue and needs to copy the report according to the cache address.
  • the port number module includes: a queue head, a queue body, and a queue tail; wherein, the queue first stores a head pointer of each port queue, a cache address corresponding to a packet that needs to be copied, and According to the cache address, the number of copies of the packet needs to be copied, and the queue head pointer is used to store the address of the next cache address in the queue of the local port; the queue body stores the cache address corresponding to the packet that needs to be copied currently.
  • the port queue module further includes a save submodule, where:
  • the saving sub-module is configured to: first write the leader pointer of each port queue, the cache address corresponding to the packet that needs to be copied, and the number of copies of the packet that needs to be copied according to the cache address to the queue First, write the tail pointer of each port queue to the end of the queue, and according to the write address indicated by the tail pointer, the received other cache address of each port queue and the need to copy the report according to the cache address The number of copies of the text is written into the queue body.
  • the output sub-module is configured to output, according to the scheduling of the port scheduling module, a cache address corresponding to a packet that needs to be copied, and update a corresponding intra-port copy in the port queue module.
  • the cache address corresponding to the currently required packet stored in the port queue is read from the first queue, and the buffer address is output once, and the cache address needs to be copied. If the number of copies of the message needs to be copied according to the number of copies of the cache address, the number of copies of the message needs to be copied, and the next one is read from the queue according to the leader of the port queue. The cache address and the number of copies of the message that need to be copied according to the cache address are written into the port queue of the queue first.
  • the device further includes a cache address recovery module, where:
  • the cache address recovery module is configured to: obtain, by the inter-port copy module, the total number of copies of the packets corresponding to each cache address, and update the number of copies of the copied packets once the cache address is sent out; The total number of copies of the file is compared with the number of copies of the copied message. If they are equal, the cached address corresponding to the copied message is collected, and the cached address of the message buffer module is notified. , and clear the number of copies of the copied message.
  • the above technical solution uses the two-level replication mode, the first level first performs the replication between the ports, and the second level performs the replication in the port, which solves the problem that the related technology in the downlink side line card performs the multicast replication.
  • a large number of storage resources can realize the replication of large data volumes of multicast messages, and facilitate the expansion of the number of ports and the increase and decrease of the number of copies.
  • FIG. 1 is a schematic structural diagram of a multicast packet copying apparatus according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a multicast replication table according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a port queue module according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an internal structure of a cache address recovery module according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a multicast message copying apparatus according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of detailed processing of a multicast message copying apparatus according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a method for copying multicast messages according to an embodiment of the present invention.
  • the embodiment of the present invention provides a method and an apparatus for copying a multicast message, which are described below with reference to the accompanying drawings and embodiments.
  • the invention is described in further detail. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
  • FIG. 1 is a schematic structural diagram of a multicast packet copying apparatus according to an embodiment of the present invention. As shown in FIG. 1, a multicast message copying according to an embodiment of the present invention is shown.
  • the device includes: a message cache module 10, an inter-port copy module 12, a port queue module 14, and a port scheduling module 16.
  • the modules of the embodiments of the present invention are described in detail below.
  • the message buffering module 10 is configured to: store the received message, and read the message output according to the cache address output by the port queue module 14;
  • the message cache module 10 internally includes a large-capacity random access memory.
  • RAM random access memory
  • the inter-port copy module 12 is configured to: obtain a buffer address of the packet, and copy the inter-port copy of the packet. And copying information in the port of the packet, and copying the cache address according to the inter-port copy information (ie, inter-port copy), and transmitting the copied cache address and corresponding intra-port copy information to the port queue module 14 ;
  • the inter-port copy is the first-level replication of the packet, that is, the input packet is copied between the ports, and the buffer address corresponding to the packet is output to the port queue.
  • the inter-port copy module 12 is configured to: obtain the cache address of the message from the message buffer module 10 and the multicast identity number (ID, IDentity) of the message; and obtain the multicast ID from the preset multicast copy table according to the multicast ID.
  • the inter-port copy information and the intra-port copy information where the multicast copy table includes the inter-port copy information and the intra-port copy information corresponding to each multicast ID, and the inter-port copy information includes: a port to which each cache address needs to be copied;
  • the internal replication information includes: The number of copies of the packet that need to be copied according to each cache address in each port.
  • the multicast replication table is composed of multiple entries, and each entry corresponds to a multicast ID (MG_ID). Within each MG-ID entry, it is divided into several parts according to the number of ports, and each one represents the corresponding number of copies in one port. If the number of copies is 0, it means that the port does not need to be copied.
  • the inter-port copy module 12 can query the ports to which the cache address of the packet needs to be copied according to the MG-ID, and how many copies need to be copied in each port. If you add the number of copies of all ports (MG-ID), you can get the total number of copies.
  • the port queue module 14 is configured to: save the received cache address and corresponding intra-port copy information, and, under the scheduling of the port scheduling module 16, output a cache address that needs to be copied according to the stored intra-port copy information;
  • the port queue module 14 needs to perform the second-level replication of the packet, and then perform the replication of the packet in the port again for the cached address that is copied between the ports.
  • the port queue module 14 internally queues according to ports, and each port queue is independent of each other.
  • the port queue module 14 specifically includes an output sub-module and a judging sub-module, where: the output sub-module is configured to: output, under the scheduling of the port scheduling module 16, the cache address corresponding to the packet that needs to be copied, And updating the corresponding intra-port copy information in the port queue module 14;
  • the determining submodule is configured to: determine the intra-port copy information corresponding to the cache address If the packet that needs to be copied is not copied, continue to call the output sub-module to output the buffer address corresponding to the packet that needs to be copied until the copy of the packet that needs to be copied is completed. After the message has been copied, the output submodule and the judgment submodule are called to perform intra-port replication of the next port until the packets of all ports are copied.
  • the port queue module 14 is provided with mutually independent port queues corresponding to the respective ports, and the port queue module 14 uses a linked list structure to store the cache address received by the corresponding port queue and needs to copy the packet according to the cache address.
  • the number of copies, the port queue module 14 includes: a queue head, a queue body, and a queue tail, wherein the queue first stores the head pointer of each port queue, the cache address corresponding to the currently required packet, and the cache address according to the cache address The number of copies of the message, the leader of the queue is used to store the address of the next cache address in the queue of this port.
  • the queue body stores the cache address corresponding to the packet that needs to be copied, and the number of copies of the packet that needs to be copied according to the cache address, other cache addresses received by each port queue, and the need to copy the packet according to the cache address.
  • the tail pointer of each port queue is stored in the tail of the queue, and the tail pointer indicates the other cache addresses received in each port queue and the number of copies of the packets to be copied according to the cache address are written to the corresponding queue body. address.
  • the port queue module 14 further includes: a saving submodule, where the saving submodule is configured to: first, a queue head pointer of each port queue, a cache address corresponding to a packet that needs to be copied, and According to the cache address, the number of copies of the packet to be copied is written to the first queue, the tail pointer of each port queue is written to the end of the queue, and the other caches received by the respective port queues are written according to the write address indicated by the tail pointer. The address and the number of copies of the message that need to be copied according to the cache address are written into the queue body.
  • the saving submodule is configured to: first, a queue head pointer of each port queue, a cache address corresponding to a packet that needs to be copied, and According to the cache address, the number of copies of the packet to be copied is written to the first queue, the tail pointer of each port queue is written to the end of the queue, and the other caches received by the respective port queues are written according to the write address indicated by the tail pointer
  • the output sub-module is configured to: after the scheduling of the port scheduling module 16, read the cache address corresponding to the currently-replicated packet stored in the port queue from the first queue, and output the cache address once, and update the cache address.
  • the cache address needs to copy the number of copies of the packet. If the number of copies of the packet to be copied is determined according to the number of copies of the cache address, the packet to be copied is read according to the queue leader of the port queue. The next cache address and the number of copies of the message that need to be copied according to the cache address are written to the port queue at the beginning of the queue.
  • FIG. 3 is a schematic structural diagram of a port queue module 14 according to an embodiment of the present invention.
  • the port queue module 14 uses a linked list structure to store each port queue, which saves storage compared to the FIFO structure. Resources.
  • the port queue module 14 is generally composed of a queue tail, a queue body, and a first three parts of the queue. The queue first stores the head pointer of each port queue, the cache address corresponding to the packet, and the number of copies of the packet.
  • the pointer is used to store the address of the next data in the queue in the port queue, and is used to link the data in the queue together;
  • the cache address is the address of the packet data in the message buffer module 10;
  • the number of copies is the message The total number of copies that need to be copied within the port.
  • the contents of the queue store are similar to the first queue, while the tail of the queue stores only pointers.
  • the queue When the queue is queued, the queue first is written first; after the queue is first written, the pointer in the queue tail is used to implement the write in the queue body.
  • the cache address When the queue is dequeued, the cache address is read from the first queue for output. Each time the team is out, the number of copies is reduced by 1 until it is reduced to 0, which means that the message is copied in the port. Only when the number of copies is reduced to 0, the next data is read from the queue body and written back to the queue first to complete the queue update operation. Before the copying is completed, the current message in the first column of the queue is used for output, and the intra-port copy of the message is implemented.
  • the port scheduling module 16 is configured to: schedule the cache address of the port queue module 14. Optionally, the port scheduling module 16 completes the scheduling of the port queue, and selects one packet from each port queue for scheduling output.
  • the device further includes: a cache address recovery module, configured to obtain, by the inter-port copy module 12, a total copy of the packet corresponding to each cache address. Number, the cache address is updated once every time, the number of copies of the copied message is updated; the total number of copies of the message is compared with the number of copies of the copied message, and if they are equal, the copied message is The corresponding cache address is reclaimed, and the buffer address that has been reclaimed by the message cache module 10 is notified, and the number of copies of the copied message is cleared to zero.
  • a cache address recovery module configured to obtain, by the inter-port copy module 12, a total copy of the packet corresponding to each cache address. Number, the cache address is updated once every time, the number of copies of the copied message is updated; the total number of copies of the message is compared with the number of copies of the copied message, and if they are equal, the copied message is The corresponding cache address is reclaimed, and the buffer address that has been reclaimed by the message cache module 10 is notified,
  • the cache address recovery module internally stores the total number of copies and the number of copies that have been dequeued, and releases the cache address according to the completion of the copy of the packet to implement address recovery.
  • FIG. 4 is a schematic diagram showing the internal structure of a cache address recovery module according to an embodiment of the present invention.
  • the cache address recovery module there are two pieces of RAM for storing the number of copies: the total number of copies of RAM and the number of deported RAMs.
  • the address depth of these two RAMs is the same as the address depth corresponding to the text buffer module 10.
  • the total number of copies of the RAM stores the total number of copies of the cached address, through the inter-port copy Module 12 is obtained.
  • the inter-port copy module 12 queries the multicast replication table, the number of copies of each port corresponding to the message MG_ID is added to obtain the total number of copies in the inter-port+port.
  • Dequeued Copies RAM stores the deported copy number information corresponding to the cached address, with an initial value of 0. Before the total number of copies is not completed, when the port scheduling module 16 outputs a cache address, the number of deported corresponding to the corresponding cache address in the deported RAM is incremented by one; only after the total number of copies is completed , the value is cleared to 0. The number of copies is used to compare the total number of copies of RAM and the number of copies of the RAM. Only the two are equal to represent the end of the port + replication in the port has ended.
  • a multicast packet replication apparatus includes: a multicast replication table 101, an inter-port replication module 102, and a newspaper.
  • FIG. 6 is a flowchart of detailed processing of the multicast message copying apparatus according to the embodiment of the present invention. As shown in FIG. 6, the multicast message copying apparatus shown in FIG. 5 includes the following processing:
  • Step 601 The multicast message copying device receives the input message.
  • the message entity is stored in the message cache module 103, and the MG_ID of the message is transmitted to the inter-port copy module 102.
  • Step 602 The inter-port copy module 102 obtains the cached address corresponding to the message entity from the message cache module 103.
  • Step 603 The inter-port copy module 102 queries the multicast replication table 101 according to the MG_ID, and obtains the replication information between the ports and the ports of the source.
  • Step 604 The inter-port copy module 102 performs the inter-port copying of the cache address corresponding to the packet, and sequentially transfers the copied data and the number of copies required for the second-level replication to the port queue module 104 in the order of the port number. .
  • Step 605 The port queue module 104 queues the received cache addresses in order, and stores the number of copies of each message in the port.
  • Step 606 the port scheduling module 105 performs scheduling output between the ports.
  • Step 607 The message caching module 103 reads the entity through the cache address sent by the port scheduling module 105, and outputs the data. Step 608, judging the number of remaining copies of the message in the port queue module 104. If the number of remaining copies is greater than 1, repeating steps 606 and 607, and continuing to schedule output of the current message; until the remaining number of copies is 0, on behalf of the copy is completed, go to step 609.
  • Step 609 After the packets of each port in the port queue module 104 are copied, the entire copy ends.
  • FIG. 7 is a flowchart of buffer address recovery according to an embodiment of the present invention. As shown in FIG. 7, combined with FIG. 5, the following specifically includes the following processing:
  • Step 701 The total number of copies is obtained by the inter-port copy module 102, and the total number of copies is written into the total number of copies of RAM.
  • Step 702 After the port scheduling module 105 performs packet dequeue, the number of copies corresponding to the current cache address is read from the total copy number RAM and the dequeued copy number RAM.
  • Step 703 adding 1 to the number of copies that have been read out.
  • Step 704 Compare the accumulated number of deported copies and the total number of copies. If the two are equal, the representative may reclaim the cache address, and perform step 706; if the number of copies that have been dequeued is less than the total number of copies The number indicates that the recovery has not been completed, and step 705 is performed.
  • Step 705 In the unfinished recovery phase, the accumulated number of dequeued copies are written back to the number of deported RAM. Subsequent steps 702 and 703 are repeated to continue the scheduling dequeue and the number of shares.
  • Step 706 after the recovery is completed, output a recycling indication to the message caching module 103, and clear the value of the number of copies in the deported RAM.
  • Step 707 the entire cache address recovery process ends.
  • the first level first performs the replication between the ports, and the second level performs the replication in the port, which can conveniently realize the expansion of the number of ports and the increase or decrease of the number of copies.
  • the management of the port queue it is implemented by using a linked list method, which saves storage resources.
  • each port uses the same packet to be dequeued multiple times to achieve replication, which further simplifies the use of queue resources.
  • two RAMs are used to store the total number of copies and the number of copies that have been dequeued, which effectively solves the problem of recovery of cache addresses.
  • FIG. 8 is a flowchart of a multicast message copying method according to an embodiment of the present invention, as shown in FIG. 8.
  • the multicast packet copying method includes the following processing: Step 801: Store the received packet in a packet buffering module, and the inter-port copying module obtains a cached address of the packet. Copy information between ports and intra-port copy information of packets, copy the cache address according to the inter-port copy information (that is, copy between ports), and send the copied cache address and corresponding intra-port copy information to the port queue. The module is saved;
  • the inter-port copy is the first-level replication of the packet, that is, the input packet is copied between the ports, and the buffer address corresponding to the packet is output to the port queue.
  • the inter-port copy module obtains the cache address of the packet, the inter-port copy information of the packet, and the intra-port copy information of the packet, and specifically includes: 1. The inter-port copy module from the packet cache module Obtaining the cache address of the packet and the multicast identifier ID of the packet; 2. Obtaining the inter-port copy information and the intra-port copy information from the preset multicast copy table according to the multicast ID, where the multicast copy table includes The inter-port copy information and the intra-port copy information corresponding to each multicast ID, and the inter-port copy information includes: a port to which each cache address needs to be copied; the intra-port copy information includes: each port needs to copy the packet according to each cache address. The number of copies.
  • the multicast replication table is composed of multiple entries, and each entry corresponds to a multicast ID (MG_ID). Within each MG-ID entry, it is divided into several parts according to the number of ports, and each one represents the corresponding number of copies in one port. If the number of copies is 0, it means that the port does not need to be copied.
  • the inter-port copy module 12 can query the ports to which the cache address of the packet needs to be copied according to the MG-ID, and how many copies need to be copied in each port. If all the values of the number of copies (MG-ID) of all ports are added, the total number of copies can be obtained.
  • Step 802 The port scheduling module schedules a cache address of the port queue module, and the port queue module outputs a cache address that needs to be copied according to the stored intra-port copy information under the scheduling of the port scheduling module;
  • the port queue module needs to perform the second-level replication of the packet, and then perform the packet replication in the port for the cached address that is copied between the ports.
  • the port queue module internally queues according to the port. Each port queue is independent of each other.
  • the port queue module outputs the cache address that needs to be copied according to the corresponding intra-port copy information in the scheduling of the port scheduling module, and specifically includes:
  • Step 8021 The port queue module outputs, according to the scheduling of the port scheduling module, the cache address corresponding to the currently required packet, and updates the corresponding intra-port copy information in the port queue module; Step 8022, the port queue module pair and the cache If the packet to be copied is not copied, the buffer address corresponding to the packet that needs to be copied is outputted until the copy of the packet that needs to be copied is completed.
  • Step 8023 If the port queue module determines that the currently copied packet has been copied, perform step 8021-8023 to perform intra-port replication of the next port until all the ports of the port are copied.
  • the port queue module is provided with mutually independent port queues ij corresponding to the respective ports, and the port queue module uses a linked list structure to store the cache address received by the corresponding port queue and needs to copy the packet according to the cache address.
  • the number of copies, the port queue module includes: a queue head, a queue body, and a queue tail, wherein the queue first stores the head pointer of each port queue, the cache address corresponding to the currently required packet, and needs to be copied according to the cache address.
  • the number of packets, the first pointer of the queue is used to store the address of the next cached address in the queue of the port.
  • the queue stores the cache address corresponding to the packet that needs to be copied, and the packet needs to be copied according to the cache address.
  • the tail pointer of each port queue is stored in the tail of the queue, and the tail pointer indicates each port queue.
  • Other cache addresses to be received and the number of copies that need to be copied according to the cache address Write to the write address of the corresponding queue body.
  • the port queue module when the port queue module stores the copied cache address and the corresponding port copy information, the port queue module first sets the head pointer of each port queue, the cache address corresponding to the currently required packet, and according to the cache. The number of copies of the address to be copied is written to the first of the queue, the tail pointer of each port queue is written to the end of the queue, and the other cached addresses received by the respective port queues are based on the write address indicated by the tail pointer. The cache address needs to be copied into the queue body for the number of copies of the message.
  • the port queue module outputs the packets that need to be copied under the scheduling of the port scheduling module.
  • the corresponding cache address, and the corresponding intra-port copy information in the port queue module are specifically included:
  • the port queue module reads the current packet to be copied stored in the port queue from the queue first in the scheduling of the port scheduling module.
  • the cache address is output. Each time the cache address is dequeued, the number of copies of the message needs to be copied. The number of copies of the message to be copied according to the cache address determines that the currently copied message has been copied. Next, the next cache address is read from the queue body according to the head pointer of the port queue, and the number of copies of the packet needs to be copied according to the cache address, and is written into the port queue at the head of the queue.
  • FIG. 3 is a schematic structural diagram of a port queue module according to an embodiment of the present invention.
  • the port queue module 14 uses a linked list structure to store each port queue, which saves storage resources compared to the FIFO structure.
  • the port queue module 14 is composed of a queue tail, a queue body and a first three parts of the queue.
  • the queue first stores the head pointer of each port queue, the cache address corresponding to the packet, and the number of copies of the packet.
  • the pointer is used to store the address of the next data in the queue in the port queue, and is used to link the data in the queue together;
  • the cache address is the address of the packet data in the message buffer module 10;
  • the number of copies is the message The total number of copies that need to be copied within the port.
  • the queue stores the same content as the queue first, while the queue tail only stores pointers.
  • the queue When the queue is queued, the queue first is written first; after the queue is first written, the pointer in the queue tail is used to implement the write in the queue body.
  • the cache address When the queue is dequeued, the cache address is read from the first queue for output. Each time the team is out, the number of copies is reduced by 1 until it is reduced to 0, which means that the message is copied in the port. Only when the number of copies is reduced to 0, the next data is read from the queue body and written back to the queue first to complete the queue update operation. Before the copying is completed, the current message in the first column of the queue is used for output, and the intra-port copy of the message is implemented.
  • Step 803 The message caching module reads the corresponding document according to the cache address output by the port queue module and outputs the corresponding message.
  • the port scheduling module completes the scheduling of the port queue, and selects a packet from each port queue for scheduling output.
  • the method for replicating the multicast packet further includes: the cache address recovery module acquires the total number of copies of the packet corresponding to each cache address by using the inter-port copy module, and the cache address is deleted once for each time, and the update is copied. The number of copies of the completed message; the cache address recovery module compares the total number of copies of the message with the number of copies of the copied message, and if they are equal, the corresponding number of the copied message The cache address is reclaimed, the buffer address that the message buffer module has reclaimed is notified, and the number of copies of the copied message is cleared to zero.
  • the cache address recovery module internally stores the total number of copies and the number of copies that have been dequeued, and releases the cache address according to the completion of the copy of the packet to implement address recovery.
  • FIG. 4 is a schematic diagram showing the internal structure of a cache address recovery module according to an embodiment of the present invention.
  • the cache address recovery module there are two pieces of RAM for storing the number of copies: the total number of copies of RAM and the number of deported RAMs.
  • the address depth of these two RAMs is the same as the address depth corresponding to the text buffer module 10.
  • the total number of copies of RAM stores the total number of copies of the cache address, obtained by the inter-port copy module 12.
  • the inter-port copy module 12 queries the multicast replication table, the number of copies of each port corresponding to the MG_ID of the message is added, and the total number of copies in the port+port is obtained.
  • Dequeued Copies RAM stores the deported copy number information corresponding to the cached address, with an initial value of 0. Before the total number of copies is not completed, when the port scheduling module 16 outputs a cache address, the number of deported shares corresponding to the corresponding cache address in the deported RAM is incremented by 1; only after the total number of copies is completed , the value is cleared to 0. The number of copies is used to compare the total number of copies of RAM and the number of copies of the RAM. Only the two are equal to represent the end of the port + replication in the port has ended.
  • FIG. 5 is a schematic structural diagram of a multicast packet copying apparatus according to an embodiment of the present invention.
  • a multicast packet replicating apparatus includes: a multicast replication table 101, an inter-port copy 102, and a packet.
  • FIG. 6 is a flowchart of detailed processing of the multicast message copying apparatus according to the embodiment of the present invention. As shown in FIG. 6, the multicast message copying apparatus shown in FIG. 5 includes the following processing:
  • Step 601 The multicast message copying device receives the input message.
  • the message entity is stored in the message cache module 103, and the MG_ID of the message is transmitted to the inter-port copy module 102.
  • step 602 the inter-port copy module 102 obtains the cached address corresponding to the message entity from the message cache module 103.
  • Step 603 The inter-port copy module 102 queries the multicast replication table 101 according to the MG_ID, and obtains the replication information between the ports and the ports of the packet.
  • Step 604 The inter-port copy module 102 performs the inter-port copying of the cache address corresponding to the packet, and sequentially transfers the copied data and the number of copies required for the second-level replication to the port queue module 104 in the order of the port number. .
  • Step 605 The port queue module 104 queues the received cache addresses in order, and stores the number of copies of each message in the port.
  • Step 606 the port scheduling module 105 performs scheduling output between the ports.
  • Step 607 The message caching module 103 reads the entity through the cache address sent by the port scheduling module 105, and outputs the data.
  • Step 608 judging the number of remaining copies of the message in the port queue module 104. If the number of remaining copies is greater than 1, repeating steps 606 and 607, and continuing to schedule output of the current message; until the remaining number of copies is 0, on behalf of the copy is completed, go to step 609.
  • Step 609 After the packets of each port in the port queue module 104 are copied, the entire copy ends.
  • FIG. 7 is a flowchart of buffer address recovery according to an embodiment of the present invention. As shown in FIG. 7, combined with FIG. 5, the following specifically includes the following processing:
  • Step 701 The total number of copies is obtained by the inter-port copy module 102, and the total number of copies is written into the total number of copies of RAM.
  • Step 702 After the port scheduling module 105 performs packet dequeue, the number of copies corresponding to the current cache address is read from the total copy number RAM and the dequeued copy number RAM.
  • Step 703 adding 1 to the number of copies that have been read out.
  • Step 704 Compare the accumulated number of deported copies and the total number of copies. If the two are equal, the representative may reclaim the cache address, and perform step 706; if the number of copies that have been dequeued is less than the total number of copies The number indicates that the recovery has not been completed, and step 705 is performed.
  • step 705 in the unfinished recovery phase, the accumulated number of dequeued copies are written back to the deported RAM. Subsequent steps 702 and 703 are repeated to continue the scheduling dequeue and the number of shares. Step 706, after the recovery is completed, output a recycling indication to the message buffering module 103, and clear the value of the share in the deported RAM.
  • Step 707 the entire cache address recovery process ends.
  • the embodiment of the present invention uses a two-level copying method to enable large-volume copying of multicast messages.
  • the replication structure of the multicast packet replication apparatus in the embodiment of the present invention is clear, the first level first performs the replication between the ports, and the second level performs the replication in the port, which can conveniently realize the expansion of the number of ports and the increase or decrease of the number of copies. .
  • the implementation of the linked list method saves storage resources.
  • each port uses the same packet to be dequeued multiple times to achieve replication, which further simplifies the use of queue resources.
  • two RAMs are used to store the total number of copies and the number of copies that have been dequeued, which effectively solves the problem of recovery of cache addresses.
  • the components therein are logically divided according to the functions to be implemented, but the present invention is not limited thereto, and the respective components may be re-as needed as needed. Dividing or combining, for example, some components may be combined into a single component, or some components may be further broken down into more subcomponents.
  • the various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the controller in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals.
  • Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • the above technical solution uses the two-level replication mode, the first level first performs the replication between the ports, and the second level performs the replication in the port, which solves the problem that the related technology in the downlink side line card performs the multicast replication.
  • a large number of storage resources can realize the replication of large data volumes of multicast messages, and facilitate the expansion of the number of ports and the increase and decrease of the number of copies.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

一种多播报文复制方法及装置,该方法包括:步骤1,将接收到的报文存储到报文缓存模块中,端口间复制模块获取报文的缓存地址、报文的端口间复制信息、以及报文的端口内复制信息,根据端口间复制信息对缓存地址进行复制,并将复制后的缓存地址和相应的端口内复制信息发送到端口队列模块进行保存;步骤2,端口调度模块对端口队列模块的缓存地址进行调度,端口队列模块在端口调度模块的调度下,根据存储的相应的端口内复制信息输出需要进行报文复制的缓存地址;步骤3,报文缓存模块根据端口队列模块输出的缓存地址读取相应的报文并输出。上述技术方案实现了多播报文的大数据量的复制。

Description

多播报文复制方法及装置
技术领域
本发明涉及多播报文复制技术, 特别是涉及一种多播报文复制方法及装 置。 背景技术
在数据通信领域,随着网络协定电视( IPTV, Internet Protocol Television )、 视频会议、 网络电台的兴起, 越来越多的厂商和业务开始支持多播(组播) 报文的应用。 多播是实现网络中单点到多点的数据传输方式, 能够节约网络 带宽, 降低网络负载, 提高网络的传输效率。
在目前的路由器和交换机的交换系统中, 多播报文的复制由上行侧和下 行侧来共同完成。 上行侧是实现不同线卡间的复制, 由交换网实现, 复制的 数量有限; 而下行侧是在实现线卡内进行复制, 需要进行大数据量的复制。 在下行侧线卡中进行多播复制的时候, 若釆用传统的方式, 将报文复制完成 后直接在输出端口中进行排队, 会耗费大量的存储资源, 不利于进行大数据 量的复制。 同时其结构也不利于端口数的扩展,端口间的复制也会互相干扰。 发明内容
本发明实施例提供了一种多播报文复制方法及装置, 以解决相关技术中 在下行侧线卡中进行多播复制时, 会耗费大量的存储资源的问题。
为解决上述技术问题, 釆用如下技术方案: 一种多播报文复制方法, 包括:
步骤 1 , 将接收到的报文存储到报文緩存模块中, 端口间复制模块获取 所述报文的緩存地址、 所述报文的端口间复制信息、 以及所述报文的端口内 复制信息, 根据所述端口间复制信息对所述緩存地址进行复制, 并将复制后 的緩存地址和相应的端口内复制信息发送到端口队列模块进行保存; 步骤 2, 端口调度模块对所述端口队列模块的緩存地址进行调度, 所述 端口队列模块在所述端口调度模块的调度下, 根据存储的相应的端口内复制 信息输出需要进行报文复制的緩存地址;
步骤 3 , 所述报文緩存模块根据所述端口队列模块输出的所述緩存地址 读取相应的报文并输出。
可选地, 所述端口间复制模块获取所述报文的緩存地址、 所述报文的端 口间复制信息、 以及所述"¾文的端口内复制信息的步骤包括:
所述端口间复制模块从所述报文緩存模块中获取所述报文的緩存地址以 及所述 4艮文的多播标识 ID;
根据所述多播标识 ID从预先设置的多播复制表中获取所述端口间复制 信息和所述端口内复制信息, 其中, 所述多播复制表中包含各多播 ID对应 的端口间复制信息和端口内复制信息, 所述端口间复制信息包括: 各个緩存 地址需要复制到的端口; 所述端口内复制信息包括: 每个端口内根据每个緩 存地址需要复制报文的份数。
可选地, 所述端口队列模块在所述端口调度模块的调度下, 根据存储的 相应的端口内复制信息输出需要进行报文复制的緩存地址的步骤包括:
步骤 21 , 所述端口队列模块在所述端口调度模块的调度下, 输出当前需 要复制的报文所对应的緩存地址, 并更新所述端口队列模块中相应的端口内 复制信息;
步骤 22,所述端口队列模块根据端口内复制信息判断与该緩存地址对应 的端口内需要复制的报文是否复制完成, 如果否, 则继续对当前需要复制的 报文所对应的緩存地址进行输出, 直到当前需要复制的报文复制完成; 如果 是, 则转步骤 23;
步骤 23 , 所述端口队列模块如果判断当前需要复制的报文已复制完成, 执行步骤 21-23 , 直到所有端口的报文都复制完成。 可选地, 所述端口队列模块中设置有与各个端口相对应的相互独立的端 口队列, 所述端口队列模块釆用链表结构保存相应端口队列接收到的緩存地 址和根据该緩存地址需要复制报文的份数,所述端口队列模块包括: 队列首、 队列体、 以及队列尾; 其中, 所述队列首存储各个端口队列的队首指针、 当 前需要复制的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的 份数, 所述队首指针用于存储下个緩存地址在本端口队列中的地址; 所述队 列体存储了除当前需要复制的报文所对应的緩存地址、 以及根据该緩存地址 需要复制报文的份数之外, 各个端口队列接收到的其他緩存地址和根据该緩 存地址需要复制报文的份数;所述队列尾中保存了各个端口队列的队尾指针, 所述队尾指针指示了各个端口队列中将所述接收到的其他緩存地址和根据该 緩存地址需要复制报文的份数写入到相应队列体的写入地址。
可选地, 将复制后的緩存地址和相应的端口内复制信息发送到端口队列 模块进行保存的步骤包括:
所述端口队列模块首先将各个端口队列的所述队首指针、 当前需要复制 的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份数写入到 所述队列首, 将各个端口队列的队尾指针写入所述队列尾, 并根据所述队尾 指针指示的写入地址将各个端口队列的所述接收到的其他緩存地址和根据该 緩存地址需要复制报文的份数写入到所述队列体中。
可选地, 所述端口队列模块在所述端口调度模块的调度下, 输出当前需 要复制的报文所对应的緩存地址, 并更新所述端口队列模块中相应的端口内 复制信息的步骤包括:
所述端口队列模块在所述端口调度模块的调度下, 从队列首中读取端口 队列中存储的当前需要复制的报文所对应的緩存地址进行输出, 该緩存地址 每出队一次, 更新该緩存地址需要复制报文的份数, 在根据该緩存地址需要 复制报文的份数确定当前需要复制的报文已复制完成的情况下, 根据所述端 口队列的队首指针从所述队列体中读取下一个緩存地址以及根据该緩存地址 需要复制^艮文的份数, 并写入所述队列首的所述端口队列中。
可选地, 所述方法还包括:
緩存地址回收模块通过端口间复制模块获取各緩存地址对应的报文总复 制份数, 緩存地址每出队一次, 更新已复制完的报文份数;
所述緩存地址回收模块将所述报文总复制份数与所述已复制完的报文份 数进行对比, 如果相等, 则对已复制完的报文所对应的緩存地址进行回收, 通知所述报文緩存模块已回收的緩存地址, 并将已复制完的报文份数清 0。 一种多播报文复制装置, 包括报文緩存模块、 端口间复制模块、 端口队 列模块和端口调度模块, 其中:
所述报文緩存模块设置成: 存储接收到的报文, 根据所述端口队列模块 输出的緩存地址读取相应的报文并输出;
所述端口间复制模块设置成: 获取所述报文的緩存地址、 所述报文的端 口间复制信息、 以及所述报文的端口内复制信息, 并根据所述端口间复制信 息对所述緩存地址进行复制, 并将复制后的緩存地址和相应的端口内复制信 息发送到所述端口队列模块;
所述端口队列模块设置成: 保存接收到的緩存地址和相应的端口内复制 信息, 并在所述端口调度模块的调度下, 根据存储的相应的端口内复制信息 输出需要进行报文复制的緩存地址;
所述端口调度模块设置成: 对所述端口队列模块的緩存地址进行调度。 可选地, 所述端口间复制模块设置成按照如下方式获取所述报文的緩存 地址、 所述 >¾文的端口间复制信息、 以及所述 ^艮文的端口内复制信息: 从所述报文緩存模块中获取所述报文的緩存地址以及所述报文的多播标 识 ID; 根据所述多播 ID从预先设置的多播复制表中获取所述端口间复制信 息和所述端口内复制信息; 其中, 所述多播复制表中包含各多播 ID对应的端口间复制信息和端口 内复制信息;
所述端口间复制信息包括: 各个緩存地址需要复制到的端口;
所述端口内复制信息包括: 每个端口内根据每个緩存地址需要复制报文 的份数。
可选地, 所述端口队列模块包括输出子模块和判断子模块, 其中: 所述输出子模块设置成: 在所述端口调度模块的调度下, 输出当前需要 复制的报文所对应的緩存地址, 并更新所述端口队列模块中相应的端口内复 制信息;
所述判断子模块设置成: 根据复制信息判断与该緩存地址对应的端口需 要复制的报文是否复制完成, 如果否, 则继续调用所述输出子模块对当前需 要复制的报文所对应的緩存地址进行输出, 直到当前需要复制的报文复制完 成; 如果判断是, 则调用所述输出子模块和所述判断子模块, 直到所有端口 的报文都复制完成。
可选地, 所述端口队列模块中设置有与各个端口相对应的相互独立的端 口队列, 所述端口队列模块釆用链表结构保存相应端口队列接收到的緩存地 址和根据该緩存地址需要复制报文的份数,所述端口队列模块包括: 队列首、 队列体、 以及队列尾; 其中, 所述队列首存储各个端口队列的队首指针、 当 前需要复制的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的 份数, 所述队首指针用于存储下个緩存地址在本端口队列中的地址; 所述队 列体存储了除当前需要复制的报文所对应的緩存地址、 以及根据该緩存地址 需要复制报文的份数之外, 各个端口队列接收到的其他緩存地址和根据该緩 存地址需要复制报文的份数;所述队列尾中保存了各个端口队列的队尾指针, 所述队尾指针指示了各个端口队列中将所述接收到的其他緩存地址和根据该 緩存地址需要复制报文的份数写入到相应队列体的写入地址。 可选地, 所述端口队列模块还包括保存子模块, 其中:
所述保存子模块设置成: 首先将各个端口队列的所述队首指针、 当前需 要复制的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份数 写入到所述队列首, 将各个端口队列的队尾指针写入所述队列尾, 并根据所 述队尾指针指示的写入地址将各个端口队列的所述接收到的其他緩存地址和 根据该緩存地址需要复制报文的份数写入到所述队列体中。
可选地, 所述输出子模块设置成按照如下方式在所述端口调度模块的调 度下, 输出当前需要复制的报文所对应的緩存地址, 并更新所述端口队列模 块中相应的端口内复制信息:
在所述端口调度模块的调度下, 从队列首中读取端口队列中存储的当前 需要复制的报文所对应的緩存地址进行输出, 该緩存地址每出队一次, 更新 该緩存地址需要复制报文的份数, 在根据该緩存地址需要复制报文的份数确 定当前需要复制的报文已复制完成的情况下, 根据所述端口队列的队首指针 从所述队列体中读取下一个緩存地址以及根据该緩存地址需要复制报文的份 数, 并写入所述队列首的所述端口队列中。
可选地, 所述装置还包括緩存地址回收模块, 其中:
所述緩存地址回收模块设置成: 通过所述端口间复制模块获取各緩存地 址对应的报文总复制份数,緩存地址每出队一次, 更新已复制完的报文份数; 将所述报文总复制份数与所述已复制完的报文份数进行对比, 如果相等, 则 对已复制完的报文所对应的緩存地址进行回收, 通知所述报文緩存模块已回 收的緩存地址, 并将已复制完的报文份数清 0。
上述技术方案通过釆用两级复制的方式, 第一级先进行端口间的复制, 第二级再进行端口内的复制, 解决了相关技术中在下行侧线卡中进行多播复 制时,会耗费大量的存储资源的问题, 能够实现多播报文的大数据量的复制, 方便地实现端口数的扩展和复制份数的增减。 附图概述
图 1是本发明实施例的多播报文复制装置的结构示意图;
图 2是本发明实施例的多播复制表的结构示意图;
图 3是本发明实施例的端口队列模块的结构示意图;
图 4是本发明实施例的緩存地址回收模块内部结构示意图;
图 5是本发明实施例的多播报文复制装置的详细结构示意图;
图 6是本发明实施例的多播报文复制装置详细处理的流程图;
图 7是本发明实施例的緩存地址回收的流程图;
图 8是本发明实施例的多播报文复制方法的流程图。
本发明的较佳实施方式
为了解决相关技术中在下行侧线卡中进行多播复制时, 会耗费大量的存 储资源的问题, 本发明实施例提供了一种多播报文复制方法及装置, 以下结 合附图以及实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述 的具体实施例仅仅用以解释本发明, 并不限定本发明。 装置实施例
根据本发明的实施例, 提供了一种多播报文复制装置, 图 1是本发明实 施例的多播报文复制装置的结构示意图, 如图 1所示, 根据本发明实施例的 多播报文复制装置包括: 报文緩存模块 10、端口间复制模块 12、端口队列模 块 14、 以及端口调度模块 16, 以下对本发明实施例的各个模块进行详细的说 明。
报文緩存模块 10设置成: 存储接收到的报文, 并根据端口队列模块 14 输出的緩存地址读取报文输出;
可选地,在实际应用中,报文緩存模块 10内部包含大容量的随机存储器
( RAM, random access memory )„ 在报文输入时用于存储输入报文的实体; 在报文输出时根据緩存地址来读取 RAM进行报文的输出。
端口间复制模块 12设置成: 获取报文的緩存地址、报文的端口间复制信 息、 以及报文的端口内复制信息, 并根据端口间复制信息对緩存地址进行复 制(即, 端口间复制), 并将复制后的緩存地址和相应的端口内复制信息发送 到端口队列模块 14;
上述端口间复制是完成报文的第一级复制, 即对输入的报文进行端口间 的复制, 并将报文对应的緩存地址输出给端口队列。
端口间复制模块 12设置成: 从报文緩存模块 10中获取报文的緩存地址 以及报文的多播身份标识号码(ID, IDentity ); 根据多播 ID从预先设置的多 播复制表中获取端口间复制信息和端口内复制信息, 其中, 多播复制表中包 含各多播 ID对应的端口间复制信息和端口内复制信息, 端口间复制信息包 括: 各个緩存地址需要复制到的端口; 端口内复制信息包括: 每个端口内根 据每个緩存地址需要复制报文的份数。
图 2是本发明实施例的多播复制表的结构示意图, 如图 2所示, 多播复 制表由多个表项组成,每个表项对应于一个多播 ID( MG— ID )。在每个 MG— ID 表项内部,根据端口数分为若干份,每一份表示一个端口内对应的复制份数。 若复制份数为 0 , 则代表该端口不需要复制。 端口间复制模块 12 可根据 MG— ID来查询到需要将报文的緩存地址复制到哪些端口,每个端口内需要复 制多少份。 若将所有端口的复制份数 ( MG— ID )相加 , 可得到总复制份数。
端口队列模块 14设置成:保存接收到的緩存地址和相应的端口内复制信 息,并在端口调度模块 16的调度下,根据存储的相应的端口内复制信息输出 需要进行报文复制的緩存地址;
端口队列模块 14需要进行报文的第二级复制,对端口间复制完成的緩存 地址再进行一次端口内的报文复制。端口队列模块 14内部根据端口来进行排 队, 各端口队列互相独立。 可选地, 端口队列模块 14具体包括输出子模块和判断子模块, 其中: 所述输出子模块设置成: 在端口调度模块 16的调度下,输出当前需要复 制的报文所对应的緩存地址,并更新端口队列模块 14中相应的端口内复制信 息;
所述判断子模块设置成: 对与该緩存地址相应的端口内复制信息进行判 断, 如果当前需要复制的报文未复制完成, 则继续调用输出子模块对当前需 要复制的报文所对应的緩存地址进行输出, 直到当前需要复制的报文复制完 成; 如果判断当前需要复制的报文已复制完成, 则调用输出子模块和判断子 模块进行下一个端口的端口内复制, 直到所有端口的报文都复制完成。
可选地,端口队列模块 14中设置有与各个端口相对应的相互独立的端口 队列,端口队列模块 14釆用链表结构保存相应端口队列接收到的緩存地址和 根据该緩存地址需要复制报文的份数, 端口队列模块 14包括: 队列首、 队列 体、 以及队列尾, 其中, 队列首存储各个端口队列的队首指针、 当前需要复 制的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份数, 队 首指针用于存储下个緩存地址在本端口队列中的地址。 队列体存储了除当前 需要复制的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份 数之外, 各个端口队列接收到的其他緩存地址和根据该緩存地址需要复制报 文的份数。 队列尾中保存了各个端口队列的队尾指针, 队尾指针指示了各个 端口队列中将接收到的其他緩存地址和根据该緩存地址需要复制报文的份数 写入到相应队列体的写入地址。
可选地, 基于上述描述, 端口队列模块 14还包括: 保存子模块, 所述保 存子模块设置成: 首先将各个端口队列的队首指针、 当前需要复制的报文所 对应的緩存地址、 以及根据该緩存地址需要复制报文的份数写入到队列首, 将各个端口队列的队尾指针写入队列尾, 并根据队尾指针指示的写入地址将 各个端口队列的接收到的其他緩存地址和根据该緩存地址需要复制报文的份 数写入到队列体中。
上述输出子模块设置成: 在端口调度模块 16的调度下,从队列首中读取 端口队列中存储的当前需要复制的报文所对应的緩存地址进行输出, 该緩存 地址每出队一次, 更新该緩存地址需要复制报文的份数, 在根据该緩存地址 需要复制报文的份数确定当前需要复制的报文已复制完成的情况下, 根据端 口队列的队首指针从队列体中读取下一个緩存地址以及根据该緩存地址需要 复制报文的份数, 并写入队列首的端口队列中。
图 3是本发明实施例的端口队列模块 14的结构示意图,如图 3所示,端 口队列模块 14釆用链表结构来存储各端口队列, 相比 FIFO结构要节省存储 资源。 端口队列模块 14整体结构上由队列尾、 队列体和队列首三部分组成。 其中队列首存储各端口队列的队首指针、 报文对应的緩存地址和报文复制份 数。 指针用来存储该队列中下个数据在端口队列的地址, 用于将队列中的数 据链接在一起;緩存地址为报文数据在报文緩存模块 10中的地址; 复制份数 为该报文在端口内需要复制的总份数。 队列体存储的内容和队列首类似, 而 队列尾仅存储了指针。
在队列入队的时候, 先写队列首; 当队列首写完之后, 再通过队列尾中 的指针来实现队列体中的写入。 在队列出队的时候, 都是从队列首中读取緩 存地址进行输出。 每出队一次, 复制份数减 1 , 直到减为 0, 代表报文在该端 口内复制完成。 只有当复制份数减到 0之后, 才从队列体中读取下一个数据 并回写到队列首中, 完成队列的更新操作。 在复制完成之前, 一直都釆用队 列首中的当前报文进行输出, 实现报文的端口内复制。
端口调度模块 16设置成: 对端口队列模块 14的緩存地址进行调度。 可选地,端口调度模块 16完成端口队列的调度,从各端口队列中选出一 个报文进行调度输出。
可选地, 在本发明实施例中, 为了能够使緩存地址进行快速的回收, 上 述装置还包括:緩存地址回收模块,用于通过端口间复制模块 12获取各緩存 地址对应的报文总复制份数, 緩存地址每出队一次, 更新已复制完的报文份 数; 将报文总复制份数与已复制完的报文份数进行对比, 如果相等, 则对已 复制完的报文所对应的緩存地址进行回收,通知报文緩存模块 10已回收的緩 存地址, 并将已复制完的报文份数清 0。
如上所述, 緩存地址回收模块内部存储了各緩存地址对应的总复制份数 和已出队复制份数, 根据报文的复制完成情况来释放緩存地址, 实现地址回 收。
图 4是本发明实施例的緩存地址回收模块内部结构示意图,如图 4所示, 在緩存地址回收模块中, 存储份数的 RAM有两块: 总份数 RAM和已出队 份数 RAM。 这两个 RAM的地址深度和 文緩存模块 10对应的地址深度一 样。
总份数 RAM存储该緩存地址对应的总复制份数信息, 通过端口间复制 模块 12获得。 当端口间复制模块 12查询多播复制表时, 将该报文 MG— ID 对应的各个端口的复制份数相加, 得到端口间 +端口内的总复制份数。
已出队份数 RAM存储该緩存地址对应的已出队复制份数信息, 其初始 值为 0。在总份数复制未完成之前,当端口调度模块 16输出了一个緩存地址, 则在已出队份数 RAM中相应緩存地址对应的已出队份数就加 1; 只有总份 数复制完成之后, 则数值清 0。 份数比较用来比对总份数 RAM和已出队份 数的 RAM, 只有二者相等才代表端口间 +端口内的复制都已结束。
以下结合附图, 对本发明实施例的上述技术方案进行详细说明。
图 5是本发明实施例的多播报文复制装置的详细结构示意图, 如图 5所 示, 根据本发明实施例的多播报文复制装置包括: 多播复制表 101、 端口间 复制模块 102、 报文緩存模块 103、 端口队列模块 104、 端口调度模块 105、 緩存地址回收模块 106。
图 6是本发明实施例的多播报文复制装置详细处理的流程图, 如图 6所 示, 基于如图 5所示的多播报文复制装置包括如下处理:
步骤 601 , 多播报文复制装置接收输入的报文。 报文实体存储到报文緩 存模块 103中, 报文的 MG— ID传输给端口间复制模块 102。
步骤 602, 端口间复制模块 102从报文緩存模块 103中获取报文实体对 应的緩存的地址。
步骤 603 , 端口间复制模块 102根据 MG— ID来查询多播复制表 101 , 获 取该才艮文的端口间和端口内的复制信息。
步骤 604, 端口间复制模块 102将报文对应的緩存地址进行端口间的复 制, 并将复制好的数据和第二级复制所需的复制份数依照端口编号的顺序依 次传递给端口队列模块 104。
步骤 605, 端口队列模块 104将接收到的緩存地址按照先后顺序进行排 队, 并存储好每个报文在端口内复制的份数。
步骤 606, 由端口调度模块 105在端口间进行调度输出。
步骤 607, 报文緩存模块 103通过端口调度模块 105送出的緩存地址来 读取 实体, 并进行输出。 步骤 608, 对端口队列模块 104内的报文剩余复制份数进行判断, 若剩 余复制份数大于 1 ,则重复执行步骤 606和 607 ,继续对当前报文进行调度输 出; 直到剩余复制份数为 0 , 代表复制完成, 执行步骤 609。
步骤 609, 待端口队列模块 104内各端口的报文都复制完, 则整个复制 结束。
图 7是本发明实施例的緩存地址回收的流程图, 如图 7所示, 结合图 5 , 具体包括如下处理:
步骤 701 , 通过端口间复制模块 102获取总份数信息, 将总份数写入总 份数 RAM中。
步骤 702,在端口调度模块 105进行报文出队后,从总复制份数 RAM和 已出队复制份数 RAM中读取当前緩存地址对应的份数信息。
步骤 703 , 将读出的已出队复制份数加 1。
步骤 704 , 将累加后的出队复制份数和总复制份数进行比较, 若二者相 等, 则代表可以对该緩存地址进行回收, 执行步骤 706; 若已出队复制份数 小于总复制份数, 则代表回收还未完成, 执行步骤 705。
步骤 705 , 在回收未完成阶段, 将累加后的出队份数回写到已出队份数 RAM中去。 后续重复执行步骤 702和 703 , 继续进行调度出队和份数累加。
步骤 706, 在回收完成之后, 输出回收指示给报文緩存模块 103 , 同时将 已出队份数 RAM中的份数值清 0。
步骤 707 , 整个緩存地址回收过程结束。
综上所述, 本发明实施例釆用两级复制的方式, 能够实现多播报文的大 数据量的复制。 本发明实施例的多播报文复制装置的复制结构清晰, 第一级 先进行端口间的复制, 第二级再进行端口内的复制, 能够方便地实现端口数 的扩展和复制份数的增减。 此外, 在端口队列的管理上, 釆用链表方式来实 现, 节省了存储资源。 同时每个端口上釆用同一报文多次出队的方式来实现 复制, 进一步简化了队列资源的使用。 在緩存资源的回收上, 釆用 2个 RAM 来分别存储总复制份数和已出队复制份数, 有效地解决了緩存地址的回收问 题。 方法实施例
基于上述方法实施例中的多播报文复制装置, 根据本发明的实施例, 提 供了一种多播报文复制方法, 图 8是本发明实施例的多播报文复制方法的流 程图, 如图 8所示, 根据本发明实施例的多播报文复制方法包括如下处理: 步骤 801 , 将接收到的报文存储到报文緩存模块中, 端口间复制模块获 取报文的緩存地址、 4艮文的端口间复制信息、 以及报文的端口内复制信息, 根据端口间复制信息对緩存地址进行复制 (即, 端口间复制 ), 并将复制后的 緩存地址和相应的端口内复制信息发送到端口队列模块进行保存;
上述端口间复制是完成报文的第一级复制, 即对输入的报文进行端口间 的复制, 并将报文对应的緩存地址输出给端口队列。
可选地, 在步骤 801中, 端口间复制模块获取报文的緩存地址、 报文的 端口间复制信息、 以及报文的端口内复制信息具体包括: 1、端口间复制模块 从报文緩存模块中获取报文的緩存地址以及报文的多播标识 ID; 2、 根据多 播 ID从预先设置的多播复制表中获取端口间复制信息和端口内复制信息, 其中, 多播复制表中包含各多播 ID对应的端口间复制信息和端口内复制信 息, 端口间复制信息包括: 各个緩存地址需要复制到的端口; 端口内复制信 息包括: 每个端口内根据每个緩存地址需要复制报文的份数。
图 2是本发明实施例的多播复制表的结构示意图, 如图 2所示, 多播复 制表由多个表项组成,每个表项对应于一个多播 ID( MG— ID )。在每个 MG— ID 表项内部,根据端口数分为若干份,每一份表示一个端口内对应的复制份数。 若复制份数为 0 , 则代表该端口不需要复制。 端口间复制模块 12 可根据 MG— ID来查询到需要将报文的緩存地址复制到哪些端口,每个端口内需要复 制多少份。 若将所有端口的复制份数(MG— ID )的所有值相加, 可得到总复 制份数。
步骤 802 , 端口调度模块对端口队列模块的緩存地址进行调度, 端口队 列模块在端口调度模块的调度下, 根据存储的相应的端口内复制信息输出需 要进行报文复制的緩存地址;
端口队列模块需要进行报文的第二级复制, 对端口间复制完成的緩存地 址再进行一次端口内的报文复制。 端口队列模块内部根据端口来进行排队, 各端口队列互相独立。 在步骤 802中, 端口队列模块在端口调度模块的调度下, 根据存储的相 应的端口内复制信息输出需要进行报文复制的緩存地址具体包括:
步骤 8021 , 端口队列模块在端口调度模块的调度下, 输出当前需要复制 的报文所对应的緩存地址, 并更新端口队列模块中相应的端口内复制信息; 步骤 8022,端口队列模块对与该緩存地址相应的端口内复制信息进行判 断, 如果当前需要复制的报文未复制完成, 则继续对当前需要复制的报文所 对应的緩存地址进行输出, 直到当前需要复制的报文复制完成;
步骤 8023 , 端口队列模块如果判断当前需要复制的报文已复制完成, 执 行步骤 8021-8023 , 进行下一个端口的端口内复制, 直到所有端口的 4艮文都 复制完成。
可选地, 端口队列模块中设置有与各个端口相对应的相互独立的端口队 歹 ij , 端口队列模块釆用链表结构保存相应端口队列接收到的緩存地址和根据 该緩存地址需要复制报文的份数, 端口队列模块包括: 队列首、 队列体、 以 及队列尾, 其中, 队列首存储各个端口队列的队首指针、 当前需要复制的报 文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份数, 队首指针 用于存储下个緩存地址在本端口队列中的地址, 队列体存储了除当前需要复 制的报文所对应的緩存地址、以及根据该緩存地址需要复制报文的份数之外, 各个端口队列接收到的其他緩存地址和根据该緩存地址需要复制报文的份 数, 队列尾中保存了各个端口队列的队尾指针, 队尾指针指示了各个端口队 列中将接收到的其他緩存地址和根据该緩存地址需要复制报文的份数写入到 相应队列体的写入地址。
因此, 端口队列模块在存储复制后的緩存地址和相应的端口内复制信息 时, 端口队列模块首先将各个端口队列的队首指针、 当前需要复制的报文所 对应的緩存地址、 以及根据该緩存地址需要复制报文的份数写入到队列首, 将各个端口队列的队尾指针写入队列尾, 并根据队尾指针指示的写入地址将 各个端口队列的接收到的其他緩存地址和根据该緩存地址需要复制报文的份 数写入到队列体中。
端口队列模块在端口调度模块的调度下, 输出当前需要复制的报文所对 应的緩存地址, 并更新端口队列模块中相应的端口内复制信息具体包括: 端 口队列模块在端口调度模块的调度下, 从队列首中读取端口队列中存储的当 前需要复制的报文所对应的緩存地址进行输出, 该緩存地址每出队一次, 更 新该緩存地址需要复制报文的份数, 在根据该緩存地址需要复制报文的份数 确定当前需要复制的报文已复制完成的情况下, 根据端口队列的队首指针从 队列体中读取下一个緩存地址以及根据该緩存地址需要复制报文的份数, 并 写入队列首的端口队列中。
图 3是本发明实施例的端口队列模块的结构示意图, 如图 3所示, 端口 队列模块 14釆用链表结构来存储各端口队列, 相比 FIFO结构要节省存储资 源。 端口队列模块 14整体结构上由队列尾、 队列体和队列首三部分组成。 其 中队列首存储各端口队列的队首指针、报文对应的緩存地址和报文复制份数。 指针用来存储该队列中下个数据在端口队列的地址, 用于将队列中的数据链 接在一起;緩存地址为报文数据在报文緩存模块 10中的地址; 复制份数为该 报文在端口内需要复制的总份数。 队列体存储的内容和队列首类似, 而队列 尾仅存储了指针。
在队列入队的时候, 先写队列首; 当队列首写完之后, 再通过队列尾中 的指针来实现队列体中的写入。 在队列出队的时候, 都是从队列首中读取緩 存地址进行输出。 每出队一次, 复制份数减 1 , 直到减为 0, 代表报文在该端 口内复制完成。 只有当复制份数减到 0之后, 才从队列体中读取下一个数据 并回写到队列首中, 完成队列的更新操作。 在复制完成之前, 一直都釆用队 列首中的当前报文进行输出, 实现报文的端口内复制。
步骤 803 , 报文緩存模块根据端口队列模块输出的緩存地址读取相应的 才艮文并输出。
可选地, 端口调度模块完成端口队列的调度, 从各端口队列中选出一个 报文进行调度输出。
可选地, 根据本发明实施例的多播报文复制方法还包括: 緩存地址回收 模块通过端口间复制模块获取各緩存地址对应的报文总复制份数, 緩存地址 每出队一次, 更新已复制完的报文份数; 緩存地址回收模块将报文总复制份 数与已复制完的报文份数进行对比, 如果相等, 则对已复制完的报文所对应 的緩存地址进行回收, 通知报文緩存模块已回收的緩存地址, 并将已复制完 的报文份数清 0。
如上所述, 緩存地址回收模块内部存储了各緩存地址对应的总复制份数 和已出队复制份数, 根据报文的复制完成情况来释放緩存地址, 实现地址回 收。
图 4是本发明实施例的緩存地址回收模块内部结构示意图,如图 4所示, 在緩存地址回收模块中, 存储份数的 RAM有两块: 总份数 RAM和已出队 份数 RAM。 这两个 RAM的地址深度和 文緩存模块 10对应的地址深度一 样。
总份数 RAM存储该緩存地址对应的总复制份数信息, 通过端口间复制 模块 12获得。 当端口间复制模块 12查询多播复制表时, 将该报文 MG— ID 对应的各个端口的复制份数相加, 得到端口间 +端口内的总复制份数。
已出队份数 RAM存储该緩存地址对应的已出队复制份数信息, 其初始 值为 0。在总份数复制未完成之前,当端口调度模块 16输出了一个緩存地址, 则在已出队份数 RAM中相应緩存地址对应的已出队份数就加 1 ; 只有总份 数复制完成之后, 则数值清 0。 份数比较用来比对总份数 RAM和已出队份 数的 RAM, 只有二者相等才代表端口间 +端口内的复制都已结束。
以下结合附图, 对本发明实施例的上述技术方案进行详细说明。
图 5是本发明实施例的多播报文复制装置的详细结构示意图, 如图 5所 示, 根据本发明实施例的多播报文复制装置包括: 多播复制表 101、 端口间 复制 102、 报文緩存模块 103、 端口队列模块 104、 端口调度模块 105、 緩存 地址回收模块 106。
图 6是本发明实施例的多播报文复制装置详细处理的流程图, 如图 6所 示, 基于如图 5所示的多播报文复制装置包括如下处理:
步骤 601 , 多播报文复制装置接收输入的报文。 报文实体存储到报文緩 存模块 103中, 报文的 MG— ID传输给端口间复制模块 102。
步骤 602, 端口间复制模块 102从报文緩存模块 103中获取报文实体对 应的緩存的地址。 步骤 603 , 端口间复制模块 102根据 MG— ID来查询多播复制表 101 , 获 取该才艮文的端口间和端口内的复制信息。
步骤 604, 端口间复制模块 102将报文对应的緩存地址进行端口间的复 制, 并将复制好的数据和第二级复制所需的复制份数依照端口编号的顺序依 次传递给端口队列模块 104。
步骤 605 , 端口队列模块 104将接收到的緩存地址按照先后顺序进行排 队, 并存储好每个报文在端口内复制的份数。
步骤 606, 由端口调度模块 105在端口间进行调度输出。
步骤 607 , 报文緩存模块 103通过端口调度模块 105送出的緩存地址来 读取 实体, 并进行输出。
步骤 608, 对端口队列模块 104内的报文剩余复制份数进行判断, 若剩 余复制份数大于 1 ,则重复执行步骤 606和 607 ,继续对当前报文进行调度输 出; 直到剩余复制份数为 0 , 代表复制完成, 执行步骤 609。
步骤 609, 待端口队列模块 104内各端口的报文都复制完, 则整个复制 结束。
图 7是本发明实施例的緩存地址回收的流程图, 如图 7所示, 结合图 5 , 具体包括如下处理:
步骤 701 , 通过端口间复制模块 102获取总份数信息, 将总份数写入总 份数 RAM中。
步骤 702,在端口调度模块 105进行报文出队后,从总复制份数 RAM和 已出队复制份数 RAM中读取当前緩存地址对应的份数信息。
步骤 703 , 将读出的已出队复制份数加 1。
步骤 704 , 将累加后的出队复制份数和总复制份数进行比较, 若二者相 等, 则代表可以对该緩存地址进行回收, 执行步骤 706; 若已出队复制份数 小于总复制份数, 则代表回收还未完成, 执行步骤 705。
步骤 705 , 在回收未完成阶段, 将累加后的出队份数回写到已出队份数 RAM中去。 后续重复执行步骤 702和 703 , 继续进行调度出队和份数累加。 步骤 706, 在回收完成之后, 输出回收指示给报文緩存模块 103 , 同时将 已出队份数 RAM中的份数值清 0。
步骤 707 , 整个緩存地址回收过程结束。
综上所述, 本发明实施例釆用两级复制的方式, 能够实现多播报文的大 数据量的复制。 本发明实施例的多播报文复制装置的复制结构清晰, 第一级 先进行端口间的复制, 第二级再进行端口内的复制, 能够方便地实现端口数 的扩展和复制份数的增减。 此外, 在端口队列的管理上, 釆用链表方式来实 现, 节省了存储资源。 同时每个端口上釆用同一报文多次出队的方式来实现 复制, 进一步简化了队列资源的使用。 在緩存资源的回收上, 釆用 2个 RAM 来分别存储总复制份数和已出队复制份数, 有效地解决了緩存地址的回收问 题。
尽管为示例目的, 已经公开了本发明的优选实施例, 本领域的技术人员 将意识到各种改进、 增加和取代也是可能的, 因此, 本发明的范围应当不限 于上述实施例。
应当注意的是, 在本发明的控制器的各个部件中, 根据其要实现的功能 而对其中的部件进行了逻辑划分, 但是, 本发明不受限于此, 可以根据需要 对各个部件进行重新划分或者组合,例如,可以将一些部件组合为单个部件, 或者可以将一些部件进一步分解为更多的子部件。
本发明的各个部件实施例可以以硬件实现, 或者以在一个或者多个处理 器上运行的软件模块实现, 或者以它们的组合实现。 本领域的技术人员应当 理解, 可以在实践中使用微处理器或者数字信号处理器(DSP ) 来实现根据 本发明实施例的控制器中的一些或者全部部件的一些或者全部功能。 本发明 还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置 程序(例如, 计算机程序和计算机程序产品)。 这样的实现本发明的程序可以 存储在计算机可读介质上, 或者可以具有一个或者多个信号的形式。 这样的 信号可以从因特网网站上下载得到, 或者在载体信号上提供, 或者以任何其 他形式提供。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制, 并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实 施例。 在权利要求中, 不应将位于括号之间的任何参考符号构造成对权利要 求的限制。 单词 "包含" 不排除存在未列在权利要求中的元件或步骤。 位于 元件之前的单词 "一" 或 "一个" 不排除存在多个这样的元件。 本发明可以 借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。 在 列举了若干装置的单元权利要求中, 这些装置中的若干个可以是通过同一个 硬件项来具体体现。 单词第一、 第二、 以及第三等的使用不表示任何顺序。 可将这些单词解释为名称。
工业实用性
上述技术方案通过釆用两级复制的方式, 第一级先进行端口间的复制, 第二级再进行端口内的复制, 解决了相关技术中在下行侧线卡中进行多播复 制时,会耗费大量的存储资源的问题, 能够实现多播报文的大数据量的复制, 方便地实现端口数的扩展和复制份数的增减。

Claims

权 利 要 求 书
1、 一种多播报文复制方法, 包括:
步骤 1 , 将接收到的报文存储到报文緩存模块中, 端口间复制模块获取 所述报文的緩存地址、 所述报文的端口间复制信息、 以及所述报文的端口内 复制信息, 根据所述端口间复制信息对所述緩存地址进行复制, 并将复制后 的緩存地址和相应的端口内复制信息发送到端口队列模块进行保存;
步骤 2, 端口调度模块对所述端口队列模块的緩存地址进行调度, 所述 端口队列模块在所述端口调度模块的调度下, 根据存储的相应的端口内复制 信息输出需要进行报文复制的緩存地址;
步骤 3 , 所述报文緩存模块根据所述端口队列模块输出的所述緩存地址 读取相应的报文并输出。
2、如权利要求 1所述的方法, 其中, 所述端口间复制模块获取所述报文 的緩存地址、 所述 "^文的端口间复制信息、 以及所述 ^艮文的端口内复制信息 的步骤包括:
所述端口间复制模块从所述报文緩存模块中获取所述报文的緩存地址以 及所述 4艮文的多播标识 ID;
根据所述多播标识 ID从预先设置的多播复制表中获取所述端口间复制 信息和所述端口内复制信息, 其中, 所述多播复制表中包含各多播 ID对应 的端口间复制信息和端口内复制信息, 所述端口间复制信息包括: 各个緩存 地址需要复制到的端口; 所述端口内复制信息包括: 每个端口内根据每个緩 存地址需要复制报文的份数。
3、如权利要求 1或 2所述的方法, 其中, 所述端口队列模块在所述端口 调度模块的调度下, 根据存储的相应的端口内复制信息输出需要进行报文复 制的緩存地址的步骤包括:
步骤 21 , 所述端口队列模块在所述端口调度模块的调度下, 输出当前需 要复制的报文所对应的緩存地址, 并更新所述端口队列模块中相应的端口内 复制信息;
步骤 22,所述端口队列模块根据端口内复制信息判断与该緩存地址对应 的端口内需要复制的报文是否复制完成, 如果否, 则继续对当前需要复制的 报文所对应的緩存地址进行输出, 直到当前需要复制的报文复制完成; 如果 是, 则转步骤 23;
步骤 23 , 所述端口队列模块如果判断当前需要复制的报文已复制完成, 执行步骤 21-23 , 直到所有端口的报文都复制完成。
4、如权利要求 3所述的方法, 其中, 所述端口队列模块中设置有与各个 端口相对应的相互独立的端口队列, 所述端口队列模块釆用链表结构保存相 应端口队列接收到的緩存地址和根据该緩存地址需要复制报文的份数, 所述 端口队列模块包括: 队列首、 队列体、 以及队列尾; 其中, 所述队列首存储 各个端口队列的队首指针、 当前需要复制的报文所对应的緩存地址、 以及根 据该緩存地址需要复制报文的份数, 所述队首指针用于存储下个緩存地址在 本端口队列中的地址; 所述队列体存储了除当前需要复制的报文所对应的緩 存地址、 以及根据该緩存地址需要复制报文的份数之外, 各个端口队列接收 到的其他緩存地址和根据该緩存地址需要复制报文的份数; 所述队列尾中保 存了各个端口队列的队尾指针, 所述队尾指针指示了各个端口队列中将所述 接收到的其他緩存地址和根据该緩存地址需要复制报文的份数写入到相应队 列体的写入地址。
5、如权利要求 4所述的方法, 其中, 将复制后的緩存地址和相应的端口 内复制信息发送到端口队列模块进行保存的步骤包括:
所述端口队列模块首先将各个端口队列的所述队首指针、 当前需要复制 的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份数写入到 所述队列首, 将各个端口队列的队尾指针写入所述队列尾, 并根据所述队尾 指针指示的写入地址将各个端口队列的所述接收到的其他緩存地址和根据该 緩存地址需要复制报文的份数写入到所述队列体中。
6、如权利要求 5所述的方法, 其中, 所述端口队列模块在所述端口调度 模块的调度下, 输出当前需要复制的报文所对应的緩存地址, 并更新所述端 口队列模块中相应的端口内复制信息的步骤包括:
所述端口队列模块在所述端口调度模块的调度下, 从队列首中读取端口 队列中存储的当前需要复制的报文所对应的緩存地址进行输出, 该緩存地址 每出队一次, 更新该緩存地址需要复制报文的份数, 在根据该緩存地址需要 复制报文的份数确定当前需要复制的报文已复制完成的情况下, 根据所述端 口队列的队首指针从所述队列体中读取下一个緩存地址以及根据该緩存地址 需要复制^艮文的份数, 并写入所述队列首的所述端口队列中。
7、 如权利要求 1或 2所述的方法, 所述方法还包括:
緩存地址回收模块通过端口间复制模块获取各緩存地址对应的报文总复 制份数, 緩存地址每出队一次, 更新已复制完的报文份数;
所述緩存地址回收模块将所述报文总复制份数与所述已复制完的报文份 数进行对比, 如果相等, 则对已复制完的报文所对应的緩存地址进行回收, 通知所述报文緩存模块已回收的緩存地址, 并将已复制完的报文份数清 0。
8、 一种多播报文复制装置, 包括报文緩存模块、 端口间复制模块、 端口 队列模块和端口调度模块, 其中:
所述报文緩存模块设置成: 存储接收到的报文, 根据所述端口队列模块 输出的緩存地址读取相应的报文并输出;
所述端口间复制模块设置成: 获取所述报文的緩存地址、 所述报文的端 口间复制信息、 以及所述报文的端口内复制信息, 并根据所述端口间复制信 息对所述緩存地址进行复制, 并将复制后的緩存地址和相应的端口内复制信 息发送到所述端口队列模块; 所述端口队列模块设置成: 保存接收到的緩存地址和相应的端口内复制 信息, 并在所述端口调度模块的调度下, 根据存储的相应的端口内复制信息 输出需要进行报文复制的緩存地址;
所述端口调度模块设置成: 对所述端口队列模块的緩存地址进行调度。
9、如权利要求 8所述的装置, 其中, 所述端口间复制模块设置成按照如 下方式获取所述报文的緩存地址、 所述报文的端口间复制信息、 以及所述报 文的端口内复制信息:
从所述报文緩存模块中获取所述报文的緩存地址以及所述报文的多播标 识 ID; 根据所述多播 ID从预先设置的多播复制表中获取所述端口间复制信 息和所述端口内复制信息;
其中, 所述多播复制表中包含各多播 ID对应的端口间复制信息和端口 内复制信息;
所述端口间复制信息包括: 各个緩存地址需要复制到的端口; 所述端口内复制信息包括: 每个端口内根据每个緩存地址需要复制报文 的份数。
10、 如权利要求 8或 9所述的装置, 其中, 所述端口队列模块包括输出 子模块和判断子模块, 其中:
所述输出子模块设置成: 在所述端口调度模块的调度下, 输出当前需要 复制的报文所对应的緩存地址, 并更新所述端口队列模块中相应的端口内复 制信息;
所述判断子模块设置成: 根据复制信息判断与该緩存地址对应的端口需 要复制的报文是否复制完成, 如果否, 则继续调用所述输出子模块对当前需 要复制的报文所对应的緩存地址进行输出, 直到当前需要复制的报文复制完 成; 如果判断是, 则调用所述输出子模块和所述判断子模块, 直到所有端口 的报文都复制完成。
11、如权利要求 10所述的装置, 其中, 所述端口队列模块中设置有与各 个端口相对应的相互独立的端口队列, 所述端口队列模块釆用链表结构保存 相应端口队列接收到的緩存地址和根据该緩存地址需要复制报文的份数, 所 述端口队列模块包括: 队列首、 队列体、 以及队列尾; 其中, 所述队列首存 储各个端口队列的队首指针、 当前需要复制的报文所对应的緩存地址、 以及 根据该緩存地址需要复制报文的份数, 所述队首指针用于存储下个緩存地址 在本端口队列中的地址; 所述队列体存储了除当前需要复制的报文所对应的 緩存地址、 以及根据该緩存地址需要复制报文的份数之外, 各个端口队列接 收到的其他緩存地址和根据该緩存地址需要复制报文的份数; 所述队列尾中 保存了各个端口队列的队尾指针, 所述队尾指针指示了各个端口队列中将所 述接收到的其他緩存地址和根据该緩存地址需要复制报文的份数写入到相应 队列体的写入地址。
12、如权利要求 11所述的装置, 其中, 所述端口队列模块还包括保存子 模块, 其中:
所述保存子模块设置成: 首先将各个端口队列的所述队首指针、 当前需 要复制的报文所对应的緩存地址、 以及根据该緩存地址需要复制报文的份数 写入到所述队列首, 将各个端口队列的队尾指针写入所述队列尾, 并根据所 述队尾指针指示的写入地址将各个端口队列的所述接收到的其他緩存地址和 根据该緩存地址需要复制报文的份数写入到所述队列体中。
13、如权利要求 12所述的装置, 其中, 所述输出子模块设置成按照如下 方式在所述端口调度模块的调度下, 输出当前需要复制的报文所对应的緩存 地址, 并更新所述端口队列模块中相应的端口内复制信息:
在所述端口调度模块的调度下, 从队列首中读取端口队列中存储的当前 需要复制的报文所对应的緩存地址进行输出, 该緩存地址每出队一次, 更新 该緩存地址需要复制报文的份数, 在根据该緩存地址需要复制报文的份数确 定当前需要复制的报文已复制完成的情况下, 根据所述端口队列的队首指针 从所述队列体中读取下一个緩存地址以及根据该緩存地址需要复制报文的份 数, 并写入所述队列首的所述端口队列中。
14、如权利要求 8或 9所述的装置,所述装置还包括緩存地址回收模块, 其中:
所述緩存地址回收模块设置成: 通过所述端口间复制模块获取各緩存地 址对应的报文总复制份数,緩存地址每出队一次, 更新已复制完的报文份数; 将所述报文总复制份数与所述已复制完的报文份数进行对比, 如果相等, 则 对已复制完的报文所对应的緩存地址进行回收, 通知所述报文緩存模块已回 收的緩存地址, 并将已复制完的报文份数清 0。
PCT/CN2013/080512 2012-08-03 2013-07-31 多播报文复制方法及装置 WO2014019511A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP13825867.8A EP2869503B1 (en) 2012-08-03 2013-07-31 Multicast message replication method and device
US14/418,980 US9407447B2 (en) 2012-08-03 2013-07-31 Multicast message replication method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210274379.6A CN102821045B (zh) 2012-08-03 2012-08-03 多播报文复制方法及装置
CN201210274379.6 2012-08-03

Publications (1)

Publication Number Publication Date
WO2014019511A1 true WO2014019511A1 (zh) 2014-02-06

Family

ID=47304906

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/080512 WO2014019511A1 (zh) 2012-08-03 2013-07-31 多播报文复制方法及装置

Country Status (4)

Country Link
US (1) US9407447B2 (zh)
EP (1) EP2869503B1 (zh)
CN (1) CN102821045B (zh)
WO (1) WO2014019511A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821045B (zh) * 2012-08-03 2015-07-22 中兴通讯股份有限公司 多播报文复制方法及装置
CN111131089B (zh) * 2019-12-24 2021-07-27 西安电子科技大学 改善多播业务hol阻塞的队列管理方法
CN112202674B (zh) * 2020-09-27 2022-10-28 北京物芯科技有限责任公司 一种组播报文的转发处理方法、装置、设备及存储介质
CN112242964B (zh) * 2020-12-18 2021-06-04 苏州裕太微电子有限公司 一种交换机中的缓存单元释放系统及方法
CN113645662B (zh) * 2021-08-17 2023-08-18 中国联合网络通信集团有限公司 业务处理方法及装置
CN117376274A (zh) * 2022-06-30 2024-01-09 深圳市中兴微电子技术有限公司 组播包的复制方法及装置、存储介质及电子装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1411211A (zh) * 2002-04-17 2003-04-16 华为技术有限公司 以太网交换芯片输出队列管理调度方法和装置
CN101414973A (zh) * 2008-11-25 2009-04-22 中国人民解放军信息工程大学 一种传输数据包的方法及装置
US7822051B1 (en) * 2007-10-24 2010-10-26 Ethernity Networks Ltd. Method and system for transmitting packets
CN102821045A (zh) * 2012-08-03 2012-12-12 中兴通讯股份有限公司 多播报文复制方法及装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5898687A (en) * 1996-07-24 1999-04-27 Cisco Systems, Inc. Arbitration mechanism for a multicast logic engine of a switching fabric circuit
WO2003083614A2 (en) * 2002-03-25 2003-10-09 Eternal Systems, Inc. Transparent consistent active replication of multithreaded application programs
CN1184777C (zh) * 2002-04-17 2005-01-12 华为技术有限公司 以太网交换芯片传输数据过程中缓存的管理和分配方法
US7649882B2 (en) * 2002-07-15 2010-01-19 Alcatel-Lucent Usa Inc. Multicast scheduling and replication in switches
US7746799B2 (en) * 2003-06-20 2010-06-29 Juniper Networks, Inc. Controlling data link layer elements with network layer elements
US7765300B2 (en) * 2003-10-06 2010-07-27 Ericsson Ab Protocol for messaging between a centralized broadband remote aggregation server and other devices
CN1298147C (zh) * 2003-11-18 2007-01-31 中兴通讯股份有限公司 一种在组播数据包转发时实现减少内存占用空间的方法
US7519054B2 (en) * 2005-01-27 2009-04-14 Intel Corporation Replication of multicast data packets in a multi-stage switching system
CN100401718C (zh) * 2005-02-04 2008-07-09 华为技术有限公司 一种数据帧组播复制的方法及系统
CN100571195C (zh) * 2005-07-27 2009-12-16 华为技术有限公司 多端口以太网交换装置及数据传输方法
SE533007C2 (sv) * 2008-10-24 2010-06-08 Ilt Productions Ab Distribuerad datalagring
CN102006526B (zh) * 2009-09-01 2016-01-20 中兴通讯股份有限公司 一种广播包/组播控制报文处理方法和装置
CN101729407B (zh) * 2009-12-04 2012-01-04 西安电子科技大学 基于单多播区分处理的低时延抖动交换方法及设备
CN102148745B (zh) * 2010-02-08 2014-03-12 中兴通讯股份有限公司 提高虚拟专用局域网业务网络转发效率的方法和系统
US8776256B2 (en) * 2011-04-29 2014-07-08 At&T Intellectual Property I, L.P. System and method for controlling multicast geographic distribution

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1411211A (zh) * 2002-04-17 2003-04-16 华为技术有限公司 以太网交换芯片输出队列管理调度方法和装置
US7822051B1 (en) * 2007-10-24 2010-10-26 Ethernity Networks Ltd. Method and system for transmitting packets
CN101414973A (zh) * 2008-11-25 2009-04-22 中国人民解放军信息工程大学 一种传输数据包的方法及装置
CN102821045A (zh) * 2012-08-03 2012-12-12 中兴通讯股份有限公司 多播报文复制方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2869503A4 *

Also Published As

Publication number Publication date
CN102821045A (zh) 2012-12-12
US9407447B2 (en) 2016-08-02
EP2869503A1 (en) 2015-05-06
US20150215132A1 (en) 2015-07-30
EP2869503A4 (en) 2015-07-29
EP2869503B1 (en) 2017-05-03
CN102821045B (zh) 2015-07-22

Similar Documents

Publication Publication Date Title
WO2014019511A1 (zh) 多播报文复制方法及装置
US11809367B2 (en) Programmed input/output mode
US20200059353A1 (en) Data fetching in data exchange networks
WO2012162949A1 (zh) 一种报文重组重排序方法、装置和系统
WO2018107681A1 (zh) 一种队列操作中的处理方法、装置及计算机存储介质
US9244648B2 (en) Multi-processor video processing system and video image synchronous transmission and display method therein
JP2015512083A (ja) 暗示的なメモリの登録のための明示的なフロー制御
WO2019232927A1 (zh) 分布式数据删除流控方法、装置、电子设备及存储介质
WO2014019347A1 (zh) 一种数据处理方法、路由器及ndn系统
WO2018032510A1 (zh) 应用于存储设备中的访问请求的处理方法和装置
WO2014131273A1 (zh) 数据传输方法、装置及直接存储器存取
WO2022121808A1 (zh) 直通转发模式的调度方法、设备及存储介质
CN109743350B (zh) 一种科学计算应用影像区交换通信模式的卸载实现方法
WO2023241676A1 (zh) 一种内存池的操作方法以及装置
WO2014206232A1 (zh) 基于多内核处理器的一致性处理方法和装置
WO2015085794A1 (en) Data transmission method, related apparatus, and communications system
WO2010031297A1 (zh) 一种wap网关提取业务的实现方法和系统
CN109845199B (zh) 合并网络设备架构中的读取请求
WO2017215466A1 (zh) 一种网络处理器查表方法、网络处理器、查表系统及存储介质
CN104427181A (zh) 图像形成装置及图像形成方法
WO2022151475A1 (zh) 报文缓存方法、内存分配器及报文转发系统
CN111131089B (zh) 改善多播业务hol阻塞的队列管理方法
CN116866429A (zh) 一种数据访问方法及相关装置
CN113778937A (zh) 用于执行片上网络(NoC)中的事务聚合的系统和方法
WO2012119393A1 (zh) 一种数据流重用传输的方法、复制点设备及系统

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: 13825867

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2013825867

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 14418980

Country of ref document: US

Ref document number: 2013825867

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE