A message processing method and network device

By segmenting the data stream, the problems of packet loss and identification conflicts in existing traffic shaping methods when processing large data packets are solved. This achieves efficient and economical data stream segmentation processing, resolving the packet identification conflict problem in existing technologies.

CN116418765BActive Publication Date: 2025-11-14HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111668797.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-11-14
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

Existing traffic shaping methods are prone to packet loss when processing large data packets, and are difficult to meet the bandwidth and latency requirements of service level protocols, and also suffer from packet identifier conflicts.

Method used

By fragmenting data stream packets and shaping them according to the data stream's MTU and output interval, and setting identifier occupancy duration or status to avoid identifier conflicts, the sequential transmission of packet fragments is ensured.

Benefits of technology

It reduces the possibility of packet loss, decreases network traffic bursts, meets the bandwidth and latency requirements of the service level agreement, and avoids message identifier conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116418765B_ABST
    Figure CN116418765B_ABST
Patent Text Reader

Abstract

A message processing method includes: after obtaining a message to be processed from a data stream, determining the maximum transmission unit (MTU) of the data stream based on the data stream identifier in configuration information; if the message length of the message to be processed is greater than the MTU of the data stream, obtaining a target message identifier, and then dividing the message to be processed into multiple message fragments with target message identifiers according to the MTU of the data stream; shaping the multiple message fragments according to the output interval of the data stream; and sending the shaped message fragments. This method can shape data streams including large data messages, reducing the burstiness of the data stream output and the possibility of data loss. This application also provides a network device capable of implementing the above message processing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more particularly to a message processing method and a network device. Background Technology

[0002] In communication systems, bursty traffic can cause network congestion, resulting in packet loss, delay, and jitter, leading to a decline in network service quality. Traffic shaping can control traffic bursts on network connections, ensuring that data packets are sent evenly and reducing traffic bursts.

[0003] One current traffic shaping method works roughly as follows: After receiving a data packet, it is added to multiple queues. These queues are opened sequentially according to their queue numbers. The duration of each queue is one sending cycle, and the amount of data sent in each sending cycle cannot exceed a specified limit.

[0004] In practical applications, some business data packets exceed the specified data volume, and the excess data packets may be lost. Therefore, this traffic shaping method has significant limitations. Summary of the Invention

[0005] In view of this, this application provides a message processing method and a network device that can fragment data stream messages and reshape multiple fragmented messages before sending them, thereby reducing the possibility of data packet loss and reducing network burstiness.

[0006] The first aspect provides a message processing method, which includes: after obtaining a message to be processed from a data stream, determining the MTU of the data stream based on the identifier of the data stream included in the message to be processed in configuration information; if the message length of the message to be processed is greater than the MTU of the data stream, obtaining the target message identifier, and then dividing the message to be processed into multiple message fragments with target message identifiers according to the MTU of the data stream; shaping the multiple message fragments according to the output interval of the data stream, and sending the shaped message fragments. The identifier occupancy information is the identifier occupancy status or the identifier occupancy duration. The output interval of the data stream can be pre-configured according to actual conditions.

[0007] By implementing this method, when a large data packet is received, it can be fragmented, and multiple fragments can be reshaped and sent. This reshaping of the data stream and precise control of network traffic can reduce the burstiness of the data stream output. This provides a solution for sending large data packets that can reduce the possibility of data loss.

[0008] In one possible implementation, before retrieving packets to be processed from the data stream, the stream shaping bandwidth of the data stream is obtained from the service level protocol corresponding to the data stream's identifier; the MTU of the data stream is determined based on the product of the stream shaping bandwidth and the output interval of the data stream; and the data stream identifier and the data stream's MTU are added to the configuration information. After setting the MTU in this way, sending packet fragments according to this MTU can meet the bandwidth and latency requirements specified by the service level protocol.

[0009] In another possible implementation, before retrieving packets to be processed from the data stream, the output burstability of the data stream is obtained from the service level protocol corresponding to the data stream's identifier; the MTU of the data stream is determined as the output burstability; and the data stream identifier and MTU are added to the configuration information. After setting the MTU in this way, sending data stream packets according to this MTU can meet the burstability requirements specified by the service level protocol.

[0010] In another possible implementation, obtaining the target message identifier includes: if a preset identifier resource pool includes message identifiers and identifier durations, then before sending multiple message fragments, obtaining the identifier durations corresponding to all message identifiers from the identifier resource pool; and determining the target message identifier as the message identifier corresponding to the minimum identifier duration. Implemented in this way, message fragments with the same message identifier are sent sequentially, and multiple message fragments do not overlap in time, thus preventing identifier conflicts. After selecting the message identifier corresponding to the minimum identifier duration, the message fragment can be sent as quickly as possible.

