WO2018133784A1 - 报文处理方法、设备及系统 - Google Patents

报文处理方法、设备及系统 Download PDF

Info

Publication number
WO2018133784A1
WO2018133784A1 PCT/CN2018/072913 CN2018072913W WO2018133784A1 WO 2018133784 A1 WO2018133784 A1 WO 2018133784A1 CN 2018072913 W CN2018072913 W CN 2018072913W WO 2018133784 A1 WO2018133784 A1 WO 2018133784A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
address
destination
source
port number
Prior art date
Application number
PCT/CN2018/072913
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 华为技术有限公司
Publication of WO2018133784A1 publication Critical patent/WO2018133784A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/11Identifying congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/11Identifying congestion
    • H04L47/115Identifying congestion using a dedicated packet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/127Avoiding congestion; Recovering from congestion by using congestion prediction

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a packet processing method, device, and system.
  • Network resources include bandwidth, cache space, and processing power of the terminal. Relying on network resources in the network for data transmission. Once the network resources required for data transmission exceed the currently available network resources, the network will be congested. Therefore, it is necessary to detect network resources in the process of data transmission, and respond to the detected network congestion before the end of the data stream transmission, thereby completing control of network congestion.
  • the commonly used congestion detection method is: implicit congestion notification method.
  • the implicit congestion notification method is based on a reliable connection of the Transmission Control Protocol (TCP).
  • TCP Transmission Control Protocol
  • the transmitting device sends a packet to the receiving device through the network device
  • a timer is started for each message sent.
  • the sender device receives the response (English: Acknowledgement, ACK) message sent by the receiver device
  • the timer is turned off.
  • the network device directly discards the packet. If the receiving device does not receive the packet, the ACK message is not fed back to the sending device.
  • the sender device does not receive the ACK message, and the timer of the corresponding packet times out, that is, the packet is lost, the network is congested, and the transmitting device performs a congestion response.
  • the time of the above congestion detection depends on the timeout of the timeout retransmission in the TCP protocol, which is generally greater than one round trip time (English: Round Trip Time, RTT), and the detection time is longer.
  • the embodiment of the present application provides a packet processing method, device, and system, which are used to solve the problem that the congestion detection takes a long time in the prior art.
  • a first aspect of the embodiment of the present application discloses a packet processing method, where the method includes:
  • the network device When the network device is congested, the network device obtains a source IP address and a destination IP address of the first Internet Protocol IP packet from the first terminal device, and stores the source IP address of the first IP packet in the first The destination IP address of the first IP packet is stored in the source IP address of the first data entry in the destination IP address of the data entry;
  • the network device obtains the second IP packet from the second terminal device, and determines that the source IP address of the second IP packet is the same as the source IP address in the first data entry, the second IP The destination IP address of the packet is the same as the destination IP address in the first data entry, and the CE tag is set to the congestion of the second IP packet to obtain the first tagged message, where the CE tag is used to identify the location.
  • the network device is congested when transmitting a message;
  • the network device sends the first tagged message to the first terminal device.
  • the network device After the network device detects that congestion occurs, the network device obtains the source IP address and the destination IP address stored in the first data entry after the source IP address and the destination IP address of the first IP packet are exchanged.
  • the IP address is obtained by the second IP packet, which is the same as the source IP address and the destination IP address in the first data entry, and the CE tag is set, and the second IP packet is sent by the second terminal device.
  • the CE flag By setting the CE flag on the reverse-transmitted IP packet, it is not required to send a response to the peer device during congestion detection, and it does not need to rely on the terminal device to determine whether the timing of the corresponding packet times out, and reduce congestion detection. Time, which in turn reduces latency.
  • the first data entry further includes a counter, where the counter is used to indicate the number of IP packets to be set by the CE, and the source of the IP packet to be set by the CE.
  • the IP address and the destination IP address are the same as the source IP address and the destination IP address of the second IP packet.
  • Obtaining the number of the IP packets to be set by the CE including:
  • the counter is incremented by one
  • the network counter is decremented by one.
  • the network device adds a counter in the first data entry to determine the number of IP packets to be set by the CE. If the number is greater, the efficiency of indicating the congestion response that the first terminal device needs to adopt is higher.
  • the network device can dynamically obtain the number of IP packets to be set by the CE by dynamically controlling the count in the counter.
  • the first data entry further includes a timer
  • the timer resets the timer when the network device generates the first data entry or decrements the counter in the first data entry by one;
  • the network device deletes the first data entry.
  • the network device adds a timer to the first data entry, and the process of aging the first data entry may delete the first data entry in time when the IP packet to be set by the CE is not obtained. Further, the problem that the forward data stream and the reverse data stream can have different paths in the case of load balancing can also be solved.
  • the first data entry further includes a source port number and a destination port number
  • the network device obtains a source port number and a destination port number in the first IP packet from the first terminal device, and stores the source port number of the first IP packet in the first data entry.
  • the destination port number of the first IP packet is stored in the source port number of the first data entry in the destination port number;
  • the network device determines that the source IP address of the second IP packet is the same as the source IP address in the first data entry, and the destination IP address of the second IP packet is the first The destination IP address of the data entry is the same, and the congestion of the second IP packet is CE marked, including:
  • the source port number of the second IP packet is the same as the source port number of the first data entry, and the destination port number of the second IP packet is in the first data entry.
  • the destination port number is the same, and congestion is generated for the second IP packet.
  • the network device adds the source port number and the destination port number in the first data entry, which can solve the situation that different data flows between the sender device and the receiver device are congested at the network device.
  • a data stream with the same source port number and destination port number is the same data stream.
  • the source IP address, the destination IP address, the source port number, and the destination port number of the IP packet to be set by the CE and the source IP address and the destination IP address of the second IP packet are The source port number and the destination port number are the same respectively.
  • the number of the IP packets to be set by the CE is obtained, including:
  • the counter is incremented by one
  • the counter is decremented by one.
  • the network device adds a counter in the first data entry to determine the number of IP packets to be set by the CE. If the number is greater, the efficiency of indicating the congestion response that the first terminal device needs to adopt is higher.
  • the network device can dynamically obtain the number of IP packets to be set by the CE by dynamically controlling the count in the counter.
  • the method further includes:
  • the network device adds the identifier information to the first IP packet, where the identifier information is used to instruct the network device to generate the first data entry and/or the pair according to the information carried in the first IP packet.
  • the counter in the first data entry is incremented by 1; the information carried in the first IP packet includes a source IP address and a destination IP address of the first IP packet, or a source of the first IP packet. IP address, destination IP address, source port number, and destination port number.
  • the network device adds the identification information to the IP packet, which is convenient for identifying which IP packets are processed when the uplink and downlink processing flows exist in the network device.
  • the IP packet header of the first IP packet includes a reverse explicit congestion notification RECN flag, and the RECN flag is used to identify the data flow supported by the first IP packet. Reverse congestion detection.
  • the second aspect of the embodiment of the present application discloses a packet processing method, which is applicable to a first terminal device. If the data flow sent by the first terminal device supports a reverse congestion detection mechanism, the method includes:
  • the first terminal device sends a first Internet Protocol IP packet to the network device, where the IP packet header of the first IP packet includes a reverse explicit congestion notification RECN flag, and the RECN flag is used to identify the first
  • the data flow to which the IP packet belongs supports the reverse congestion detection mechanism.
  • the first terminal device obtains a first tagged message from the network device, where the first tagged message includes a congestion occurrence CE tag, and the CE tag is used to identify that the network device occurs when transmitting a message. congestion;
  • the first terminal device performs a congestion response based on the first marked message.
  • the first terminal device adds the RECN flag to the IP packet sent by the network device, so that the network device receives the IP packet sent by the terminal device, and passes the IP in the reverse transmission based on the supported RECN mechanism.
  • the CE mark is set on the packet, and then the terminal device is fed back, so that the terminal device directly determines that the packet transmission of the UE is congested by the CE mark. Thereby reducing the time of congestion detection, thereby reducing the delay.
  • the method further includes:
  • the first terminal device obtains a second tagged message from the network device, where the second tagged message includes the CE tag;
  • the first terminal device determines that the congestion detection mechanism supported by the data flow is a reverse congestion detection mechanism, the first terminal device performs congestion processing on the data flow;
  • the first terminal device determines that the congestion detection supported by the data flow is a forward congestion detection mechanism, sending a response ACK message to the network device, where the ACK message is used to instruct the second terminal device to perform the Congestion processing of the data stream, the ACK message including a CE mark.
  • the congestion detection mechanism supported by each data stream is distinguished based on different sets of ECN FIELD in the packet header.
  • the network device sets the congestion detection mechanism according to the ECN FIELD of the packet header in the received packet. Based on the manner in which different data streams support different congestion detection mechanisms, network devices can be more flexible when performing congestion detection.
  • a third aspect of the embodiment of the present application discloses a network device, including:
  • a processing unit configured to: obtain a source IP address and a destination IP address of the first Internet Protocol IP packet from the first terminal device, and store the source IP address of the first IP packet, if the network device is congested And storing, in the destination IP address of the first data entry, the destination IP address of the first IP packet in the source IP address of the first data entry, and obtaining the second IP address from the second terminal device.
  • the source IP address of the second IP packet is the same as the source IP address of the first data entry, and the destination IP address of the second IP packet is in the first data entry.
  • the destination address is the same, and the congestion occurs in the second IP packet, and the CE mark is obtained, and the CE mark is used to identify that the network device is congested when transmitting the packet.
  • a sending unit configured to send the first tagged message to the first terminal device.
  • the first data entry further includes a counter, where the counter is used to indicate the number of IP packets to be set by the CE, and the source of the IP packet to be set by the CE.
  • the IP address and the destination IP address are the same as the source IP address and the destination IP address of the second IP packet.
  • the processing unit is configured to: when each receives an IP packet that is the same as the source IP address and the destination IP address of the first IP packet, add 1 to the counter, and obtain a When the source IP address and the destination IP address of the second packet are the same IP packets, the counter is decremented by one.
  • the first data entry further includes a timer
  • the processing unit is further configured to: when the first data entry is generated or the counter in the first data entry is decremented by one, the timer resets the timing, if the timer reaches a pre-time At the time of design, the first data entry is deleted.
  • the first data entry further includes a source port number and a destination port number
  • the processing unit is further configured to: obtain a source port number and a destination port number in the first IP packet from the first terminal device, and store the source port number of the first IP packet in the first And storing, in the destination port number of the data entry, the destination port number of the first IP packet in the source port number of the first data entry; and determining a source IP address of the second IP packet
  • the source IP address of the first data entry is the same
  • the destination IP address of the second IP packet is the same as the destination address of the first data entry
  • the source port of the second IP packet is determined.
  • the number is the same as the source port number in the first data entry
  • the destination port number of the second IP packet is the same as the destination port number in the first data entry
  • the second IP packet is Set congestion to CE mark.
  • the source IP address, the destination IP address, the source port number, and the destination port number of the IP packet to be set by the CE and the source IP address and the destination IP address of the second IP packet are The source port number and the destination port number are the same respectively.
  • the processing unit is configured to: when receiving an IP packet with the same source IP address, destination IP address, source port number, and destination port number as the first IP packet, the counter is Add 1; the counter is decremented by 1 each time it receives an IP packet with the same source IP address, destination IP address, source port number, and destination port number as the second IP packet.
  • the processing unit is further configured to: after obtaining the first IP packet, add identifier information to the first IP packet, where the identifier information is used to indicate the network device Generating the first data entry according to the information carried in the first IP packet and/or adding a counter to the counter in the first data entry; the information carried in the first IP packet includes the first Source IP address and destination IP address of an IP packet, or source IP address, destination IP address, source port number, and destination port number of the first IP packet.
  • a fourth aspect of the embodiments of the present application discloses a network device, including: a memory, and a processor in communication with the memory;
  • the memory is configured to store program code for processing a message
  • the processor is configured to execute the program code saved by the memory to implement the operations in the first aspect and various possible designs described above.
  • the fifth aspect of the embodiment of the present application discloses a terminal device, which is used as a first terminal device. If the data flow sent by the first terminal device supports a reverse congestion detection mechanism, the first terminal device includes:
  • a sending unit configured to send a first Internet Protocol IP packet to the network device, where the IP packet header of the first IP packet includes a reverse explicit congestion notification RECN flag, where the RECN flag is used to identify the The data flow to which an IP packet belongs supports reverse congestion detection;
  • a receiving unit configured to receive a first tagged message from the network device, where the first tagged message includes a congestion occurrence CE tag, where the CE tag is used to identify that the network device is congested when transmitting a packet ;
  • a processing unit configured to perform a congestion response based on the first marked message.
  • the data flow sent by the first terminal device supports a reverse congestion detection mechanism and a forward congestion detection mechanism
  • the receiving unit is further configured to receive a second tagged message from the network device, where the second tagged message includes a CE tag;
  • the processing unit is further configured to determine a source port number and a destination port number of the second tagged message, and determine the second tagged message based on a source port number and a destination port number of the second tagged message An associated data stream; if it is determined that the congestion detection mechanism supported by the data flow is a reverse congestion detection mechanism, the first terminal device performs congestion processing on the data flow; if it is determined that the data flow supports The congestion detection mechanism is a forward congestion detection mechanism, and sends a response ACK message to the network device, where the ACK message is used to instruct the second terminal device to perform congestion processing on the data flow, where the ACK message includes a CE mark. .
  • a terminal device which is used as a first terminal device, and the data stream sent by the first terminal device supports a reverse congestion detection mechanism, or is sent by the first terminal device.
  • the data stream may support a reverse congestion detection mechanism, and may also support a forward congestion detection mechanism, the first terminal device comprising: a memory, and a processor in communication with the memory;
  • the memory is configured to store program code for processing a message
  • the processor is configured to execute the program code saved by the memory to implement the operations in the second aspect and various possible designs described above.
  • a seventh aspect of the embodiment of the present application discloses a network system, including: a first terminal device and a network device;
  • the network device is the network device described in the foregoing third aspect or the fourth aspect;
  • the first terminal device may be the terminal device described in the fifth aspect or the sixth aspect.
  • An eighth aspect of the embodiments of the present application provides a computer readable storage medium for storing a computer program, the computer program comprising any of the possible designs or the first aspect, the second aspect, the first aspect, or the first aspect The instructions of the method in any of the possible aspects of the two aspects.
  • FIG. 1 is a schematic diagram of an end-to-end network connection disclosed in an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a network device according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a packet processing method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart diagram of another packet processing method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart diagram of another packet processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart diagram of another packet processing method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a network device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a first terminal device according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of another network device according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of another first terminal device according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a network system according to an embodiment of the present application.
  • the embodiment of the present invention provides a packet processing method, a network device, and a system, which are used to shorten congestion detection time, reduce delay caused by network congestion control, and transmit short-lived data streams and services sensitive to transmission delay. Provide favorable conditions.
  • FIG. 1 is a schematic diagram of an end-to-end network connection disclosed in an embodiment of the present application.
  • the schematic diagram includes: a network device 10, a sender device 11 and a receiver device 12.
  • the sender device 11 and the receiver device 12 perform message interaction through the network device 10.
  • IP Internet Protocol
  • Table 1 The format of the IP packet header is shown in Table 1.
  • the explicit congestion notification field (English: Explicit Congestion Notification FIELD, ECN FIELD) occupies the 6th bit and the 7th bit, and uses different set flags to congest different information in the probe. As shown in Table 2, it is set for ECN FIELD, and the corresponding mechanism for supporting congestion detection is set.
  • the network device and the receiving device support the RECN mechanism, and also support the forward ECN mechanism.
  • the setting is "01", that is, ECT(1), it is used to identify the packet being transmitted.
  • the RECN mechanism is supported when congestion occurs in the process.
  • the embodiment of the present application is not limited to this.
  • the setting performed by the ECN FIELD can be distinguished only by the RECN mechanism and the forward ECN mechanism.
  • FIG. 2 it is a schematic structural diagram of a network device 10 disclosed in the embodiment of the present application.
  • the network device 10 includes an uplink board 201, a switching network board 202, and a downlink board 203.
  • the uplink board 201 includes: an uplink physical interface card (Physical Interface Card, PIC), an uplink packet forwarding engine (PFE) connected to the uplink PIC, and an upstream traffic manager connected to the uplink PFE. :Traffic Manager, TM), an upstream forwarding information table (FIC) connected to the uplink TM, and the uplink FIC is connected to the switching network board 202.
  • PIC Physical Interface Card
  • PFE Packet Control Engine
  • TM Traffic Manager
  • FIC upstream forwarding information table
  • the downlink board 203 includes a downlink FIC connected to the switching network board 202, a downlink TM connected to the downlink FIC, a downlink PFE connected to the downlink TM, and a downlink PIC connected to the downlink PFE.
  • the uplink board and the downlink board in the embodiment of the present invention are directed to the forwarding process of a certain data packet in the network device.
  • the upstream board (that is, the forwarding board) is the board on which the data packet enters the network device, that is, the inbound interface.
  • the packet is sent to the switching network board through the forwarding process of the upstream board. Network card).
  • the data packet is sent to the downlink board through the switching of the switching network board, and the downlink board performs forwarding processing, and the data packet is sent out from the network device through the outbound interface. Therefore, the downlink board is the board where the interface that the data packet leaves the network device, that is, the outbound interface.
  • the uplink refers to the flow direction of receiving a data packet from the network device to the switching network board
  • the downlink refers to the flow direction from the switching network board to forwarding a data packet from the network device.
  • the same board can be an uplink board for one data packet, and a downlink board for another data packet.
  • the upstream board and the downstream board refer to the same board for the data packet.
  • the transmitting device 11 sends a packet to the receiving device 12 via the network device 10.
  • the network device 10 sets the CE mark on the packet and directly feeds back to the sender device.
  • the device does not need to pass through the receiver device, thereby shortening at least half of the packet. Congestion detection time.
  • the network device may be a router, or may be a device for forwarding processing, such as a switch.
  • FIG. 3 is a schematic flowchart of a packet processing method according to an embodiment of the present application.
  • a first terminal device establishes a connection with a second terminal device based on TCP.
  • the data flow between the first terminal device and the second terminal device only supports the reverse congestion detection mechanism.
  • the message processing method includes:
  • the first terminal device sends an IP packet in the data stream to the second terminal device by using the network device.
  • the first terminal device may be the sender device shown in FIG. 1 of the embodiment of the present application.
  • the network device may be the network device shown in FIG. 1 of the embodiment of the present application.
  • the second terminal device may be the receiving end device shown in FIG. 1 of the embodiment of the present application.
  • the data stream consists of multiple IP packets.
  • An example is shown by taking an IP packet in the data stream as an example.
  • the network device obtains the source IP address and the destination IP address of the first IP packet from the first terminal device when the network device detects that the network device is congested, and stores the source IP address of the first IP packet in the first The destination IP address of the first IP packet is stored in the source IP address of the first data entry in the destination IP address of the data entry.
  • the network device determines whether the network device is congested by detecting whether the storage capacity in the storage queue is greater than a preset threshold. When it is detected that the storage capacity in the storage queue is greater than a preset threshold, it is determined that the network device is congested.
  • the preset threshold is usually smaller than the total capacity of the storage queue.
  • the total capacity of the storage queue of the network device is related to the network device itself, and the total capacity of the storage queues of different network devices is different.
  • the capacity of the storage queue can be expressed not only in the number of packets, but also in KB size.
  • the network device After detecting the congestion, the network device determines the IP packet that is congested according to the preset rule.
  • the preset rule relates to how the network device stores the received message. For example, the network device uses a storage queue to store different IP packets received, and can also classify and store the received IP packets in the corresponding storage queue according to the different data streams.
  • the preset rules include various methods in Active Queue Management (AQM).
  • the preset rules include: random early detection (RED), delay control (English: Controlled Delay, Co DEL), and Proportional Integral Enhanced (PIE), ie, the tail drop algorithm. .
  • the first data entry belongs to an entry in a data table of the network device, and each column of the data table corresponds to one item, and each row corresponds to one data entry.
  • the data table can be pre-established by the network device or can be established at the time of use. Similarly, the data entry in the data table may be pre-established by the network device, or may be established when the network device obtains the source IP address and the destination IP address of the first IP packet from the first terminal device.
  • the data table is shown in Table 3.
  • the types of entries include: source IP (English: Source IP, SIP) address and destination IP (English: Destination, DIP) address. Among them, you can also set the entry number (ID).
  • the first behavior is the first data entry.
  • the network device performs congestion detection for the subsequent reverse congestion detection mechanism.
  • the source device obtains the source IP address and the destination IP address of the first IP packet, and then obtains the source IP address and the destination IP packet of the first IP packet when the first data entry is listed in Table 3. After the exchange, the storage is performed, so that the IP packets of the reverse transmission are subsequently marked for marking.
  • the network device obtains the second IP packet from the second terminal device, and determines that the source IP address of the second IP packet is the same as the SIP address in the first data entry, and the destination IP address of the second IP packet is The DIP address in the first data entry is the same, and the CE mark is set to the second IP packet to obtain the first marked message.
  • the CE tag is used to identify that the network device is congested when transmitting a message.
  • S304 The network device sends the first tagged message to the first terminal device.
  • the first terminal device obtains the first tagged message from the network device, and performs a congestion response based on the first tagged message.
  • the congestion response There are various ways for the congestion response.
  • the first terminal device determines that the IP packet sent by itself is congested at the network device based on the first tagged message. Therefore, the first terminal device performs congestion processing on the data stream sent to the network device, where the congestion processing includes: reducing the sending rate of the IP packet in the data stream, or performing packet loss processing on the transmitted data stream, or stopping some The transmission of a data stream.
  • the embodiment of the present application does not specifically limit the congestion processing performed as long as the congestion state of the network device can be alleviated.
  • the packet processing method illustrated by using the first IP packet is disclosed in the foregoing application.
  • the network device may select all IPs received after congestion occurs. After the packet is processed, some IP packets can also be processed.
  • the network device obtains an IP packet received after the storage capacity is greater than a preset threshold.
  • a preset threshold is 50 IP packets.
  • the items in the data table also include counters, as shown in Table 4. Each time the network device receives an IP packet with the same source IP address and destination IP address as the first IP packet, the counter is incremented by one; each time the network device receives a source IP address of the second IP packet and When the destination IP addresses are the same IP packets, the counter is decremented by 1.
  • the count in the counter is used to indicate the number of IP packets to be set by the CE.
  • the source IP address of the IP packet to be set by the CE is the same as the source IP address of the second IP packet.
  • the destination IP address of the marked IP packet is the same as the destination IP address of the second IP packet.
  • the SIP stores the destination IP address of the IP packet that has been congested, and serves as the source IP address of the IP packet to which the CE tag needs to be set.
  • the source IP address of the IP packet that has been congested is stored in the DIP, and is used as the destination IP address of the IP packet to be set by the CE.
  • the number (English: Number, Num) is used to indicate the counter.
  • the number of IP packets that need to set the CE mark is stored in the Num.
  • the value in the Num is dynamically changed. If the network device obtains an IP packet after the storage capacity is greater than the preset threshold, the value in the Num entry is incremented by one. Each time the network device sets a CE flag, the value in the Num entry is decremented by one.
  • the network device may be the network device 10 shown in FIG. 1 of the embodiment of the present application. Then, the network device stores the source IP address and the destination IP address in the IP packet from the second terminal device obtained in the downlink PFE shown in FIG. 2 of the embodiment of the present application, and stores the destination IP address in the IP packet in the IP packet. In the SIP address, the source IP address in the IP packet is stored in the DIP address, and Num is updated at the same time.
  • the first data entry further includes a timer (English: Timer), as shown in Table 5.
  • the message processing method includes:
  • the network device obtains the source IP address and the destination IP address of the first IP packet from the first terminal device, and stores the destination IP address in the first IP packet in the SIP address of the first data entry.
  • the source IP address in an IP packet is stored in the DIP address of the first data entry, and the Num of the first data entry is incremented by one, and the Timer of the first data entry is reset.
  • the network device adds a Timer to the data table shown in Table 4.
  • the other items are the same.
  • only the Timer in the first data entry is described in detail.
  • the corresponding value in the Timer is the timing for a message.
  • Timer is dynamically changing.
  • the timer resets the timing when the network device generates the first data entry or subtracts Num from the first data entry by one.
  • the network device can set the maximum timing in the Timer to be 1 RTT.
  • the network device can adopt a positive timing method or a countdown method.
  • the network device obtains the second IP packet from the second terminal device, where the Num value in the first data entry is decremented by one, and the Timer resets the timing.
  • the source IP address of the second IP packet is the same as the SIP address in the first data entry, and the destination IP address of the second IP packet is the same as the DIP address in the first data entry.
  • S403 The network device sets a CE mark on the second IP packet, and obtains the first marked message.
  • the network device During the timer timing, if the network device has not obtained the second IP packet from the second terminal device, or the source IP address is the same as the SIP address in the first data entry, the destination IP address is in the first data entry. If the DIP address is the same as the IP packet, the timer counts up to the preset timing, and the network device deletes the first data entry.
  • the preset timing is equal to the preset maximum timer of the timer entry in the Timer entry; if the network device adopts the countdown mode, the pre-design The time is 0.
  • the timing of setting the Timer in advance is 0.25 seconds. If the network device adopts the positive timing mode, the timer is incremented from 0 after the reset timing. When the timing reaches 0.25 seconds or exceeds 0.25 seconds, the network device deletes the first data entry; if the network device uses the countdown method, Then, after the reset timing, the timing is decremented from 0.25 seconds. When the timing reaches 0, the network device deletes the first data entry.
  • the first data entry further includes a source port (SPort) number and a destination port (DPort) number, as shown in Table 6 Show.
  • SPort source port
  • DPort destination port
  • the message processing method includes:
  • the network device obtains the source IP address, the destination IP address, the source port number, and the destination port number in the first IP packet sent by the first terminal device, and stores the destination IP address of the first IP packet in the first data.
  • the source IP address of the first IP packet is stored in the DIP address of the first data entry
  • the source port number of the first IP packet is stored in the DPort of the first data entry
  • the destination port number of the first IP packet is stored in the SPort of the first data entry.
  • the DPort and the SPort are added to the first data entry, and the other is the same as the table 3 disclosed in the embodiment of the present application.
  • the network device obtains the source port number and the destination port number of the first IP packet of the first terminal device for storage, and may determine to set the CE when searching for a reverse packet that needs to be marked by the CE.
  • the marked packet belongs to the same data stream as the first IP packet.
  • the network device adds 1 to the value in the Num of the first data entry in the process of executing S501. That is, each time the network device receives an IP packet with the same source IP address, destination IP address, source port number, and destination port number as the first IP packet, the value in Num is incremented by one.
  • the network device performs timing in the process of executing S501.
  • the network device obtains the second IP packet from the second terminal device, and determines that the source IP address of the second IP packet is the same as the SIP address in the first data entry, and the destination IP address of the second IP packet is The DIP address in the first data entry is the same, the source port number of the second IP packet is the same as the SPort in the first data entry, and the destination port number of the second IP packet is the same as the DPort in the first data entry.
  • the second IP packet is set with the CE tag to obtain the first tagged message.
  • the process of setting the CE mark on the second IP packet in the S502 is the same as the process in the S304 in the embodiment corresponding to FIG. 3, and details are not described herein.
  • the network device decrements the value in the Num of the first data entry by one during the process of executing S502. That is, each time the network device receives an IP packet with the same source IP address, destination IP address, source port number, and destination port number as the second IP packet, the value in Num is decremented by one.
  • S503 The network device sends the first tagged message to the first terminal device.
  • the first terminal device receives the first tagged message, and performs a congestion response according to the first tagged message.
  • the process of the first terminal device performing the congestion response according to the first tagged message in the S504 is the same as the process described in S306 in the embodiment corresponding to FIG. 3, and details are not described herein.
  • the identifier information may be added to the IP packet that needs to be processed.
  • the form of the identification information is not specifically limited and may be any form.
  • the network device after obtaining the IP packet from the first terminal device, the network device adds the identifier information to the IP packet, where the identifier information is used to instruct the network device to generate the first data table according to the information carried in the IP packet. Item and/or add 1 to the counter in the first data entry.
  • the information carried in the IP packet includes the source IP address and the destination IP address of the IP packet.
  • the information carried in the IP packet includes the source IP address, destination IP address, and source port number of the IP packet. Destination port number.
  • the first IP packet from the first terminal device obtained by the network device is taken as an example.
  • the network device After obtaining the IP packet from the first terminal device, the network device adds the identifier information to the first IP packet, where the identifier information is used to instruct the network device to generate the first data entry according to the information carried in the first IP packet. / or add 1 to the counter in the first data entry.
  • the information carried in the first IP packet includes a source IP address and a destination IP address of the first IP packet, or the information carried in the first IP packet includes a source IP address of the first IP packet. Destination IP address, source port number, and destination port number.
  • the network device may be the network device 10 shown in FIG. 1 of the embodiment of the present application.
  • the network device determines that the storage capacity is greater than the pre-determined rule.
  • the IP packet from the first terminal device obtained after the threshold is set, and the identification information is added.
  • the reverse congestion detection mechanism supported between the first terminal device and the network device may be pre-defined between the first terminal device and the network device.
  • the RECN flag for indicating the reverse congestion detection mechanism may be added to the packet transmitted between the first terminal device and the network device, which is not limited in this embodiment of the present application.
  • the RECN flag may be added to the packet in the manner of adding a new field, or may be added in a specific field, which is not limited in this embodiment of the present application.
  • the header of the first IP packet sent by the first terminal device to the network device includes an RECN flag, where the RECN flag is used to identify that the data flow to which the first IP packet belongs supports a reverse congestion detection mechanism.
  • the network device obtains the first IP packet from the first terminal device, and determines the setting information of the ECN FIELD in the packet header of the first IP packet.
  • the setting information of the ECN FIELD in the header of the first IP packet is "01"
  • it is determined that the first ECN label is ECT (1)
  • the header of the first IP packet is The set information of the ECN FIELD field in the middle is "10”
  • both ECT(0) and ECT(1) are used to identify that the RECN performs congestion detection when the first IP packet is congested in the network device.
  • the CE mark may be set in the second IP packet by adding a new field. If the ECN FIELD field exists in the header of the second IP packet, the "0" position in the ECT(1) or ECT(0) in the existing ECN FIELD field may be directly set. The ECN FIELD field is set to "11" to get the CE mark.
  • the network device receives the IP packet sent by the terminal device, and based on the reverse congestion detection mechanism supported between the network device and the terminal device, The CE flag is set on the IP packet, and then the terminal device is fed back.
  • the terminal device can directly determine that the packet transmission of the UE is congested by using the CE flag. Therefore, a congestion response is timely performed, and the transmission rate of the packet is reduced.
  • the packet processing method disclosed in the embodiment of the present application does not need to send a response to the peer device during the congestion detection, and does not need to rely on the terminal device itself to determine whether the timing of the corresponding packet is Timeouts reduce the time spent on congestion detection, which in turn reduces latency.
  • FIG. 6 is a schematic flowchart of another packet processing method according to an embodiment of the present application.
  • the first terminal device establishes a connection with the second terminal device based on the TCP.
  • different types of congestion detection mechanisms supported by the respective data streams are determined.
  • Different types of congestion detection mechanisms refer to sending different types of congestion notifications, including RECN and forward ECN.
  • the message processing method includes:
  • the first terminal device sends a third IP packet to the second terminal device via the network device.
  • the first terminal device may be the sender device shown in FIG. 1 of the embodiment of the present application.
  • the network device may be the network device shown in FIG. 1 of the embodiment of the present application.
  • the second terminal device may be the receiving end device shown in FIG. 1 of the embodiment of the present application.
  • the ECN FIELD in the header of the third IP packet is set to "00", that is, Not-ECT.
  • the Not-ECT is used to identify that when the third IP packet is congested in the network device, the ECT mechanism is not supported for congestion detection.
  • the ECN FIELD in the header of the third IP packet is set to "01", that is, ECT(1).
  • the ECT (1) is used to identify that when the third IP packet is congested in the network device, the RECT mechanism is supported for congestion detection.
  • the ECN FIELD in the header of the third IP packet is set to "10", that is, ECT (0).
  • the ECT (0) is used to identify that when the third IP packet is congested in the network device, the forward ECN mechanism is supported for congestion detection.
  • the ECN FIELD in the header of the third IP packet is set to "11", which is the CE.
  • the CE is used to identify that packets are congested during transmission.
  • S602 The network device obtains a third IP packet from the first terminal device, and determines a setting information of the ECN FIELD in the packet header of the third IP packet, where the setting information identifies the third IP packet.
  • S603-S604 is executed in the packet header, and S603-S604 is executed. If the setting information indicates that the packet header of the third IP packet includes the second ECN label, S605-S607 is performed; if the setting information is set If the header of the third IP packet is marked with a Not-ECT flag, then S608-S609 is performed.
  • the network device determines, according to a preset rule, that the congestion occurs as a third IP packet, and the network device determines that the first ECN flag included in the third IP packet header is ECT(1), Then, the network device sets a CE mark on the obtained third IP packet, obtains a second marked message, and sends the second marked message to the first terminal device.
  • the network device determines that the set in the received third IP packet header is “01”, and determines to perform the RECN mechanism for congestion detection.
  • the network device can set the CE mark on the third IP packet by using the method of setting the CE mark on the second IP packet as shown in FIG. 5 in the foregoing embodiment of the present application, to obtain the second mark message. And sending the second tagged message to the first terminal device.
  • the first terminal device obtains a second tagged message from the network device, and determines a data flow to which the second tagged message belongs, where the first terminal device performs a corresponding congestion detection mechanism supported by the determined data flow. Congestion processing.
  • the second tagged message includes a CE tag, where the CE tag is used to identify that congestion occurs in the packet transmission, and the second tagged message includes a source port number and a destination port number, where the source port number and the destination port number are used to identify The data stream to which the second marked message belongs.
  • the first terminal device After receiving the packet including the CE mark, the first terminal device can determine the data flow to which the packet belongs by using the source port number and the destination port number of the packet. The first terminal device performs corresponding corresponding congestion processing on the data stream at the first terminal device based on the congestion detection mechanism supported by the determined data stream.
  • the first terminal device determines that the packet sent by the first device is congested in the network device, performs a congestion response, and reduces the sending rate of the packet in the sent data stream. To achieve congestion control.
  • the network device determines, according to a preset rule, that the congestion occurs as a third IP packet, and the network device determines that the second ECN flag included in the third IP packet header is ECT(0). Then, the network device sets a CE mark on the obtained third IP packet, obtains a third marked message, and sends the third marked message to the first terminal device.
  • the network device determines that the set in the received third IP packet header is “10”, and determines to perform the forward ECN mechanism for congestion detection. Specifically, the set "10" in the third IP packet is changed to "11", and then sent to the second terminal device.
  • the second terminal device obtains the third tagged message from the network device, and sends an ACK message that adds a congestion flag to the TCP terminal to the first terminal device, and stops the first message after receiving the determining message sent by the first terminal device.
  • the terminal device sends an ACK message with a congestion flag.
  • the second terminal device determines, according to the source port number and the destination port number included in the third tagged message, the data flow to which the third tagged message belongs when receiving the third tagged message with the CE flag.
  • determining that the congestion notification type supported by the data flow is a forward ECN mechanism determines that congestion occurs at the opposite end. That is to say, the first terminal device is congested.
  • the first terminal device receives the ACK message carrying the congestion flag, sends a determination message to the second terminal device, and performs a corresponding congestion response.
  • the network device determines that the third IP packet header includes a Not-ECT flag, and when detecting that the network device is congested, performing packet loss processing according to the preset rule.
  • the network device determines that the set in the third IP packet header is “00”, and determines that the data flow does not support the ECT mechanism for congestion detection. Therefore, the network device performs packet loss processing. At this time, the second terminal device will not receive the packet that has been discarded, nor will it send an ACK message to the first terminal device. After the timer corresponding to the transmitted third IP packet expires, the first terminal device determines that the packet is lost, and determines that the network is congested, and then performs a congestion response.
  • the packet when receiving the packet marked by the CE sent by the network device, the packet may be in the packet marked with the CE.
  • the source port number and the destination port number are included, and the data stream to which the packet marked as the CE belongs is determined, and the type of congestion advertisement supported by the data stream is determined. If the data flow supports the forward ECN mechanism, it is determined that congestion occurs at the opposite end. If the data stream supports the RECT mechanism, it is determined that congestion has occurred.
  • different types of congestion detection mechanisms are supported due to different data flows sent between the first terminal device and the second terminal device.
  • the congestion detection mechanism supported by each data stream is distinguished based on different sets of ECN FIELD in the packet header.
  • the network device sets the congestion detection mechanism according to the ECN FIELD of the packet header in the received packet. Based on the manner in which different data streams support different congestion detection mechanisms, network devices can be more flexible when performing congestion detection.
  • the embodiment of the present application further discloses a network device that executes the packet processing method.
  • the network device 70 disclosed in the embodiment of the present application includes:
  • the processing unit 701 is configured to: when the network device is congested, obtain the source IP address and the destination IP address of the first IP packet from the first terminal device, and store the source IP address of the first IP packet in the first data table.
  • the destination IP address of the entry the destination IP address of the first IP packet is stored in the source IP address of the first data entry, and the second IP packet from the second terminal device is obtained, and the second IP packet is obtained.
  • the source IP address is the same as the source IP address in the first data entry, and the destination IP address of the second IP packet is the same as the destination address in the first data entry.
  • the first tagged message, the CE tag is used to identify that the network device is congested when transmitting a message.
  • the sending unit 702 is configured to send the first tagged message to the first terminal device.
  • the processing unit 701 further includes a counter
  • the counter is used to indicate the number of IP packets to be set by the CE, and the source IP address and destination of the IP packet to be set by the CE.
  • the IP address is the same as the source IP address and the destination IP address of the second IP packet.
  • the processing unit 701 is configured to: when each receives an IP packet with the same source IP address and destination IP address as the first IP packet, add 1 to the counter, and each time a second packet is obtained.
  • the counter is decremented by 1. The number of IP packets to be set by the CE is finally obtained.
  • a timer is also included in the first data entry created by the processing unit 701.
  • the processing unit 701 is further configured to: when the first data entry is generated or the counter in the first data entry is decremented by one, the timer resets the timing, and if the timer reaches the preset timing, the deletion is performed.
  • the first data item is described.
  • the processing unit 701 further includes a source port number and a destination port number
  • the processing unit 701 is further configured to: obtain the source port number and the destination port number in the first IP packet from the first terminal device, and store the source port number of the first IP packet in the first data entry.
  • the destination port number of the first IP packet is stored in the source port number of the first data entry, and the source IP address of the second IP packet and the source IP address in the first data entry are determined.
  • the destination IP address of the second IP packet is the same as the destination address of the first data entry, and the source port number of the second IP packet is the same as the source port number of the first data entry, and the second IP packet is used.
  • the destination port number of the text is the same as the destination port number in the first data entry, and the congestion is generated for the second IP packet.
  • the source IP address, the destination IP address, the source port number, and the destination port number of the IP packets to be set are the same as the source IP address, destination IP address, source port number, and destination port number of the second IP packet.
  • the processing unit 701 is configured to: when receiving an IP packet with the same source IP address, destination IP address, source port number, and destination port number as the first IP packet, increment the counter by one; When a IP packet with the same source IP address, destination IP address, source port number, and destination port number as the second IP packet is received, the counter is decremented by one.
  • the processing unit 701 is further configured to: after obtaining the first IP packet, add the identifier information to the first IP packet, where the identifier information is used to indicate that the network device carries the packet according to the first IP packet.
  • the information generates a first data entry and/or adds 1 to the counter in the first data entry.
  • the information carried in the first IP packet includes the source IP address and the destination IP address of the first IP packet, or the source IP address, the destination IP address, the source port number, and the destination port number of the first IP packet. .
  • the embodiment of the present application further discloses a first terminal device that executes the packet processing method.
  • FIG. 8 is a schematic structural diagram of the first terminal device 80 shown in the embodiment of the present application.
  • the first terminal device 80 includes a transmitting unit 801, a receiving unit 802, and a processing unit 803.
  • the sending unit 801 is configured to send a first IP packet to the network device, where the IP packet header of the first IP packet includes an RECN flag, and the RECN flag is used to identify that the data flow to which the first IP packet belongs supports reverse congestion detection. .
  • the receiving unit 802 is configured to receive a first tagged message from the network device, where the first tagged message includes a congestion occurrence CE tag, and the CE tag is used to identify that the network device is congested when transmitting the packet.
  • the processing unit 803 is configured to perform a congestion response based on the first marked message.
  • the data flow sent by the first terminal device 80 supports a reverse congestion detection mechanism and a forward congestion detection mechanism:
  • the receiving unit 802 is further configured to receive a second tagged message from the network device, where the second tagged message includes a CE tag;
  • the processing unit 803 is further configured to determine a source port number and a destination port number of the second tagged message, and determine, according to the source port number and the destination port number of the second tagged message, the data flow to which the second tagged message belongs;
  • the congestion detection mechanism supported by the data flow is a reverse congestion detection mechanism, and the first terminal device performs congestion processing on the data flow; if it is determined that the congestion detection mechanism supported by the data flow is a forward congestion detection mechanism, the network congestion is sent to the network device.
  • the ACK message is used to instruct the second terminal device to perform congestion processing on the data stream, and the ACK message includes a CE flag.
  • the network device and the first terminal device disclosed in the embodiments of the present application may also be directly implemented by hardware, a memory executed by a processor, or a combination of the two, in combination with the message processing method disclosed in the embodiment of the present application.
  • the present application further corresponds to the packet processing method disclosed in the foregoing embodiment of the present application, and discloses the network device 90 shown in FIG. 9 , such as the first terminal device 100 shown in FIG. 10 .
  • the network device 90 includes a memory 901, a bus 902, a processor 903, and an interface 904.
  • the interface 904 can be implemented by using a wireless or wired manner, and specifically can be an element such as a network card.
  • the memory 901, the processor 903, and the interface 904 are connected by a bus 902.
  • the interface 904 may specifically include a transmitter and a receiver, and is used for sending and receiving packets between the network device and the first terminal device and the second terminal device in the foregoing embodiment of the present application.
  • a transmitter and a receiver is used for sending and receiving packets between the network device and the first terminal device and the second terminal device in the foregoing embodiment of the present application.
  • the processor 903 is configured to execute the part of the foregoing application that the network device performs processing on the first IP packet and the second IP packet. The specific process can be seen, and will not be described here.
  • the memory 901 includes an operating system and an application program for storing operation programs, codes or instructions for message processing, and can be completed when the processor 903 or the hardware device calls and executes the programs, codes or instructions while executing the message processing.
  • 3- Figure 7 relates to the process of processing a message by a network device. For the specific process, reference may be made to the corresponding parts of the foregoing embodiment of the present application, and details are not described herein again.
  • Figure 9 only shows a simplified design of the network device.
  • the network device may include any number of interfaces, processors, memories, etc., and all network devices that can implement the present application are within the scope of the present application.
  • the embodiment of the present application provides a computer storage medium for storing computer software instructions used by the network device, which includes a program designed to execute the foregoing embodiment shown in FIG. 3-7.
  • FIG. 10 is a schematic structural diagram of hardware of a first terminal device 100 according to an embodiment of the present disclosure.
  • the first terminal device 100 shown in FIG. 10 can perform the corresponding steps performed by the first terminal device in the foregoing embodiment of the present application.
  • the first terminal device 100 includes a memory 1001, a bus 1002, a processor 1003, and an interface 1004.
  • the interface 1004 can be implemented by using a wireless or wired manner, and specifically can be an element such as a network card.
  • the memory 1001, the processor 1003, and the interface 1004 are connected by a bus 1002.
  • the interface 1004 may specifically include a transmitter and a receiver, and configured to send and receive a message between the first terminal device and the network device in the foregoing embodiment of the present application.
  • the specific process of the interface 1004 can be referred to the corresponding part of the packet sent and received between the first terminal device and the network device in the foregoing embodiment of the present application, and details are not described herein again.
  • the processor 1003 is configured to perform processing performed by the first terminal device in the foregoing application embodiment.
  • the processor 1003 is configured to perform a corresponding congestion response based on the received first marked message or the second marked message.
  • a corresponding congestion response based on the received first marked message or the second marked message.
  • the memory 1001 includes an operating system and an application program for storing a program, code, or instruction for message processing.
  • the processor 1003 or the hardware device executes and executes the message processing, the program, code, or instruction can be executed and executed.
  • the processing of the first terminal device is referred to in FIG. For the specific process, reference may be made to the corresponding parts of the foregoing embodiment of the present application, and details are not described herein again.
  • Figure 10 only shows a simplified design of the first terminal device.
  • the first terminal device may include any number of interfaces, processors, memories, etc., and all of the first terminal devices that can implement the present application are within the scope of the present application.
  • the embodiment of the present application provides a computer storage medium for storing computer software instructions used by the first terminal device, which includes a program designed to execute the foregoing embodiment shown in FIG. 3-7.
  • the network system 1100 for implementing a packet processing method disclosed in the embodiment of the present application mainly includes: a first terminal device 1101 and a network device 1102.
  • the network device 1102 may be specifically the network device disclosed in FIG. 7 and FIG. 9.
  • the specific process and the implementation principle may refer to the foregoing description, and details are not described herein.
  • the first terminal device 1101 may be specifically the first terminal device disclosed in FIG. 8 and FIG. 10.
  • the specific process and the implementation principle may refer to the foregoing description, and details are not described herein.
  • the network device after detecting the congestion, obtains the source IP address and the destination IP address of the first IP packet from the first terminal device. After the exchange, the source IP address and the destination IP address are stored in the first data entry, and the second IP packet with the same source IP address and destination IP address in the first data entry is obtained and set. The CE is marked, and the second IP packet is sent by the second terminal device.
  • the CE flag on the reverse-transmitted IP packet it is not required to send a response to the peer device during congestion detection, and it does not need to rely on the terminal device to determine whether the timing of the corresponding packet times out, and reduce congestion detection. Time, which in turn reduces latency.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

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

