+

WO2018177041A1 - Method and apparatus for saving and recombining message fragment, and computer storage medium - Google Patents

Method and apparatus for saving and recombining message fragment, and computer storage medium Download PDF

Info

Publication number
WO2018177041A1
WO2018177041A1 PCT/CN2018/076322 CN2018076322W WO2018177041A1 WO 2018177041 A1 WO2018177041 A1 WO 2018177041A1 CN 2018076322 W CN2018076322 W CN 2018076322W WO 2018177041 A1 WO2018177041 A1 WO 2018177041A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
fragment
ram
bundle group
sequence number
Prior art date
Application number
PCT/CN2018/076322
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 WO2018177041A1 publication Critical patent/WO2018177041A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9057Arrangements for supporting packet reassembly or resequencing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9063Intermediate storage in different physical parts of a node or terminal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor

Definitions

  • Embodiments of the present invention relate to, but are not limited to, the field of data communications, and in particular, to a method, an apparatus, and a computer storage medium for packet fragment storage and reassembly.
  • multi-link bundling is a logical channel, and techniques for increasing bandwidth and improving stability are often used in internal and underlying transmissions of devices.
  • link aggregation technology MLPPP (Multilink PPP) uses link aggregation technology to bundle multiple PPP (Point-to-Point Protocol) services to provide greater bandwidth while one of the links appears. When the problem occurs, it does not affect other links, ensuring its stability.
  • each link In the traditional design, when multiple bundles and multiple links are to be reorganized, it is common practice for each link to require a RAM (Random-Access Memory) to store the corresponding data.
  • the serial number related information is compared with the serial number of all links in the same bundle group to find the minimum value, and the minimum value is sorted to the sorted queue, and the ordered fragments are finally sorted. According to the package start position and end position, the complete message is assembled.
  • Embodiments of the present invention provide a method, a device, and a computer storage medium for packet fragment storage and reorganization, so as to reduce dependence on system RAM resources.
  • the embodiment of the invention provides a method for packet fragment storage, including:
  • the information of the message fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs.
  • An embodiment of the present invention further provides an apparatus for packet fragment storage, including: a specified storage unit and four RAMs, wherein
  • the designated storage unit is configured to store data of the received packet fragmentation
  • the four RAMs are configured to store the information of the message fragmentation in an address corresponding to the bundle group number of the packet fragment.
  • the embodiment of the invention further provides a method for reassembling a message fragment, comprising:
  • the data of the packet fragment is stored in a designated storage unit, and the packet is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs.
  • the information of the packet fragment is read from the four RAMs from the first serial number of the packet to be grouped for packet processing.
  • the embodiment of the invention further provides an apparatus for packet fragmentation and reorganization, comprising:
  • the storage module is configured to: after receiving the packet fragmentation, store the data of the packet fragment in a specified storage unit, and store the data in an address corresponding to the bundle group number of the packet fragment in four RAMs respectively. Information about the fragmentation of the message;
  • the processing module when configured as a group package, starts from the first serial number of the to-be-grouped packet, and reads information of the packet fragment from the four RAMs to perform packet processing.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the method for storing message fragments according to the embodiment of the present invention; or,
  • the computer executable instructions are used to perform the method for packet fragmentation and reassembly according to the embodiment of the present invention.
  • An embodiment of the present invention further provides an apparatus for packet fragment storage, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the present invention The method for packet fragment storage described in the embodiment.
  • An embodiment of the present invention further provides an apparatus for reassembling a message fragment, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the present invention when executing the program
  • the method for packet fragmentation and reorganization described in the embodiment including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the present invention when executing the program The method for packet fragmentation and reorganization described in the embodiment.
  • the method, device and computer storage medium for packet fragment storage and reorganization provided by the embodiments of the present invention can reduce the dependency on the system RAM resources, thereby ensuring the system achievability.
  • FIG. 1 is a schematic diagram of a conventional multi-Bundle multi-Link packet fragmentation reorganization manner
  • FIG. 2 is a flowchart of a method for packet fragment storage according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a multi-Bundle multi-Link packet fragmentation recombination state according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a method for packet fragmentation and recombination according to Embodiment 2 of the present invention.
  • FIG. 5 is a flowchart of a method for packet fragmentation and recombination according to Embodiment 2 of the present invention.
  • FIG. 6 is a schematic diagram of an apparatus for packet fragment storage according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of an apparatus for packet fragmentation and reassembly according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for packet fragment storage according to an embodiment of the present invention. As shown in FIG. 2, the method in this embodiment includes the following steps:
  • step S12 the method may include:
  • m represents the number of links
  • n represents the number of bundled groups
  • t represents the number of serial numbers that can be supported
  • s represents the serial number value.
  • bit width, t and s are related.
  • the sequence number normally received does not exceed the value of the last sequence number plus t. Therefore, the embodiment does not need to support a large number of serial numbers.
  • the depth of the four sets of RAM is n, and the corresponding addresses represent the current bundle group number.
  • the multi-bundle group shares one RAM, so that the RAM resources are not greatly increased by the number of bundle groups.
  • RAM0 indicates whether there is a slice in the corresponding serial number, and the bit width is t.
  • the RAM1 indicates the B/E (slice start/end) flag of each slice and the first sequence number value of the bundle group to be the packet, and the bit width is 2t+s;
  • RAM2 stores the length corresponding to each serial number, and sets the RAM bit width according to the maximum fragment length in the system divided by the DDR (Double Data Rate) read/write Burst (burst) length, such as the maximum score in the system.
  • the chip length is 1024B, and the Burst length is 32B, then the RAM bit width is 5, and the bit width is 5*t;
  • the RAM 3 stores the current expected value sequence number of each bundle (ie, the next arriving sequence number), and the bit width is s.
  • FIG. 3 A method for packet fragment storage provided in this embodiment is shown in FIG. 3.
  • the embodiment of the present invention has a RAM resource.
  • Significant changes by replacing the 2048 FIFOs (First In First Out) in Figure 1 with 4 RAMs, greatly saving RAM resources.
  • FIG. 4 is a flowchart of a method for reassembling a packet according to an embodiment of the present invention. As shown in FIG. 4, the method in this embodiment includes the following steps:
  • the information about the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs, including: In the address corresponding to the bundle group number of the packet fragment, storing information indicating whether each sequence number has a fragment; and storing an indication in the address corresponding to the bundle group number of the packet fragment in the second RAM Decoding the start or end tag of the message fragment and the first sequence number value of the bundled group to be grouped; storing the newspaper in an address corresponding to the bundle group number of the packet fragment in the third RAM
  • the length of the fragment of the packet is stored in the address corresponding to the bundle group number of the packet fragment in the fourth RAM, and the sequence number of the next arrival of the bundle group to which the packet fragment belongs belongs.
  • the method further includes: if the serial number of the received packet fragment is the same as the sequence number that has been read and has not been successfully packaged, or detected If the next packet fragment is not received within the specified time, the packet fragmentation of all the received bundles is forcibly grouped.
  • the method further includes: if the sequence number of the packet fragment is greater than a sequence number of the next arrival read from the fourth RAM plus a first designated value, corresponding to the sequence number of the second specified value from all the RAMs starting from the first address of the message to the next arriving sequence number read from the fourth RAM Data elimination, the second specified value being less than or equal to the first specified value.
  • the four-letter RAM starts from a first address of the message, and the next arriving sequence number read from the fourth RAM is added with a second specified value.
  • Data elimination corresponding to the serial number including: if it is determined that the fragment corresponding to the serial number to be eliminated is a trailer fragment, then reading the corresponding packet first sequence number from the second RAM until the end of the packet Framing the serial number of the packet, and then clearing the information of the corresponding serial number in the first RAM, the second RAM and the third RAM, and writing the packet first serial number of the next packet into the In the second RAM, the next arriving sequence number value in the fourth RAM is incremented by one, and then the next sequence number to be eliminated is continued to be read.
  • the method further includes: if the received packet fragment is the header fragment of the next packet, the packet before the packet header fragment is received. Fragmentation performs mandatory grouping.
  • the group packet starts from the first serial number of the packet to be grouped, and the information of the packet fragment is read from the four RAMs according to the bundle group number of the packet fragment.
  • the packet processing includes: starting from the first serial number of the to-be-grouped packet to the end-of-packet serial number, and sequentially reading the length of the packet fragment from the four RAMs, according to the sequence number of the packet fragment and the packet score.
  • the length of the slice is read from the specified storage unit to read the data of the corresponding packet fragment.
  • FIG. 5 is a flowchart of a method for reassembling a packet according to an embodiment of the present invention. As shown in FIG. 5, the embodiment includes the following steps:
  • Step S101 Being in an idle state.
  • Step S102 It is determined whether the next packet fragment is received after the specified time is exceeded. If the next packet fragment is not received within the specified time, the process proceeds to step S116, otherwise, the process proceeds to step 103.
  • the timeout mechanism is controlled by a timer, and the specific size can be set according to the respective system.
  • the working principle of the timer is that the new serial number satisfies the expected value, or the timer is cleared during the clearing process in step S105. Cleared, only when the serial number is no longer coming or does not satisfy the clear watermark, and the serial number in the RAM has not been read, the timeout will be triggered, avoiding the prior art, when the expected value serial number has not come. When waiting, increase the cache resources.
  • the clear water line is set according to the system requirements. It is assumed that one Bundle is bundled with 32 links. Therefore, according to the normal situation, the maximum value of the two serial numbers before and after the same link is 63, and the water line can be cleared.
  • Setting 128, of course, can also be other values, such as 256, etc., to prevent the bandwidth from being uneven in some cases, resulting in an excessive difference between the two serial numbers before and after the same Link.
  • Step S103 determining whether a new packet fragment is received, and if so, storing the packet fragment data in the DDR, writing the packet fragmentation information into the four RAMs, and detecting the reception
  • the received message fragment is a packet tail fragment, and the sequence number is equal to the expected sequence number stored in the RAM 3. Then, all the information of the to-be-packaged packets in the four RAMs is read out, and the process proceeds to step S104. Otherwise, the process proceeds to step S101. .
  • Step S104 It is judged whether the serial number of the currently received message fragment is the same as the sequence number of the unpacked packet read out by the RAM0. If yes, the process proceeds to step S116, otherwise, the process proceeds to step S105.
  • Step S105 It is judged whether the serial number of the currently received message fragment is larger than the expected value serial number read out in the RAM 3 plus the clear watermark value. If yes, the process proceeds to step S111, otherwise, the process proceeds to step S106.
  • Step S106 It is judged whether the serial number of the currently received message fragment is equal to the expected value read out in the RAM 3, and if yes, the process proceeds to step S107, otherwise, the process proceeds to step S117.
  • Step S107 It is judged whether the packet position flag of the currently received message fragment is E (message end flag), and if yes, the process proceeds to step S108, otherwise, the process proceeds to step S109.
  • Step S108 Start the group package, start from the packet first serial number read out from the RAM1, continue until the serial number of the current E, and group the related serial number information read out in the RAM1, RAM2, and RAM3, and assemble the packet. After the completion, write all the serial number indication marks of the packet in RAM0 to 0, write B in the RAM1, write 0 in the RAM2, and update the first serial number value of the next packet to the RAM1, and proceed to step S109.
  • Step S109 The expected value serial number value is incremented by one, written in the RAM 3, and proceeds to step S110.
  • Step S110 Whether the next serial number in RAM0 is also present, and if yes, the process proceeds to step S107, and if no, the process proceeds to step S117.
  • Step S111 Start clearing the lost serial number.
  • serial number in the RAM is cleared from the first address of the message to the desired value plus 32. If yes, the process proceeds to step S110. Otherwise, the process proceeds to step S112.
  • the 32 in this is based on the assumption that a Bundle bundles 32 links in the current system, so it can be set to 32.
  • Step S112 Whether the packet position flag of the currently cleared serial number is E (message end tag) or the packet position of the next serial number is marked as B (message start tag), and if so, the expected value in RAM3 is incremented by 1, entering In step S113, if no, the process proceeds to step S111.
  • Step S113 Start the group package, start from the packet first serial number read out from the RAM1, continue until the serial number of the current E or continue to the position of the previous serial number whose serial number is the B mark, and simultaneously set the RAM0 and the RAM1.
  • the serial number indication mark, B/E attribute, and message length are all read out and given to the respective serial numbers.
  • all the serial number indication marks of the package in RAM0 are written to 0, and B/E is written in RAM1.
  • the length of the message in RAM2 is written as 0, and the value of the first serial number of the next packet is updated to the RAM1, and the flow proceeds to step S115.
  • Step S114 The expected value serial number value is incremented by 1, written in the RAM 3, and proceeds to step S115.
  • Step S115 Is the next serial number in RAM0 also present, and if yes, the process proceeds to step S112, otherwise, the process proceeds to step S117.
  • Step S116 Forcibly grouping the packets, and clearing all the existing serial numbers, that is, the RAM0 indicates the serial number mark, the B/E of the RAM1, and the length of the RAM2 are all written with 0; and the last serial number in the process of the timeout group is added.
  • 1 is the first serial number value of the next group packet in the RAM 1, and the expected value in the RAM 3 is also equal to the next packet first sequence number value.
  • Step S117 The end of the package or the new serial number has been stored.
  • FIG. 6 is a schematic diagram of an apparatus for packet fragment storage according to an embodiment of the present invention.
  • the apparatus of this embodiment includes: a storage unit and four RAMs (including: RAM0, RAM1, RAM2, and RAM3). ,among them,
  • the storage unit is configured to store data of the received packet fragmentation
  • the four RAMs are configured to store the information of the message fragmentation in an address corresponding to the bundle group number of the packet fragment.
  • the RAM0 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating whether each sequence number has a fragment;
  • the RAM1 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating a start or end mark of the packet fragmentation and a first sequence number value of the bundled group to be grouped packet;
  • the RAM2 is configured to store the length of the packet fragment in an address corresponding to the bundle group number of the packet fragmentation
  • the RAM3 is configured to store, in an address corresponding to the bundle group number of the packet fragment, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  • the apparatus for packet fragment storage in this embodiment can save RAM resources and reduce dependence on system RAM resources, thereby ensuring system achievability.
  • the apparatus for storing the packet fragmentation in the foregoing embodiment is only illustrated by the division of each of the foregoing program modules. In actual applications, the foregoing processing may be allocated according to requirements. It is completed by different program modules, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above.
  • the apparatus for packet fragment storage provided by the foregoing embodiment is the same as the method embodiment of the packet fragment storage, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
  • FIG. 7 is a schematic diagram of an apparatus for packet fragmentation and reorganization according to an embodiment of the present invention. As shown in FIG. 7, the apparatus of this embodiment includes:
  • the storage module is configured to: after receiving the packet fragmentation, store the data of the packet fragment in a specified storage unit, and store the data in an address corresponding to the bundle group number of the packet fragment in four RAMs respectively. Information about the fragmentation of the message;
  • the processing module when configured as a group package, starts from the first serial number of the to-be-grouped packet, and reads information of the packet fragment from the four RAMs to perform packet processing.
  • the storage module includes the designated storage unit and four RAMs, where
  • the designated storage unit is configured to store data of the received packet fragmentation
  • the four RAMs are configured to store the information of the message fragment in an address corresponding to the bundle group number of the packet fragment, wherein the four RAMs include: RAM0, RAM1, RAM2, and RAM3;
  • the RAM0 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating whether each sequence number has a fragment;
  • the RAM1 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating a start or end mark of the packet fragmentation and a first sequence number value of the bundled group to be grouped packet;
  • the RAM2 is configured to store, in an address corresponding to the bundle group number of the packet fragment, a length of the packet fragment.
  • the RAM3 is configured to store, in an address corresponding to the bundle group number of the packet fragment, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  • the processing module is configured to receive the same serial number of the packet fragment as the serial number that has been read out and has not been successfully packaged, or that the specified time is not received. If the next packet is fragmented, the packet fragmentation of all the received bundles is forcibly grouped.
  • the processing module is configured to receive, as the received message fragment, a sequence number greater than a next arriving sequence number read from the fourth RAM, plus a first specified value, And erasing data corresponding to the sequence number of the next arriving sequence plus the sequence number of the second specified value from the first address of the message in the all the RAM to the fourth RAM, The second specified value is less than or equal to the first specified value.
  • the processing module is configured to: if it is determined that the fragment corresponding to the sequence number to be eliminated is a trailer fragment, start reading the corresponding packet first sequence number from the second RAM. Until the sequence number of the end-of-packet fragment is grouped, and then the information of the corresponding serial number in the first RAM, the second RAM, and the third RAM is cleared, and the packet sequence of the next packet is The number is written into the second RAM, the next arriving sequence number value in the fourth RAM is incremented by 1, and then the next sequence number to be eliminated is continued to be read.
  • the processing module is configured to receive the packet header after receiving the packet fragmentation, and if the received packet fragment is the header fragment of the next packet, The previous packet fragmentation is forcibly grouping.
  • the processing module is configured to: when the packet is configured as a group packet, start from the first serial number of the packet to be grouped, and read information of the packet fragment from the four RAMs to perform packet processing, including: The length of the message fragment is read from the four RAMs in sequence from the first sequence number of the packet to be packaged until the end sequence number, according to the sequence number of the packet fragment and the length of the packet fragment. The data of the corresponding packet fragment is read in the specified storage unit for grouping.
  • the apparatus for reassembling the message fragment in the foregoing embodiment is only illustrated by the division of each of the foregoing program modules. In actual application, the foregoing processing may be allocated according to requirements. It is completed by different program modules, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the apparatus for reassembling the packet fragmentation and the method for reassembling the packet fragment are provided in the same concept. The specific implementation process is described in the method embodiment, and details are not described herein again.
  • An embodiment of the present invention further provides an apparatus for packet fragment storage, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements: receiving After the packet is fragmented, the data of the packet fragment is stored in the specified storage unit; and the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs. Information.
  • the processor executes the program, the information corresponding to the bundle group number of the packet fragment in the first RAM is stored, and information indicating whether each sequence number has a fragment is stored; And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet; And storing, in an address corresponding to the bundle group number of the packet fragment in the third RAM, a length of the packet fragment; and an address corresponding to the bundle group number of the packet fragment in the fourth RAM And storing a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  • the memory can be either volatile memory or non-volatile memory, and can include both volatile and nonvolatile memory.
  • the non-volatile memory may be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), or an Erasable Programmable Read (EPROM). Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a disk storage or a tape storage.
  • the volatile memory can be a random access memory (RAM) that acts as an external cache.
  • RAM Random Access Memory
  • SRAM Static Random Access Memory
  • SSRAM Synchronous Static Random Access Memory
  • SSRAM Dynamic Random Access
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • ESDRAM enhancement Enhanced Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Dynamic Random Access Memory
  • DRRAM Direct Memory Bus Random Access Memory
  • the method disclosed in the foregoing embodiments of the present invention may be applied to a processor or implemented by a processor.
  • the processor may be an integrated circuit chip with signal processing capabilities.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the above processor may be a general purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like.
  • DSP digital signal processor
  • the processor may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention.
  • a general purpose processor can be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a storage medium, the storage medium being located in the memory, the processor reading the information in the memory, and completing the steps of the foregoing methods in combination with the hardware thereof.
  • an embodiment of the present invention further provides a computer storage medium, such as a memory including a computer program, which may be executed by a processor of a device for message slice storage to perform the steps of the foregoing method.
  • the computer storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
  • the embodiment of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to perform: after receiving the message fragment, the message is fragmented.
  • the data is stored in the designated storage unit; the information of the message fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs.
  • the computer executable instructions are configured to: store, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment; And storing, in the address corresponding to the bundle group number of the packet fragment, the information indicating the start or end mark of the packet fragment and the first sequence number value of the bundle group to be grouped; The length of the packet fragment is stored in the address corresponding to the bundle group number of the packet fragment in the third RAM; and the address corresponding to the bundle group number of the packet fragment in the fourth RAM And storing the sequence number of the next arrival of the bundle group to which the message fragment belongs.
  • An embodiment of the present invention further provides an apparatus for reassembling a message fragment, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the program: receiving After the packet is fragmented, the data of the packet fragment is stored in a specified storage unit, and the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs. The information of the packet fragment is read from the four RAMs for group packet processing starting from the first serial number of the packet to be grouped.
  • the processor executes the program, the information corresponding to the bundle group number of the packet fragment in the first RAM is stored, and information indicating whether each sequence number has a fragment is stored; And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet; And storing, in the third RAM, an address of the packet fragment corresponding to the bundle group number of the packet fragment; in the address corresponding to the bundle group number of the packet fragment in the fourth RAM And storing a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  • the serial number of the received message fragment is the same as the sequence number that has been read out and has not been successfully packaged, or is detected to exceed the specified time. If the next packet fragment is not received, the packet fragmentation of all the received bundles is forcibly grouped.
  • the processor executes the program, after receiving the message fragment, if the sequence number of the message fragment is greater than the next arrival from the fourth RAM. Adding the first specified value to the serial number, starting from the first address of the message in all the RAMs, and adding the second specified value to the next arriving sequence number read from the fourth RAM. The data corresponding to the serial number is eliminated, and the second specified value is less than or equal to the first specified value.
  • the processor executes the program, if it is determined that the fragment corresponding to the sequence number to be eliminated is a trailer fragment, the corresponding packet header sequence is read from the second RAM. The number starts until the serial number of the end-of-packet fragment is grouped, and then the information of the corresponding serial number in the first RAM, the second RAM and the third RAM is cleared, and the packet of the next packet is The first serial number is written into the second RAM, the next arriving sequence number value in the fourth RAM is incremented by 1, and then the next serial number to be eliminated is continued to be read.
  • the processor executes the program, after receiving the packet fragmentation, if the received packet fragment is the header fragment of the next packet, the packet header is received. The packet fragmentation before the fragmentation is forced to be packaged.
  • the length of the message fragment is read from the four RAMs in sequence, starting from the first serial number of the packet to be grouped until the end sequence number, according to The sequence number of the packet fragment and the length of the packet fragment are read from the specified storage unit to read the data of the corresponding packet fragment.
  • an embodiment of the present invention further provides a computer storage medium, such as a memory including a computer program, which may be executed by a processor of a device for packet fragmentation to complete the steps of the foregoing method.
  • the computer storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
  • the embodiment of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to perform: after receiving the message fragment, the message is fragmented.
  • the data is stored in the designated storage unit, and the information of the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs; the first serial number of the packet to be grouped when the packet is grouped Initially, the information of the message fragment is read from the four RAMs for packet processing.
  • the computer executable instructions are configured to: store, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment; And storing, in the address corresponding to the bundle group number of the packet fragment, the information indicating the start or end mark of the packet fragment and the first sequence number value of the bundle group to be grouped;
  • the length of the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the third RAM, and is stored in an address corresponding to the bundle group number of the packet fragment in the fourth RAM.
  • the sequence number of the next arrival of the bundle group to which the packet fragment belongs are configured to: store, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment; And storing, in the address corresponding to the bundle group number of the packet fragment, the information indicating the start or end mark of the packet fragment and the first sequence number value of the bundle group to be grouped;
  • the length of the packet fragment is stored in
  • the computer executable instructions are configured to: if the serial number of the received message fragment is the same as the serial number that has been read and has not been successfully packaged, or is detected to be more than the specified time. After receiving the next packet fragmentation, the packet fragmentation of all the received bundles is forcibly grouped.
  • the computer executable instructions are configured to: after receiving the message fragment, if the sequence number of the message fragment is greater than the next arrival sequence read from the fourth RAM Adding a first specified value to the sequence of all the RAMs from the first address of the message to the next arriving sequence number read from the fourth RAM plus a second specified value The data corresponding to the number is eliminated, and the second specified value is less than or equal to the first specified value.
  • the computer executable instructions are configured to: if it is determined that the slice corresponding to the serial number to be eliminated is a trailer fragment, the corresponding packet first sequence number is read from the second RAM. Starting to assemble the serial number of the end-of-packet fragment, and then clearing the information of the corresponding serial number in the first RAM, the second RAM, and the third RAM, and the packet header of the next packet The serial number is written into the second RAM, the next arriving sequence number value in the fourth RAM is incremented by 1, and then the next sequence number to be eliminated is continued to be read.
  • the computer executable instructions are configured to: after receiving the message fragmentation, if the received message fragment is the header fragment of the next message, the packet header is received. The packet fragment before the slice is forced to be packaged.
  • the computer executable instructions are configured to: read the length of the message fragment from the four RAMs in sequence, starting from the first serial number of the packet to be grouped until the end sequence number, according to the report The sequence number of the fragment and the length of the packet fragment are read from the specified storage unit to read the data of the corresponding packet fragment.
  • the method and the device provided by the embodiments of the present invention can greatly reduce the occupation rate of the RAM resources under the premise of multi-bundle multi-link, and only need to pass 4 RAMs, and the address of each RAM is the bundle group number.
  • the main function of packet splicing and reassembly of multi-bundle group greatly saves RAM resources, brings more abundant resource space to the system, and enhances achievability.
  • the embodiment of the present invention can also quickly clear the discarded fragments by clearing the waterline when the serial number is lost, so that the expected value is gradually approached to the latest serial number, so that the service is quickly restored; the timeout mechanism of the embodiment of the present invention can also save the RAM. Resources: The timeout mechanism will only be triggered if the fragmentation in the RAM has not been grouped out and the new serial number does not satisfy the clear watermark. It does not need to wait for the expected value sequence number to arrive, and all the non-conformities are expected. The serial number is specially cached, which wastes the cache resources. The timeout mechanism also ensures that the data does not stay in the RAM, ensuring the smooth flow of the business.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
  • the units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit;
  • the unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.
  • the above-described integrated unit of the present invention may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a RAM, a magnetic disk, or an optical disk.
  • the technical solution of the embodiment of the present invention can greatly reduce the occupation rate of the RAM resources under the premise of multi-bundle multi-link, and only needs to pass 4 RAMs, and the address of each RAM is the bundle group number, so that the multi-bundle group can be realized.
  • the main function of message fragmentation reorganization which greatly saves RAM resources, brings more resource space to the system, and enhances the achievability.