[0011] Optionally, the duration of the identifier corresponding to multiple message fragments is equal to the product of the data stream output interval and the number of fragments. This allows the duration of the identifier and the release time of the identifier for a message to be processed to be determined based on the size of the message to be processed and the MTU.

[0012] In another possible implementation, the above message processing method further includes: calculating the sum of the number of target messages and the number of target message fragments in the buffer; and setting the identifier occupancy duration corresponding to the target message identifier based on the calculation result. Here, both the target message and the target message fragment have target message identifiers, and the calculation result is positively correlated with the identifier occupancy duration. This allows for the determination of the transmission time of each message fragment or message, achieving high-precision detection of the data stream.

[0013] In another possible implementation, the above message processing method further includes: if the identifier resource pool includes message identifiers and identifier occupancy status, selecting an unoccupied message identifier from the identifier resource pool as the target message identifier based on the identifier occupancy status. This provides another method for allocating message identifiers.

[0014] The second aspect provides a network device that can implement the message processing method described in the first aspect. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned function.

[0015] A third aspect provides a network device including a processor and a memory, the memory being used to store a program; the processor executing the program is used to implement the message processing method of the first aspect.

[0016] The fourth aspect provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method of the first aspect.

[0017] The fifth aspect provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of the first aspect.

[0018] A sixth aspect provides a chip system including at least one processor coupled to a memory for storing computer programs or instructions, and the processor for executing the computer programs or instructions to implement the method of the first aspect. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of an application scenario in an embodiment of this application;

[0020] Figure 2 This is a flowchart of a message processing method in an embodiment of this application;

[0021] Figure 3 This is a schematic diagram illustrating message fragmentation in an embodiment of this application;

[0022] Figure 4 This is a schematic diagram of the message identifier and the identifier duration in an embodiment of this application;

[0023] Figure 5 This is another schematic diagram illustrating the message identifier and identifier duration in the embodiments of this application;

[0024] Figure 6A This is a schematic diagram of message fragmentation in an embodiment of this application;

[0025] Figure 6B This is a schematic diagram of message fragmentation in an embodiment of this application;

[0026] Figure 7 This is another schematic diagram illustrating message fragmentation in an embodiment of this application;

[0027] Figure 8This is a schematic diagram of message transmission and message fragmentation in an embodiment of this application;

[0028] Figure 9 This is a schematic diagram of message identifier and identifier occupancy status in an embodiment of this application;

[0029] Figure 10 This is a structural diagram of a network device in an embodiment of this application;

[0030] Figure 11 This is a schematic diagram illustrating the fragmentation and reshaping of the message to be processed in an embodiment of this application;

[0031] Figure 12 This is a structural diagram of the segmentation module in an embodiment of this application;

[0032] Figure 13 This is another structural diagram of the network device in this application embodiment. Detailed Implementation

[0033] The message processing method of this application can be applied to communication systems with bursty data streams. The executor of the message processing method can be a router and / or a switch in the communication system.

[0034] See Figure 1 In one example of an application scenario, the communication system includes substation equipment 11, base station 121, base station 122, base station 123, cell site gateway (CSG) 131, base station site gateway 132, base station site gateway 133, access service gateway (ASG) 14, and mobile edge computing (MEC) entity 15.

[0035] Substation equipment 11 is connected to base station 121 via a data transfer unit (DTU). Base station-side gateways 131, 132, and 133 form a base station-side gateway ring. In this ring, base station-side gateway 131 is connected to base station 121, base station-side gateway 132 is connected to base station 122, and base station-side gateway 133 is connected to base station 123. Access service gateway 14 connects base station-side gateway 133 to mobile edge computing entity 15. Base station-side gateways 131, 132, and 133 may be equipped with routers and / or switches, and access service gateway 14 may also be equipped with routers and / or switches. Optionally, the bandwidth of the base station-side gateway is 10 gigabits per second (Gbps). The bandwidth of the access service gateway ring is 50 Gbps. The length of a single-hop fiber optic cable is 2–10 kilometers.

[0036] It should be understood that application scenarios with sudden traffic spikes are not limited to... Figure 1 The application scenarios shown are as follows. In these scenarios, the number of substation devices, base stations, base station-side gateways, access service gateways, and mobile edge computing entities is not limited to the examples above. The connection relationships between devices are also not limited to the examples above. For instance, each base station can connect to one or more substation devices, each base station-side gateway can connect to one or more base stations, and each access service gateway can connect to one or more base station-side gateways; for example, an access service gateway can connect to 20 base station-side gateways. Multiple access service gateways can form an access service gateway ring.

