WO2014015498A1 - 报文发送方法、接收方法、装置及系统 - Google Patents

报文发送方法、接收方法、装置及系统 Download PDF

Info

Publication number
WO2014015498A1
WO2014015498A1 PCT/CN2012/079191 CN2012079191W WO2014015498A1 WO 2014015498 A1 WO2014015498 A1 WO 2014015498A1 CN 2012079191 W CN2012079191 W CN 2012079191W WO 2014015498 A1 WO2014015498 A1 WO 2014015498A1
Authority
WO
WIPO (PCT)
Prior art keywords
fragmented
message
priority
queue
packet
Prior art date
Application number
PCT/CN2012/079191
Other languages
English (en)
French (fr)
Inventor
周民
侯春凡
邓修东
钟蜜
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201280001103.9A priority Critical patent/CN103748845B/zh
Priority to PCT/CN2012/079191 priority patent/WO2014015498A1/zh
Publication of WO2014015498A1 publication Critical patent/WO2014015498A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6215Individual queue per QOS, rate or priority

Definitions

  • the present invention relates to the field of communications, and in particular, to a message sending method, a receiving method, a device and a system.
  • each frame of the message has a minimum and maximum length limit due to the difference between the transmission physical medium and the link layer protocol. Therefore, when the length of the packet to be transmitted is greater than the maximum length limit, the packet fragmentation must be performed on the packet sending side, and the fragmented packet is reassembled on the packet receiving side.
  • FIG. 1 and FIG. 2 respectively show an implementation diagram of a message sending and receiving method and a format of a fragmented message.
  • the existing packet sending method and receiving method are as follows: First, the packet sending device fragments and sends the long packet, and each fragment packet is less than or equal to the maximum packet length of the physical medium. The fragmented packet is fragmented by the same fragmented entity to ensure that the fragmented packets are not out of order.
  • each fragmented packet has a packet header, and the packet header of the fragmented packet includes a fragment serial number and is used to indicate whether the fragmented packet is the first slice or the fragment end. The first and last indications of the slice.
  • the packet receiving device receives the fragmented packet and caches the packet, and then sorts and reassembles the fragmented packet according to the fragment sequence number and the first and last indications in the header of each fragmented packet.
  • the embodiment of the present invention provides a packet sending method, a receiving method, a device and a system.
  • the technical solution is as follows:
  • a method for sending a message includes:
  • the at least one long message carrying the priority is fragmented, and the fragmented packet carrying the priority is obtained.
  • the fragmented packet is input into the sending queue according to the corresponding priority, and the same priority is used.
  • Slice messages are entered in sequence In the same sending queue, the fragmented packets of different priorities are sequentially input into different sending queues;
  • the fragmented packets in different sending queues are sent in sequence.
  • the queue number is used to indicate a sending queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet, and the fragmented packets of the same priority have the same queue. number.
  • fragmenting the long packet to obtain at least one fragmented packet specifically:
  • the queue number, the priority identifier, the fragment serial number, and the first and last chip identifiers are added, and the fragmented packet carrying the priority is obtained, including:
  • the packet header adding task of each fragment packet is processed by the current idle process in at least two processes to obtain a fragment packet carrying the priority.
  • a packet receiving method includes:
  • the fragmented packet is input into the reassembly queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same reassembly queue, and the fragmented packets of different priorities are sequentially input into different reassembly queues;
  • the fragmented packets in different reassembly queues are reorganized in turn to obtain at least one long message.
  • the receiving the at least one fragmented packet carrying the priority includes:
  • the header of each fragmented packet includes: a queue number, a priority identifier, a fragment serial number, and a first and last slice identifier;
  • the queue number is used to indicate the reassembly queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet, and the same queue number of the fragmented packet of the same priority.
  • the step of inputting the packet packet into the reassembly queue according to the corresponding priority specifically includes:
  • the high-to-low priority is performed to reassemble the fragmented packets in the different reassembly queues to obtain at least one long packet, which includes:
  • the currently received fragmented message is reassembled into a long message according to the fragment serial number and the first and last slice identifiers.
  • a message sending apparatus where the apparatus includes:
  • a fragmentation module configured to slice at least one long message carrying a priority to obtain a fragmented packet carrying the priority
  • a sending buffer configured to input the fragmented packet into the sending queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same sending queue, and the fragmented packets of different priorities are sequentially input.
  • the sending module is configured to send the fragmented packets in the sending queue with higher priority when the fragmented packets are sent in different sending queues.
  • the fragmentation module specifically includes:
  • a fragmentation unit configured to fragment the long packet to obtain at least one fragmented packet, where the length of each fragmented packet is less than or equal to a maximum packet length
  • a adding unit configured to add a queue number, a priority identifier, a fragment serial number, and a first and last slice identifiers in the packet header of the fragment packet, to obtain a fragment packet carrying the priority
  • the queue number is used to indicate a sending queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet, and the fragmented packets of the same priority have the same queue. number.
  • the fragmentation unit is configured to process a single fragmentation task in each long packet to a current idle process in at least two processes to obtain the fragmented packet.
  • the adding unit is configured to process the packet header adding task of each fragmented packet to the current idle process in the at least two processes to obtain the fragmented packet carrying the priority.
  • a message receiving apparatus wherein the apparatus includes:
  • a receiving module configured to receive at least one fragmented packet carrying a priority
  • the receiving buffer is configured to input the fragmented packet into the reassembly queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same reassembly queue, and the fragmented packets of different priorities are sequentially input.
  • Different reassembly queues; the reassembly module is configured to reassemble the fragmentation messages in different reassembly queues according to the priority from high to low, and obtain One less long message.
  • the receiving module is configured to receive at least one fragmented packet, where the header of each fragmented packet includes: a queue number, a priority identifier, a fragment serial number, and a first and last slice identifier;
  • the queue number is used to indicate the reassembly queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet, and the same queue number of the fragmented packet of the same priority.
  • the receiving buffer is specifically configured to input the fragmented packet into a corresponding re-queue according to a queue number of the fragmented packet.
  • a message sending system wherein the system includes:
  • the fragmented packet is input to the corresponding sending queue according to the queue number, and the fragment is sent according to the priority from high to low.
  • the message is used to enable the packet sending device to send the fragmented packet according to the priority of the packet, and solves the problem that the packet cannot be sent according to the priority of the packet in the prior art.
  • the fragmented message is input into the corresponding reassembly queue, and the packet is received by the high-to-low priority packet according to the priority, so that the packet receiving device can re-send the packet according to the packet priority, and the prior art is solved. Unable to reorganize the message according to the packet priority.
  • FIG. 1 is a schematic diagram of implementation of a message sending and receiving method provided by the background art of the present invention
  • FIG. 2 is a format diagram of a fragmented message provided by the background art of the present invention.
  • FIG. 3 is a flowchart of a method for sending a message according to Embodiment 1 of the present invention.
  • FIG. 5 is a schematic diagram of a format of a fragmented packet according to Embodiment 2 of the present invention.
  • FIG. 6 is a schematic diagram of packet transmission according to Embodiment 2 of the present invention.
  • FIG. 7 is a schematic diagram of sending a multi-link packet according to Embodiment 2 of the present invention.
  • FIG. 8 is a schematic diagram of another multi-link packet transmission according to Embodiment 2 of the present invention.
  • 9 is a schematic diagram of sending a multi-link priority packet according to Embodiment 2 of the present invention.
  • 10 is a flowchart of a method for receiving a message according to Embodiment 3 of the present invention.
  • FIG. 11 is a flowchart of a method for receiving a message according to Embodiment 4 of the present invention.
  • FIG. 12 is a schematic diagram of packet receiving according to Embodiment 4 of the present invention.
  • FIG. 13 is a structural diagram of a device of a message sending apparatus according to Embodiment 5 of the present invention.
  • FIG. 14 is a structural diagram of a device of a message receiving apparatus according to Embodiment 6 of the present invention.
  • Figure 15 is a system configuration diagram of a message transmitting and receiving system according to a seventh embodiment of the present invention. detailed description
  • the message sending method may be used for fragmenting and transmitting a message in an Ethernet network data link layer.
  • the method for sending a packet may include the following steps: Step 101: Perform at least one long message carrying a priority to perform fragmentation to obtain a fragmented packet carrying a priority; when several of the networks have their own priorities When the long message of the class needs to be sent, the packet sending device first fragments the long message to obtain at least one fragmented packet, and the length of each fragmented packet is less than or equal to the maximum packet length; A packet number, a priority identifier, a fragment serial number, and a first and last slice identifiers are added to the packet header of the fragmented packet to obtain a fragmented packet carrying the priority.
  • the queue number is used to indicate the sending queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet.
  • the fragmented packets of the same priority have the same queue number.
  • each fragment packet is input into the sending queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same sending queue, and the fragmented packets of different priorities are sequentially input into different sending queues;
  • the packet sending device sequentially inputs the fragmented packets of the same priority into the same sending queue according to the queue number in the header of each fragmented packet.
  • the fragmented packets of different priorities are sequentially input into different sending queues.
  • Step 103 Send the fragmented packets in different sending queues according to the priority from high to low.
  • the fragmented packet with the higher priority is sent according to the priority identifier in the packet header of the fragmented packet;
  • the sending queue is preset, and each sending queue corresponds to a priority.
  • the sending queues with the highest priority can be sent according to the priority of the sending queue.
  • the fragment message of the location is sent to the right end.
  • the method for sending a packet according to the first embodiment of the present invention adds a queue number and a priority identifier of the fragmented packet to the corresponding sending queue according to the queue number. Then, the fragmentation packet is sent according to the priority identifier, so that the packet sending apparatus can send the fragmented packet according to the packet priority, which solves the problem that the packet cannot be sent according to the packet priority in the prior art.
  • Embodiment 2
  • FIG. 3 a flow chart of a method for sending a message according to an IEEE is shown.
  • the 802.3ah protocol is extended and can be used to fragment and send packets in the Ethernet media data link layer.
  • the method for sending a packet provided in the second embodiment may specifically include the following steps:
  • Step 201 The packet sending apparatus performs fragmentation on at least one long packet carrying the priority.
  • the message sending device When a long message needs to be sent, the message sending device first fragments the long message to generate one or more fragmented messages. Among them, long messages have their own priorities.
  • Step 202 Add the queue number, the priority identifier, the fragment serial number, and the first and last slice identifiers of the fragmented packet to the packet header of the fragmented packet, and obtain the fragmented packet carrying the priority. ;
  • the existing IEEE 802.3ah protocol is extended, that is, in addition to adding the fragment serial number and the first and last chip identifiers in the packet header of the fragmented packet, the queue number of the fragmented packet is added.
  • the priority ID and the fragmented packets of the same priority have the same queue number.
  • the Ti field is the queue number (lObits) and the priority identifier (6 bits) of the fragmented packet
  • the sn field is the fragment sequence number of the fragmented packet ( 14bits) and the first and last slice identification (2bit), wherein the first and last slice identifiers are divided into a first slice identifier and a tail slice identifier.
  • Step 203 Input the fragmented packet into a corresponding sending queue according to the queue number of the fragmented packet.
  • the packet sending device sets the sending queue according to the priority number in advance, and each sending queue corresponds to a priority. After the fragmentation is completed, the packet sending device inputs the fragmented packet into the corresponding sending queue according to the queue number of the fragmented packet. Because the queue number of the same priority is the same, the queue number is the same. Therefore, the fragmented packets of the same priority can be input to the same sending queue according to the queue number of the fragmented packets.
  • FIG. 5 shows a schematic diagram of packet transmission, where a long packet is configured with three priorities, and a long packet 1 is a second priority, and a long packet 2 is a first priority.
  • Long message 3 is the third priority.
  • the packet sending device fragments the long messages 1, 2, and 3 into fragmented packets 1 ⁇ 15, where the fragmented packets 1 ⁇ 5 belong to the long message 1, and the fragmented message 6 ⁇ 10 It belongs to long message 2, and fragmented message 11 ⁇ 15 belongs to long message 3.
  • the message sending device presets three sending queues (queue 1 to queue 3), wherein the queue 1 corresponds to the first priority, the team Column 2 corresponds to the second priority, and queue 3 corresponds to the third priority.
  • the message sending device inputs the fragmented message 1 ⁇ 5 into the queue 2 according to the queue number of the fragmented message, and inputs the fragmented message 6 ⁇ 10 into the queue 1, and the fragmented message is sent. 11 ⁇ 15 input queue 3.
  • Step 204 Send a fragmented packet with a higher priority according to the priority identifier in the fragment header.
  • the fragmented packet in the queue is sent, and there are multiple packets in the queue at a certain transmission time point.
  • the fragmented packet with the highest priority is sent preferentially according to the priority identifier of the fragmented packet.
  • the location of the fragmented packets in queues 1 ⁇ 3 reflects the order in which they enter the queue and push to the right in the queue.
  • the rightmost end of the queue is the sending location. If the fragmented message 1 in the queue 2 advances to the rightmost transmitting position of the queue, and only the fragmented message 1 is in the transmitting position at the moment, the packet transmitting apparatus sends the fragmented message 1; 1 After the transmission is completed, the fragmented packets in queue 1 and the fragmented packets 2 in queue 2 may be in the rightmost sending position of the respective queues because the positions of the fragmented packets are pushed to the right in the respective queues.
  • the fragmentation and fragmentation packets of the packet are pushed forward faster in the queue than the fragmented packet.
  • the packet sending device takes precedence based on the fragmented packet 6 and the fragmented packet 2.
  • the level identifier is selected to send the fragmented packet with the higher priority.
  • the fragmented packet is also pushed to the right in the queue. 7 is further advanced to the sending position of the rightmost end of the queue.
  • the packet sending apparatus selects the fragmented message 7 with the higher priority according to the priority identifier of the fragmented packet 7 and the fragmented packet 2, thereby analogy.
  • the processing of the long packets can be performed by a single core or thread at the same time.
  • the packet fragmentation method provided in the second embodiment can support multiple cores or threads to perform fragmentation and packet headers on a long message at the same time.
  • the packet sending apparatus can The single fragmentation task in each of the long packets is processed by the current idle process in the at least two processes to obtain the fragmented message; and in step 202 of the embodiment, the packet sending device may divide each of the segments.
  • the packet header addition task of the fragment packet is processed by the current idle process in at least two processes to obtain the fragmented packet carrying the priority, so that the fragmentation of the long packet and the addition of the packet header are performed. It can be performed simultaneously by multiple processes, which can effectively utilize hardware resources and improve fragmentation efficiency.
  • the first scheme is The packets in different data streams are allocated to different transmission links for transmission, as shown in Figure 7. Schematic diagram of multi-link packet transmission, where long messages 1, 3, 4, and 5 belong to data stream 1, message 2 belongs to data stream 2, and data stream 1 and data stream 2 are performed through link 1 and link 2, respectively. send.
  • the second scheme is to fragment each long message according to the IEEE 802.3ah protocol, and send it according to the sequence of the original long message.
  • the long message is divided into two sets of slice messages and sent by link 1 and link 2 respectively.
  • the fragment number and the priority identifier of the fragmented packet are added to the fragmented packet, and the fragmented packet is input into the corresponding sending queue according to the queue number, and then Sending the fragmented packet according to the priority identifier, so as to enable the packet sending apparatus to send the fragmented packet according to the priority of the packet, and solving the problem that the packet cannot be sent according to the priority of the packet in the prior art;
  • the message receiving method may be used to receive and reassemble a fragmented message in an Ethernet medium data link layer.
  • the method for receiving the packet may specifically include the following steps:
  • Step 301 Receive at least one fragmented packet carrying a priority.
  • the packet receiving device receives at least one fragmented packet sent by the packet sending device, and the packet header of the received fragmented packet includes a queue number and a priority identifier of the fragmented packet added by the packet sending device. , slice serial number and first and last pieces The identifier of the fragmented packet is used to indicate the reassembly queue corresponding to the fragmented packet, and the priority identifier is used to indicate the priority of the fragmented packet, and the fragmented packets of the same priority have the same identifier. Queue number.
  • Step 302 The fragmented packet is input into the reassembly queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same reassembly queue, and the fragmented packets of different priorities are sequentially input into different reassembly queues;
  • the fragment receiving packets of the same priority have the same queue number, and the packet receiving device can input the same reorganization according to the fragment queue number in each fragment header and the fragmented packets of the same priority.
  • the fragmented packets of different priorities are sequentially input into different reassembly queues.
  • Step 303 Reassemble the fragmented packets in different reassembly queues according to the priority from high to low, to obtain at least one long packet.
  • the packet receiving device determines, according to the fragment serial number and the first and last chip identifiers, whether the currently received fragmented message in each reassembly queue can form a complete long message; if yes, according to the fragment serial number and the first and last ends
  • the slice identifier reassembles the currently received fragmented message that can form a complete long message into a long message.
  • the packet receiving method in the third embodiment is configured to input the fragmented packet into the corresponding reassembly queue according to the queue number in the packet header of the fragmented packet, and then pass the fragmented packet report.
  • the fragment serial number and the first and last slice identifiers in the header reorganize the fragmented packets into long messages according to the priority order, and achieve the purpose of reassembling the packets according to the priority.
  • a flow chart of a method for receiving a message according to the IEEE 802.3ah protocol is extended and can be used for aligning in the data link layer of the Ethernet medium.
  • the piece of message is received and reorganized.
  • the packet receiving method may specifically include the following steps:
  • Step 401 The packet receiving apparatus receives at least one fragmented packet carrying a priority.
  • the message receiving device receives and buffers at least one fragmented message.
  • the packet header of the received fragment packet contains the queue number, the priority identifier, the fragment sequence number, and the first and last slice identifiers of the fragmented packet, and the fragmented packets of the same priority, and the queue number. the same.
  • the queue number is used to indicate the reassembly queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet.
  • the fragment sequence number is used to determine the sequence of each fragmented packet when the packet is reorganized.
  • the slice identifier is used to indicate whether each fragmented packet is the first or last slice of the long packet.
  • the Ti field is the queue number (lObits) and the priority identifier (6bits) of the fragmented packet
  • the sn field is the fragment sequence number (14bits) of the fragmented packet and the first and last fragments.
  • Step 402 The packet receiving device inputs the fragmented packet into the reassembly queue according to the corresponding priority, and the fragment of the same priority The packets are sequentially input into the same reassembly queue, and the fragmented packets of different priorities are sequentially input into different reassembly queues.
  • the packet receiving device receives the fragmented packets according to the queue number in the packet header of the fragmented packet.
  • the corresponding reassembly queue is input, wherein the reassembly queue is preset by the message receiving device.
  • FIG. 12 shows a schematic diagram of packet receiving, where fragmented packets 1 ⁇ 5 belong to long message 1, and fragmented messages 6 ⁇ 10 belong to long message 2, fragmented. Messages 11 ⁇ 15 belong to long message 3.
  • the long message is configured with three priorities.
  • the long message 1 is the second priority
  • the long message 2 is the first priority
  • the long message 3 is the third priority.
  • the packet receiving device presets three reassembly queues (queue 1 to queue 3), wherein queue 1 corresponds to the first priority, queue 2 corresponds to the second priority, and queue 3 corresponds to Third priority.
  • the packet receiving device After receiving the fragmented packet, the packet receiving device inputs the fragmented packet 1 ⁇ 5 into the queue 2 according to the queue number of the fragmented packet, and inputs the fragmented packet 6 ⁇ 10 into the queue 1, and the fragmented packet 11 ⁇ 15 input queue 3.
  • Step 403 The packet receiving device reassembles the fragmented packets in different reassembly queues according to the priority from high to low, to obtain at least one long packet.
  • the packet receiving device when there are packets in the queues 1 to 3 that need to be reassembled, the packet receiving device first determines whether the packets in the reassembly queue can form a complete length according to the fragment serial number and the first and last chip identifiers. The packet, specifically, if a plurality of packet sequence numbers in a reassembly queue are consecutive fragmented packets, and there are both the first piece of message and the corresponding tail piece message, the continuous message is considered Multiple fragmented messages can form a complete long message. Then, the message receiving device reassembles the consecutive plurality of fragmented messages into one long message according to the message sequence number and the first and last slice identifiers. In addition, as shown in FIG.
  • the fragmented packets in the three reassembly queues are fragmented packets 6 ⁇ 10, fragmented packets 1 ⁇ 5, and fragmented packets 11-15, and the fragmented packets are included.
  • the first, the sixth and the first are the packets, and the fragmented packets 5, 10 and 15 are the tail packets.
  • the fragmented packets in the three reassembly queues can be reassembled into complete long messages.
  • the device may reassemble the long message 2, reassemble the long message 1, and reassemble the long message 3 according to the priority of each fragmented message.
  • the fragmented packet is respectively input into the corresponding reassembly queue according to the queue number in the packet header of the fragmented packet, and then the fragmented packet is reported.
  • the priority identifier, the fragment serial number, and the first and last chip identifiers in the header are reassembled into long packets according to the priority order, and the purpose of reassembling the packets according to the priority is achieved.
  • the message sending device may specifically include:
  • the fragmentation module 501 is configured to slice at least one long message with a respective priority to obtain a fragmented message carrying a priority;
  • the sending buffer 502 is configured to input the fragmented packets into the sending queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same sending queue, and the fragmented packets of different priorities are sequentially input into different sending queues;
  • the sending module 503 is configured to sequentially send the fragmented packets in different sending queues according to the priority from high to low.
  • the fragmentation module 501 specifically includes:
  • the fragmentation unit 501a is configured to slice the long packet to obtain at least one fragmented packet, where the length of each fragmented packet is less than or equal to the maximum packet length;
  • the adding unit 501b is configured to add a queue number, a priority identifier, a fragment serial number, and a first and last chip identifiers in the packet header of the fragmented packet, to obtain a fragmented packet carrying the priority;
  • the queue number is used to indicate the sending queue corresponding to the fragmented packet.
  • the priority identifier is used to indicate the priority of the fragmented packet.
  • the fragmented packets of the same priority have the same queue number.
  • fragmentation module 501 can be a multi-threaded entity, specifically,
  • a fragmentation unit 501a configured to process a single fragmentation task in each long message to a current idle process in at least two processes to obtain a fragmented message
  • the adding unit 501b is configured to process the packet header adding task of each fragmented packet to the current idle process in the at least two processes to obtain the fragmented packet carrying the priority.
  • the Ti field is the queue number (lObits) and the priority identifier (6bits) of the fragmented packet
  • the sn field is the fragment sequence number (14bits) of the fragmented packet and the first and last fragments.
  • the sending module 503 is configured to: when a fragmented packet needs to be sent in different sending queues, send the fragmented packet in the sending queue with a higher priority.
  • the sending module 503 sends the fragmented packet in the queue, when there are multiple queues in a certain sending time point.
  • the sending module 503 preferentially sends the fragmented packet with the highest priority according to the priority identifier of the fragmented packet.
  • the packet sending apparatus provided in the fifth embodiment can increase the queue number and the priority identifier of the fragmented packet in the fragmented packet, so that the packet sending apparatus can send the packet according to the packet priority.
  • the purpose of the fragment message is to solve the problem that the packet cannot be sent according to the priority of the packet in the prior art.
  • the packet receiving device may specifically include:
  • the receiving module 601 is configured to receive at least one fragmented packet carrying a priority;
  • the receiving buffer 602 is configured to input the fragmented packet into the reassembly queue according to the corresponding priority, and the fragmented packets of the same priority are sequentially input into the same reassembly queue, and the fragmented packets of different priorities are sequentially input into different reassembly queues;
  • the reassembly module 603 is configured to reassemble the fragmented packets in different reassembly queues according to the priority from high to low, to obtain at least one long packet.
  • the receiving module 601 is specifically configured to receive at least one fragmented packet, where the header of each fragmented packet includes: a queue number, a priority identifier, a fragment serial number, and a first and last slice identifier;
  • the queue number is used to indicate the reassembly queue corresponding to the fragmented packet
  • the priority identifier is used to indicate the priority of the fragmented packet and the same queue number of the fragmented packet of the same priority.
  • the receiving buffer 602 is specifically configured to input the fragmented packet into the corresponding reassembly queue according to the queue number of the fragmented packet.
  • the reorganization module 603 specifically includes:
  • the determining unit 603a is configured to determine, according to the fragment serial number and the first and last chip identifiers, whether the currently received fragmented message in each reassembly queue can form a complete long message;
  • the recombining unit 603b is configured to: if the judging unit 603a determines that the currently received fragmented packet in the reassembly queue can form a complete long message, the currently received fragmented packet according to the fragment serial number and the first and last chip identifiers Reorganized into a long message.
  • the packet receiving apparatus separately inputs the fragmented packet into the corresponding reassembly queue according to the queue number in the packet header of the fragmented packet, and then passes the fragmented packet report.
  • the priority identifier, the fragment serial number, and the first and last chip identifiers in the header are reassembled into long packets according to the priority order, and the purpose of reassembling the packets according to the priority is achieved.
  • the message sending and receiving system can include:
  • the packet sending and receiving system adds a queue number and a priority identifier of the fragmented packet to the fragmented packet, and inputs the fragmented packet according to the queue number.
  • the corresponding sending queue sends the fragmented packet according to the priority identifier, so that the packet sending device can send the fragmented packet according to the priority of the packet; and, in addition, according to the packet header of the fragmented packet on the receiving side
  • the queue number is used to input the fragmented message into the corresponding reassembly queue, and then the fragmentation message is reorganized according to the priority order by the priority identifier, the fragment serial number and the first and last slice identifiers in the packet header of the fragmented packet.