Landscapes

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

Abstract

Disclosed are a method and apparatus for saving a message fragment. The method comprises: receiving a message fragment and saving data in the message fragment in a specified storage unit; and respectively storing information about the message fragment at addresses in four random access memories (RAMs) corresponding to a bound group number of the message fragment. Also disclosed are a method and apparatus for recombining a message fragment, and a computer storage medium.

Description

一种报文分片存储及重组的方法、装置和计算机存储介质Method, device and computer storage medium for message fragment storage and reorganization
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201710188546.8、申请日为2017年3月27日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。The present application is based on a Chinese patent application filed on Jan. 27, 2017, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本发明实施例涉及但不限于数据通讯领域,尤其涉及一种报文分片存储及重组的方法、装置和计算机存储介质。Embodiments of the present invention relate to, but are not limited to, the field of data communications, and in particular, to a method, an apparatus, and a computer storage medium for packet fragment storage and reassembly.
背景技术Background technique
在数据通信领域,随着网络数据业务量的增长和对服务质量要求的提高,现有的带宽已不够,由此对系统的带宽以及稳定性等技术指标提出了更高的要求。In the field of data communication, with the growth of network data traffic and the improvement of service quality requirements, the existing bandwidth is not enough, which puts higher requirements on the technical indicators such as bandwidth and stability of the system.
在通信设备中,多链路捆绑为逻辑通道,增加带宽,提高稳定性的技术,在设备内部和底层传输中经常使用。例如,链路聚合技术,MLPPP(多链路PPP)即运用了链路聚合技术,将多条PPP(点对点协议)业务捆绑在一起,以提供更大的带宽,同时当其中某条链路出现问题时,不影响到其他链路,保证了其稳定性。In communication devices, multi-link bundling is a logical channel, and techniques for increasing bandwidth and improving stability are often used in internal and underlying transmissions of devices. For example, link aggregation technology, MLPPP (Multilink PPP) uses link aggregation technology to bundle multiple PPP (Point-to-Point Protocol) services to provide greater bandwidth while one of the links appears. When the problem occurs, it does not affect other links, ensuring its stability.
传统的设计中,当要实现多个捆绑组,多个Link(链路)时进行报文重组时,通常做法是每个Link需要一个RAM(Random-Access Memory,随机存取存储器)来存储相应的序列号相关信息,再将同1个捆绑组里所有Link来临的序列号进行比较,找出最小值,将此最小值排到已排序好的队列后面,最终排序出有序的分片,再根据包起始位置和结束位置,组装 成完整的报文。In the traditional design, when multiple bundles and multiple links are to be reorganized, it is common practice for each link to require a RAM (Random-Access Memory) to store the corresponding data. The serial number related information is compared with the serial number of all links in the same bundle group to find the minimum value, and the minimum value is sorted to the sorted queue, and the ordered fragments are finally sorted. According to the package start position and end position, the complete message is assembled.
然而,随着链路个数以及捆绑个数大幅增加,此时需要RAM的资源也越来越多,比如需要实现64个Bundle(捆绑组),32个Link时,此时需要的RAM个数为64*32=2048,如图1所示,这对于资源有限的系统来说,实现难度会越来越大,因此RAM资源将逐渐成为制约整个系统的关键因素。However, as the number of links and the number of bundles increase significantly, more and more RAM resources are needed at this time. For example, 64 bundles (bundle groups) and 32 links are required, and the number of RAMs required at this time is required. For 64*32=2048, as shown in Figure 1, this is more difficult for systems with limited resources, so RAM resources will gradually become a key factor that constrains the entire system.
发明内容Summary of the invention
本发明实施例提供一种报文分片存储及重组的方法、装置和计算机存储介质,以降低对系统RAM资源的依靠性。Embodiments of the present invention provide a method, a device, and a computer storage medium for packet fragment storage and reorganization, so as to reduce dependence on system RAM resources.
本发明实施例提供了一种报文分片存储的方法,包括:The embodiment of the invention provides a method for packet fragment storage, including:
接收到报文分片后,将所述报文分片的数据存储于指定存储单元;After receiving the fragment of the packet, storing the data of the fragment of the packet in a specified storage unit;
分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。The information of the message fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs.
本发明实施例还提供了一种报文分片存储的装置,包括:指定存储单元和四个RAM,其中,An embodiment of the present invention further provides an apparatus for packet fragment storage, including: a specified storage unit and four RAMs, wherein
所述指定存储单元,配置为存储接收到报文分片的数据;The designated storage unit is configured to store data of the received packet fragmentation;
四个所述RAM,配置为分别在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。The four RAMs are configured to store the information of the message fragmentation in an address corresponding to the bundle group number of the packet fragment.
本发明实施例还提供了一种报文分片重组的方法,包括:The embodiment of the invention further provides a method for reassembling a message fragment, comprising:
接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;After receiving the packet fragmentation, the data of the packet fragment is stored in a designated storage unit, and the packet is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs. Piece of information;
组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。When the packet is grouped, the information of the packet fragment is read from the four RAMs from the first serial number of the packet to be grouped for packet processing.
本发明实施例还提供了一种报文分片重组的装置,包括:The embodiment of the invention further provides an apparatus for packet fragmentation and reorganization, comprising:
存储模块,配置为接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;The storage module is configured to: after receiving the packet fragmentation, store the data of the packet fragment in a specified storage unit, and store the data in an address corresponding to the bundle group number of the packet fragment in four RAMs respectively. Information about the fragmentation of the message;
处理模块,配置为组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。The processing module, when configured as a group package, starts from the first serial number of the to-be-grouped packet, and reads information of the packet fragment from the four RAMs to perform packet processing.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明实施例所述的报文分片存储的方法;或者,The embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the method for storing message fragments according to the embodiment of the present invention; or,
所述计算机可执行指令用于执行本发明实施例所述的报文分片重组的方法。The computer executable instructions are used to perform the method for packet fragmentation and reassembly according to the embodiment of the present invention.
本发明实施例还提供了一种报文分片存储的装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现本发明实施例所述的报文分片存储的方法。An embodiment of the present invention further provides an apparatus for packet fragment storage, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the present invention The method for packet fragment storage described in the embodiment.
本发明实施例还提供了一种报文分片重组的装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现本发明实施例所述的报文分片重组的方法。An embodiment of the present invention further provides an apparatus for reassembling a message fragment, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the present invention when executing the program The method for packet fragmentation and reorganization described in the embodiment.
本发明实施例提供的报文分片存储及重组的方法、装置和计算机存储介质,可以降低对系统RAM资源的依靠性,从而保证了系统的可实现性。The method, device and computer storage medium for packet fragment storage and reorganization provided by the embodiments of the present invention can reduce the dependency on the system RAM resources, thereby ensuring the system achievability.
附图说明DRAWINGS
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。The drawings are intended to provide a further understanding of the invention, and are intended to be a
图1是传统的多Bundle多Link报文分片重组方式示意图;FIG. 1 is a schematic diagram of a conventional multi-Bundle multi-Link packet fragmentation reorganization manner;
图2为本发明实施例的一种报文分片存储的方法的流程图;2 is a flowchart of a method for packet fragment storage according to an embodiment of the present invention;
图3为本发明实施例的多Bundle多Link报文分片重组状态示意图;FIG. 3 is a schematic diagram of a multi-Bundle multi-Link packet fragmentation recombination state according to an embodiment of the present invention; FIG.
图4为本发明实施例二的一种报文分片重组的方法的流程图;4 is a flowchart of a method for packet fragmentation and recombination according to Embodiment 2 of the present invention;
图5为本发明实施例二的一种报文分片重组的方法的流程图;FIG. 5 is a flowchart of a method for packet fragmentation and recombination according to Embodiment 2 of the present invention;
图6为本发明实施例的一种报文分片存储的装置的示意图;FIG. 6 is a schematic diagram of an apparatus for packet fragment storage according to an embodiment of the present invention;
图7为本发明实施例的一种报文分片重组的装置的示意图。FIG. 7 is a schematic diagram of an apparatus for packet fragmentation and reassembly according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
实施例一 Embodiment 1
图2为本发明实施例的一种报文分片存储的方法的流程图,如图2所示,本实施例的方法包括以下步骤:FIG. 2 is a flowchart of a method for packet fragment storage according to an embodiment of the present invention. As shown in FIG. 2, the method in this embodiment includes the following steps:
S11、接收到报文分片后,将所述报文分片的数据存储于指定存储单元;S11. After receiving the fragment of the packet, storing the data of the fragment of the packet in a specified storage unit.
S12、分别在四个随机存取存储器RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。S12. Store information of the packet fragmentation in an address corresponding to the bundle group number of the packet fragment in the four random access memory RAMs.
其中,步骤S12中,可以包括:Wherein, in step S12, the method may include:
在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;And storing, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment;
在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet;
在第三RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片的长度;And storing, in an address corresponding to the bundle group number of the packet fragment in the third RAM, a length of the packet fragment;
在第四RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片所属的捆绑组下一个到达的序列号。And storing, in the address corresponding to the bundle group number of the packet fragment in the fourth RAM, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
为了将该技术方案叙述清楚,定义了m,n,t,s四个参数,其中,m表示链路数,n表示捆绑组数,t表示可支持的序列号个数,s表示序列号 值的位宽,t和s有相关性。In order to clarify the technical solution, four parameters m, n, t, s are defined, where m represents the number of links, n represents the number of bundled groups, t represents the number of serial numbers that can be supported, and s represents the serial number value. The bit width, t and s are related.
可支持的序列号个数越多,系统容忍的超时等待分片时间也就越长,本发明实施例根据当前系统分片的特性,正常接收的序列号不会超出上次序列号值加t,所以本实施例无需支持很多的序列号,本发明实施例设置t=256,则s=8(8bits位宽可以指示从0-255)。The more the number of serial numbers that can be supported, the longer the timeout waiting for the system to wait for the fragmentation time. In the embodiment of the present invention, according to the characteristics of the current system fragmentation, the sequence number normally received does not exceed the value of the last sequence number plus t. Therefore, the embodiment does not need to support a large number of serial numbers. In the embodiment of the present invention, t=256 is set, and s=8 (the 8-bits bit width can indicate from 0-255).
这四组RAM的深度为n,对应的各个地址表示当前的捆绑组号。这里面通过运用RAM的特性,将地址作为捆绑组号,实现了多捆绑组共用1个RAM,使RAM资源不会因为捆绑组个数的增加而大幅的增加。The depth of the four sets of RAM is n, and the corresponding addresses represent the current bundle group number. By using the characteristics of the RAM and using the address as the bundle group number, the multi-bundle group shares one RAM, so that the RAM resources are not greatly increased by the number of bundle groups.
对每组RAM具体功能和位宽进行说明:Explain the specific functions and bit width of each group of RAM:
RAM0指示相应的序列号是否存在分片,位宽为t。每bit(比特)表示该捆绑组的t个序列号是否存在分片,如bit0=1,则指示了序列号为0的分片存在,bit1=1,则指示了序列号为1的分片存在,以此类推;RAM0 indicates whether there is a slice in the corresponding serial number, and the bit width is t. Each bit (bit) indicates whether there are fragments in the t serial numbers of the bundle. If bit0=1, it indicates that the fragment with sequence number 0 exists, and bit1=1 indicates that the sequence number is 1 fragment. Exist, and so on;
RAM1指示每个分片的B/E(分片开始/结束)标记和该捆绑组即将组包的首序列号值,位宽为2t+s;The RAM1 indicates the B/E (slice start/end) flag of each slice and the first sequence number value of the bundle group to be the packet, and the bit width is 2t+s;
RAM2存储每个序列号对应的长度,根据系统中最大分片长度除以DDR(Double Data Rate,双倍速率)读写Burst(突发)长度的结果来设置RAM位宽,比如系统中最大分片长度为1024B,Burst长度为32B,那么该RAM位宽为5,则位宽为5*t;RAM2 stores the length corresponding to each serial number, and sets the RAM bit width according to the maximum fragment length in the system divided by the DDR (Double Data Rate) read/write Burst (burst) length, such as the maximum score in the system. The chip length is 1024B, and the Burst length is 32B, then the RAM bit width is 5, and the bit width is 5*t;
RAM3存储每个捆绑组当前期望值序列号(即下一个到达的序列号),位宽为s。The RAM 3 stores the current expected value sequence number of each bundle (ie, the next arriving sequence number), and the bit width is s.
本实施例提供的一种报文分片存储的方法,如图3所示,从图中可以看出,在64个捆绑组,32个链路前提下,本发明实施例在RAM资源上有重大变化,通过4个RAM代替图1中的2048个FIFO(First In First Out,先进先出),大大节省了RAM资源。A method for packet fragment storage provided in this embodiment is shown in FIG. 3. As can be seen from the figure, in the case of 64 bundle groups and 32 links, the embodiment of the present invention has a RAM resource. Significant changes, by replacing the 2048 FIFOs (First In First Out) in Figure 1 with 4 RAMs, greatly saving RAM resources.
实施例二 Embodiment 2
图4为本发明实施例的一种报文分片重组的方法的流程图,如图4所示,本实施例的方法包括以下步骤:FIG. 4 is a flowchart of a method for reassembling a packet according to an embodiment of the present invention. As shown in FIG. 4, the method in this embodiment includes the following steps:
S21、接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;S21: After receiving the packet fragmentation, storing the data of the packet fragment in a specified storage unit, and storing the newspaper in an address corresponding to the bundle group number of the packet fragment in each of four RAMs. Information on the fragmentation;
S22、组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。S22: When the group package starts from the first serial number of the to-be-grouped packet, the information of the message fragment is read from the four RAMs to perform group packet processing.
在一可选实施例中,所述分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息,包括:在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;在第三RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的长度;在第四RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片所属的捆绑组下一个到达的序列号。In an optional embodiment, the information about the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs, including: In the address corresponding to the bundle group number of the packet fragment, storing information indicating whether each sequence number has a fragment; and storing an indication in the address corresponding to the bundle group number of the packet fragment in the second RAM Decoding the start or end tag of the message fragment and the first sequence number value of the bundled group to be grouped; storing the newspaper in an address corresponding to the bundle group number of the packet fragment in the third RAM The length of the fragment of the packet is stored in the address corresponding to the bundle group number of the packet fragment in the fourth RAM, and the sequence number of the next arrival of the bundle group to which the packet fragment belongs belongs.
在一可选实施例中,所述接收到报文分片后,还包括:如接收到的报文分片的系列号与已读取出的且尚未组包成功的序列号相同,或者检测到超过指定时间未接收到下一个报文分片,则对所有已接收到的该捆绑组的报文分片进行强制组包。In an optional embodiment, after receiving the fragment of the packet, the method further includes: if the serial number of the received packet fragment is the same as the sequence number that has been read and has not been successfully packaged, or detected If the next packet fragment is not received within the specified time, the packet fragmentation of all the received bundles is forcibly grouped.
在一可选实施例中,所述接收到报文分片后,还包括:如所述报文分片的序列号大于从所述第四RAM中读出的下一个到达的序列号加上第一指定值,则将所有所述RAM中从所述报文的首地址开始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,所述第二指定值小于或者等于所述第一指定值。In an optional embodiment, after receiving the packet fragmentation, the method further includes: if the sequence number of the packet fragment is greater than a sequence number of the next arrival read from the fourth RAM plus a first designated value, corresponding to the sequence number of the second specified value from all the RAMs starting from the first address of the message to the next arriving sequence number read from the fourth RAM Data elimination, the second specified value being less than or equal to the first specified value.
在一可选实施例中,所述将四信所述RAM中从所述报文的首地址开 始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,包括:如确定待消除的序列号对应的分片是包尾分片,则对从所述第二RAM中读出对应的包首序列号开始直到所述包尾分片的序列号进行组包,然后将所述第一RAM、所述第二RAM和所述第三RAM中对应序列号的信息清零,将下个包的包首序列号写入所述第二RAM中,将所述第四RAM中的下一个到达的序列号值加1,然后继续读下一个待消除的序列号。In an optional embodiment, the four-letter RAM starts from a first address of the message, and the next arriving sequence number read from the fourth RAM is added with a second specified value. Data elimination corresponding to the serial number, including: if it is determined that the fragment corresponding to the serial number to be eliminated is a trailer fragment, then reading the corresponding packet first sequence number from the second RAM until the end of the packet Framing the serial number of the packet, and then clearing the information of the corresponding serial number in the first RAM, the second RAM and the third RAM, and writing the packet first serial number of the next packet into the In the second RAM, the next arriving sequence number value in the fourth RAM is incremented by one, and then the next sequence number to be eliminated is continued to be read.
在一实施例中,所述接收到报文分片后,还包括:如接收到的报文分片为下个报文的包头分片,则将接收到所述包头分片之前的报文分片进行强制组包。In an embodiment, after receiving the packet fragmentation, the method further includes: if the received packet fragment is the header fragment of the next packet, the packet before the packet header fragment is received. Fragmentation performs mandatory grouping.
在一可选实施例中,所述组包时从待组包的首序列号开始,根据所述报文分片的捆绑组号从四个所述RAM中读取报文分片的信息进行组包处理,包括:从待组包的首序列号开始直到包尾序列号,依次从四个所述RAM中读取报文分片的长度,根据报文分片的序列号和报文分片的长度从所述指定存储单元中读取对应的报文分片的数据进行组包。In an optional embodiment, the group packet starts from the first serial number of the packet to be grouped, and the information of the packet fragment is read from the four RAMs according to the bundle group number of the packet fragment. The packet processing includes: starting from the first serial number of the to-be-grouped packet to the end-of-packet serial number, and sequentially reading the length of the packet fragment from the four RAMs, according to the sequence number of the packet fragment and the packet score. The length of the slice is read from the specified storage unit to read the data of the corresponding packet fragment.
实施例三 Embodiment 3
图5为本发明实施例的报文分片重组的方法的流程图,如图5所示,本实施例包括以下步骤:FIG. 5 is a flowchart of a method for reassembling a packet according to an embodiment of the present invention. As shown in FIG. 5, the embodiment includes the following steps:
步骤S101:处于空闲状态。Step S101: Being in an idle state.
步骤S102:判断超过指定时间是否接收到下一个报文分片;当超过指定时间未接收到下一个报文分片,那么进入步骤S116,否则转步骤103。Step S102: It is determined whether the next packet fragment is received after the specified time is exceeded. If the next packet fragment is not received within the specified time, the process proceeds to step S116, otherwise, the process proceeds to step 103.
这里面的超时机制是通过一个定时器来控制,具体大小,可以根据各自系统来设置,这个定时器工作原理是:新来的序列号满足期望值,或者在步骤S105清包过程中,该定时器清零,只有当后面序列号不再来临或者不满足清除水线,且RAM中的序列号还未读出的情况下,才会触发超时, 避免了以往技术中,当期望值序列号一直没来时,进行等待而增加的缓存资源。The timeout mechanism is controlled by a timer, and the specific size can be set according to the respective system. The working principle of the timer is that the new serial number satisfies the expected value, or the timer is cleared during the clearing process in step S105. Cleared, only when the serial number is no longer coming or does not satisfy the clear watermark, and the serial number in the RAM has not been read, the timeout will be triggered, avoiding the prior art, when the expected value serial number has not come. When waiting, increase the cache resources.
这里面的清除水线是根据系统要求来设定的,假设1个Bundle捆绑32个Link,所以按照正常情况下,同1个link前后2个序列号值最大相差63,这里面清除水线可以设置128,当然还可以是其他数值,例如256等,防止有某些情况带宽不均匀,导致同一条Link前后2个序列号相差过大。The clear water line is set according to the system requirements. It is assumed that one Bundle is bundled with 32 links. Therefore, according to the normal situation, the maximum value of the two serial numbers before and after the same link is 63, and the water line can be cleared. Setting 128, of course, can also be other values, such as 256, etc., to prevent the bandwidth from being uneven in some cases, resulting in an excessive difference between the two serial numbers before and after the same Link.
步骤S103:判断是否接收到新的报文分片,如果是,将该报文分片的数据存入到DDR中,将该报文分片的信息写入4个RAM中,当检测到接收到的报文分片为包尾分片,且序列号等于RAM3中存储的期望序列号,然后将4个RAM中的待组包的所有信息读出来,进入步骤S104,否的话,进入步骤S101。Step S103: determining whether a new packet fragment is received, and if so, storing the packet fragment data in the DDR, writing the packet fragmentation information into the four RAMs, and detecting the reception The received message fragment is a packet tail fragment, and the sequence number is equal to the expected sequence number stored in the RAM 3. Then, all the information of the to-be-packaged packets in the four RAMs is read out, and the process proceeds to step S104. Otherwise, the process proceeds to step S101. .
步骤S104:判断当前接收到的报文分片的序列号是否与RAM0读出来的尚未组包的序列号相同,如果是,进入步骤S116,否的话,进入步骤S105。Step S104: It is judged whether the serial number of the currently received message fragment is the same as the sequence number of the unpacked packet read out by the RAM0. If yes, the process proceeds to step S116, otherwise, the process proceeds to step S105.
步骤S105:判断当前接收到的报文分片的序列号是否大于RAM3中读出来的期望值序列号加上清除水线值,如果是,进入步骤S111,否的话,进入步骤S106。Step S105: It is judged whether the serial number of the currently received message fragment is larger than the expected value serial number read out in the RAM 3 plus the clear watermark value. If yes, the process proceeds to step S111, otherwise, the process proceeds to step S106.
步骤S106:判断当前接收到的报文分片的序列号是否与RAM3中读出来的期望值相等,如果是,进入步骤S107,否的话,进入步骤S117。Step S106: It is judged whether the serial number of the currently received message fragment is equal to the expected value read out in the RAM 3, and if yes, the process proceeds to step S107, otherwise, the process proceeds to step S117.
步骤S107:判断当前接收到的报文分片的包位置标记是否为E(报文结束标记),如果是,进入步骤S108,否的话,进入步骤S109。Step S107: It is judged whether the packet position flag of the currently received message fragment is E (message end flag), and if yes, the process proceeds to step S108, otherwise, the process proceeds to step S109.
步骤S108:开始进行组包,从RAM1中读出来的包首序列号开始,一直持续到当前为E的序列号,将RAM1,RAM2,RAM3中读出的相关序列号信息进行组包,组包完毕后,再将RAM0中该包所有序列号指示标记写0,RAM1中B/E写0,RAM2中报文长度写0,更新下个包的首序列号值到RAM1中,进入步骤S109。Step S108: Start the group package, start from the packet first serial number read out from the RAM1, continue until the serial number of the current E, and group the related serial number information read out in the RAM1, RAM2, and RAM3, and assemble the packet. After the completion, write all the serial number indication marks of the packet in RAM0 to 0, write B in the RAM1, write 0 in the RAM2, and update the first serial number value of the next packet to the RAM1, and proceed to step S109.
步骤S109:期望值序列号值加1,写到RAM3中,进入步骤S110。Step S109: The expected value serial number value is incremented by one, written in the RAM 3, and proceeds to step S110.
步骤S110:RAM0中下一个序列号是否也存在,如果是,进入步骤S107,否的话,进入步骤S117。Step S110: Whether the next serial number in RAM0 is also present, and if yes, the process proceeds to step S107, and if no, the process proceeds to step S117.
步骤S111:开始清除丢失的序列号。Step S111: Start clearing the lost serial number.
本实施例中,从该报文的首地址开始往后清RAM里的序列号,是否已清除到期望值加32,如果是,进入S110步骤,否的话,进入步骤S112。In this embodiment, the serial number in the RAM is cleared from the first address of the message to the desired value plus 32. If yes, the process proceeds to step S110. Otherwise, the process proceeds to step S112.
这里面的32,是根据当前系统中假定一个Bundle捆绑32个Link,那么可以设置成32。The 32 in this is based on the assumption that a Bundle bundles 32 links in the current system, so it can be set to 32.
步骤S112:当前清除的序列号的包位置标记是否为E(报文结束标记)或者下个序列号的包位置标记为B(报文开始标记),如果是,RAM3中的期望值加1,进入步骤S113,否的话,进入步骤S111。Step S112: Whether the packet position flag of the currently cleared serial number is E (message end tag) or the packet position of the next serial number is marked as B (message start tag), and if so, the expected value in RAM3 is incremented by 1, entering In step S113, if no, the process proceeds to step S111.
步骤S113:开始进行组包,从RAM1中读出来的包首序列号开始,一直持续到当前为E的序列号或者持续到序列号为B标记的前一个序列号位置,同时将RAM0、RAM1、RAM2中序列号指示标记、B/E属性、报文长度都读出来赋予给各自的序列号,组包完毕后,再将RAM0中该包所有序列号指示标记写0,RAM1中B/E写0,RAM2中报文长度写0,更新下个包的首序列号值到RAM1中,进入步骤S115。Step S113: Start the group package, start from the packet first serial number read out from the RAM1, continue until the serial number of the current E or continue to the position of the previous serial number whose serial number is the B mark, and simultaneously set the RAM0 and the RAM1. In RAM2, the serial number indication mark, B/E attribute, and message length are all read out and given to the respective serial numbers. After the group is completed, all the serial number indication marks of the package in RAM0 are written to 0, and B/E is written in RAM1. 0, the length of the message in RAM2 is written as 0, and the value of the first serial number of the next packet is updated to the RAM1, and the flow proceeds to step S115.
步骤S114:期望值序列号值加1,写到RAM3中,进入步骤S115。Step S114: The expected value serial number value is incremented by 1, written in the RAM 3, and proceeds to step S115.
步骤S115:RAM0中下一个序列号是否也存在,如果是,进入S112步骤,否的话,进入步骤S117。Step S115: Is the next serial number in RAM0 also present, and if yes, the process proceeds to step S112, otherwise, the process proceeds to step S117.
步骤S116:强行组包,将所有存在的序列号全部清空,即RAM0指示序列号标记、RAM1的B/E、RAM2的报文长度都写0;同时将超时组包过程中最后一个序列号加1作为RAM1中下次组包的首序列号值,RAM3中期望值也等于下次包首序列号值,组完包后,进入步骤S117。Step S116: Forcibly grouping the packets, and clearing all the existing serial numbers, that is, the RAM0 indicates the serial number mark, the B/E of the RAM1, and the length of the RAM2 are all written with 0; and the last serial number in the process of the timeout group is added. 1 is the first serial number value of the next group packet in the RAM 1, and the expected value in the RAM 3 is also equal to the next packet first sequence number value. After the group is completed, the process proceeds to step S117.
步骤S117:组包结束或者新来的序列号已经存储完毕。Step S117: The end of the package or the new serial number has been stored.
实施例四Embodiment 4
图6为本发明实施例的一种报文分片存储的装置的示意图,如图6所示,本实施例的装置包括:存储单元和四个RAM(包括:RAM0、RAM1、RAM2和RAM3),其中,FIG. 6 is a schematic diagram of an apparatus for packet fragment storage according to an embodiment of the present invention. As shown in FIG. 6, the apparatus of this embodiment includes: a storage unit and four RAMs (including: RAM0, RAM1, RAM2, and RAM3). ,among them,
所述存储单元,配置为存储接收到报文分片的数据;The storage unit is configured to store data of the received packet fragmentation;
四个所述RAM,配置为分别在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。The four RAMs are configured to store the information of the message fragmentation in an address corresponding to the bundle group number of the packet fragment.
其中,RAM0,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;The RAM0 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating whether each sequence number has a fragment;
RAM1,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;The RAM1 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating a start or end mark of the packet fragmentation and a first sequence number value of the bundled group to be grouped packet;
RAM2,配置为在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的长度;The RAM2 is configured to store the length of the packet fragment in an address corresponding to the bundle group number of the packet fragmentation;
RAM3,配置为在与所述报文分片的捆绑组号对应的地址中存储所述报文分片所属的捆绑组下一个到达的序列号。The RAM3 is configured to store, in an address corresponding to the bundle group number of the packet fragment, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
本实施例的报文分片存储的装置,可以节省RAM资源,降低对系统RAM资源的依靠性,从而保证了系统的可实现性。The apparatus for packet fragment storage in this embodiment can save RAM resources and reduce dependence on system RAM resources, thereby ensuring system achievability.
需要说明的是:上述实施例提供的报文分片存储的装置在进行报文分片存储时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的报文分片存储的装置与报文分片存储的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that, in the packet fragment storage, the apparatus for storing the packet fragmentation in the foregoing embodiment is only illustrated by the division of each of the foregoing program modules. In actual applications, the foregoing processing may be allocated according to requirements. It is completed by different program modules, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the apparatus for packet fragment storage provided by the foregoing embodiment is the same as the method embodiment of the packet fragment storage, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
实施例五Embodiment 5
图7为本发明实施例的一种报文分片重组的装置的示意图,如图7所示,本实施例的装置包括:FIG. 7 is a schematic diagram of an apparatus for packet fragmentation and reorganization according to an embodiment of the present invention. As shown in FIG. 7, the apparatus of this embodiment includes:
存储模块,配置为接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;The storage module is configured to: after receiving the packet fragmentation, store the data of the packet fragment in a specified storage unit, and store the data in an address corresponding to the bundle group number of the packet fragment in four RAMs respectively. Information about the fragmentation of the message;
处理模块,配置为组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。The processing module, when configured as a group package, starts from the first serial number of the to-be-grouped packet, and reads information of the packet fragment from the four RAMs to perform packet processing.
在一可选实施例中,所述存储模块包括所述指定存储单元和四个RAM,其中,In an optional embodiment, the storage module includes the designated storage unit and four RAMs, where
所述指定存储单元,配置为存储接收到报文分片的数据;The designated storage unit is configured to store data of the received packet fragmentation;
四个所述RAM,配置为分别在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息,其中,四个所述RAM包括:RAM0、RAM1、RAM2和RAM3;The four RAMs are configured to store the information of the message fragment in an address corresponding to the bundle group number of the packet fragment, wherein the four RAMs include: RAM0, RAM1, RAM2, and RAM3;
RAM0,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;The RAM0 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating whether each sequence number has a fragment;
RAM1,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;The RAM1 is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating a start or end mark of the packet fragmentation and a first sequence number value of the bundled group to be grouped packet;
RAM2,配置为在与所述报文分片的捆绑组号对应的地址中,存储所述报文分片的长度;The RAM2 is configured to store, in an address corresponding to the bundle group number of the packet fragment, a length of the packet fragment.
RAM3,配置为在与所述报文分片的捆绑组号对应的地址中,存储所述报文分片所属的捆绑组下一个到达的序列号。The RAM3 is configured to store, in an address corresponding to the bundle group number of the packet fragment, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
在一可选实施例中,所述处理模块,配置为如接收到的报文分片的系列号与已读取出的且尚未组包成功的序列号相同,或者检测到指定时间未接收到下一个报文分片,则对所有已接收到的该捆绑组的报文分片进行强 制组包。In an optional embodiment, the processing module is configured to receive the same serial number of the packet fragment as the serial number that has been read out and has not been successfully packaged, or that the specified time is not received. If the next packet is fragmented, the packet fragmentation of all the received bundles is forcibly grouped.
在一可选实施例中,所述处理模块,配置为如接收到的报文分片的序列号大于从所述第四RAM中读出的下一个到达的序列号加上第一指定值,则将所述所有所述RAM中从所述报文的首地址开始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,所述第二指定值小于或者等于所述第一指定值。In an optional embodiment, the processing module is configured to receive, as the received message fragment, a sequence number greater than a next arriving sequence number read from the fourth RAM, plus a first specified value, And erasing data corresponding to the sequence number of the next arriving sequence plus the sequence number of the second specified value from the first address of the message in the all the RAM to the fourth RAM, The second specified value is less than or equal to the first specified value.
在一可选实施例中,所述处理模块,配置为如确定待消除的序列号对应的分片是包尾分片,则对从所述第二RAM中读出对应的包首序列号开始直到所述包尾分片的序列号进行组包,然后将所述第一RAM、所述第二RAM和所述第三RAM中对应序列号的信息清零,将下个包的包首序列号写入所述第二RAM中,将所述第四RAM中的下一个到达的序列号值加1,然后继续读下一个待消除的序列号。In an optional embodiment, the processing module is configured to: if it is determined that the fragment corresponding to the sequence number to be eliminated is a trailer fragment, start reading the corresponding packet first sequence number from the second RAM. Until the sequence number of the end-of-packet fragment is grouped, and then the information of the corresponding serial number in the first RAM, the second RAM, and the third RAM is cleared, and the packet sequence of the next packet is The number is written into the second RAM, the next arriving sequence number value in the fourth RAM is incremented by 1, and then the next sequence number to be eliminated is continued to be read.
在一实施例中,所述处理模块,配置为所述接收到报文分片后,如接收到的报文分片为下个报文的包头分片,则将接收到所述包头分片之前的报文分片进行强制组包。In an embodiment, the processing module is configured to receive the packet header after receiving the packet fragmentation, and if the received packet fragment is the header fragment of the next packet, The previous packet fragmentation is forcibly grouping.
在一可选实施例中,所述处理模块,配置为组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理,包括:从待组包的首序列号开始直到包尾序列号,依次从四个所述RAM中读取报文分片的长度,根据报文分片的序列号和报文分片的长度从所述指定存储单元中读取对应的报文分片的数据进行组包。In an optional embodiment, the processing module is configured to: when the packet is configured as a group packet, start from the first serial number of the packet to be grouped, and read information of the packet fragment from the four RAMs to perform packet processing, including: The length of the message fragment is read from the four RAMs in sequence from the first sequence number of the packet to be packaged until the end sequence number, according to the sequence number of the packet fragment and the length of the packet fragment. The data of the corresponding packet fragment is read in the specified storage unit for grouping.
需要说明的是:上述实施例提供的报文分片重组的装置在进行报文分片重组时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的报文分片重组的装置与报文分片重组的方法实施例属于同 一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that, in the packet reassembly and reorganization, the apparatus for reassembling the message fragment in the foregoing embodiment is only illustrated by the division of each of the foregoing program modules. In actual application, the foregoing processing may be allocated according to requirements. It is completed by different program modules, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the apparatus for reassembling the packet fragmentation and the method for reassembling the packet fragment are provided in the same concept. The specific implementation process is described in the method embodiment, and details are not described herein again.
实施例六Embodiment 6
本发明实施例还提供了一种报文分片存储的装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现:接收到报文分片后,将所述报文分片的数据存储于指定存储单元;分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。An embodiment of the present invention further provides an apparatus for packet fragment storage, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements: receiving After the packet is fragmented, the data of the packet fragment is stored in the specified storage unit; and the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs. Information.
在一实施例中,所述处理器执行所述程序时实现:在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;在第三RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片的长度;在第四RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片所属的捆绑组下一个到达的序列号。In an embodiment, when the processor executes the program, the information corresponding to the bundle group number of the packet fragment in the first RAM is stored, and information indicating whether each sequence number has a fragment is stored; And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet; And storing, in an address corresponding to the bundle group number of the packet fragment in the third RAM, a length of the packet fragment; and an address corresponding to the bundle group number of the packet fragment in the fourth RAM And storing a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
可以理解,存储器可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例 如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It will be appreciated that the memory can be either volatile memory or non-volatile memory, and can include both volatile and nonvolatile memory. The non-volatile memory may be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), or an Erasable Programmable Read (EPROM). Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a disk storage or a tape storage. The volatile memory can be a random access memory (RAM) that acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access (SSRAM). DRAM (Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), enhancement Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory Bus Random Access Memory (DRRAM) ). The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
上述本发明实施例揭示的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成前述方法的步骤。The method disclosed in the foregoing embodiments of the present invention may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software. The above processor may be a general purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. The processor may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention. A general purpose processor can be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, the storage medium being located in the memory, the processor reading the information in the memory, and completing the steps of the foregoing methods in combination with the hardware thereof.
实施例七Example 7
在示例性实施例中,本发明实施例还提供了一种计算机存储介质,例如包括计算机程序的存储器,上述计算机程序可由报文分片存储的装置的 处理器执行,以完成前述方法所述步骤。计算机存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In an exemplary embodiment, an embodiment of the present invention further provides a computer storage medium, such as a memory including a computer program, which may be executed by a processor of a device for message slice storage to perform the steps of the foregoing method. . The computer storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
本发明实施例提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行:接收到报文分片后,将所述报文分片的数据存储于指定存储单元;分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。The embodiment of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to perform: after receiving the message fragment, the message is fragmented. The data is stored in the designated storage unit; the information of the message fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs.
在一实施例中,所述计算机可执行指令用于执行:在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;在第三RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片的长度;在第四RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片所属的捆绑组下一个到达的序列号。In an embodiment, the computer executable instructions are configured to: store, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment; And storing, in the address corresponding to the bundle group number of the packet fragment, the information indicating the start or end mark of the packet fragment and the first sequence number value of the bundle group to be grouped; The length of the packet fragment is stored in the address corresponding to the bundle group number of the packet fragment in the third RAM; and the address corresponding to the bundle group number of the packet fragment in the fourth RAM And storing the sequence number of the next arrival of the bundle group to which the message fragment belongs.
实施例八Example eight
本发明实施例还提供了一种报文分片重组的装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现:接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。An embodiment of the present invention further provides an apparatus for reassembling a message fragment, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the program: receiving After the packet is fragmented, the data of the packet fragment is stored in a specified storage unit, and the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs. The information of the packet fragment is read from the four RAMs for group packet processing starting from the first serial number of the packet to be grouped.
在一实施例中,所述处理器执行所述程序时实现:在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示 所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;在第三RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的长度;在第四RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片所属的捆绑组下一个到达的序列号。In an embodiment, when the processor executes the program, the information corresponding to the bundle group number of the packet fragment in the first RAM is stored, and information indicating whether each sequence number has a fragment is stored; And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet; And storing, in the third RAM, an address of the packet fragment corresponding to the bundle group number of the packet fragment; in the address corresponding to the bundle group number of the packet fragment in the fourth RAM And storing a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
在一实施例中,所述处理器执行所述程序时实现:如接收到的报文分片的系列号与已读取出的且尚未组包成功的序列号相同,或者检测到超过指定时间未接收到下一个报文分片,则对所有已接收到的该捆绑组的报文分片进行强制组包。In an embodiment, when the processor executes the program, the serial number of the received message fragment is the same as the sequence number that has been read out and has not been successfully packaged, or is detected to exceed the specified time. If the next packet fragment is not received, the packet fragmentation of all the received bundles is forcibly grouped.
在一实施例中,所述处理器执行所述程序时实现:接收到报文分片后,如所述报文分片的序列号大于从所述第四RAM中读出的下一个到达的序列号加上第一指定值,则将所有所述RAM中从所述报文的首地址开始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,所述第二指定值小于或者等于所述第一指定值。In an embodiment, when the processor executes the program, after receiving the message fragment, if the sequence number of the message fragment is greater than the next arrival from the fourth RAM. Adding the first specified value to the serial number, starting from the first address of the message in all the RAMs, and adding the second specified value to the next arriving sequence number read from the fourth RAM. The data corresponding to the serial number is eliminated, and the second specified value is less than or equal to the first specified value.
在一实施例中,所述处理器执行所述程序时实现:如确定待消除的序列号对应的分片是包尾分片,则对从所述第二RAM中读出对应的包首序列号开始直到所述包尾分片的序列号进行组包,然后将所述第一RAM、所述第二RAM和所述第三RAM中对应序列号的信息清零,将下个包的包首序列号写入所述第二RAM中,将所述第四RAM中的下一个到达的序列号值加1,然后继续读下一个待消除的序列号。In an embodiment, when the processor executes the program, if it is determined that the fragment corresponding to the sequence number to be eliminated is a trailer fragment, the corresponding packet header sequence is read from the second RAM. The number starts until the serial number of the end-of-packet fragment is grouped, and then the information of the corresponding serial number in the first RAM, the second RAM and the third RAM is cleared, and the packet of the next packet is The first serial number is written into the second RAM, the next arriving sequence number value in the fourth RAM is incremented by 1, and then the next serial number to be eliminated is continued to be read.
在一实施例中,所述处理器执行所述程序时实现:接收到报文分片后,如接收到的报文分片为下个报文的包头分片,则将接收到所述包头分片之前的报文分片进行强制组包。In an embodiment, when the processor executes the program, after receiving the packet fragmentation, if the received packet fragment is the header fragment of the next packet, the packet header is received. The packet fragmentation before the fragmentation is forced to be packaged.
在一实施例中,所述处理器执行所述程序时实现:从待组包的首序列号开始直到包尾序列号,依次从四个所述RAM中读取报文分片的长度,根据报文分片的序列号和报文分片的长度从所述指定存储单元中读取对应的 报文分片的数据进行组包。In an embodiment, when the processor executes the program, the length of the message fragment is read from the four RAMs in sequence, starting from the first serial number of the packet to be grouped until the end sequence number, according to The sequence number of the packet fragment and the length of the packet fragment are read from the specified storage unit to read the data of the corresponding packet fragment.
本实施例中,存储器和处理器的具体描述可参照实施例六中所述,这里不再赘述。For a detailed description of the memory and the processor, refer to the description in Embodiment 6, and details are not described herein again.
实施例九Example nine
在示例性实施例中,本发明实施例还提供了一种计算机存储介质,例如包括计算机程序的存储器,上述计算机程序可由报文分片重组的装置的处理器执行,以完成前述方法所述步骤。计算机存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In an exemplary embodiment, an embodiment of the present invention further provides a computer storage medium, such as a memory including a computer program, which may be executed by a processor of a device for packet fragmentation to complete the steps of the foregoing method. . The computer storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
本发明实施例提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行:接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。The embodiment of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to perform: after receiving the message fragment, the message is fragmented. The data is stored in the designated storage unit, and the information of the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs; the first serial number of the packet to be grouped when the packet is grouped Initially, the information of the message fragment is read from the four RAMs for packet processing.
在一实施例中,所述计算机可执行指令用于执行:在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;在第三RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的长度;在第四RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片所属的捆绑组下一个到达的序列号。In an embodiment, the computer executable instructions are configured to: store, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment; And storing, in the address corresponding to the bundle group number of the packet fragment, the information indicating the start or end mark of the packet fragment and the first sequence number value of the bundle group to be grouped; The length of the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the third RAM, and is stored in an address corresponding to the bundle group number of the packet fragment in the fourth RAM. The sequence number of the next arrival of the bundle group to which the packet fragment belongs.
在一实施例中,所述计算机可执行指令用于执行:如接收到的报文分片的系列号与已读取出的且尚未组包成功的序列号相同,或者检测到超过 指定时间未接收到下一个报文分片,则对所有已接收到的该捆绑组的报文分片进行强制组包。In an embodiment, the computer executable instructions are configured to: if the serial number of the received message fragment is the same as the serial number that has been read and has not been successfully packaged, or is detected to be more than the specified time. After receiving the next packet fragmentation, the packet fragmentation of all the received bundles is forcibly grouped.
在一实施例中,所述计算机可执行指令用于执行:接收到报文分片后,如所述报文分片的序列号大于从所述第四RAM中读出的下一个到达的序列号加上第一指定值,则将所有所述RAM中从所述报文的首地址开始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,所述第二指定值小于或者等于所述第一指定值。In an embodiment, the computer executable instructions are configured to: after receiving the message fragment, if the sequence number of the message fragment is greater than the next arrival sequence read from the fourth RAM Adding a first specified value to the sequence of all the RAMs from the first address of the message to the next arriving sequence number read from the fourth RAM plus a second specified value The data corresponding to the number is eliminated, and the second specified value is less than or equal to the first specified value.
在一实施例中,所述计算机可执行指令用于执行:如确定待消除的序列号对应的分片是包尾分片,则对从所述第二RAM中读出对应的包首序列号开始直到所述包尾分片的序列号进行组包,然后将所述第一RAM、所述第二RAM和所述第三RAM中对应序列号的信息清零,将下个包的包首序列号写入所述第二RAM中,将所述第四RAM中的下一个到达的序列号值加1,然后继续读下一个待消除的序列号。In an embodiment, the computer executable instructions are configured to: if it is determined that the slice corresponding to the serial number to be eliminated is a trailer fragment, the corresponding packet first sequence number is read from the second RAM. Starting to assemble the serial number of the end-of-packet fragment, and then clearing the information of the corresponding serial number in the first RAM, the second RAM, and the third RAM, and the packet header of the next packet The serial number is written into the second RAM, the next arriving sequence number value in the fourth RAM is incremented by 1, and then the next sequence number to be eliminated is continued to be read.
在一实施例中,所述计算机可执行指令用于执行:接收到报文分片后,如接收到的报文分片为下个报文的包头分片,则将接收到所述包头分片之前的报文分片进行强制组包。In an embodiment, the computer executable instructions are configured to: after receiving the message fragmentation, if the received message fragment is the header fragment of the next message, the packet header is received. The packet fragment before the slice is forced to be packaged.
在一实施例中,所述计算机可执行指令用于执行:从待组包的首序列号开始直到包尾序列号,依次从四个所述RAM中读取报文分片的长度,根据报文分片的序列号和报文分片的长度从所述指定存储单元中读取对应的报文分片的数据进行组包。In an embodiment, the computer executable instructions are configured to: read the length of the message fragment from the four RAMs in sequence, starting from the first serial number of the packet to be grouped until the end sequence number, according to the report The sequence number of the fragment and the length of the packet fragment are read from the specified storage unit to read the data of the corresponding packet fragment.
采用本发明实施例提供的方法及装置,在多捆绑组多链路前提下,可以大幅降低RAM资源的占有率,只需要通过4个RAM,每个RAM的地址就是捆绑组号,就可以实现多捆绑组的报文分片重组的主要功能,从而大大节省了RAM资源,为系统带来更宽裕的资源空间,增强了可实现性。The method and the device provided by the embodiments of the present invention can greatly reduce the occupation rate of the RAM resources under the premise of multi-bundle multi-link, and only need to pass 4 RAMs, and the address of each RAM is the bundle group number. The main function of packet splicing and reassembly of multi-bundle group greatly saves RAM resources, brings more abundant resource space to the system, and enhances achievability.
本发明实施例还可以在序列号丢失时,通过清除水线,快速的清除丢 弃的分片,使期望值逐步逼近最新的序列号,使业务迅速恢复;本发明实施例的超时机制也可以节省RAM资源:只有在RAM里分片一直未组包出去,同时新的序列号不满足清除水线情况下,才会触发超时机制,而不需要为了等待期望值序列号的到来,将所有的不符合期望值的序列号进行专门的缓存,浪费了缓存资源,该超时机制同时能保证数据不滞留在RAM里,确保了业务的畅通。The embodiment of the present invention can also quickly clear the discarded fragments by clearing the waterline when the serial number is lost, so that the expected value is gradually approached to the latest serial number, so that the service is quickly restored; the timeout mechanism of the embodiment of the present invention can also save the RAM. Resources: The timeout mechanism will only be triggered if the fragmentation in the RAM has not been grouped out and the new serial number does not satisfy the clear watermark. It does not need to wait for the expected value sequence number to arrive, and all the non-conformities are expected. The serial number is specially cached, which wastes the cache resources. The timeout mechanism also ensures that the data does not stay in the RAM, ensuring the smooth flow of the business.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; The unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各 种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.
或者,本发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, the above-described integrated unit of the present invention may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.
工业实用性Industrial applicability
本发明实施例的技术方案在多捆绑组多链路前提下,可以大幅降低RAM资源的占有率,只需要通过4个RAM,每个RAM的地址就是捆绑组号,就可以实现多捆绑组的报文分片重组的主要功能,从而大大节省了RAM资源,为系统带来更宽裕的资源空间,增强了可实现性。The technical solution of the embodiment of the present invention can greatly reduce the occupation rate of the RAM resources under the premise of multi-bundle multi-link, and only needs to pass 4 RAMs, and the address of each RAM is the bundle group number, so that the multi-bundle group can be realized. The main function of message fragmentation reorganization, which greatly saves RAM resources, brings more resource space to the system, and enhances the achievability.