[0037] Data from substation equipment 11 passes through base station 121, base station-side gateway 131, base station-side gateway 132, base station-side gateway 133, and access service gateway 14 before reaching mobile edge computing entity 15. Because the data from substation equipment 11 is transmitted periodically, it is prone to generating data streams with low average rates and high burst rates. In this application, burst rate refers to the maximum number of bytes sent at once when scheduling a data stream.

[0038] Existing traffic shaping methods cannot shape traffic containing large data packets. To address this, this application provides a message processing method that sets a maximum transmission unit (MTB) for the data stream, fragments the data stream according to the MTB, and then sends the fragmented messages in multiple cycles. This not only prevents data loss but also reduces traffic bursts. The message processing method of this application is described below; please refer to [link / reference]. Figure 2 One embodiment of the message processing method of this application includes:

[0039] Step 201: Obtain the message to be processed from the data stream.

[0040] Specifically, a message includes a header and message data. The message to be processed includes an identifier for the data stream, which can be, but is not limited to, an Internet Protocol (IP) 5-tuple. In the header, the IP 5-tuple for the data stream includes the source IP address, destination IP address, source port number, destination port number, and protocol number. The data stream identifier may also include the sequence number of the data stream.

[0041] Step 202: Determine the maximum transmission unit of the data stream based on the data stream identifier in the configuration information.

[0042] The configuration information includes multiple data flow identifiers and the maximum transmission unit (MTB) corresponding to each data flow identifier. The configuration information may, but is not limited to, be stored in the network device in the form of a configuration information table.

[0043] Step 203: When the message length of the message to be processed is greater than the maximum transmission unit of the data stream, obtain the target message identifier.

[0044] In one example, obtaining the target packet identifier includes: the network device obtaining the target packet identifier according to a round-robin allocation rule. For example, when n∈[0, N), if the sequence number of the preceding packet to be processed is n, then the sequence number of the packet to be processed is n+1. When n=N, if the sequence number of the preceding packet to be processed is N, then the sequence number of the packet to be processed is 0. Both n and N are positive integers.

[0045] In other examples, obtaining the target packet identifier includes: the network device retrieving the target packet identifier from the identifier resource pool based on the identifier occupancy duration or the identifier occupancy status. The identifier resource pool may be, but is not limited to, an identifier resource table. Optionally, the identifier resource pool includes multiple packet identifiers and the identifier occupancy duration corresponding to each packet identifier. Alternatively, the identifier resource pool includes multiple packet identifiers and the identifier occupancy status corresponding to each packet identifier.

[0046] Step 204: Divide the message to be processed into multiple message fragments with target message identifiers according to the maximum transmission unit of the data stream.

[0047] In this configuration, the length of each packet fragment is less than or equal to the target MTU. Optionally, the length of the last fragment is less than or equal to the target MTU, while the lengths of other packet fragments are equal to the target MTU. The packet length of the packet to be processed and the packet length of the fragments satisfy the following formula:

[0048] LH = (n-1)*(MTU-H) + (Ln-H);

[0049] n is the number of fragments, L is the length of the message to be processed, and Ln is the length of the nth fragment. The message lengths of the 1st fragment to the (n-1)th fragment are all the target MTU, and H is the length of the message header.

[0050] See Figure 3 In an optional example, message 31 is 9600 bytes long, the destination MTU is 4000 bytes, and the header length is 160 bytes. Message 31 can be divided into message fragment 32, message fragment 33 and message fragment 34. Message fragment 32 and message fragment 33 are 4000 bytes in size, and message fragment 34 is 1920 bytes in size.

[0051] A message fragment consists of a message header and message fragment data. The message header includes, but is not limited to, message length, message identifier, and fragment offset. The message identifier may include, but is not limited to, a message sequence number. Each message fragment has a unique fragment offset. The fragment offset can be used to identify which message fragment it is. Message fragments can also be called fragments or fragmented messages.

[0052] Step 205: Reshape multiple message fragments according to the output interval of the data stream.

[0053] The output interval of the data stream can be preset according to actual conditions, specifically one or more time slices. A time slice is the minimum transmission period for a network device to send a message. The length of a time slice can be, but is not limited to, 10 microseconds.

[0054] When a message fragment is sent within a time slice, the data stream output interval is the transmission period of the message fragment. When a group of message fragments is sent within a time slice, the data stream output interval is the transmission period of the group of message fragments. A group of message fragments may include one or more messages. It should be understood that multiple shaped message fragments may be arranged, but are not limited to, in the order of fragment offsets.

[0055] Step 206: Send the shaped message fragments.

[0056] Before sending multiple message fragments, if there are messages or message fragments waiting to be sent in the buffer, then the messages or message fragments preceding the multiple message fragments are sent first, followed by the reshaped message fragments. For example, if there is one message and two message fragments with a target message identifier that precede the multiple message fragments, and the current time is the 5th time slice, one message and two message fragments can be sent starting from the 6th time slice, and the reshaped message fragments can be sent starting from the 9th time slice.