Landscapes

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

Abstract

本发明实施例提供了一种报文发送方法、接收方法、装置及系统,涉及领域通信,所述方法包括:将至少一个携带有优先级的长报文进行分片,得到携带有所述优先级的分片报文;将所述分片报文按照对应优先级输入发送队列,相同优先级的所述分片报文依次输入相同的发送队列,不同优先级的所述分片报文依次输入不同的发送队列;按照优先级由高到低,依次发送不同发送队列中的分片报文。本发明通过在分片报文中添加分片报文的队列号和优先级标识,根据队列号将分片报文输入相应发送队列,再根据优先级标识发送分片报文,达到使报文发送装置能够按照报文优先级发送分片报文的目的,解决了现有技术中无法按照报文优先级发送报文的问题。

Description

报文发送方法、 接收方法、 装置及系统 技术领域
本发明涉及通信领域, 特别涉及一种报文发送方法、 接收方法、 装置及系统。 背景技术 说
报文传输过程中, 由于传输物理介质和链路层协议的差异, 每帧报文都会有最小和最 大长度限制。 因此, 当需要传输的报文长度大于最大长度限制时, 必须在报文发送侧进行 报文分片, 并在报文接收侧将分片的报文进行重组。
以以太网介质数据链路层为例, 请结合参见图 1书和图 2, 其分别示出了一种报文发送和 接收方法的实施示意图以及分片报文格式图。 现有的报文发送方法和接收方法如下: 第一、 报文发送装置对长报文进行分片并发送, 每个分片报文小于等于物理介质最大 报文长度。 其中, 分片报文由同一个分片实体完成分片, 保证分片报文之间不会乱序。 另 夕卜, 每个分片报文都有一个报文头, 分片报文的报文头中包含有分片序列号以及用于指示 该分片报文是否为分片首片或分片尾片的首尾指示标识。
第二、 报文接收装置接收分片报文并缓存, 再按照各个分片报文的报文头中的分片序 列号和首尾指示标识进行分片报文的排序和重组。
在实现本发明的过程中, 发明人发现现有技术至少存在以下问题:
当网络上存在的报文较多, 且各报文之间有优先级调度和传输的需要时, 一个优先级 较低的报文进入分片状态后, 其它优先级较高的报文必须等待已经进入分片状态的报文完 成分片并全部发送后, 才能开始分片和发送的过程, 在报文接收侧也存在同样的问题, 无 法按照报文优先级进行分片发送和重组。 发明内容
为了能够按照报文优先级对报文进行分片发送和重组, 本发明实施例提供了一种报文 发送方法、 接收方法、 装置及系统。 所述技术方案如下:
一方面, 提供一种报文发送方法, 所述方法包括:
将至少一个携带有优先级的长报文进行分片, 得到携带有所述优先级的分片报文; 将所述分片报文按照对应优先级输入发送队列, 相同优先级的所述分片报文依次输入 相同的发送队列, 不同优先级的所述分片报文依次输入不同的发送队列;
按照优先级由高到低, 依次发送不同发送队列中的分片报文。
所述将至少一个携带有优先级的长报文进行分片, 得到携带有所述优先级的分片报文, 具体包括:
将所述长报文进行分片得到至少一个分片报文, 每个分片报文的长度小于等于最大报 文长度;
在所述分片报文的报文头中添加队列号、 优先级标识、 分片序列号和首尾片标识, 得 到携带有所述优先级的分片报文;
其中, 所述队列号用于指示所述分片报文对应的发送队列, 所述优先级标识用于指示 所述分片报文的优先级, 相同优先级的分片报文具有相同的队列号。
所述将所述长报文进行分片得到至少一个分片报文, 具体包括:
将每个长报文中的单次分片任务交由至少两个进程中的当前空闲进程进行处理, 以得 到所述分片报文;
相应的, 所述在所述分片报文的报文头中, 添加队列号、 优先级标识、 分片序列号和 首尾片标识, 得到携带有所述优先级的分片报文, 包括:
将每个分片报文的报文头添加任务交由至少两个进程中的当前空闲进程进行处理, 以 得到携带有所述优先级的分片报文。
所述按照优先级由高到低, 依次发送不同发送队列中的分片报文, 具体包括: 当不同的发送队列中同时有分片报文需要发送时, 优先发送优先级较高的发送队列中 的分片报文。
另一方面, 提供了一种报文接收方法, 所述方法包括:
接收至少一个携带有优先级的分片报文;
将所述分片报文按照对应优先级输入重组队列, 相同优先级的所述分片报文依次输入 相同的重组队列, 不同优先级的所述分片报文依次输入不同的重组队列;
按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少一个长报文。 所述接收至少一个携带有优先级的分片报文, 具体包括:
接收至少一个分片报文, 每个分片报文的报文头中包含有: 队列号、 优先级标识、 分 片序列号和首尾片标识;
其中, 所述队列号用于指示所述分片报文对应的重组队列, 所述优先级标识用于指示 所述分片报文的优先级, 相同优先级的分片报文相同的队列号。 所述将所述分组报文按照对应优先级输入重组队列, 具体包括:
根据所述分片报文的队列号将所述分片报文输入相应的重组队列。
所述按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少一个长报 文, 具体包括:
根据所述分片序列号和首尾片标识判断每个重组队列中当前接收到的分片报文是否能 够组成完整的长报文;
如果是, 则根据所述分片序列号和首尾片标识将当前接收到的分片报文重组为一个长 报文。
又一方面, 提供一种报文发送装置, 所述装置包括:
分片模块, 用于将至少一个携带有优先级的长报文进行分片得到携带有所述优先级的 分片报文;
发送缓存器, 用于将所述分片报文按照对应优先级输入发送队列, 相同优先级的所述 分片报文依次输入相同的发送队列, 不同优先级的所述分片报文依次输入不同的发送队列; 发送模块, 用于当不同的发送队列中同时有分片报文需要发送时, 优先发送优先级较 高的发送队列中的分片报文。
所述分片模块, 具体包括:
分片单元, 用于将所述长报文进行分片得到至少一个分片报文, 每个分片报文的长度 小于等于最大报文长度;
添加单元, 用于在所述分片报文的报文头中添加队列号、 优先级标识、 分片序列号和 首尾片标识, 得到携带有所述优先级的分片报文;
其中, 所述队列号用于指示所述分片报文对应的发送队列, 所述优先级标识用于指示 所述分片报文的优先级, 相同优先级的分片报文具有相同的队列号。
所述分片单元, 具体用于将每个长报文中的单次分片任务交由至少两个进程中的当前 空闲进程进行处理, 以得到所述分片报文;
所述添加单元, 具体用于将每个分片报文的报文头添加任务交由至少两个进程中的当 前空闲进程进行处理, 以得到携带有所述优先级的分片报文。
又一方面, 提供一种报文接收装置, 其特征在于, 所述装置包括:
接收模块, 用于接收至少一个携带有优先级的分片报文;
接收缓存器, 用于将所述分片报文按照对应优先级输入重组队列, 相同优先级的所述 分片报文依次输入相同的重组队列, 不同优先级的所述分片报文依次输入不同的重组队列; 重组模块, 用于按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至 少一个长报文。
所述接收模块, 具体用于接收至少一个分片报文, 每个分片报文的报文头中包含有: 队列号、 优先级标识、 分片序列号和首尾片标识;
其中, 所述队列号用于指示所述分片报文对应的重组队列, 所述优先级标识用于指示 所述分片报文的优先级, 相同优先级的分片报文相同的队列号。
所述接收缓存器, 具体用于根据所述分片报文的队列号将所述分片报文输入相应的重 组队列。
再一方面, 提供了一种报文发送系统, 其特征在于, 所述系统包括:
上述报文发送装置和报文接收装置。
本发明实施例提供的技术方案的有益效果是:
通过在分片报文中添加分片报文的队列号和优先级标识, 在报文发送侧, 根据队列号 将分片报文输入相应发送队列, 并根据优先级由高到低发送分片报文, 达到使报文发送装 置能够按照报文优先级发送分片报文的目的, 解决了现有技术中无法按照报文优先级发送 报文的问题; 在报文接收侧, 根据队列号将分片报文输入相应重组队列, 并根据优先级由 高到低重组分片报文, 达到使报文接收装置能够按照报文优先级重组分片报文的目的, 解 决了现有技术中无法按照报文优先级重组报文的问题。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所需要使用的 附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本 领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的 附图。
图 1是本发明背景技术提供的报文发送和接收方法的实施示意图;
图 2是本发明背景技术提供的分片报文格式图;
图 3是本发明实施例一提供的报文发送方法的方法流程图;
图 4是本发明实施例二提供的报文发送方法的方法流程图;
图 5是本发明实施例二提供的分片报文格式示意图;
图 6是本发明实施例二提供的报文发送原理图;
图 7是本发明实施例二提供的一种多链路报文发送示意图;
图 8是本发明实施例二提供的另一种多链路报文发送示意图;
图 9是本发明实施例二提供的多链路优先级报文发送示意图; 图 10是本发明实施例三提供的报文接收方法的方法流程图;
图 11是本发明实施例四提供的报文接收方法的方法流程图;
图 12是本发明实施例四提供的报文接收原理图;
图 13是本发明实施例五提供的报文发送装置的装置结构图;
图 14是本发明实施例六提供的报文接收装置的装置结构图;
图 15是本发明实施例七提供的报文发送和接收系统的系统构成图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明实施方式作 进一步地详细描述。 实施例一
请参见图 2, 其示出了一种报文发送方法的方法流程图, 该报文发送方法可以用于在以 太网介质数据链路层中对报文进行分片和发送。 该报文发送方法具体可以包括如下步骤: 步骤 101,将至少一个携带有优先级的长报文进行分片,得到携带有优先级的分片报文; 当网络中有若干个具有各自的优先级的长报文需要发送时, 报文发送装置首先将长报 文进行分片得到至少一个分片报文, 每个分片报文的长度小于等于最大报文长度; 报文发 送装置还在分片报文的报文头中添加队列号、 优先级标识、 分片序列号和首尾片标识, 得 到携带有优先级的分片报文。
其中, 队列号用于指示该分片报文对应的发送队列, 优先级标识用于指示该分片报文 的优先级, 相同优先级的分片报文具有相同的队列号。
步骤 102, 将各分片报文按照对应优先级输入发送队列, 相同优先级的分片报文依次输 入相同的发送队列, 不同优先级的分片报文依次输入不同的发送队列;
为了便于对分片报文按照优先级进行发送, 报文发送装置还会根据每个分片报文的报 文头中的队列号, 将相同优先级的分片报文依次输入相同的发送队列, 将不同优先级的分 片报文依次输入不同的发送队列。
步骤 103, 按照优先级由高到低, 依次发送不同发送队列中的分片报文。
具体的, 当不同发送队列中同时有分片报文到达各自队列最右端的发送位置时, 根据 分片报文的报文头中的优先级标识发送优先级高的分片报文;
其中, 发送队列为预先设置, 并且, 每个发送队列对应一个优先级; 另外, 发送分片 报文时, 也可以按照发送队列对应的优先级, 优先发送优先级高的发送队列中处于队列最 右端发送位置的分片报文。
综上所述, 本发明实施例一提供的报文发送方法, 通过在分片报文中添加分片报文的 队列号和优先级标识, 根据队列号将分片报文输入相应发送队列, 再根据优先级标识发送 分片报文, 达到使报文发送装置能够按照报文优先级发送分片报文的目的, 解决了现有技 术中无法按照报文优先级发送报文的问题。 实施例二
请参见图 3, 其示出了一种报文发送方法的方法流程图, 该报文发送方法基于 IEEE
802.3ah协议并对其进行扩展,可以用于在以太网介质数据链路层中对报文进行分片和发送。 本实施例二提供的报文发送方法具体可以包括如下步骤:
步骤 201, 报文发送装置将至少一个携带有优先级的长报文进行分片;
当有长报文需要发送时, 报文发送装置首先将长报文进行分片, 生成一至多个分片报 文。 其中, 长报文都具有各自的优先级。
步骤 202, 在分片生成的分片报文的报文头中添加该分片报文的队列号、 优先级标识、 分片序列号和首尾片标识, 得到携带有优先级的分片报文;
本实施例二对现有 IEEE 802.3ah协议进行了扩展, 即除了在分片报文的报文头中添加 分片序列号和首尾片标识之外, 还添加该分片报文的队列号和优先级标识, 并且相同优先 级的分片报文, 队列号也相同。
具体的, 请参见图 4所示的一种分片报文的格式示意图。 在图 4所示的分片报文的报 文头中, Ti字段为分片报文的队列号 (lObits) 和优先级标识 (6bits), sn字段为分片报文 的分片序列号(14bits)和首尾片标识(2bit), 其中, 首尾片标识分为首片标识和尾片标识。
步骤 203, 根据分片报文的队列号将分片报文输入相应的发送队列;
报文发送装置预先根据优先级数量设置发送队列, 每个发送队列对应一个优先级; 分 片完成后, 报文发送装置根据分片报文的队列号将分片报文输入相应的发送队列。 由于相 同优先级的分片报文, 队列号也相同, 因此, 可以根据分片报文的队列号将相同优先级的 分片报文输入同一发送队列。
具体的, 图 5示出了一种报文发送原理图, 其中, 长报文共配置有 3个优先级, 且, 长报文 1为第二优先级, 长报文 2为第一优先级, 长报文 3为第三优先级。 分片时, 报文 发送装置将长报文 1、 2和 3分片为分片报文 1~15, 其中, 分片报文 1~5属于长报文 1, 分 片报文 6~10属于长报文 2, 分片报文 11~15属于长报文 3。 对应长报文的 3个优先级, 报 文发送装置预先设置了 3个发送队列 (队列 1~队列 3), 其中, 队列 1对应第一优先级, 队 列 2对应第二优先级, 队列 3对应第三优先级。 长报文分片完成之后, 报文发送装置根据 分片报文的队列号, 将分片报文 1~5输入队列 2, 将分片报文 6~10输入队列 1, 将分片报 文 11~15输入队列 3。
步骤 204, 根据分片报文头中的优先级标识优先发送优先级高的分片报文。
其中, 当某一发送时间点上只有一个队列中有分片报文需要发送时, 则发送该队列中 的分片报文, 当某一发送时间点上有多个队列中有分片报文需要发送时, 则根据分片报文 的优先级标识, 优先发送优先级高的分片报文。
具体的, 请参见图 5, 队列 1~3中的分片报文的位置体现其进入队列并在队列中向右推 进的先后顺序, 其中, 队列最右端为发送位置。 如果队列 2中的分片报文 1率先推进至队 列最右端的发送位置, 并且, 此刻只有分片报文 1 处于发送位置, 则报文发送装置发送分 片报文 1 ; 在分片报文 1发送完毕后, 由于分片报文在各自队列中的位置向右推进, 队列 1 中的分片报文 6和队列 2中的分片报文 2可能同时处于各自队列最右端的发送位置 (报文 的分片和分片报文在队列中推进的速度远远高于分片报文的发送速度), 此时, 报文发送装 置根据分片报文 6和分片报文 2的优先级标识, 选择发送优先级较高的分片报文 6; 在分片 报文 6发送完毕后, 同样由于分片报文在各队列中位置的向右推进, 队列 1中的分片报文 7 又推进至队列最右端的发送位置, 此时, 报文发送装置根据分片报文 7和分片报文 2的优 先级标识, 选择发送优先级较高的分片报文 7, 以此类推。
本实施例二提供的报文分片方法, 可以对长报文的分片和分片报文的发送这两个阶段 进行优化:
一方面, 在长报文分片阶段进行优化。 现有技术基于 IEEE 802.3ah协议在基于 IEEE
802.3ah协议对长报文进行分片时, 为了保证报文顺序, 同一时间只能由单个核心或线程对 长报文进行分片、 添加报文头等操作, 处理效率低。 通过本实施例二提供的报文分片方法, 可以支持多个核心或线程同时对长报文进行分片、 添加报文头等操作, 比如, 在本实施例 步骤 201,报文发送装置可以将每个长报文中的单次分片任务交由至少两个进程中的当前空 闲进程进行处理, 以得到分片报文; 再如本实施例步骤 202, 报文发送装置可以将每个分片 报文的报文头添加任务交由至少两个进程中的当前空闲进程进行处理, 以得到携带有优先 级的分片报文, 这样, 长报文的分片和报文头添加任务就可以由多个进程同时进行, 可以 有效利用硬件资源, 提高分片效率。
另一方面, 在分片报文发送阶段进行优化。 比如, 当报文发送装置绑定多条传输链路 进行报文传输时, 为了保证同一条数据流中各报文之间的报序, 现有技术有两种发送方案: 第一种方案是将不同数据流中的报文分配到不同的传输链路进行发送, 详见图 7 所示 的多链路报文发送示意图, 其中长报文 1、 3、 4和 5属于数据流一, 报文 2属于数据流二, 数据流一和数据流二分别通过链路 1和链路 2进行发送。
第二种方案是基于 IEEE 802.3ah协议将各长报文进行分片, 并按照原长报文的报序发 送, 详见图 8 所示的另一种多链路报文发送示意图, 将各长报文分别分成两组分片报文并 分别有链路 1和链路 2进行发送。
上述第一种方案中, 当数据流一和数据流二之间数据量相差较大 (数据流一的数据量 比数据流二多很多) 时, 链路 1和链路 2的负载不均衡, 而第二种方案则对此进行改进, 将所有的长报文均分成两组分片报文,并将同一长报文分成的两组分片报文分别通过链路 1 和链路 2进行发送, 并且各链路中的分片报文严格按照原长报文的报序进行发送, 这样就 可以解决方案一中链路 1和链路 2负载不均衡的问题。
但是, 当数据流一和数据流二有优先级发送的要求 (比如数据流二中的报文需要优先 发送) 时, 上述的方案二无法解决。 而通过本实施例二提供的报文发送方法, 在各分组报 文头中添加队列号和优先级标识, 就可以实现在方案二的基础上, 将高优先级的分片报文 优先推送入各链路进行发送, 详见图 9所示的多链路优先级报文发送示意图, 其中, 在分 片报文头中添加队列号和优先级标识后, 可以优先发送优先级较高的长报文 2 的两个分片 报文 21和 22。具体的按照优先级发送分片报文的过程与本实施例二所述方法类似, 此处不 再赘述。
综上所述, 本实施例二提供的报文发送方法, 通过在分片报文中添加分片报文的队列 号和优先级标识, 根据队列号将分片报文输入相应发送队列, 再根据优先级标识发送分片 报文, 达到使报文发送装置能够按照报文优先级发送分片报文的目的, 解决了现有技术中 无法按照报文优先级发送报文的问题; 同时, 通过在分片报文中添加分片报文的队列号和 优先级标识, 能够支持多核心或多线程对长报文进行分片、 添加报文头等操作, 达到有效 利用硬件资源, 提高分片效率的目的。 实施例三
请参见图 10, 其示出了一种报文接收方法的方法流程图, 该报文接收方法可以用于在 以太网介质数据链路层中对分片报文进行接收和重组。 该报文接收方法具体可以包括如下 步骤:
步骤 301, 接收至少一个携带有优先级的分片报文;
报文接收装置接收报文发送装置发送的至少一个分片报文, 接收到的分片报文的报文 头中包含有报文发送装置添加的该分片报文的队列号、 优先级标识、 分片序列号和首尾片 标识, 其中, 分片报文的队列号用于指示该分片报文对应的重组队列, 优先级标识用于指 示该分片报文的优先级, 相同优先级的分片报文具有相同的队列号。
步骤 302, 将分片报文按照对应优先级输入重组队列, 相同优先级的分片报文依次输入 相同的重组队列, 不同优先级的分片报文依次输入不同的重组队列;
具体的, 由于相同优先级的分片报文具有相同的队列号, 报文接收装置可以根据各分 片报文头中的分片队列号, 相同优先级的分片报文依次输入相同的重组队列, 将不同优先 级的分片报文依次输入不同的重组队列。
步骤 303, 按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少一个 长报文。
具体的, 报文接收装置根据分片序列号和首尾片标识判断每个重组队列中当前接收到 的分片报文是否能够组成完整的长报文; 如果是, 则根据分片序列号和首尾片标识将当前 接收到的能够组成完整长报文的分片报文重组为一个长报文。
综上所述, 本实施例三提供的报文接收方法, 通过根据分片报文的报文头中的队列号 将分片报文分别输入相应的重组队列, 再通过分片报文的报文头中的分片序列号和首尾片 标识, 按照优先级顺序将分片报文重组为长报文, 达到了按照优先级对报文进行重组的目 的。 实施例四
请参见图 11, 其示出了一种报文接收方法的方法流程图, 该报文接收方法基于 IEEE 802.3ah协议并对其进行扩展, 可以用于在以太网介质数据链路层中对分片报文进行接收和 重组。 该报文接收方法具体可以包括如下步骤:
步骤 401, 报文接收装置接收至少一个携带有优先级的分片报文;
报文接收装置接收并缓存至少一个分片报文。 接收到的分片报文的报文头中均包含有 该分片报文的队列号、 优先级标识、 分片序列号和首尾片标识, 并且相同优先级的分片报 文, 队列号也相同。 其中, 队列号用于指示分片报文对应的重组队列, 优先级标识用于指 示分片报文的优先级, 分片序号用于在报文重组时确定各分片报文的顺序, 首尾片标识用 于指示各分片报文是否为长报文的首片或尾片。
具体的, 请参见图 4所示的一种分片报文的格式示意图。 在图 4所示的报文头中, Ti 字段为分片报文的队列号 (lObits) 和优先级标识 (6bits), sn字段为分片报文的分片序列 号 (14bits) 和首尾片标识 (2bit), 其中, 首尾片标识分为首片标识和尾片标识。
步骤 402, 报文接收装置将分片报文按照对应优先级输入重组队列, 相同优先级的分片 报文依次输入相同的重组队列, 不同优先级的分片报文依次输入不同的重组队列; 报文接收装置根据分片报文的报文头中的队列号将接收到的分片报文分别输入相应的 重组队列, 其中, 重组队列为报文接收装置预先设置的。
具体的, 请参见图 12, 其示出了一种报文接收原理图, 其中, 分片报文 1~5属于长报 文 1, 分片报文 6~10属于长报文 2, 分片报文 11~15属于长报文 3。 另外, 长报文共配置为 3个优先级, 其中, 长报文 1为第二优先级, 长报文 2为第一优先级, 长报文 3为第三优先 级。 对应长报文的 3个优先级, 报文接收装置预先设置了 3个重组队列 (队列 1~队列 3), 其中, 队列 1对应第一优先级, 队列 2对应第二优先级, 队列 3对应第三优先级。 接收分 片报文之后, 报文接收装置根据分片报文的队列号, 将分片报文 1~5输入队列 2, 将分片报 文 6~10输入队列 1, 将分片报文 11~15输入队列 3。
步骤 403, 报文接收装置按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少一个长报文。
具体的, 参见图 12, 当队列 1~3中都有需要重组的报文时, 报文接收装置首先根据分 片序列号和首尾片标识判断个重组队列中的报文是否能够组成完整的长报文, 具体的, 若 某一重组队列中的多个报文序列号连续的分片报文中, 既有首片报文, 又有与之对应的尾 片报文, 则认为这连续的多个分片报文能够组成一个完整的长报文。 则此时, 报文接收装 置根据报文序列号和首尾片标识将这连续的多个分片报文重组为一个长报文。 另外, 如图 12所示, 3 个重组队列中的分片报文分别为分片报文 6~10、 分片报文 1~5 以及分片报文 11-15, 并且, 其中分片报文 1、 6和 11为首片报文, 分片报文 5、 10和 15为尾片报文, 3 个重组队列中的分片报文都能够重组为完整的长报文, 则报文接收装置可以根据各分片报 文的优先级, 先重组长报文 2, 再重组长报文 1, 最后重组长报文 3。
综上所述, 本实施例四提供的报文接收方法, 通过根据分片报文的报文头中的队列号 将分片报文分别输入相应的重组队列, 再通过分片报文的报文头中的优先级标识、 分片序 列号和首尾片标识, 按照优先级顺序将分片报文重组为长报文, 达到了按照优先级对报文 进行重组的目的。 实施例五
请参见图 13, 其示出了一种报文发送装置的装置结构图, 该报文发送装置可以应用于 在以太网介质数据链路层中对报文进行分片和发送。 该报文发送装置具体可以包括:
分片模块 501,用于将至少一个具有各自的优先级的长报文进行分片得到携带有优先级 的分片报文; 发送缓存器 502, 用于将分片报文按照对应优先级输入发送队列, 相同优先级的分片报 文依次输入相同的发送队列, 不同优先级的分片报文依次输入不同的发送队列;
发送模块 503, 用于按照优先级由高到低, 依次发送不同发送队列中的分片报文。 其中, 分片模块 501, 具体包括:
分片单元 501a, 用于将长报文进行分片得到至少一个分片报文, 每个分片报文的长度 小于等于最大报文长度;
添加单元 501b, 用于在分片报文的报文头中添加队列号、 优先级标识、 分片序列号和 首尾片标识, 得到携带有优先级的分片报文;
其中, 队列号用于指示分片报文对应的发送队列, 优先级标识用于指示分片报文的优 先级, 相同优先级的分片报文具有相同的队列号。
另外, 分片模块 501可以是一个多线程的实体, 具体的,
分片单元 501a, 用于将每个长报文中的单次分片任务交由至少两个进程中的当前空闲 进程进行处理, 以得到分片报文;
添加单元 501b, 用于将每个分片报文的报文头添加任务交由至少两个进程中的当前空 闲进程进行处理, 以得到携带有优先级的分片报文。
具体的, 请参见图 4所示的一种分片报文的格式示意图。 在图 4所示的报文头中, Ti 字段为分片报文的队列号 (lObits ) 和优先级标识 (6bits), sn字段为分片报文的分片序列 号 (14bits) 和首尾片标识 (2bit), 其中, 首尾片标识分为首片标识和尾片标识。
发送模块 503, 具体用于当不同的发送队列中同时有分片报文需要发送时, 优先发送优 先级较高的发送队列中的分片报文。
具体的, 当某一发送时间点上只有一个队列中有分片报文需要发送时, 则发送模块 503 发送该队列中的分片报文, 当某一发送时间点上有多个队列中有分片报文需要发送时, 则 发送模块 503根据分片报文的优先级标识, 优先发送优先级高的分片报文。
综上所述, 本实施例五提供的报文发送装置, 通过在分片报文中添加分片报文的队列 号和优先级标识, 达到使报文发送装置能够按照报文优先级发送分片报文的目的, 解决了 现有技术中无法按照报文优先级发送报文的问题。 实施例六
请参见图 14, 其示出了一种报文接收装置的装置结构图, 该报文接收装置可以用于在 以太网介质数据链路层中对分片报文进行接收重组。 该报文接收装置具体可以包括:
接收模块 601, 用于接收至少一个携带有优先级的分片报文; 接收缓存器 602, 用于将分片报文按照对应优先级输入重组队列, 相同优先级的分片报 文依次输入相同的重组队列, 不同优先级的分片报文依次输入不同的重组队列;
重组模块 603, 用于按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到 至少一个长报文。
接收模块 601, 具体用于接收至少一个分片报文, 每个分片报文的报文头中包含有: 队 列号、 优先级标识、 分片序列号和首尾片标识;
其中, 队列号用于指示分片报文对应的重组队列, 优先级标识用于指示分片报文的优 先级, 相同优先级的分片报文相同的队列号。
接收缓存器 602, 具体用于根据分片报文的队列号将分片报文输入相应的重组队列。 重组模块 603, 具体包括:
判断单元 603a, 用于根据分片序列号和首尾片标识判断每个重组队列中当前接收到的 分片报文是否能够组成完整的长报文;
重组单元 603b,用于如果判断单元 603a判断出重组队列中当前接收到的分片报文能够 组成完整的长报文, 则根据分片序列号和首尾片标识将当前接收到的分片报文重组为一个 长报文。
综上所述, 本实施例六提供的报文接收装置, 通过根据分片报文的报文头中的队列号 将分片报文分别输入相应的重组队列, 再通过分片报文的报文头中的优先级标识、 分片序 列号和首尾片标识, 按照优先级顺序将分片报文重组为长报文, 达到了按照优先级对报文 进行重组的目的。 实施例七
请参见图 15, 其示出了一种报文发送和接收系统的系统构成图, 该报文发送和接收系 统可以用于在以太网介质数据链路层中对报文进行分片发送与接收重组。 该报文发送和接 收系统可以包括:
如实施例五所示的报文发送装置 50和如实施例六所示的报文接收装置 60。
综上所述, 本实施例七提供的报文发送和接收系统, 通过在发送侧在分片报文中添加 分片报文的队列号和优先级标识, 根据队列号将分片报文输入相应发送队列, 根据优先级 标识发送分片报文, 达到使报文发送装置能够按照报文优先级发送分片报文的目的; 另外, 通过在接收侧根据分片报文的报文头中的队列号将分片报文分别输入相应的重组队列, 再 通过分片报文的报文头中的优先级标识、 分片序列号和首尾片标识, 按照优先级顺序将分 片报文重组为长报文, 达到了按照优先级对报文进行重组的目的。 本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完 成, 也可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计算机可读存储 介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。 以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种报文发送方法, 其特征在于, 所述方法包括:
将至少一个携带有优先级的长报文进行分片, 得到携带有所述优先级的分片报文; 将所述分片报文按照对应优先级输入发送队列, 相同优先级的所述分片报文依次输入相 同的发送队列, 不同优先级的所述分片报文依次输入不同的发送队列;
按照优先级由高到低, 依次发送不同发送队列中的分片报文。
2、根据权利要求 1所述的报文发送方法, 其特征在于, 所述将至少一个携带有优先级的 长报文进行分片, 得到携带有所述优先级的分片报文, 具体包括:
将所述长报文进行分片得到至少一个分片报文, 每个分片报文的长度小于等于最大报文 长度;
在所述分片报文的报文头中添加队列号、 优先级标识、 分片序列号和首尾片标识, 得到 携带有所述优先级的分片报文;
其中, 所述队列号用于指示所述分片报文对应的发送队列, 所述优先级标识用于指示所 述分片报文的优先级, 相同优先级的分片报文具有相同的队列号。
3、根据权利要求 2所述的报文发送方法, 其特征在于, 所述将所述长报文进行分片得到 至少一个分片报文, 具体包括:
将每个长报文中的单次分片任务交由至少两个进程中的当前空闲进程进行处理, 以得到 所述分片报文;
相应的, 所述在所述分片报文的报文头中, 添加队列号、 优先级标识、 分片序列号和首 尾片标识, 得到携带有所述优先级的分片报文, 包括:
将每个分片报文的报文头添加任务交由至少两个进程中的当前空闲进程进行处理, 以得 到携带有所述优先级的分片报文。
4、根据权利要求 1至 3任一所述的报文发送方法, 其特征在于, 所述按照优先级由高到 低, 依次发送不同发送队列中的分片报文, 具体包括:
当不同的发送队列中同时有分片报文需要发送时, 优先发送优先级较高的发送队列中的 分片报文。
5、 一种报文接收方法, 其特征在于, 所述方法包括:
接收至少一个携带有优先级的分片报文;
将所述分片报文按照对应优先级输入重组队列, 相同优先级的所述分片报文依次输入相 同的重组队列, 不同优先级的所述分片报文依次输入不同的重组队列;
按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少一个长报文。
6、根据权利要求 5所述的报文接收方法, 其特征在于, 所述接收至少一个携带有优先级 的分片报文, 具体包括:
接收至少一个分片报文, 每个分片报文的报文头中包含有: 队列号、 优先级标识、 分片 序列号和首尾片标识;
其中, 所述队列号用于指示所述分片报文对应的重组队列, 所述优先级标识用于指示所 述分片报文的优先级, 相同优先级的分片报文具有相同的队列号。
7、根据权利要求 6所述的报文接收方法, 其特征在于, 所述将所述分组报文按照对应优 先级输入重组队列, 具体包括:
根据所述分片报文的队列号将所述分片报文输入相应的重组队列。
8、 根据权利要求 5或 6所述的报文接收方法, 其特征在于, 所述按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少一个长报文, 具体包括:
根据所述分片序列号和首尾片标识判断每个重组队列中当前接收到的分片报文是否能够 组成完整的长报文;
如果是, 则根据所述分片序列号和首尾片标识将当前接收到的分片报文重组为一个长报 文。
9、 一种报文发送装置, 其特征在于, 所述装置包括:
分片模块, 用于将至少一个携带有优先级的长报文进行分片得到携带有所述优先级的分 片报文;
发送缓存器, 用于将所述分片报文按照对应优先级输入发送队列, 相同优先级的所述分 片报文依次输入相同的发送队列, 不同优先级的所述分片报文依次输入不同的发送队列; 发送模块, 用于当不同的发送队列中同时有分片报文需要发送时, 优先发送优先级较高 的发送队列中的分片报文。
10、 根据权利要求 9所述的报文发送装置, 其特征在于, 所述分片模块, 具体包括: 分片单元, 用于将所述长报文进行分片得到至少一个分片报文, 每个分片报文的长度小 于等于最大报文长度;
添加单元, 用于在所述分片报文的报文头中添加队列号、 优先级标识、 分片序列号和首 尾片标识, 得到携带有所述优先级的分片报文;
其中, 所述队列号用于指示所述分片报文对应的发送队列, 所述优先级标识用于指示所 述分片报文的优先级, 相同优先级的分片报文具有相同的队列号。
11、 根据权利要求 10所述的报文发送装置, 其特征在于,
所述分片单元, 具体用于将每个长报文中的单次分片任务交由至少两个进程中的当前空 闲进程进行处理, 以得到所述分片报文;
所述添加单元, 具体用于将每个分片报文的报文头添加任务交由至少两个进程中的当前 空闲进程进行处理, 以得到携带有所述优先级的分片报文。
12、 一种报文接收装置, 其特征在于, 所述装置包括:
接收模块, 用于接收至少一个携带有优先级的分片报文;
接收缓存器, 用于将所述分片报文按照对应优先级输入重组队列, 相同优先级的所述分 片报文依次输入相同的重组队列, 不同优先级的所述分片报文依次输入不同的重组队列; 重组模块, 用于按照优先级由高到低, 依次重组不同重组队列中的分片报文, 得到至少 一个长报文。
13、 根据权利要求 12所述的报文接收装置, 其特征在于,
所述接收模块, 具体用于接收至少一个分片报文, 每个分片报文的报文头中包含有: 队 列号、 优先级标识、 分片序列号和首尾片标识;
其中, 所述队列号用于指示所述分片报文对应的重组队列, 所述优先级标识用于指示所 述分片报文的优先级, 相同优先级的分片报文相同的队列号。
14、 根据权利要求 13所述的报文接收装置, 其特征在于,
所述接收存储器, 具体用于根据所述分片报文的队列号将所述分片报文输入相应的重组 队列。
15、 一种报文发送和接收系统, 其特征在于, 所述系统包括:
如权利要求 9至 11任一所述的报文发送装置和如权利要求 12至 14任一所述的报文接收 装置。
PCT/CN2012/079191 2012-07-26 2012-07-26 报文发送方法、接收方法、装置及系统 WO2014015498A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280001103.9A CN103748845B (zh) 2012-07-26 2012-07-26 报文发送方法、接收方法、装置及系统
PCT/CN2012/079191 WO2014015498A1 (zh) 2012-07-26 2012-07-26 报文发送方法、接收方法、装置及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/079191 WO2014015498A1 (zh) 2012-07-26 2012-07-26 报文发送方法、接收方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2014015498A1 true WO2014015498A1 (zh) 2014-01-30