Claims (16)

  1. 一种报文分片存储的方法,包括:A method for packet fragment storage, comprising:
    接收到报文分片后,将所述报文分片的数据存储于指定存储单元;After receiving the fragment of the packet, storing the data of the fragment of the packet in a specified storage unit;
    分别在四个随机存取存储器RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。The information of the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four random access memory RAMs.
  2. 如权利要求1所述的方法,其中,所述分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息,包括:The method of claim 1, wherein the information of the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs, including:
    在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;And storing, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment;
    在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet;
    在第三RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片的长度;And storing, in an address corresponding to the bundle group number of the packet fragment in the third RAM, a length of the packet fragment;
    在第四RAM中与所述报文分片的捆绑组号对应的地址中,存储所述报文分片所属的捆绑组下一个到达的序列号。And storing, in the address corresponding to the bundle group number of the packet fragment in the fourth RAM, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  3. 一种报文分片存储的装置,包括:指定存储单元和四个随机存取存储器RAM,A device for packet fragment storage, comprising: a specified storage unit and four random access memory RAMs,
    所述指定存储单元,配置为存储接收到报文分片的数据;The designated storage unit is configured to store data of the received packet fragmentation;
    四个所述RAM,配置为分别在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息。The four RAMs are configured to store the information of the message fragmentation in an address corresponding to the bundle group number of the packet fragment.
  4. 如权利要求3所述的装置,其中,四个所述RAM包括:第一RAM、第二RAM、第三RAM和第四RAM;The apparatus of claim 3, wherein the four RAMs comprise: a first RAM, a second RAM, a third RAM, and a fourth RAM;
    所述第一RAM,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;The first RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating whether each sequence number has a fragment;
    所述第二RAM,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;The second RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating a start or end mark of the packet fragment and a header of the bundled group to be grouped. Serial number value;
    所述第三RAM,配置为在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的长度;The third RAM is configured to store the length of the packet fragment in an address corresponding to the bundle group number of the packet fragmentation;
    所述第四RAM,配置为在与所述报文分片的捆绑组号对应的地址中存储所述报文分片所属的捆绑组下一个到达的序列号。The fourth RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  5. 一种报文分片重组的方法,包括:A method for reassembling a message fragment, comprising:
    接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个随机存取存储器RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;After receiving the packet fragmentation, the data of the packet fragment is stored in a designated storage unit, and is respectively stored in an address corresponding to the bundle group number of the packet fragment in the four random access memory RAMs. Information about the fragmentation of the message;
    组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。When the packet is grouped, the information of the packet fragment is read from the four RAMs from the first serial number of the packet to be grouped for packet processing.
  6. 如权利要求5所述的方法,其中,所述分别在四个RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息,包括:The method of claim 5, wherein the information of the packet fragmentation is stored in an address corresponding to the bundle group number of the packet fragment in the four RAMs, including:
    在第一RAM中与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;And storing, in an address corresponding to the bundle group number of the packet fragment in the first RAM, information indicating whether each sequence number has a fragment;
    在第二RAM中与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;And storing, in an address corresponding to the bundle group number of the packet fragment in the second RAM, information indicating a start or end mark of the packet fragment and a first sequence number value of the bundled group to be grouped packet;
    在第三RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的长度;The length of the packet fragment is stored in an address corresponding to the bundle group number of the packet fragment in the third RAM;
    在第四RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片所属的捆绑组下一个到达的序列号。And storing, in the address corresponding to the bundle group number of the packet fragment in the fourth RAM, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  7. 如权利要求6所述的方法,其中,所述接收到报文分片后,还包括:The method of claim 6, wherein after receiving the message fragmentation, the method further comprises:
    如接收到的报文分片的系列号与已读取出的且尚未组包成功的序列号相同,或者检测到超过指定时间未接收到下一个报文分片,则对所有已接收到的该捆绑组的报文分片进行强制组包。If the serial number of the received message fragment is the same as the serial number that has been read out and has not been successfully packaged, or if the next message fragment is not received after the specified time is exceeded, then all received packets are received. The packet fragmentation of the bundle group performs mandatory grouping.
  8. 如权利要求6所述的方法,其中,所述接收到报文分片后,还包括:The method of claim 6, wherein after receiving the message fragmentation, the method further comprises:
    如所述报文分片的序列号大于从所述第四RAM中读出的下一个到达的序列号加上第一指定值,则将所有所述RAM中从所述报文的首地址开始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,所述第二指定值小于或者等于所述第一指定值。If the sequence number of the message fragment is greater than the next arriving sequence number read from the fourth RAM plus the first specified value, all the RAMs are started from the first address of the message. And erasing data corresponding to the next arriving sequence number read from the fourth RAM plus the sequence number of the second specified value, the second specified value being less than or equal to the first specified value.
  9. 如权利要求8所述的方法,其中,所述将四个所述RAM中从所述报文的首地址开始,到从所述第四RAM中读出的下一个到达的序列号加上第二指定值的序列号对应的数据消除,包括:The method of claim 8, wherein said four said RAMs start from a first address of said message to a sequence number of the next arrival read from said fourth RAM The data elimination corresponding to the serial number of the specified value includes:
    如确定待消除的序列号对应的分片是包尾分片,则对从所述第二RAM中读出对应的包首序列号开始直到所述包尾分片的序列号进行组包,然后将所述第一RAM、所述第二RAM和所述第三RAM中对应序列号的信息清零,将下个包的包首序列号写入所述第二RAM中,将所述第四RAM中的下一个到达的序列号值加1,然后继续读下一个待消除的序列号。If it is determined that the fragment corresponding to the sequence number to be eliminated is a trailer fragment, the serial number of the packet header fragment is read from the second RAM, and then the sequence number of the trailer fragment is grouped, and then Clearing information of the corresponding serial number in the first RAM, the second RAM, and the third RAM, and writing the packet first sequence number of the next packet into the second RAM, and the fourth The value of the next arriving sequence number in the RAM is incremented by 1, and then continues to read the next sequence number to be eliminated.
  10. 如权利要求6所述的方法,其中,所述接收到报文分片后,还包括:The method of claim 6, wherein after receiving the message fragmentation, the method further comprises:
    如接收到的报文分片为下个报文的包头分片,则将接收到所述包头分片之前的报文分片进行强制组包。If the received packet fragment is the header fragment of the next packet, the packet fragmentation before receiving the packet header fragment is forced to be packaged.
  11. 如权利要求5所述的方法,其中,所述组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理,包括:The method according to claim 5, wherein the group packet is read from the first serial number of the packet to be grouped, and the information of the packet fragment is read from the four RAMs for packet processing, including:
    从待组包的首序列号开始直到包尾序列号,依次从四个所述RAM中读取报文分片的长度,根据报文分片的序列号和报文分片的长度从所述指定存储单元中读取对应的报文分片的数据进行组包。The length of the message fragment is read from the four RAMs in sequence from the first sequence number of the packet to be packaged until the end sequence number, according to the sequence number of the packet fragment and the length of the packet fragment. The data of the corresponding packet fragment is read in the specified storage unit for grouping.
  12. 一种报文分片重组的装置,包括:A device for reassembling a message fragment, comprising:
    存储模块,配置为接收到报文分片后,将所述报文分片的数据存储于指定存储单元,分别在四个随机存取存储器RAM中与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息;The storage module is configured to: after receiving the packet fragmentation, store the data of the packet fragment in a specified storage unit, and respectively correspond to the bundle group number of the packet fragment in four random access memory RAMs. The information of the packet fragmentation is stored in the address;
    处理模块,配置为组包时从待组包的首序列号开始,从四个所述RAM中读取报文分片的信息进行组包处理。The processing module, when configured as a group package, starts from the first serial number of the to-be-grouped packet, and reads information of the packet fragment from the four RAMs to perform packet processing.
  13. 如权利要求12所述的装置,其中,所述存储模块包括所述指定存储单元和四个随机存取存储器RAM,其中,The apparatus according to claim 12, wherein said storage module comprises said designated storage unit and four random access memory RAMs, wherein
    所述指定存储单元,配置为存储接收到报文分片的数据;The designated storage unit is configured to store data of the received packet fragmentation;
    四个所述RAM,配置为分别在与所述报文分片的捆绑组号对应的地址中存储所述报文分片的信息,其中,四个所述RAM包括:第一RAM、第二RAM、第三RAM和第四RAM;The four RAMs are configured to store the information of the packet fragmentation in an address corresponding to the bundle group number of the packet fragment, wherein the four RAMs include: a first RAM and a second RAM, third RAM, and fourth RAM;
    所述第一RAM,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示各序列号是否存在分片的信息;The first RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating whether each sequence number has a fragment;
    所述第二RAM,配置为在与所述报文分片的捆绑组号对应的地址中,存储指示所述报文分片的开始或结束标记的信息和所属的捆绑组待组包的首序列号值;The second RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, information indicating a start or end mark of the packet fragment and a header of the bundled group to be grouped. Serial number value;
    所述第三RAM,配置为在与所述报文分片的捆绑组号对应的地址中,存储所述报文分片的长度;The third RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, a length of the packet fragment;
    所述第四RAM,配置为在与所述报文分片的捆绑组号对应的地址中,存储所述报文分片所属的捆绑组下一个到达的序列号。The fourth RAM is configured to store, in an address corresponding to the bundle group number of the packet fragment, a sequence number of the next arrival of the bundle group to which the packet fragment belongs.
  14. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1或2所述的报文分片存储的方法;或者,A computer storage medium storing computer executable instructions for performing the method of message fragment storage according to claim 1 or 2; or
    所述计算机可执行指令用于执行权利要求5至11任一项所述的报文分 片重组的方法。The computer executable instructions are for performing the method of message fragment recombination according to any one of claims 5 to 11.
  15. 一种报文分片存储的装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1或2所述的报文分片存储的方法。An apparatus for message fragment storage, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the program to implement the report of claim 1 or 2 The method of fragment storage.
  16. 一种报文分片重组的装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求5至11任一项所述的报文分片重组的方法。An apparatus for reassembling a message fragment, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the program to implement any one of claims 5 to 11 The method of packet fragmentation and reorganization described.