[0057] If there are no packets waiting to be sent in the buffer, then the shaped packet fragments can be sent starting from the next time slice from the current time. For example, if the current time is the 5th time slice, then the shaped packet fragments can be sent starting from the 6th time slice. The time slices corresponding to the above packet fragments are illustrative examples and should not be regarded as limitations.

[0058] In this embodiment, after receiving a big data packet, the big data packet is fragmented according to the maximum transmission unit, and then the fragmented packets are shaped and sent. This precise control of network traffic can reduce the burstiness of the data stream output.

[0059] Secondly, dividing big data messages into multiple message fragments allows them to be sent in multiple sending cycles, which can solve the problem of losing some data when sending big data messages.

[0060] In an optional embodiment, before step 201, the above message processing method further includes: obtaining the flow shaping bandwidth of the data flow from the service level protocol corresponding to the identifier of the data flow; determining the MTU of the data flow based on the product of the flow shaping bandwidth of the data flow and the output interval of the data flow; and adding the identifier of the data flow and the MTU of the data flow to the configuration information.

[0061] Optionally, the MTU of a data stream is equal to the product of the stream shaping bandwidth and the output interval of the data stream. MTU = B * T, where B is the stream shaping bandwidth and T is the output interval of the data stream.

[0062] In one example, T is 100 microseconds (us) and B is 10 Mbps (megabits per second), then MTU = 10 Mbps * 100us = 1000 bits = 125 bytes.

[0063] In another example, T is 20 microseconds (us) and B is 100 Mbps (megabits per second), then MTU = 100 Mbps * 20us = 2000 bits = 250 bytes.

[0064] In another example, T is 20 microseconds (us) and B is 100 Mbps (megabits per second), then MTU = 2 * 100 Mbps * 20us = 2000 bits = 500 bytes.

[0065] It should be noted that when a packet fragment group is sent in one time slice and the packet fragment group contains multiple packet fragments, if there are M time slices within N time slices that can send the packet fragment group, then MTU = B*T*N / M. M and N are both positive integers and M... <N。

[0066] After setting the MTU of the data stream in this way, sending data stream packets or packet fragments according to the MTU of the data stream can meet the bandwidth and latency requirements specified in the service level agreement.

[0067] In another optional embodiment, before step 201, the above message processing method further includes: obtaining the output burstability of the data stream from the service level protocol corresponding to the identifier of the data stream; determining the MTU of the data stream as the output burstability of the data stream; and adding the identifier of the data stream and the MTU of the data stream to the configuration information.

[0068] In this embodiment, the output burst rate refers to the maximum number of bytes sent at once when scheduling a data stream. By setting the MTU of the data stream in this way, sending data stream packets or packet fragments according to this MTU ensures that the amount of data sent each time does not exceed the allowed output burst rate, thereby meeting the output burst rate requirements specified in the service level agreement.

[0069] In existing packet fragmentation methods, after receiving a packet, the router determines the interface corresponding to the packet through a routing lookup, and then determines the maximum transmission unit (MTU) of the link corresponding to that interface. When the received packet is larger than the MTU, it is fragmented into packets smaller than or equal to the MTU. This method shapes all traffic transmitted through the interface, making it difficult to meet the bandwidth or latency requirements of data flows specified by service level agreements (SLAs).

[0070] Sending large data packets using existing methods of packet fragmentation can lead to packet identifier conflicts. For example, a 64-byte fragment can be divided into 219 fragments. It would take 219 transmission cycles to send a 9600-byte IPv4 packet. With a 100Gbps interface and a 10µs transmission cycle, each cycle can send 125,000 bytes. This means a maximum of 1953 64-byte packets can be sent per cycle, and 427,707 64-byte packets can be sent in 219 cycles. The maximum sequence number for existing IPv4 packets is 65535, meaning 65536 sequence numbers are allocated per round. Since 427,707 is much larger than 65536, the sequence numbers assigned to packet fragments will conflict with those allocated in other rounds. This prevents receiving devices from distinguishing packets with the same identifier, leading to packet assembly errors or packet loss.

[0071] In response, this application provides a method for setting the identifier occupancy duration or identifier occupancy status. Based on the identifier occupancy duration or identifier occupancy status, message fragments with the same message identifier are sent in sequence, which can avoid message identifier conflicts.

[0072] In an optional embodiment, the above message processing method further includes: for a target message with a target message identifier and a target message fragment, calculating the sum of the number of target messages and the number of target message fragments in the cache; and setting the identifier occupancy duration corresponding to the target message identifier based on the calculation result.