Abstract

本申请提供了一种报文处理方法、设备及系统,当网络设备发生拥塞时,获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址,进行互换后存储于第一数据表项中的源IP地址和目的IP地址中,再获得来自第二终端设备的第二IP报文,该第二IP报文的源IP地址与第一数据表项中的源IP地址相同,目的IP地址与第一数据表项中的目的IP地址相同,对第二IP报文设置CE标记,得到第一标记报文,并向第一终端设备发送该第一标记报文。在拥塞探测时,不需要发送给对端设备进行响应,也不需要依赖终端设备自身判断对应该报文的计时是否超时,从而实现提高拥塞探测的速率,降低延时的目的。

Description

报文处理方法、设备及系统
本申请要求于2017年1月18日提交中国专利局、申请号为201710039457.7、申请名称为“报文处理方法、设备及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其是,涉及一种报文处理方法、设备及系统。
背景技术
网络资源包括带宽、缓存空间和终端的处理能力等。在网络中依赖网络资源进行数据传输。一旦数据传输所需要的网络资源超出了当前可用的网络资源,网络会发生拥塞。因此,需要在数据传输的过程中对网络资源进行探测,并在数据流传输结束之前对探测到的网络拥塞进行响应,从而完成对网络拥塞的控制。
在进行网络拥塞控制的过程中,常用的拥塞探测方法为:隐式拥塞通告方法。该隐式拥塞通告方法基于传输控制协议(英文:Transmission Control Protocol,TCP)的可靠连接,在发送端设备通过网络设备向接收端设备发送报文的过程中,每发送一个报文开启一个计时器。当发送端设备接收到接收端设备反馈的响应(英文:Acknowledgement,ACK)消息后,关闭计时器。当报文在网络设备处发生拥塞时,网络设备直接丢弃该报文。因接收端设备未接收到该报文,则不向发送端设备反馈ACK消息。发送端设备未接收到该ACK消息,对应报文的计时器超时,即判断报文丢失,网络发生拥塞,发送端设备进行拥塞响应。上述拥塞探测的时间取决于TCP协议中超时重传的时间,一般大于一个往返时间(英文:Round Trip Time,RTT),探测时间较长。
目前数据网络中出现了越来越多短寿命数据流(英文:short-lived flow),且数据网络中承载的对传输时延敏感的业务也越来越多,因此需要更加快速灵敏的拥塞探测方法,以提升拥塞控制效率,降低时延。而现有技术中的拥塞探测方法耗时长,已经无法满足目前数据网络对于拥塞探测的要求。
发明内容
有鉴于此,本申请实施例提供一种报文处理方法、设备及系统,用于解决现有技术中拥塞探测耗时长的问题。
本申请实施例提供如下技术方案:
本申请实施例第一方面公开了一种报文处理方法,所述方法包括:
当网络设备发生拥塞时,所述网络设备获得来自第一终端设备的第一因特网协议IP报文的源IP地址和目的IP地址,将所述第一IP报文的源IP地址存储于第一数据表项的目的IP地址中,将所述第一IP报文的目的IP地址存储于所述第一数据表项的源IP地址中;
所述网络设备获得来自第二终端设备的第二IP报文,并确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的IP地址相同,对所述第二IP报文设置拥塞发生CE标记,得到第一标记报文,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
所述网络设备向所述第一终端设备发送所述第一标记报文。
上述方案,网络设备在检测到发生拥塞后,将获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址交换后,存储于第一数据表项中的源IP地址和目的IP地址中,基于此,获得与第一数据表项中的源IP地址和目的IP地址相同的第二IP报文,并设置CE标记,该第二IP报文为第二终端设备发送的。通过在反向传输的IP报文上设置CE标记,在拥塞探测时,不需要发送给对端设备进行响应,也不需要依赖终端设备自身判断对应该报文的计时是否超时,减少了拥塞探测的时间,进而降低时延。
在一种可能的设计中,所述第一数据表项中还包括计数器,所述计数器用于指示待设置CE标记的IP报文的个数,所述待设置CE标记的IP报文的源IP地址和目的IP地址与所述第二IP报文的源IP地址和目的IP地址分别相同。
获得所述待设置CE标记的IP报文的个数,包括:
所述网络设备每接收到一个与所述第一IP报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器加1;
所述网络设备每接收到一个与所述第二IP报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器减1。
上述方案,网络设备在第一数据表项中增加计数器,可以确定待设置CE标记的IP报文的个数,若个数越多则指示第一终端设备需要采取的拥塞响应的效率越高。此外,网络设备通过对计数器中的计数进行动态控制,可以有效的得到待设置CE标记的IP报文的个数。
在一种可能的设计中,所述第一数据表项中还包括计时器;
所述网络设备在生成所述第一数据表项或对所述第一数据表项中的计数器减1时,所述计时器重置计时;
若所述计时器的计时达到预设计时,所述网络设备删除所述第一数据表项。
上述方案,网络设备在第一数据表项中增加计时器,为老化第一数据表项的过程,可以在未获得待设置CE标记的IP报文时,及时删除该第一数据表项。进一步的,还可以解决在负载均衡的情况下,正向数据流和反向数据流可以路径不同的问题。
在一种可能的设计中,所述第一数据表项中还包括源端口号和目的端口号;
所述网络设备获得来自所述第一终端设备的第一IP报文中的源端口号和目的端口号,将所述第一IP报文的源端口号存储于所述第一数据表项的目的端口号中,将所述第一IP报文的目的端口号存储于所述第一数据表项的源端口号中;
相应地,所述网络设备确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的IP地址相同,对所述第二IP报文设置拥塞发生CE标记,包括:
确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述 第二IP报文的目的IP地址与所述第一数据表项中的目的IP地址相同,所述第二IP报文的源端口号与所述第一数据表项中的源端口号相同,所述第二IP报文的目的端口号与所述第一数据表项中的目的端口号相同,对所述第二IP报文设置拥塞发生CE标记。
上述方案,网络设备在第一数据表项中增加源端口号和目的端口号,可以解决相同的发送端设备和接收端设备之间存在不同数据流在网络设备处出现拥塞的情况。具有相同源端口号和目的端口号的数据流为同一数据流。
在一种可能的设计中,所述待设置CE标记的IP报文的源IP地址、目的IP地址、源端口号和目的端口号与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同;
相应地,获得所述待设置CE标记的IP报文的个数,包括:
所述网络设备每接收到一个与所述第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器加1;
所述网络设备每接收到一个与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器减1。
上述方案,网络设备在第一数据表项中增加计数器,可以确定待设置CE标记的IP报文的个数,若个数越多则指示第一终端设备需要采取的拥塞响应的效率越高。此外,网络设备通过对计数器中的计数进行动态控制,可以有效的得到待设置CE标记的IP报文的个数。
在一种可能的设计中,在所述网络设备获得第一IP报文之后,还包括:
所述网络设备对所述第一IP报文添加标识信息,所述标识信息用于指示所述网络设备根据所述第一IP报文携带的信息生成所述第一数据表项和/或对所述第一数据表项中的计数器加1;所述第一IP报文携带的信息包括所述第一IP报文的源IP地址和目的IP地址,或者所述第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号。
上述方案,网络设备对IP报文添加标识信息,有利于在当网络设备中存在上下行处理流程时,能够快速识别对哪些IP报文进行处理。
在一种可能的设计中,所述第一IP报文的IP报文头中包括反向显式拥塞通告RECN标记,所述RECN标记用于标识所述第一IP报文所属的数据流支持反向拥塞探测。
本申请实施例的第二方面公开了一种报文处理方法,适用于第一终端设备,若所述第一终端设备发送的数据流支持反向拥塞探测机制,所述方法包括:
第一终端设备向网络设备发送第一因特网协议IP报文,所述第一IP报文的IP报文头中包括反向显式拥塞通告RECN标记,所述RECN标记用于标识所述第一IP报文所属的数据流支持反向拥塞探测机制;
所述第一终端设备获得来自所述网络设备的第一标记报文,所述第一标记报文包括拥塞发生CE标记,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
所述第一终端设备基于所述第一标记报文执行拥塞响应。
上述方案,第一终端设备在向网络设备发送的IP报文中添加RECN标记,使网络 设备在接收到终端设备发送的IP报文,并基于其支持的RECN机制,通过在反向传输的IP报文上设置CE标记,然后反馈该终端设备,可以使终端设备直接通过该CE标记判断自身的报文传输发生拥塞。从而减少了拥塞探测的时间,进而降低时延。
在一种可能的设计中,若所述第一终端设备发送的数据流支持反向拥塞探测机制和正向拥塞探测机制,还包括:
所述第一终端设备获得来自所述网络设备的第二标记报文,所述第二标记报文包括所述CE标记;
所述第一终端设备确定所述第二标记报文的源端口号和目的端口号,基于所述第二标记报文的源端口号和目的端口号确定所述第二标记报文所属的数据流;
若所述第一终端设备确定所述数据流所支持的拥塞探测机制为反向拥塞探测机制,所述第一终端设备执行对所述数据流的拥塞处理;
若所述第一终端设备确定所述数据流所支持的拥塞探测为正向拥塞探测机制,则向所述网络设备发送响应ACK消息,所述ACK消息用于指示第二终端设备执行对所述数据流的拥塞处理,所述ACK消息中包括CE标记。
上述方案,第一终端设备在发送报文时,基于在报文头中ECN FIELD的不同置位,区分各个数据流所支持的拥塞探测机制。网络设备根据接收到的报文中的报文头的ECN FIELD不同置位,执行相应地拥塞探测机制。基于不同数据流支持不同拥塞探测机制的方式,使网络设备在执行拥塞探测时,能够更加灵活。
本申请实施例的第三方面公开了一种网络设备,包括:
处理单元,用于若所述网络设备发生拥塞时,获得来自第一终端设备的第一因特网协议IP报文的源IP地址和目的IP地址,将所述第一IP报文的源IP地址存储于第一数据表项的目的IP地址中,将所述第一IP报文的目的IP地址存储于所述第一数据表项的源IP地址中,以及获得来自第二终端设备的第二IP报文,所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的地址相同,对所述第二IP报文设置拥塞发生CE标记,得到第一标记报文,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
发送单元,用于向所述第一终端设备发送所述第一标记报文。
在一种可能的设计中,所述第一数据表项中还包括计数器,所述计数器用于指示待设置CE标记的IP报文的个数,所述待设置CE标记的IP报文的源IP地址和目的IP地址与所述第二IP报文的源IP地址和目的IP地址分别相同;
相应地,所述处理单元,用于每接收到一个与所述第一IP报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器加1,以及每得到一个与所述第二报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器减1。
在一种可能的设计中,所述第一数据表项中还包括计时器;
所述处理单元,还用于在生成所述第一数据表项或对所述第一数据表项中的计数器减1时,所述计时器重置计时,若所述计时器的计时达到预设计时,删除所述第一数据表项。
在一种可能的设计中,所述第一数据表项中还包括源端口号和目的端口号;
所述处理单元,还用于获取来自所述第一终端设备的第一IP报文中的源端口号和 目的端口号,将所述第一IP报文的源端口号存储于所述第一数据表项的目的端口号中,将所述第一IP报文的目的端口号存储于所述第一数据表项的源端口号中;以及确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的地址相同,确定所述第二IP报文的源端口号与所述第一数据表项中的源端口号相同,所述第二IP报文的目的端口号与所述第一数据表项中的目的端口号相同,对所述第二IP报文设置拥塞发生CE标记。
在一种可能的设计中,所述待设置CE标记的IP报文的源IP地址、目的IP地址、源端口号和目的端口号与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同;
相应地,所述处理单元,用于每接收到一个与所述第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器加1;每接收到一个与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器减1。
在一种可能的设计中,所述处理单元,还用于在获得所述第一IP报文之后,对所述第一IP报文添加标识信息,所述标识信息用于指示所述网络设备根据所述第一IP报文携带的信息生成所述第一数据表项和/或对所述第一数据表项中的计数器加1;所述第一IP报文携带的信息包括所述第一IP报文的源IP地址和目的IP地址,或者所述第一IP报文的源IP地址、目的IP地址,源端口号和目的端口号。
本申请实施例的第四方面公开了一种网络设备,包括:存储器,以及与所述存储器通信的处理器;
所述存储器,用于存储处理报文的程序代码;
所述处理器,用于执行所述存储器保存的程序代码,以实现上述第一方面以及各种可能的设计中的操作。
本申请实施例的第五方面公开了一种终端设备,用作第一终端设备,若所述第一终端设备发送的数据流支持反向拥塞探测机制,所述第一终端设备包括:
发送单元,用于向网络设备发送第一因特网协议IP报文,所述第一IP报文的IP报文头中包括反向显式拥塞通告RECN标记,所述RECN标记用于标识所述第一IP报文所属的数据流支持反向拥塞探测;
接收单元,用于接收来自所述网络设备的第一标记报文,所述第一标记报文包括拥塞发生CE标记,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
处理单元,用于基于所述第一标记报文执行拥塞响应。
在一种可能的设计中,若所述第一终端设备发送的数据流支持反向拥塞探测机制和正向拥塞探测机制;
所述接收单元,还用于接收来自所述网络设备的第二标记报文,所述第二标记报文包括CE标记;
所述处理单元,还用于确定所述第二标记报文的源端口号和目的端口号,并基于所述第二标记报文的源端口号和目的端口号确定所述第二标记报文所属的数据流;若确定所述数据流所支持的拥塞探测机制为反向拥塞探测机制,则所述第一终端设备执行对所述数据流的拥塞处理;若确定所述数据流所支持的拥塞探测机制为正向拥塞探 测机制,则向所述网络设备发送响应ACK消息,所述ACK消息用于指示第二终端设备执行对所述数据流的拥塞处理,所述ACK消息中包括CE标记。
在本申请实施例的第六方面公开了一种终端设备,用作第一终端设备,所述第一终端设备发送的数据流支持反向拥塞探测机制,或者,所述第一终端设备发送的数据流可以支持反向拥塞探测机制,也可以支持正向拥塞探测机制,所述第一终端设备包括:存储器,以及与所述存储器通信的处理器;
所述存储器,用于存储处理报文的程序代码;
所述处理器,用于执行所述存储器保存的程序代码,以实现上述第二方面以及各种可能的设计中的操作。
本申请实施例的第七方面公开了一种网络系统,包括:第一终端设备和网络设备;
所述网络设备为上述第三方面或第四方面所述的网络设备;
所述第一终端设备可以为上述第五方面或第六方面所述的终端设备。
本申请实施例的第八方面提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序包括用于执行第一方面、第二方面、第一方面的任一可能的设计或第二方面的任一可能的设计中的方法的指令。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例公开的一种端到端的网络连接示意图;
图2为本申请实施例公开的网络设备的结构示意图;
图3为本申请实施例公开的一种报文处理方法的流程示意图;
图4为本申请实施例公开的另一种报文处理方法的流程示意图;
图5为本申请实施例公开的另一种报文处理方法的流程示意图;
图6为本申请实施例公开的另一种报文处理方法的流程示意图;
图7为本申请实施例公开的一种网络设备的结构示意图;
图8为本申请实施例公开的一种第一终端设备的结构示意图;
图9为本申请实施例公开的另一种网络设备的结构示意图;
图10为本申请实施例公开的另一种第一终端设备的结构示意图;
图11为本申请实施例公开的一种网络系统的结构示意图。
具体实施方式
本申请实施例提供了一种报文处理方法、网络设备和系统,用于缩短拥塞探测时间,降低网络拥塞控制带来的时延,并为传输短寿命数据流和对传输时延敏感的业务提供有利条件。
本申请实施例和权利要求书及附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”不是排他的。例如,包括了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已 列出的步骤或单元,还可以包括没有列出的步骤或单元。
本申请实施例公开的报文处理方法通过以下具体实施例进行详细说明。
如图1所示,为本申请实施例公开的一种端到端的网络连接示意图。该示意图中包括:网络设备10,发送端设备11和接收端设备12。发送端设备11和接收端设备12通过网络设备10进行报文交互。
本申请实施例所公开的报文处理方法应用于因特网协议(英文:Internet Protocol,IP)层,发送端设备11向接收端设备发送的报文封装为IP报文格式。可选的,在该IP报文头中标记拥塞探测中所涉及的信息。IP报文头的部分格式如表1所示。
表1:IP报文头部分格式
Figure PCTCN2018072913-appb-000001
显式拥塞通告字段(英文:Explicit Congestion Notification FIELD,ECN FIELD),占用第6bit位和第7bit位,利用不同的置位标记拥塞探测中的不同信息。如表2所示,为针对ECN FIELD所进行的置位,以及置位所对应的支持拥塞探测的机制。
表2:ECN FIELD置位及其标识含义
Figure PCTCN2018072913-appb-000002
在表2中,“00”:用于标识当报文在网络设备中发生拥塞时,不支持ECN,即Not-ECT。
“01”和“10”:当发送端设备,网络设备和接收端设备之间仅支持反向拥塞探测机制,即反向显式拥塞通告(英文:Reverse Explicit Congestion Notification,RECN)机制时,“01”和“10”均用于标识当报文在传输过程中发生拥塞时,支持RECN机制,即ECT(0)和ECT(1)都表示支持RECN机制。
在发送端设备,网络设备和接收端设备之间即支持RECN机制,也支持正向ECN机制的情况下,当置位为“01”,即ECT(1)时,用于标识报文在传输过程中发生拥塞时支持RECN机制。当置位为“10”,即ECT(0)时,用于标识报文在传输过程中发生拥塞时支持正向ECN机制。当然本申请实施例也并不仅限于此,在支持多种探测机制的情况下,ECN FIELD所进行的置位只要能够区分RECN机制和正向ECN机制即可。
“11”:用于标识网络设备在传输报文时发生了拥塞(英文:Congestion Experienced,CE)。
作为举例,如图2所示,为本申请实施例公开的网络设备10的结构示意图。该网络设备10包括:上行单板201,交换网板202和下行单板203。
上行单板201包括:上行物理接口卡(英文:Physical Interface Card,PIC),与上行PIC连接的上行包转发引擎(英文:Packet Forwarding Engines,PFE),与上行PFE连接的上行流量管理器(英文:Traffic Manager,TM),与上行TM连接的上行转发信息表(英文:Forwarding Information Base,FIC),该上行FIC与交换网板202连接。
下行单板203包括:与交换网板202连接的下行FIC,与下行FIC连接的下行TM,与下行TM连接的下行PFE,与下行PFE连接的下行PIC。
需要说明的是,本发明实施例中的上行单板和下行单板是针对某个数据报文在网络设备内部转发流程的角度来说的。上行单板(即转发单板)是该数据报文进入该网络设备的接口(即入接口)所在的单板,通过上行单板的转发处理将该报文发送到交换网板(也叫交换网卡)。通过交换网板的交换,将该数据报文发送到下行单板,该下行单板执行转发处理,通过出接口把该数据报文从该网络设备上发送出去。故下行单板是该数据报文离开该网络设备的接口(即出接口)所在的单板。由此可以看出,上行是指从网络设备接收一个数据报文向交换网板转发的流向,下行是指从交换网板到将一个数据报文从网络设备上转发出去的流向。应理解,同一块单板针对于一个数据报文来说,可以是上行单板;而针对另一个数据报文来说,也可以是下行单板。还应理解,当一个数据报文经过一个网络设备时的入接口和出接口在同一个单板上时,针对该数据报文来说,上行单板和下行单板是指同一块单板。
本申请实施例中,发送端设备11经过网络设备10向接收端设备12发送报文。当报文在网络设备10中发生拥塞,由网络设备10对报文设置CE标记,并直接反馈给发送端设备,相较于现有技术,不需要经过接收端设备,从而缩短了至少一半的拥塞探测时间。
在本申请实施例中,网络设备可以是路由器,也可以是交换机等用于转发处理的设备。
如图3所示,为本申请实施例公开的一种报文处理方法的流程示意图,在本申请该实施例中,第一终端设备基于TCP建立与第二终端设备之间的连接。第一终端设备与第二终端设备之间的数据流只支持反向拥塞探测机制。该报文处理方法包括:
S301:第一终端设备经过网络设备向第二终端设备发送数据流中的IP报文。
作为举例,该第一终端设备,可以为本申请实施例图1中示出的发送端设备。该网络设备,可以为本申请实施例图1中示出的网络设备。该第二终端设备,可以为本申请实施例图1中示出的接收端设备。
该数据流由多个IP报文构成。以接收到数据流中的一个IP报文为例进行说明。
S302:网络设备在检测到网络设备发生拥塞时,网络设备获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址,将该第一IP报文的源IP地址存储于第一数据表项的目的IP地址中,将该第一IP报文的目的IP地址存储于第一数据表项的源IP地址中。
作为举例,网络设备通过检测存储队列中的存储容量是否大于预设阈值,确定网络设备是否发生拥塞。当检测到存储队列中的存储容量大于预设阈值时,确定网络设备发生拥塞。该预设阈值通常小于存储队列的总容量,该网络设备的存储队列的总容量与网络设备本身有关,不同的网络设备存储队列的总容量不同。存储队列的容量不仅可以以包的个数来表示,也可以以KB大小来表示。
网络设备在检测到发生了拥塞后,按照预设规则确定发生拥塞的IP报文。该预设规则与网络设备采用什么方式对接收到的报文进行存储有关。例如:网络设备采用一个存储队列的方式存储接收到的不同IP报文,也可以采用分类的方式,将接收到的IP报文按照所属数据流的不同,进行分类存储于对应的存储队列中。
在网络设备检测到存储队列中的存储容量大于预设阈值时,基于该预设规则选择当前发生拥塞的报文。该预设规则包括主动队列管理(英文:Active Queue Management,AQM)中的各种方法。作为举例,该预设规则包括:随机早期检测(random early detection,RED),延迟控制(英文:Controlled Delay,Co DEL)和比例积分增强(英文:Proportional Integral Enhanced,PIE),即队尾丢弃算法。
该第一数据表项属于网络设备的数据表中的一条表项,该数据表的每一列对应一个项,每一行对应一个数据表项。该数据表可以由网络设备预先建立,也可以在使用时再建立。同样的,该数据表中的数据表项也可以由网络设备预先建立,也可以在网络设备获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址时,再进行建立。
该数据表如表3所示,项的类型包括:报文的源IP(英文:Source IP,SIP)地址和目的IP(英文:Destination,DIP)地址。其中,还可以设置表项编号(ID)。
作为举例,第一行为第一数据表项。
表3
Figure PCTCN2018072913-appb-000003
网络设备为了后续采用反向拥塞探测机制进行拥塞探测。网络设备获取第一IP报文的源IP地址和目的IP地址,然后在存储于表3示出的第一数据表项时,将获取的第一IP报文的源IP地址和目的IP报文进行交换后存储,以便于后续查询反向传输的IP报文进行标记。
S303:网络设备获得来自第二终端设备的第二IP报文,并确定第二IP报文的源IP地址与第一数据表项中的SIP地址相同,第二IP报文的目的IP地址与第一数据表项中的DIP地址相同,对第二IP报文设置CE标记,得到第一标记报文。
该CE标记用于标识网络设备在传输报文时发生了拥塞。
S304:网络设备向第一终端设备发送第一标记报文。
S305:第一终端设备获得来自网络设备的第一标记报文,基于该第一标记报文执行拥塞响应。
拥塞响应有多种方式,在本申请实施例中,第一终端设备、第二终端设备和网络设备之间仅支持反向拥塞探测机制。因此,该第一终端设备基于该第一标记报文,确 定自身发送的IP报文在网络设备处发生了拥塞。由此,第一终端设备对向网络设备发送的数据流进行拥塞处理,该拥塞处理包括:降低数据流中IP报文的发送速率,或者对传输的数据流进行丢包处理,或者,停止某一数据流的传输。对于该第一种终端设备对数据流所执行的拥塞处理,本申请实施例并不进行具体限定,所执行的拥塞处理只要可以缓解网络设备的拥塞状态即可。
基于上述本申请实施例公开的以第一IP报文进行举例说明的报文处理方法,在具体应用中,网络设备在确定发生拥塞后,可选的,可以对发生拥塞后接收到的所有IP报文进行处理,也可以对部分IP报文进行处理。
在具体实现过程中,该网络设备获取存储容量大于预设阈值之后接收到的IP报文进行处理。作为举例,若该网络设备的存储队列的总容量为最大存储100个报文,该预设阈值为50个IP报文。在存储队列中所存储的报文超过50个时,从第51个IP报文开始进行处理。
因此,结合表3,在数据表中的项还包括计数器,如表4所示。网络设备每接收到一个与第一IP报文的源IP地址和目的IP地址分别相同的IP报文时,将计数器加1;网络设备每接收到一个与第二IP报文的源IP地址和目的IP地址分别相同的IP报文时,将计数器减1。
最终,该计数器中的计数用于指示待设置CE标记的IP报文的个数,该待设置CE标记的IP报文的源IP地址与第二IP报文的源IP地址相同,待设置CE标记的IP报文的目的IP地址与第二IP报文的目的IP地址相同。
表4
Figure PCTCN2018072913-appb-000004
在该第一数据表中,SIP中存储的是发生了拥塞的IP报文的目的IP地址,作为后续需要设置CE标记的IP报文的源IP地址。
DIP中存储的是发生了拥塞的IP报文的源IP地址,作为后续需要设置CE标记的IP报文的目的IP地址。
个数(英文:Number,Num),用于指示计数器,该Num中存储的是需要设置CE标记的IP报文的个数。该Num中的数值是动态变化的,网络设备在存储容量大于预设阈值之后每获取一个IP报文,则对该Num表项中的数值进行加1。网络设备每设置一个CE标记,则对该Num表项中的数值进行减1。
作为举例,该网络设备可以为本申请实施例图1中示出的网络设备10。则网络设备在本申请实施例图2中示出的下行PFE中获取的来自第二终端设备的IP报文中的源IP地址和目的IP地址,将该IP报文中的目的IP地址存储于SIP地址中,将该IP报文中的源IP地址存储于DIP地址中,并同时更新Num。
基于上述本申请实施例公开的报文处理方法,结合表4示出的数据表,若第一数据表项中还包括计时器(英文:Timer),具体如表5所示。
以网络设备对获得的来自第一终端设备的第一IP报文进行处理,以及对网络设备获得来自第二终端设备的第二IP报文设置CE标记,得到第一标记报文的过程为例进行说明,如图4所示,该报文处理方法包括:
S401:网络设备获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址,将第一IP报文中的目的IP地址存储于第一数据表项的SIP地址中,将第一IP报文中的源IP地址存储于第一数据表项的DIP地址中,并将第一数据表项的Num加1,第一数据表项的Timer重置计时。
表5
Figure PCTCN2018072913-appb-000005
网络设备在表4示出的数据表中增加一项Timer,其他项相同,可以参见表4中的记载,这里不再进行赘述。在此,仅对第一数据表项中的Timer进行详细说明。
Timer中对应的值为针对一个报文的计时。
Timer为动态变化的。网络设备在生成第一数据表项或对第一数据表项中的Num减1时,该Timer重置计时。可选的,网络设备可以设置该Timer中的最大计时为1个RTT。
可选的,网络设备可以采用正向计时方式,也可以采用倒计时的方式。
S402:在计时器计时过程中,网络设备获得来自第二终端设备的第二IP报文,该第一数据表项中的Num数值减1,Timer重置计时。
该第二IP报文的源IP地址与第一数据表项中的SIP地址相同,第二IP报文的目的IP地址与第一数据表项中的DIP地址相同。
S403:网络设备对第二IP报文设置CE标记,得到第一标记报文。
网络设备执行S403所依据的原理以及具体执行过程与本申请实施例中图3公开的S304记载的内容相同,这里不再进行赘述。
S404:在Timer计时过程中,若Timer的计时达到预设计时,网络设备删除第一数据表项。
在Timer计时过程中,若网络设备一直未获得来自第二终端设备的第二IP报文,或者源IP地址与第一数据表项中的SIP地址相同,目的IP地址与第一数据表项中的DIP地址相同的IP报文,则Timer计时在达到预设计时,网络设备将删除第一数据表项。
可选的,在计时器计时的过程中,若网络设备采用正计时方式,则预设计时等于预先设置的该Timer表项中的计时器的最大计时;若网络设备采用倒计时方式,则预设计时则为0。
作为举例,预先设置Timer的计时为0.25秒。若网络设备采用正向计时方式,则在重置计时后从0开始递增计时,当计时达到0.25秒或超过0.25秒时,则网络设备删除第一数据表项;若网络设备采用倒计时的方式,则在重置计时后从0.25秒开始递减计时,当计时达到0,则网络设备删除第一数据表项。
基于上述本申请实施例公开的报文处理方法,结合表3示出的数据表,若第一数据表项中还包括源端口(SPort)号和目的端口(DPort)号,具体如表6所示。
以网络设备对获得的来自第一终端设备的第一IP报文进行处理,以及对网络设备获得来自第二终端设备的第二IP报文设置CE标记,得到第一标记报文的过程为例进行说明,如图5所示,该报文处理方法包括:
S501:网络设备获取来自第一终端设备发送的第一IP报文中的源IP地址,目的IP地址,源端口号和目的端口号,将第一IP报文的目的IP地址存储于第一数据表项的SIP地址中,将第一IP报文的源IP地址存储于第一数据表项的DIP地址中,将第一IP报文的源端口号存储于第一数据表项的DPort中,将第一IP报文的目的端口号存储于第一数据表项的SPort中。
在本申请实施例中,相较于表3,该第一数据表项中增加了DPort和SPort,其他与本申请实施例公开的表3相同,可以参见上述记载,这里不再进行赘述。
在本申请实施例中,网络设备获得到第一终端设备的第一IP报文的源端口号和目的端口号进行存储,可以在后续查找需要设置CE标记的反向报文时,确定设置CE标记的报文与第一IP报文属于同一个数据流。
表6
Figure PCTCN2018072913-appb-000006
若第一数据表项中还包括Num项,则网络设备在执行S501的过程中,对第一数据表项的Num中的数值加1。即网络设备每接收到一个与第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将Num中的数值加1。
若第一数据表项中还包括Timer项,则网络设备在执行S501的过程中,Timer进行计时。
S502:网络设备获得来自第二终端设备的第二IP报文,并确定第二IP报文的源IP地址与第一数据表项中的SIP地址相同,第二IP报文的目的IP地址与第一数据表项中的DIP地址相同,第二IP报文的源端口号与第一数据表项中的SPort相同,第二IP报文的目的端口号与第一数据表项中的DPort相同,第二IP报文设置CE标记,得到第一标记报文。
本申请实施例中,该S502对第二IP报文设置CE标记的过程与图3所对应的实施例中S304所记载的过程相同,这里不再进行赘述。
若第一数据表项中还包括Num项,则网络设备在执行S502的过程中,对第一数据表项的Num中的数值减1。即网络设备每接收到一个与第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将Num中的数值减1。
S503:网络设备向第一终端设备发送第一标记报文。
S504:第一终端设备接收该第一标记报文,并依据该第一标记报文执行拥塞响应。
本申请实施例中,该S504中第一终端设备依据第一标记报文执行拥塞响应的过程, 与图3所对应的实施例中S306所记载的过程相同,这里不再进行赘述。
基于上述本申请实施例公开的报文处理方法,可选的,可以对需要进行处理的IP报文添加标识信息。该标识信息的形式并不进行具体限定,可以是任意形式。
在具体实现过程中,网络设备在获得来自第一终端设备的IP报文之后,对该IP报文添加标识信息,该标识信息用于指示网络设备根据IP报文携带的信息生成第一数据表项和/或对第一数据表项中的计数器加1。可选的,该IP报文携带的信息包括IP报文的源IP地址和目的IP地址;或者,该IP报文携带的信息包括IP报文的源IP地址、目的IP地址、源端口号和目的端口号。
以网络设备获得的来自第一终端设备的第一IP报文为例。网络设备在获得来自第一终端设备的IP报文之后,对该第一IP报文添加标识信息,该标识信息用于指示网络设备根据第一IP报文携带的信息生成第一数据表项和/或对第一数据表项中的计数器加1。可选的,该第一IP报文携带的信息包括第一IP报文的源IP地址和目的IP地址;或者,该第一IP报文携带的信息包括第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号。
作为举例,该网络设备可以为本申请实施例图1中示出的网络设备10,则网络设备在本申请实施例图2中示出的上行TM中,对依据预设规则确定存储容量大于预设阈值之后获得的来自第一终端设备的IP报文,添加标识信息。
基于上述本申请实施例公开的报文处理方法,在本申请实施例中,第一终端设备和网络设备之间所支持的反向拥塞探测机制,可以在第一终端设备和网络设备之间预先进行设定,也可以在第一终端设备和网络设备之间传输的报文中添加用于指示反向拥塞探测机制的RECN标记,本申请实施例对此并不进行限定。该RECN标记可以采用新增字段的方式,设置于报文中,也可以在特定的字段中进行添加,本申请实施例对此并不进行限定。
可选的,第一终端设备向网络设备发送的第一IP报文的报文头中包括RECN标记,该RECN标记用于标识该第一IP报文所属的数据流支持反向拥塞探测机制。网络设备获得来自第一终端设备的第一IP报文,确定该第一IP报文的报文头中ECN FIELD的置位信息。
作为举例,若第一IP报文的报文头中ECN FIELD的置位信息为“01”,则确定该第一ECN标记为ECT(1),或者,若第一IP报文的报文头中的ECN FIELD字段的置位信息为“10”,则确定该第一ECN标记为ECT(0)。在本申请实施例中,ECT(0)和ECT(1)均用于标识当该第一IP报文在网络设备中发生拥塞时,支持RECN进行拥塞探测。
可选的,在网络设备对获得的来自第二终端设备的第二IP报文设置CE标记时,该CE标记可以采用新增字段的方式,设置于第二IP报文中。若第二IP报文的报文头中存在ECN FIELD字段,也可以直接将已有ECN FIELD字段中的ECT(1)或ECT(0)中的“0”位置1。即将ECN FIELD字段置位为“11”,得到CE标记。
基于上述本申请实施例公开的报文处理方法,网络设备在接收到终端设备发送的 IP报文,并基于网络设备和终端设备之间所支持的反向拥塞探测机制,通过在反向传输的IP报文上设置CE标记,然后反馈该终端设备,可以使终端设备直接通过该CE标记判断自身的报文传输发生拥塞。从而及时做出拥塞响应,降低该报文的发送速率。相比较于现有技术而言,本申请实施例公开的报文处理方法,在拥塞探测时,不需要发送给对端设备进行响应,也不需要依赖终端设备自身判断对应该报文的计时是否超时,减少了拥塞探测的时间,进而降低时延。
如图6所示,为本申请实施例公开的另一种报文处理方法的流程示意图,在本申请实施例中,第一终端设备基于TCP建立与第二终端设备之间的连接。且第一终端设备与第二终端设备之间发送不同数据流时,确定各个数据流所支持的不同类型拥塞探测机制。不同类型拥塞探测机制指发送不同类型的拥塞通告,该拥塞通告类型包括RECN和正向ECN。该报文处理方法包括:
S601:第一终端设备经过网络设备向第二终端设备发送第三IP报文。
作为举例,该第一终端设备,可以为本申请实施例图1中示出的发送端设备。该网络设备,可以为本申请实施例图1中示出的网络设备。该第二终端设备,可以为本申请实施例图1中示出的接收端设备。
作为举例,在本申请实施例中,不同类型拥塞探测机制为:
该第三IP报文的报文头中ECN FIELD的置位为“00”,即Not-ECT。该Not-ECT用于标识当该第三IP报文在网络设备中发生拥塞时,不支持ECT机制进行拥塞探测。
该第三IP报文的报文头中ECN FIELD的置位为“01”,即ECT(1)。该ECT(1)用于标识当该第三IP报文在网络设备中发生拥塞时,支持RECT机制进行拥塞探测。
该第三IP报文的报文头中ECN FIELD的置位为“10”,即ECT(0)。该ECT(0)用于标识当该第三IP报文在网络设备中发生拥塞时,支持正向ECN机制进行拥塞探测。
该第三IP报文的报文头中ECN FIELD的置位为“11”,即CE。该CE用于标识报文在传输过程中发生拥塞。
S602:网络设备获得来自第一终端设备的第三IP报文,确定该第三IP报文的报文头中的ECN FIELD的置位信息,若该置位信息标识该第三IP报文的报文头中包含第一ECN标记,则执行S603-S604;若该置位信息标识该第三IP报文的报文头中包含第二ECN标记,则执行S605-S607;若该置位信息标识该第三IP报文的报文头中包含Not-ECT标记,则执行S608-S609。
S603:网络设备在检测网络设备发生拥塞时,依据预设规则确定发生拥塞的为第三IP报文,网络设备确定该第三IP报文头中包含的第一ECN标记为ECT(1),则该网络设备对获取到的第三IP报文设置CE标记,得到第二标记报文,并将该第二标记报文发送给第一终端设备。
基于设备之间支持不同类型拥塞探测机制的置位,网络设备确定接收到的第三IP报文头中的置位为“01”,则确定执行RECN机制进行拥塞探测。作为举例,网络设备可以采用上述本申请实施例图5中示出的对第二IP报文设置CE标记的方式,对第三IP报文设置CE标记,得到第二标记报文。并将该第二标记报文发送给第一终端设备。
S604:第一终端设备获得来自网络设备的第二标记报文,确定该第二标记报文所属于的数据流,该第一终端设备基于该确定的数据流所支持的拥塞探测机制,执行相应地拥塞处理。
该第二标记报文包括CE标记,该CE标记用于标识报文传输中发生了拥塞,该第二标记报文包括源端口号和目的端口号,该源端口号和目的端口号用于标识该第二标记报文所属的数据流。
在第一终端设备接收到包括CE标记的报文后,可以通过该报文的源端口号和目的端口号确定该报文所属于的数据流。第一终端设备基于该确定的数据流所支持的拥塞探测机制,在第一终端设备对该数据流执行相应的相应地拥塞处理。
可选的,当第一终端设备确定该数据流支持RECN,则第一终端设备确定自己发送的报文在网络设备中发生拥塞,执行拥塞响应,降低发送该数据流中的报文的发送速率,实现拥塞控制。
S605:网络设备在检测到网络设备发生拥塞时,依据预设规则确定发生拥塞的为第三IP报文,网络设备确定第三IP报文头中包含的第二ECN标记为ECT(0),则该网络设备对获取到的第三IP报文设置CE标记,得到第三标记报文,并将该第三标记报文发送给第一终端设备。
基于设备之间支持不同类型拥塞探测机制的置位,网络设备确定接收到的第三IP报文头中的置位为“10”,则确定执行正向ECN机制进行拥塞探测。具体为:将第三IP报文中的置位“10”更改为“11”,然后发送给第二终端设备。
S606:第二终端设备获得来自网络设备的第三标记报文,向第一终端设备发送在TCP头部添加拥塞标记的ACK消息,直至接收到第一终端设备发送的确定消息后停止向第一终端设备发送具有拥塞标记的ACK消息。
第二终端设备在接收到设置CE标记的第三标记报文时,可以根据该第三标记报文包括的源端口号和目的端口号,确定该第三标记报文所属的数据流。作为举例,确定该数据流所支持的拥塞通告类型为正向ECN机制,则确定对端发生拥塞。也就是说,第一终端设备发生拥塞。
S607:第一终端设备接收到携带有拥塞标记的ACK消息,向该第二终端设备发送确定消息,并进行相应地拥塞响应。
S608:网络设备确定第三IP报文头中包含Not-ECT标记,则在检测到网络设备发生拥塞时,依据预设规则进行丢包处理。
基于设备之间支持不同类型拥塞探测机制的置位,网络设备确定获得的第三IP报文头中的置位为“00”,则确定该数据流不支持ECT机制进行拥塞探测。因此,网络设备执行丢包处理。此时,第二终端设备将不会接收到已经被丢弃的报文,也不会向第一终端设备发送ACK消息。第一终端设备在传输的第三IP报文对应的计时器超时后,即判断报文丢失,确定网络发生拥塞,则进行拥塞响应。
可选的,若第一终端设备为本申请实施例图1中示出的接收端设备,则在接收到网络设备发送的标记为CE的报文时,可以根据该标记为CE的报文中包括的源端口号和目的端口号,确定该标记为CE的报文所属的数据流,以及确定该数据流所支持的拥塞通告类型。若该数据流支持正向ECN机制,则确定对端发生拥塞。若该数据流支 持RECT机制,则确定自己发生拥塞。
在本申请实施例中,因第一终端设备与第二终端设备之间发送的不同数据流,支持不同类型拥塞探测机制。在本申请实施例中作为发送端设备的第一终端设备在发送报文时,基于在报文头中ECN FIELD的不同置位,区分各个数据流所支持的拥塞探测机制。网络设备根据接收到的报文中的报文头的ECN FIELD不同置位,执行相应地拥塞探测机制。基于不同数据流支持不同拥塞探测机制的方式,使网络设备在执行拥塞探测时,能够更加灵活。
基于上述本申请实施例一公开的报文处理方法,本申请实施例还对应公开了执行该报文处理方法的网络设备。
如图7所示,本申请实施例公开的网络设备70包括:
处理单元701,用于若网络设备发生拥塞时,获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址,将第一IP报文的源IP地址存储于第一数据表项的目的IP地址中,将第一IP报文的目的IP地址存储于第一数据表项的源IP地址中,以及获得来自第二终端设备的第二IP报文,第二IP报文的源IP地址与第一数据表项中的源IP地址相同,第二IP报文的目的IP地址与第一数据表项中的目的地址相同,对第二IP报文设置拥塞发生CE标记,得到第一标记报文,CE标记用于标识所述网络设备在传输报文时发生了拥塞。
发送单元702,用于向第一终端设备发送第一标记报文。
若处理单元701所建立的第一数据表项中还包括计数器,该计数器用于指示待设置CE标记的IP报文的个数,所述待设置CE标记的IP报文的源IP地址和目的IP地址与所述第二IP报文的源IP地址和目的IP地址分别相同。
相应地,该处理单元701,用于每接收到一个与第一IP报文的源IP地址和目的IP地址相同的IP报文时,将计数器加1,以及每得到一个与第二报文的源IP地址和目的IP地址相同的IP报文时,将计数器减1。最终得到待设置CE标记的IP报文的个数。
若处理单元701所建立的第一数据表项中还包括计时器。
相应地,该处理单元701,还用于在生成第一数据表项或对第一数据表项中的计数器减1时,计时器重置计时,若计时器的计时达到预设计时,删除所述第一数据表项。
若处理单元701所建立的第一数据表项中还包括源端口号和目的端口号;
相应地,处理单元701,还用于获取来自第一终端设备的第一IP报文中的源端口号和目的端口号,将第一IP报文的源端口号存储于第一数据表项的目的端口号中,将第一IP报文的目的端口号存储于第一数据表项的源端口号中;以及确定第二IP报文的源IP地址与第一数据表项中的源IP地址相同,第二IP报文的目的IP地址与第一数据表项中的目的地址相同,确定第二IP报文的源端口号与第一数据表项中的源端口号相同,第二IP报文的目的端口号与第一数据表项中的目的端口号相同,对第二IP报文设置拥塞发生CE标记。
若待设置CE标记的IP报文的源IP地址、目的IP地址、源端口号和目的端口号 与第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同;
相应地,处理单元701,用于每接收到一个与第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将计数器加1;每接收到一个与第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将计数器减1。
基于上述公开的网络设备,该处理单元701,还用于对获得第一IP报文之后,对该第一IP报文添加标识信息,该标识信息用于指示网络设备根据第一IP报文携带的信息生成第一数据表项和/或对第一数据表项中的计数器加1。所获得的第一IP报文携带的信息包括第一IP报文的源IP地址和目的IP地址,或者所述第一IP报文的源IP地址、目的IP地址,源端口号和目的端口号。
以上本申请实施例公开的网络设备中的各个单元的执行过程,可以参见本申请实施例上述报文处理方法中涉及网络设备的记载,原理和执行方式相同,这里不再进行赘述。
基于上述本申请实施例一公开的报文处理方法,本申请实施例还对应公开了执行该报文处理方法的第一终端设备。
如图8所示,为本申请实施例示出的该第一终端设备80的结构示意图。
该第一终端设备80包括:发送单元801,接收单元802和处理单元803。
发送单元801,用于向网络设备发送第一IP报文,第一IP报文的IP报文头中包括RECN标记,RECN标记用于标识第一IP报文所属的数据流支持反向拥塞探测。
若该第一终端设备80发送的数据流支持反向拥塞探测机制:
接收单元802,用于接收来自网络设备的第一标记报文,第一标记报文包括拥塞发生CE标记,CE标记用于标识网络设备在传输报文时发生了拥塞。
处理单元803,用于基于第一标记报文执行拥塞响应。
若第一终端设备80发送的数据流支持反向拥塞探测机制和正向拥塞探测机制:
接收单元802,还用于接收来自网络设备的第二标记报文,第二标记报文包括CE标记;
处理单元803,还用于确定第二标记报文的源端口号和目的端口号,并基于第二标记报文的源端口号和目的端口号确定第二标记报文所属的数据流;若确定数据流所支持的拥塞探测机制为反向拥塞探测机制,则第一终端设备执行对数据流的拥塞处理;若确定数据流所支持的拥塞探测机制为正向拥塞探测机制,则向网络设备发送响应ACK消息,ACK消息用于指示第二终端设备执行对数据流的拥塞处理,ACK消息中包括CE标记。
以上本申请实施例公开的第一终端设备中的各个单元的执行过程,可以参见本申请实施例上述报文处理方法中涉及第一终端设备的记载,原理和执行方式相同,这里不再进行赘述。
结合本申请实施例公开的报文处理方法,本申请实施例所公开的网络设备和第一终端设备也可以直接用硬件、处理器执行的存储器,或者二者的结合来实施。
因此,本申请还对应上述本申请实施例公开的报文处理方法,公开了如图9所示的网络设备90,如图10所示的第一终端设备100。
如图9所示,该网络设备90包括:存储器901、总线902、处理器903和接口904。其中,接口904可以通过无线或有线的方式实现,具体来讲可以是例如网卡等元件,上述存储器901、处理器903和接口904通过总线902连接。
该接口904具体可以包括发送器和接收器,用于网络设备与上述本申请实施例中的第一终端设备和第二终端设备之间收发报文。具体过程可参见上述本申请实施例涉及网络设备收发报文的相应部分,这里不再赘述。
所述处理器903用于执行上述申请实施例涉及网络设备执行对第一IP报文和第二IP报文进行处理的部分。具体过程可参见,这里不再赘述。
存储器901包括操作系统和应用程序,用于存储报文处理的操作程序、代码或指令,当处理器903或硬件设备在执行报文处理时,调用并执行这些程序、代码或指令时可以完成图3-图7中涉及网络设备对报文进行处理的过程。具体过程可参见上述本申请实施例相应地部分,这里不再赘述。
可以理解的是,图9仅仅示出了网络设备的简化设计。在实际应用中,网络设备可以包含任意数量的接口,处理器,存储器等,而所有可以实现本申请的网络设备都在本申请的保护范围之内。
另外,本申请实施例提供了一种计算机存储介质,用于储存为上述网络设备所用的计算机软件指令,其包含用于执行上述图3-图7所示实施例所设计的程序。
图10为本申请实施例公开的第一终端设备100的硬件结构示意图。图10所示的第一终端设备100可以执行上述本申请实施例中第一终端设备所执行的相应步骤。
如图10所示,该第一终端设备100包括:存储器1001、总线1002、处理器1003和接口1004。其中,接口1004可以通过无线或有线的方式实现,具体来讲可以是例如网卡等元件,上述存储器1001、处理器1003和接口1004通过总线1002连接。
该接口1004具体可以包括发送器和接收器,用于第一终端设备与上述本申请实施例中的网络设备之间收发报文。例如,该接口1004的具体过程可参见上述本申请实施例中,第一终端设备与网络设备之间收发报文的相应部分,这里不再赘述。
所述处理器1003用于执行上述申请实施例中由第一终端设备进行的处理。例如,处理器1003用于基于接收到的第一标记报文或第二标记报文执行相应地拥塞响应。具体过程可参见上述本申请实施例相应地部分,这里不再赘述。
存储器1001包括操作系统和应用程序,用于存储报文处理的程序、代码或指令,当处理器1003或硬件设备在执行报文处理时,调用并执行这些程序、代码或指令时可以完成图3-图7中涉及第一终端设备的处理过程。具体过程可参见上述本申请实施例相应地部分,这里不再赘述。
可以理解的是,图10仅仅示出了第一终端设备的简化设计。在实际应用中,第一终端设备可以包含任意数量的接口,处理器,存储器等,而所有可以实现本申请的第一终端设备都在本申请的保护范围之内。
另外,本申请实施例提供了一种计算机存储介质,用于储存为上述第一终端设备所用的计算机软件指令,其包含用于执行上述图3-图7所示实施例所设计的程序。
如图11所示,为本申请实施例公开的用于实现报文处理方法的网络系统1100,主要包括:第一终端设备1101和网络设备1102。
以上本申请实施例公开的网络系统中,网络设备1102可以具体为图7和图9中公开的网络设备,具体过程以及执行原理可以参照上述说明,这里不再进行赘述。
以上本申请实施例公开的网络系统中,第一终端设备1101可以具体为图8和图10中公开的第一终端设备,具体过程以及执行原理可以参照上述说明,这里不再进行赘述。
综上所述,本申请实施例公开的一种报文处理的技术方案,网络设备在检测到发生拥塞后,将获得来自第一终端设备的第一IP报文的源IP地址和目的IP地址交换后,存储于第一数据表项中的源IP地址和目的IP地址中,基于此,获得与第一数据表项中的源IP地址和目的IP地址相同的第二IP报文,并设置CE标记,该第二IP报文为第二终端设备发送的。通过在反向传输的IP报文上设置CE标记,在拥塞探测时,不需要发送给对端设备进行响应,也不需要依赖终端设备自身判断对应该报文的计时是否超时,减少了拥塞探测的时间,进而降低时延。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质中的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中,通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
本说明书的各个部分均采用递进的方式进行描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点介绍的都是与其他实施例不同之处。尤其,对于装置和系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例部分的说明即可。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (18)

  1. 一种报文处理方法,其特征在于,所述方法包括:
    当网络设备发生拥塞时,所述网络设备获得来自第一终端设备的第一因特网协议IP报文的源IP地址和目的IP地址,将所述第一IP报文的源IP地址存储于第一数据表项的目的IP地址中,将所述第一IP报文的目的IP地址存储于所述第一数据表项的源IP地址中;
    所述网络设备获得来自第二终端设备的第二IP报文,并确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的IP地址相同,对所述第二IP报文设置拥塞发生CE标记,得到第一标记报文,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
    所述网络设备向所述第一终端设备发送所述第一标记报文。
  2. 根据权利要求1所述的方法,其特征在于,所述第一数据表项中还包括计数器,所述计数器用于指示待设置CE标记的IP报文的个数,所述待设置CE标记的IP报文的源IP地址和目的IP地址与所述第二IP报文的源IP地址和目的IP地址分别相同;
    相应地,获得所述待设置CE标记的IP报文的个数,包括:
    所述网络设备每接收到一个与所述第一IP报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器加1;
    所述网络设备每接收到一个与所述第二IP报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器减1。
  3. 根据权利要求2所述的报文处理方法,其特征在于,所述第一数据表项中还包括计时器;
    所述网络设备在生成所述第一数据表项或对所述第一数据表项中的计数器减1时,所述计时器重置计时;
    若所述计时器的计时达到预设计时,所述网络设备删除所述第一数据表项。
  4. 根据权利要求1所述的报文处理方法,其特征在于,所述第一数据表项中还包括源端口号和目的端口号;
    所述网络设备获得来自所述第一终端设备的第一IP报文中的源端口号和目的端口号,将所述第一IP报文的源端口号存储于所述第一数据表项的目的端口号中,将所述第一IP报文的目的端口号存储于所述第一数据表项的源端口号中;
    相应地,所述网络设备确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的IP地址相同,对所述第二IP报文设置拥塞发生CE标记,包括:
    确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的IP地址相同,所述第二IP报文的源端口号与所述第一数据表项中的源端口号相同,所述第二IP报文的目的端口号与所述第一数据表项中的目的端口号相同,对所述第二IP报文设置拥塞发生CE标记。
  5. 根据权利要求2-4中任意一项所述的报文处理方法,其特征在于,所述待设置CE标记的IP报文的源IP地址、目的IP地址、源端口号和目的端口号与所述第二IP 报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同;
    相应地,获得所述待设置CE标记的IP报文的个数,包括:
    所述网络设备每接收到一个与所述第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器加1;
    所述网络设备每接收到一个与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器减1。
  6. 根据权利要求1-5中任意一项所述的报文处理方法,其特征在于,在所述网络设备获得第一IP报文之后,所述方法还包括:
    所述网络设备对所述第一IP报文添加标识信息,所述标识信息用于指示所述网络设备根据所述第一IP报文携带的信息生成所述第一数据表项和/或对所述第一数据表项中的计数器加1;所述第一IP报文携带的信息包括所述第一IP报文的源IP地址和目的IP地址,或者所述第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号。
  7. 根据权利要求1-6中任意一项所述的报文处理方法,其特征在于,所述第一IP报文的IP报文头中包括反向显式拥塞通告RECN标记,所述RECN标记用于标识所述第一IP报文所属的数据流支持反向拥塞探测。
  8. 一种报文处理方法,其特征在于,适用于第一终端设备,若所述第一终端设备发送的数据流支持反向拥塞探测机制,所述方法包括:
    第一终端设备向网络设备发送第一因特网协议IP报文,所述第一IP报文的IP报文头中包括反向显式拥塞通告RECN标记,所述RECN标记用于标识所述第一IP报文所属的数据流支持反向拥塞探测机制;
    所述第一终端设备获得来自所述网络设备的第一标记报文,所述第一标记报文包括拥塞发生CE标记,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
    所述第一终端设备基于所述第一标记报文执行拥塞响应。
  9. 根据权利要求8所述的报文处理方法,其特征在于,若所述第一终端设备发送的数据流支持反向拥塞探测机制和正向拥塞探测机制,还包括:
    所述第一终端设备获得来自所述网络设备的第二标记报文,所述第二标记报文包括所述CE标记;
    所述第一终端设备确定所述第二标记报文的源端口号和目的端口号,基于所述第二标记报文的源端口号和目的端口号确定所述第二标记报文所属的数据流;
    若所述第一终端设备确定所述数据流所支持的拥塞探测机制为反向拥塞探测机制,所述第一终端设备执行对所述数据流的拥塞处理;
    若所述第一终端设备确定所述数据流所支持的拥塞探测为正向拥塞探测机制,则向所述网络设备发送响应ACK消息,所述ACK消息用于指示第二终端设备执行对所述数据流的拥塞处理,所述ACK消息中包括CE标记。
  10. 一种网络设备,其特征在于,包括:
    处理单元,用于若所述网络设备发生拥塞时,获得来自第一终端设备的第一因特网协议IP报文的源IP地址和目的IP地址,将所述第一IP报文的源IP地址存储于第一数据表项的目的IP地址中,将所述第一IP报文的目的IP地址存储于所述第一数据 表项的源IP地址中,以及获得来自第二终端设备的第二IP报文,所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的地址相同,对所述第二IP报文设置拥塞发生CE标记,得到第一标记报文,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
    发送单元,用于向所述第一终端设备发送所述第一标记报文。
  11. 根据权利要求10所述的网络设备,其特征在于,所述第一数据表项中还包括计数器,所述计数器用于指示待设置CE标记的IP报文的个数,所述待设置CE标记的IP报文的源IP地址和目的IP地址与所述第二IP报文的源IP地址和目的IP地址分别相同;
    相应地,所述处理单元,用于每接收到一个与所述第一IP报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器加1,以及每得到一个与所述第二报文的源IP地址和目的IP地址分别相同的IP报文时,将所述计数器减1。
  12. 根据权利要求11所述的网络设备,其特征在于,所述第一数据表项中还包括计时器;
    所述处理单元,还用于在生成所述第一数据表项或对所述第一数据表项中的计数器减1时,所述计时器重置计时,若所述计时器的计时达到预设计时,删除所述第一数据表项。
  13. 根据权利要求10所述的网络设备,其特征在于,所述第一数据表项中还包括源端口号和目的端口号;
    所述处理单元,还用于获取来自所述第一终端设备的第一IP报文中的源端口号和目的端口号,将所述第一IP报文的源端口号存储于所述第一数据表项的目的端口号中,将所述第一IP报文的目的端口号存储于所述第一数据表项的源端口号中;以及确定所述第二IP报文的源IP地址与所述第一数据表项中的源IP地址相同,所述第二IP报文的目的IP地址与所述第一数据表项中的目的地址相同,确定所述第二IP报文的源端口号与所述第一数据表项中的源端口号相同,所述第二IP报文的目的端口号与所述第一数据表项中的目的端口号相同,对所述第二IP报文设置拥塞发生CE标记。
  14. 根据权利要求11-13中任意一项所述的网络设备,其特征在于,所述待设置CE标记的IP报文的源IP地址、目的IP地址、源端口号和目的端口号与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同;
    相应地,所述处理单元,用于每接收到一个与所述第一IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器加1;每接收到一个与所述第二IP报文的源IP地址、目的IP地址、源端口号和目的端口号分别相同的IP报文时,将所述计数器减1。
  15. 根据权利要求10-14中任意一项所述的网络设备,其特征在于,
    所述处理单元,还用于在获得所述第一IP报文之后,对所述第一IP报文添加标识信息,所述标识信息用于指示所述网络设备根据所述第一IP报文携带的信息生成所述第一数据表项和/或对所述第一数据表项中的计数器加1;所述第一IP报文携带的信息包括所述第一IP报文的源IP地址和目的IP地址,或者所述第一IP报文的源IP地址、目的IP地址,源端口号和目的端口号。
  16. 一种终端设备,用作第一终端设备,其特征在于,若所述第一终端设备发送的数据流支持反向拥塞探测机制,所述第一终端设备包括:
    发送单元,用于向网络设备发送第一因特网协议IP报文,所述第一IP报文的IP报文头中包括反向显式拥塞通告RECN标记,所述RECN标记用于标识所述第一IP报文所属的数据流支持反向拥塞探测;
    接收单元,用于接收来自所述网络设备的第一标记报文,所述第一标记报文包括拥塞发生CE标记,所述CE标记用于标识所述网络设备在传输报文时发生了拥塞;
    处理单元,用于基于所述第一标记报文执行拥塞响应。
  17. 根据权利要求16所述的终端设备,其特征在于,若所述第一终端设备发送的数据流支持反向拥塞探测机制和正向拥塞探测机制;
    所述接收单元,还用于接收来自所述网络设备的第二标记报文,所述第二标记报文包括CE标记;
    所述处理单元,还用于确定所述第二标记报文的源端口号和目的端口号,并基于所述第二标记报文的源端口号和目的端口号确定所述第二标记报文所属的数据流;若确定所述数据流所支持的拥塞探测机制为反向拥塞探测机制,则所述第一终端设备执行对所述数据流的拥塞处理;若确定所述数据流所支持的拥塞探测机制为正向拥塞探测机制,则向所述网络设备发送响应ACK消息,所述ACK消息用于指示第二终端设备执行对所述数据流的拥塞处理,所述ACK消息中包括CE标记。
  18. 一种网络系统,其特征在于,包括:第一终端设备和网络设备;
    所述第一终端设备为权利要求16或17所述的终端设备;
    所述网络设备为权利要求10-15中任意一项所述的网络设备。