PCT/CN2018/076322 2017-03-27 2018-02-11 Method and apparatus for saving and recombining message fragment, and computer storage medium WO2018177041A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710188546.8A CN108667755B (en) 2017-03-27 2017-03-27 Message fragment storage and reassembly method and device
CN201710188546.8 2017-03-27

Publications (1)

Publication Number Publication Date
WO2018177041A1 true WO2018177041A1 (en) 2018-10-04

Family

ID=63674169

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/076322 WO2018177041A1 (en) 2017-03-27 2018-02-11 Method and apparatus for saving and recombining message fragment, and computer storage medium

Country Status (2)

Country Link
CN (1) CN108667755B (en)
WO (1) WO2018177041A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371703A (en) * 2018-12-25 2020-07-03 迈普通信技术股份有限公司 Message recombination method and network equipment
CN113691469A (en) * 2021-07-27 2021-11-23 新华三技术有限公司合肥分公司 Message out-of-order rearrangement method and single board
CN119420707A (en) * 2025-01-07 2025-02-11 山东华翼微电子技术股份有限公司 A method and system for reassembling IP message fragments based on FPGA

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491871B (en) * 2020-11-25 2023-07-28 北京宝兰德软件股份有限公司 TCP reorganization method, TCP reorganization device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674234A (en) * 2009-08-21 2010-03-17 曙光信息产业(北京)有限公司 Fragments-reassembling method of IP messages and device thereof
US7814165B2 (en) * 2005-12-29 2010-10-12 Sap Ag Message classification system and method
CN102111339A (en) * 2011-03-24 2011-06-29 福建星网锐捷网络有限公司 Message transmission method and network equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100460970B1 (en) * 2002-01-10 2004-12-09 삼성전자주식회사 Data transmitting/receiving system and method thereof
US7304996B1 (en) * 2004-03-30 2007-12-04 Extreme Networks, Inc. System and method for assembling a data packet
CN100531147C (en) * 2007-03-07 2009-08-19 华为技术有限公司 Multi-link binding protocol message zone receiving method
CN101662461B (en) * 2008-08-27 2012-08-08 华为技术有限公司 Method, device and system for recombining multilink protocol fragment data
CN101447928B (en) * 2008-12-31 2011-09-14 华为技术有限公司 Method and device for processing fragment information
CN101917472B (en) * 2010-08-12 2013-05-29 北京星网锐捷网络技术有限公司 Method, device and equipment for recombining multi-link messages
CN105610744B (en) * 2016-01-28 2018-10-23 东南大学 A kind of IP packet fragment and recombination method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814165B2 (en) * 2005-12-29 2010-10-12 Sap Ag Message classification system and method
CN101674234A (en) * 2009-08-21 2010-03-17 曙光信息产业(北京)有限公司 Fragments-reassembling method of IP messages and device thereof
CN102111339A (en) * 2011-03-24 2011-06-29 福建星网锐捷网络有限公司 Message transmission method and network equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371703A (en) * 2018-12-25 2020-07-03 迈普通信技术股份有限公司 Message recombination method and network equipment
CN113691469A (en) * 2021-07-27 2021-11-23 新华三技术有限公司合肥分公司 Message out-of-order rearrangement method and single board
CN113691469B (en) * 2021-07-27 2023-12-26 新华三技术有限公司合肥分公司 Message disorder rearrangement method and single board
CN119420707A (en) * 2025-01-07 2025-02-11 山东华翼微电子技术股份有限公司 A method and system for reassembling IP message fragments based on FPGA