[0073] In this embodiment, after assigning a packet identifier to a packet or packet fragment in the network device's cache, the sum of the number of packets with packet identifiers and the number of packet fragments can be calculated. Based on the calculation result, the identifier occupancy time corresponding to the packet identifier is determined. Similarly, for each packet identifier in the identifier resource pool, the identifier occupancy time corresponding to each packet identifier can be determined, thus enabling periodic monitoring of identifier occupancy time.

[0074] The calculation result is positively correlated with the identifier's duration. Optionally, the calculation result is proportional to the identifier's duration. When the transmission period of the target packet is one time slice and the transmission period of the target packet fragment is one time slice, the identifier's duration can be equal to the calculation result multiplied by the time slice. At any given time, if the network device stores *a* packets and *b* packet fragments with the same packet identifier, then the identifier's duration corresponding to that packet identifier is *a* + *b* time slices. *a* and *b* are positive integers. For example, the identifier's duration corresponding to a packet is one time slice. The identifier's duration decreases by one for each packet sent.

[0075] When the sending period of the target message is n time slices and the sending period of the target message fragment is n time slices, the duration of the identifier occupation can be equal to the calculation result * n * time slices.

[0076] In another optional embodiment, obtaining the target message identifier from the identifier resource pool based on the identifier occupancy information contained in the identifier resource pool includes: when the identifier resource pool includes message identifiers and identifier occupancy durations, obtaining the identifier occupancy durations corresponding to all message identifiers in the identifier resource pool before sending multiple message fragments; and determining the target message identifier as the message identifier corresponding to the minimum identifier occupancy duration.

[0077] In this embodiment, the identifier occupation duration indicates how much longer the message identifier will remain to be released. When the message identifier corresponding to the minimum identifier occupation duration is used, the waiting time for sending multiple message fragments is minimized, thus shortening the transmission time. Furthermore, it prevents the problem of one message identifier being occupied by multiple messages while other message identifiers remain idle.

[0078] See Figure 4 In one example, message identifiers range from 0 to 17. In the statistical results obtained at the first statistical time, the identifier corresponding to message identifier 1 occupies 8 time slices, the identifier corresponding to message identifier 2 occupies 5 time slices, the identifier corresponding to message identifier 5 occupies 10 time slices, the identifier corresponding to message identifier 12 occupies 6 time slices, the identifier corresponding to message identifier 13 occupies 6 time slices, and the identifiers corresponding to other message identifiers occupy 0 time slices. A message identifier occupying 0 time slices indicates that the message identifier is an unoccupied message identifier, that is, the message identifier is in an idle state.

[0079] A network device can send a group of packets within a time slice. This group of packets includes one packet with each packet identifier. After one time slice, the duration of non-zero identifiers in the identifier resource pool is decreased by one. Identifiers with a duration of 0 remain unchanged. After one time slice, the duration of identifiers in the identifier resource pool is as follows: Figure 5 As shown.

[0080] When there are multiple minimum identifier durations, any one of them can be selected as the target message identifier. When the minimum identifier duration is 0, the first fragment of the message to be processed can be sent in the next time slice. For example... Figure 5 As shown, the minimum identifier duration is 0, and the message identifiers corresponding to the minimum identifier duration include 0, 3, 4, 6, 7, 8, 9, 10, 11, 14, 15, 16, and 17. Any one of these can be selected as the message identifier for multiple message fragments.

[0081] In one optional embodiment, the duration of the identifier corresponding to each packet fragment is equal to the output interval of the data stream.

[0082] When the output interval of the data stream is equal to one time slice, the duration occupied by the identifiers corresponding to multiple packet fragments is equal to the product of the time slice and the number of fragments. See also... Figure 6A In one example, the nine consecutive time slices are labeled 610, 611, 612, 613, 614, 615, 616, 617, and 618. The identifier for fragment 601 occupies time slice 611, the identifier for fragment 602 occupies time slice 612, the identifier for fragment 603 occupies time slice 613, and the identifier for fragment 604 occupies time slice 614. The identifiers corresponding to these four fragments occupy four time slices.

[0083] When the data stream output interval is equal to two time slices, the duration occupied by the identifiers corresponding to multiple packet fragments is equal to the product of two time slices and the number of fragments. See also... Figure 6B In another example, the nine consecutive time slices are labeled 610, 611, 612, 613, 614, 615, 616, 617, and 618. The identifier for fragment 601 occupies time slices 611 and 612; the identifier for fragment 602 occupies time slices 613 and 614; the identifier for fragment 603 occupies time slices 615 and 616; and the identifier for fragment 604 occupies time slices 617 and 618. Since the data stream output interval is equal to two time slices, the identifiers for the four fragments occupy a total of eight time slices.