Family

ID=49996505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/079191 WO2014015498A1 (zh) 2012-07-26 2012-07-26 报文发送方法、接收方法、装置及系统

Country Status (2)

Country Link
CN (1) CN103748845B (zh)
WO (1) WO2014015498A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105827686A (zh) * 2015-11-16 2016-08-03 广东亿迅科技有限公司 一种数据传输方法
CN106533954A (zh) * 2015-09-15 2017-03-22 深圳市中兴微电子技术有限公司 一种报文调度方法和装置
WO2017198108A1 (zh) * 2016-05-19 2017-11-23 中兴通讯股份有限公司 一种处理分片报文的方法及装置
WO2018171115A1 (zh) * 2017-03-21 2018-09-27 中兴通讯股份有限公司 一种分片的服务质量保证方法及现场可编程逻辑门阵列
US10367723B2 (en) 2015-03-28 2019-07-30 Huawei Technologies, Co., Ltd. Packet sending method and apparatus based on multi-link aggregation
CN112653639A (zh) * 2020-12-21 2021-04-13 北京华环电子股份有限公司 一种基于多线程交互处理的IPv6报文分片重组方法
CN113595932A (zh) * 2021-08-06 2021-11-02 上海金仕达软件科技有限公司 数据乱序报文的处理方法及专用集成电路
CN115811504A (zh) * 2022-11-16 2023-03-17 芯启源(南京)半导体科技有限公司 实现ip分片报文重组的dpu装置及ip分片报文重组方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107342955B (zh) * 2017-06-29 2020-09-22 迈普通信技术股份有限公司 一种数据报文分片方法及装置、重组方法及装置
CN112714070B (zh) * 2019-10-24 2024-01-09 北京华为数字技术有限公司 通信方法、装置、系统及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101031092A (zh) * 2006-02-28 2007-09-05 华为技术有限公司 一种语音报文的处理方法和报文处理器
CN101170492A (zh) * 2007-11-30 2008-04-30 中兴通讯股份有限公司 一种在网络拥塞时发送分片报文的方法
CN101252536A (zh) * 2008-03-31 2008-08-27 清华大学 路由器多队列数据包缓存管理与输出队列调度系统
CN101369962A (zh) * 2007-08-13 2009-02-18 华为技术有限公司 转发报文的方法和网络设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5956341A (en) * 1996-12-13 1999-09-21 International Business Machines Corporation Method and system for optimizing data transmission line bandwidth occupation in a multipriority data traffic environment
US20040264488A1 (en) * 2003-06-25 2004-12-30 Hyun-Min Yoon Apparatus and method for processing packets
US20080056192A1 (en) * 2006-08-31 2008-03-06 Piping Hot Networks Limited Latency reduction by adaptive packet fragmentation
US20080056295A1 (en) * 2006-09-01 2008-03-06 Dne Technologies, Inc. Internet protocol quality of service apparatus and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101031092A (zh) * 2006-02-28 2007-09-05 华为技术有限公司 一种语音报文的处理方法和报文处理器
CN101369962A (zh) * 2007-08-13 2009-02-18 华为技术有限公司 转发报文的方法和网络设备
CN101170492A (zh) * 2007-11-30 2008-04-30 中兴通讯股份有限公司 一种在网络拥塞时发送分片报文的方法
CN101252536A (zh) * 2008-03-31 2008-08-27 清华大学 路由器多队列数据包缓存管理与输出队列调度系统

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10367723B2 (en) 2015-03-28 2019-07-30 Huawei Technologies, Co., Ltd. Packet sending method and apparatus based on multi-link aggregation
CN106533954A (zh) * 2015-09-15 2017-03-22 深圳市中兴微电子技术有限公司 一种报文调度方法和装置
CN105827686A (zh) * 2015-11-16 2016-08-03 广东亿迅科技有限公司 一种数据传输方法
WO2017198108A1 (zh) * 2016-05-19 2017-11-23 中兴通讯股份有限公司 一种处理分片报文的方法及装置
CN107404446A (zh) * 2016-05-19 2017-11-28 中兴通讯股份有限公司 一种处理分片报文的方法及装置
WO2018171115A1 (zh) * 2017-03-21 2018-09-27 中兴通讯股份有限公司 一种分片的服务质量保证方法及现场可编程逻辑门阵列
CN108632169A (zh) * 2017-03-21 2018-10-09 中兴通讯股份有限公司 一种分片的服务质量保证方法及现场可编程逻辑门阵列
CN112653639A (zh) * 2020-12-21 2021-04-13 北京华环电子股份有限公司 一种基于多线程交互处理的IPv6报文分片重组方法
CN112653639B (zh) * 2020-12-21 2022-10-14 北京华环电子股份有限公司 一种基于多线程交互处理的IPv6报文分片重组方法
CN113595932A (zh) * 2021-08-06 2021-11-02 上海金仕达软件科技有限公司 数据乱序报文的处理方法及专用集成电路
CN113595932B (zh) * 2021-08-06 2024-05-14 上海金仕达软件科技股份有限公司 数据乱序报文的处理方法及专用集成电路
CN115811504A (zh) * 2022-11-16 2023-03-17 芯启源(南京)半导体科技有限公司 实现ip分片报文重组的dpu装置及ip分片报文重组方法