Also Published As

Publication number Publication date
CN108667755B (en) 2021-10-22
CN108667755A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
WO2018177041A1 (en) Method and apparatus for saving and recombining message fragment, and computer storage medium
CN102549552B (en) For the treatment of the method for the packet in flow-aware network nodes
US20060215691A1 (en) Network adaptor, communication system and communication method
JP5049834B2 (en) Data receiving apparatus, data receiving method, and data processing program
WO2010075795A1 (en) Method and device for fragment information processing
CN108933756B (en) A data packet processing method, access network device and computer-readable storage medium
CN111211990B (en) Data packet processing method and device
WO2017198108A1 (en) Method and device for processing fragment messages
CN116032861A (en) Message processing method and device
US20090225757A1 (en) Processing apparatus and method for processing ip packets
CN111262798B (en) Information processing method, information processing equipment and computer storage medium
US12010045B2 (en) Packet processing device and packet processing method
US20160085683A1 (en) Data receiving device and data receiving method
CN113973091A (en) Message processing method, network equipment and related equipment
CN116016687B (en) Message distribution method and system based on DPDK
US20230334273A1 (en) Data transmission method and data processing method, distributed unit, radio unit, and computer-readable storage medium
CN113098780B (en) Message processing method of virtual network, electronic equipment and storage medium
CN109802900B (en) Message caching method, message reading method, message caching device, message reading device and computer readable storage medium
CN115604183B (en) A message processing method, device, network equipment and storage medium
TWI353150B (en) System and method for a method for reducing latenc
CN103414656B (en) Message transmission control method and network interface card
CN114979041B (en) Packaging method for improving utilization efficiency of on-chip cache
JP2005515649A5 (en)
CN108781170A (en) A kind of configuration device and method
CN118175114B (en) Method, device, system and electronic device for sending virtual machine message

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18777118

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载