PCT/CN2018/072913 2017-01-18 2018-01-16 报文处理方法、设备及系统 WO2018133784A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710039457.7 2017-01-18
CN201710039457.7A CN108322402B (zh) 2017-01-18 2017-01-18 报文处理方法、设备及系统

Publications (1)

Publication Number Publication Date
WO2018133784A1 true WO2018133784A1 (zh) 2018-07-26

Family

ID=62892245

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/072913 WO2018133784A1 (zh) 2017-01-18 2018-01-16 报文处理方法、设备及系统

Country Status (2)

Country Link
CN (1) CN108322402B (zh)
WO (1) WO2018133784A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111065120B (zh) * 2019-12-24 2022-02-11 展讯通信(上海)有限公司 蜂窝网络上行链路ecn机制的增强方法、设备及介质
CN111404783B (zh) * 2020-03-20 2021-11-16 南京大学 一种网络状态数据采集方法及其系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188611A (zh) * 2007-11-21 2008-05-28 华为技术有限公司 拥塞通知方法、系统和节点设备
WO2010106311A1 (en) * 2009-03-16 2010-09-23 British Telecommunication Public Limited Company Path characterisation in networks
CN102291315A (zh) * 2011-09-08 2011-12-21 杭州华三通信技术有限公司 一种监控系统中信息的传输方法和系统
CN102498696A (zh) * 2009-07-17 2012-06-13 英国电讯有限公司 数据网络的使用监管

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1936880A1 (en) * 2006-12-18 2008-06-25 British Telecommunications Public Limited Company Method and system for congestion marking
CN102055677A (zh) * 2011-01-26 2011-05-11 杭州华三通信技术有限公司 减少网络拥塞的方法及设备
CN103139093B (zh) * 2013-02-22 2016-01-27 桂林电子科技大学 基于fpga的高速网络数据流负载均衡调度方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188611A (zh) * 2007-11-21 2008-05-28 华为技术有限公司 拥塞通知方法、系统和节点设备
WO2010106311A1 (en) * 2009-03-16 2010-09-23 British Telecommunication Public Limited Company Path characterisation in networks
CN102498696A (zh) * 2009-07-17 2012-06-13 英国电讯有限公司 数据网络的使用监管
CN102291315A (zh) * 2011-09-08 2011-12-21 杭州华三通信技术有限公司 一种监控系统中信息的传输方法和系统