Also Published As

Publication number Publication date
CN103748845A (zh) 2014-04-23
CN103748845B (zh) 2017-02-01

Similar Documents

Publication Publication Date Title
WO2014015498A1 (zh) 报文发送方法、接收方法、装置及系统
EP3573297B1 (en) Packet processing method and apparatus
EP2353017B1 (en) Packet aggregation and fragmentation at layer-2 over a managed network
US7760629B2 (en) Aggregate data frame generation
US9590910B1 (en) Methods and apparatus for handling multicast packets in an audio video bridging (AVB) network
US7602809B2 (en) Reducing transmission time for data packets controlled by a link layer protocol comprising a fragmenting/defragmenting capability
WO2011120467A2 (zh) 报文保序处理方法、保序协处理器和网络设备
JP7329627B2 (ja) パケット処理方法及び関連装置
WO2016154833A1 (zh) 一种多链路聚合的报文发送方法及装置
CN107431665B (zh) 网络节点处的流量管理方法和分组交换网络中的网络节点
CN110290074B (zh) FPGA片间互连的Crossbar交换单元设计方法
WO2014173246A1 (zh) 一种数据传输方法、装置和计算机存储介质
WO2020063340A1 (zh) 数据传输方法和设备
WO2018082595A1 (zh) 数据传输方法、装置及基站
JP4988487B2 (ja) データの転送方法、装置、プログラム
WO2016123975A1 (zh) 数据传输方法及装置
CN110855584B (zh) 一种tcp乱序重组的方法和装置
CN114827292A (zh) 工业异构协议高速转换优化处理方法及系统
WO2014067409A1 (zh) 一种队列调度方法、装置及系统
CN117579555A (zh) 数据传输方法、计算设备及系统
CN111865813A (zh) 一种基于反ecn标记的数据中心网络传输控制方法、系统及可读存储介质
CN104363216A (zh) 数据处理方法及列车网络系统
CN102611621B (zh) 信元级联的处理方法和设备
CN113133033A (zh) 一种拓扑感知随机线性网络编码重传方案
CN110430146A (zh) 基于CrossBar交换的信元重组方法及交换结构

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

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

Country of ref document: EP

Kind code of ref document: A1