[0084] It should be noted that a time slice can send m messages with the same message identifier. The value of m can be set according to the actual situation, and this application does not limit it. See reference. Figure 7 The nine consecutive time slices are labeled 710, 711, 712, 713, 714, 715, 716, 717, and 718. Each time slice can send two message fragments. Therefore, the identifier for message fragment 601 occupies time slices 711 and 712; the identifier for message fragment 602 occupies time slices 711 and 712; the identifier for message fragment 603 occupies time slices 713 and 714; and the identifier for message fragment 604 occupies time slices 713 and 714.

[0085] In another optional embodiment, before sending the shaped message fragments, the above message processing method further includes: obtaining multiple messages with target message identifiers; determining the sending order of the multiple messages; and sending the multiple messages in the sending order of the multiple messages.

[0086] The following section describes the situation of delayed message fragmentation. Please refer to [link / reference]. Figure 8 In one example, the nine consecutive time slices are labeled 810, 811, 812, 813, 814, 815, 816, 817, and 818. Message fragments 601 to 604 and messages 801 to 803 share the same message identifier. The identifier for message fragment 601 occupies time slice 814, the identifier for message fragment 602 occupies time slice 815, the identifier for message fragment 603 occupies time slice 816, and the identifier for message fragment 604 occupies time slice 817. Before sending message fragments 601 to 604, message 801 needs to be sent in time slice 811, message 802 in time slice 812, and message 803 in time slice 813. Sending messages with the same identifier sequentially avoids message identifier conflicts. It should be understood that the number of message fragments, the number of messages, and the duration of the identifier corresponding to the data stream are not limited to the examples above, and can be set according to the actual situation.

[0087] In another optional embodiment, obtaining the target message identifier from the identifier resource pool based on the identifier occupancy information contained in the identifier resource pool includes: when the identifier resource pool includes message identifiers and identifier occupancy status, selecting an unoccupied message identifier from the identifier resource pool as the target message identifier based on the identifier occupancy status.

[0088] In this embodiment, the identifier resource pool includes multiple message identifiers and the identifier occupancy status of each message identifier. The identifier occupancy status of a message identifier includes an occupied status and an unoccupied status. For example, an unoccupied status is recorded as 0, and an occupied status is recorded as 1. In another example, an unoccupied status is recorded as 1, and an occupied status is recorded as 0.

[0089] In one example, the message identifier and the identifier occupancy status of the message identifier are as follows: Figure 9 As shown. See also Figure 9 The message identifier ranges from 0 to 17. A message identifier status of 0 indicates that the message is in an unused state. A message identifier status of 1 indicates that the message is in a used state.

[0090] It should be noted that if all identifiers in the identifier resource pool are in an occupied state, then pending packets can be discarded. Once multiple packet fragments have been sent, their identifiers can be released. This provides an alternative method for allocating packet identifiers, improving the flexibility of the solution implementation.

[0091] This application provides a network device capable of implementing the message processing method described in the above embodiments. (See also...) Figure 10 In one embodiment, the network device 1000 includes:

[0092] The acquisition module 1001 is used to acquire a message to be processed from the data stream, the message to be processed including the identifier of the data stream;

[0093] The sharding module 1002 is used to determine the MTU of the data stream based on the data stream identifier in the configuration information;

[0094] The fragmentation module 1002 is also used to obtain the target packet identifier when the packet length of the packet to be processed is greater than the MTU of the data stream.

[0095] The fragmentation module 1002 is also used to divide the message to be processed into multiple message fragments with target message identifiers according to the MTU of the data stream;

[0096] The shaping module 1003 is used to shape multiple packets into fragments according to the output interval of the data stream;

[0097] The sending module 1004 is used to send the shaped message fragments.

[0098] In this embodiment, network device 1000 can achieve... Figure 2 The message processing method in the illustrated embodiment or optional embodiment. The acquisition module 1001, fragmentation module 1002, and shaping module 1003 can be implemented by a processor. The sending module 1004 can be implemented by a network interface.

[0099] The following example illustrates the processing steps of the slicing module 1002 and the shaping module 1003. (See attached image.) Figure 11 In one example, after the message to be processed is input into the fragmentation module 1002, the fragmentation module 1002 divides the message to be processed into 4 fragments, and the shaping module 1003 shapes the 4 fragments according to the output interval of the data stream.

[0100] See Figure 12 In one optional embodiment, the fragmentation module 1002 includes a maximum transmission unit configuration submodule 1201, a message identifier resource pool submodule 1202, and a message fragmentation submodule 1203;

[0101] The maximum transmission unit configuration submodule 1201 is used to determine the maximum transmission unit of the data stream based on the data stream identifier in the configuration information;