Also Published As

Publication number Publication date
CN108322402B (zh) 2022-05-10
CN108322402A (zh) 2018-07-24

Similar Documents

Publication Publication Date Title
US11799790B2 (en) Data transmission method, computing device, network device, and data transmission system
US11934340B2 (en) Multi-path RDMA transmission
WO2018210117A1 (zh) 一种拥塞控制方法、网络设备及其网络接口控制器
WO2017101503A1 (zh) 一种数据传送方法、发送节点、接收节点及数据传送系统
US7839783B2 (en) Systems and methods of improving performance of transport protocols
US8996718B2 (en) TCP-aware receive side coalescing
US8437252B2 (en) Intelligent congestion feedback apparatus and method
US20060203730A1 (en) Method and system for reducing end station latency in response to network congestion
WO2017050216A1 (zh) 一种报文传输方法及用户设备
US9867068B2 (en) Wirespeed TCP session optimization for networks having radio segments
WO2018113426A1 (zh) 一种流量控制方法及交换设备
JP2021516012A (ja) ネットワークにおけるフロー管理
WO2018121535A1 (zh) 一种负载均衡处理方法及装置
CN106330742B (zh) 一种流量控制的方法及网络控制器
WO2021238799A1 (zh) 一种数据报文传输方法及装置
Shukla et al. TCP PLATO: Packet labelling to alleviate time-out
CN112104562A (zh) 拥塞控制方法及装置、通信网络、计算机存储介质
Zats et al. Fastlane: making short flows shorter with agile drop notification
CN111224888A (zh) 发送报文的方法及报文转发设备
CN113992588A (zh) 数据传输方法、装置、电子设备及可读存储介质
WO2023019202A1 (en) System and method for congestion control using a flow level transmit mechanism
WO2018133784A1 (zh) 报文处理方法、设备及系统
US10063489B2 (en) Buffer bloat control
WO2022042386A1 (zh) 一种控制报文发送的方法、网路设备和系统
CN112737737B (zh) 一种确认报文的处理方法和通信装置以及存储介质

Legal Events

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

Ref document number: 18741816

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

Country of ref document: EP

Kind code of ref document: A1