[0102] The message identifier resource pool submodule 1202 is used to obtain the target message identifier when the message length of the message to be processed is greater than the MTU of the data stream;

[0103] The message fragmentation submodule 1203 is used to divide the message to be processed into multiple message fragments with target message identifiers according to the MTU of the data stream.

[0104] In an optional embodiment, the sharding module 1002 is further configured to obtain the stream shaping bandwidth of the data stream from the service level protocol corresponding to the identifier of the data stream; determine the MTU of the data stream based on the product of the stream shaping bandwidth of the data stream and the output interval of the data stream; and add the data stream identifier and the MTU of the data stream to the configuration information.

[0105] In another optional embodiment, the sharding module 1002 is further configured to obtain the output burstiness of the data stream from the service level agreement corresponding to the identifier of the data stream; determine the MTU of the data stream as the output burstiness of the data stream; and add the identifier of the data stream and the MTU of the data stream to the configuration information.

[0106] In another optional embodiment, the fragmentation module 1002 is specifically configured to, when the identifier resource pool includes message identifiers and identifier occupancy durations, obtain the identifier occupancy durations corresponding to all message identifiers in the identifier resource pool before sending multiple message fragments; and determine the target message identifier as the message identifier corresponding to the minimum identifier occupancy duration. Optionally, the identifier occupancy duration corresponding to each message fragment is equal to the output interval of the data stream.

[0107] In another optional embodiment, the fragmentation module 1002 is further configured to calculate the sum of the number of target packets in the cache and the number of target packet fragments, wherein both the target packets and the target packet fragments have target packet identifiers; and set the identifier occupancy duration corresponding to the target packet identifier according to the calculation result, wherein the calculation result is positively correlated with the identifier occupancy duration.

[0108] In another optional embodiment, the fragmentation module 1002 is specifically used to select an unoccupied message identifier from the identifier resource pool as the target message identifier, based on the identifier occupancy status, when the identifier resource pool includes message identifiers and identifier occupancy status.

[0109] Figure 10 For the explanation of terms used in the illustrated embodiments, the execution steps of each unit in the network device 1000, and their beneficial effects, please refer to the corresponding descriptions in the above method embodiments.

[0110] The network device described below is from a hardware perspective; the network device can be a router or a switch. (See also...) Figure 13 One embodiment of the network device 1300 in this application includes a processor 1301, a memory 1302, and a network interface 1303 connected via a bus 1304.

[0111] In this embodiment, the memory 1302 is used to store information such as programs, instructions, or data. The processor 1301 executes the program or instructions stored in the memory 1302. Figure 2 The message processing method in the illustrated embodiment.

[0112] It should be understood that the processor 1301 mentioned in this embodiment can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0113] It should also be understood that the memory 1302 mentioned in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM).

[0114] Network interface 1303 can be used to receive or send messages.

[0115] It should be noted that the information interaction and execution process between the modules / units of the above-mentioned device are based on the same concept as the method embodiments of this application, and the resulting technical effects are the same as those of the method embodiments of this application. For details, please refer to the description in the method embodiments shown above in this application, and will not be repeated here.

[0116] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines.

[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, and of course, it can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memory, special components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0118] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the message processing method described in the above embodiments or optional embodiments.

[0119] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0120] A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).

[0121] This application also provides a chip system comprising a processor and a memory coupled to each other. The memory stores computer programs or instructions, and the processing unit executes the computer programs or instructions stored in the memory to cause a network device to perform the steps performed by the network device in the above embodiments. Optionally, the memory is on-chip memory, such as registers, caches, etc. The memory can also be off-chip memory within a site, such as read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM), etc. The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for implementing the above message processing methods.

[0122] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A message processing method, characterized in that, include: Obtain the stream shaping bandwidth of the data stream from the service level agreement corresponding to the identifier of the data stream; The maximum transmission unit (MTU) of the data stream is determined by multiplying the stream shaping bandwidth of the data stream by the output interval of the data stream. Add the identifier of the data stream and the MTU of the data stream to the configuration information; Obtain a message to be processed from the data stream, the message to be processed including the identifier of the data stream; The MTU of the data stream is determined in the configuration information based on the identifier of the data stream; If the message length of the message to be processed is greater than the MTU of the data stream and the identifier resource pool includes message identifiers and identifier occupancy durations, the identifier occupancy durations corresponding to all message identifiers shall be obtained from the identifier resource pool before sending multiple message fragments. The target message identifier is determined to be the message identifier corresponding to the minimum identifier duration; The message to be processed is divided into multiple message fragments with the target message identifier according to the MTU of the data stream; Multiple packets are fragmented and shaped according to the output interval of the data stream; Send the reshaped message fragments.

2. The method according to claim 1, characterized in that, The method further includes: Calculate the sum of the number of target packets in the cache and the number of target packet fragments, wherein both the target packets and the target packet fragments have the target packet identifier; The target message identifier is set with a corresponding identifier occupancy duration based on the calculation result, and the calculation result is positively correlated with the identifier occupancy duration.

3. A message processing method, characterized in that, include: The output burstiness of the data stream is obtained from the service level agreement corresponding to the identifier of the data stream; The maximum transmission unit (MTU) of the data stream is determined as the output burstiness of the data stream; Add the identifier of the data stream and the MTU of the data stream to the configuration information; Obtain a message to be processed from the data stream, the message to be processed including the identifier of the data stream; The MTU of the data stream is determined in the configuration information based on the identifier of the data stream; If the message length of the message to be processed is greater than the MTU of the data stream and the identifier resource pool includes message identifiers and identifier occupancy durations, the identifier occupancy durations corresponding to all message identifiers shall be obtained from the identifier resource pool before sending multiple message fragments. The target message identifier is determined to be the message identifier corresponding to the minimum identifier duration; The message to be processed is divided into multiple message fragments with the target message identifier according to the MTU of the data stream; Multiple packets are fragmented and shaped according to the output interval of the data stream; Send the reshaped message fragments.

4. The method according to claim 3, characterized in that, The method further includes: Calculate the sum of the number of target packets in the cache and the number of target packet fragments, wherein both the target packets and the target packet fragments have the target packet identifier; The target message identifier is set with a corresponding identifier occupancy duration based on the calculation result, and the calculation result is positively correlated with the identifier occupancy duration.

5. A network device, characterized in that, include: The sharding module is used to obtain the stream shaping bandwidth of the data stream from the service level protocol corresponding to the identifier of the data stream; The maximum transmission unit (MTU) of the data stream is determined by multiplying the stream shaping bandwidth of the data stream by the output interval of the data stream. Add the identifier of the data stream and the MTU of the data stream to the configured information; An acquisition module is used to acquire a message to be processed from the data stream, wherein the message to be processed includes an identifier of the data stream; The sharding module is also used to determine the MTU of the data stream based on the data stream identifier in the configuration information; The fragmentation module is further configured to, when the message length of the message to be processed is greater than the MTU of the data stream and the identification resource pool includes message identifiers and identifier occupancy duration, obtain the identifier occupancy duration corresponding to all message identifiers in the identification resource pool before sending multiple message fragments; The target message identifier is determined to be the message identifier corresponding to the minimum identifier duration; The fragmentation module is further configured to divide the message to be processed into multiple message fragments with the target message identifier according to the MTU of the data stream; The shaping module is used to shape multiple packet fragments according to the output interval of the data stream; The sending module is used to send the shaped message fragments.

6. The network device according to claim 5, characterized in that, The fragmentation module is also used to calculate the sum of the number of target packets in the cache and the number of target packet fragments, wherein both the target packet and the target packet fragment have the target packet identifier; The target message identifier is set with a corresponding identifier occupancy duration based on the calculation result, and the calculation result is positively correlated with the identifier occupancy duration.

7. A network device, characterized in that, include: The sharding module is used to obtain the output burstiness of the data stream from the service level protocol corresponding to the identifier of the data stream; The maximum transmission unit (MTU) of the data stream is determined as the output burstiness of the data stream; Add the identifier of the data stream and the MTU of the data stream to the configuration information; An acquisition module is used to acquire a message to be processed from the data stream, wherein the message to be processed includes an identifier of the data stream; The sharding module is also configured to determine the MTU of the data stream based on the identifier of the data stream in the configuration information; The fragmentation module is further configured to, when the message length of the message to be processed is greater than the MTU of the data stream and the identification resource pool includes message identifiers and identifier occupancy duration, obtain the identifier occupancy duration corresponding to all message identifiers in the identification resource pool before sending multiple message fragments; The target message identifier is determined to be the message identifier corresponding to the minimum identifier duration; The fragmentation module is further configured to divide the message to be processed into multiple message fragments with the target message identifier according to the MTU of the data stream; The shaping module is used to shape multiple packet fragments according to the output interval of the data stream; The sending module is used to send the shaped message fragments.

8. The network device according to claim 7, characterized in that, The fragmentation module is also used to calculate the sum of the number of target packets in the cache and the number of target packet fragments, wherein both the target packet and the target packet fragment have the target packet identifier; The target message identifier is set with a corresponding identifier occupancy duration based on the calculation result, and the calculation result is positively correlated with the identifier occupancy duration.

9. A computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Flow sequencing

    US20160191400A1

  • Tenant-specific quality of service

    US20210218677A1