WO2024065732A1 - 一种数据处理方法、装置、转发芯片及网络设备 - Google Patents

一种数据处理方法、装置、转发芯片及网络设备 Download PDF

Info

Publication number
WO2024065732A1
WO2024065732A1 PCT/CN2022/123398 CN2022123398W WO2024065732A1 WO 2024065732 A1 WO2024065732 A1 WO 2024065732A1 CN 2022123398 W CN2022123398 W CN 2022123398W WO 2024065732 A1 WO2024065732 A1 WO 2024065732A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
network device
information
path
flow
Prior art date
Application number
PCT/CN2022/123398
Other languages
English (en)
French (fr)
Inventor
朱仕银
闻广亮
Original Assignee
新华三技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新华三技术有限公司 filed Critical 新华三技术有限公司
Priority to PCT/CN2022/123398 priority Critical patent/WO2024065732A1/zh
Publication of WO2024065732A1 publication Critical patent/WO2024065732A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks

Definitions

  • the present application relates to the field of communication technology, and in particular to a data processing method, device, forwarding chip and network equipment.
  • a multiple-send and selective-receive mechanism is often used to forward messages.
  • the multiple-send and selective-receive mechanism is implemented through software, and the forwarding logic is complex and the message forwarding efficiency is low.
  • the purpose of the embodiments of the present application is to provide a data processing method, device, forwarding chip and network equipment to improve the efficiency of message forwarding.
  • the specific technical solution is as follows:
  • an embodiment of the present application provides a data processing method, which is applied to any forwarding chip in a network device, wherein the network device is a network device on a multiple-transmit selective receiving path, and the method includes:
  • the network device is a source network device on the multiple transmission and selective reception path, forwarding the first message to the next-hop network device on the multiple transmission and selective reception path respectively through multiple paths included in the multiple transmission and selective reception path;
  • the network device is an intermediate network device on the multiple transmission and selective reception path, forwarding the first message to a next-hop network device on the multiple transmission and selective reception path;
  • message information is extracted from the first message.
  • the extracted message information is not stored in the network device, the extracted message information is stored and the first message is forwarded to the destination terminal.
  • the message information of the first message is used to distinguish different messages of the same business flow and different messages of different business flows.
  • an embodiment of the present application further provides a data processing device, which is applied to any forwarding chip in a network device, wherein the network device is a network device on a multiple transmission and selective reception path, and the device includes:
  • An acquisition unit used for acquiring a first message to be forwarded through the multiple transmission and reception selection path
  • a first processing unit configured to forward the first message to a next-hop network device on the multi-transmitting and selectively receiving path respectively through a plurality of paths included in the multi-transmitting and selectively receiving path if the network device is a source network device on the multi-transmitting and selectively receiving path;
  • a second processing unit configured to forward the first message to a next-hop network device on the multi-transmitting and selectively receiving path if the network device is an intermediate network device on the multi-transmitting and selectively receiving path;
  • the third processing unit is used to extract message information from the first message if the network device is the destination network device on the multi-transmission and selective reception path, and when the extracted message information is not stored in the network device, store the extracted message information and forward the first message to the destination terminal, wherein the message information of the first message is used to distinguish different messages of the same business flow and different messages of different business flows.
  • an embodiment of the present application provides a forwarding chip that executes any of the above-mentioned data processing method steps.
  • an embodiment of the present application provides a network device, the network device comprising at least one forwarding chip, the forwarding chip being used to execute any of the steps of the data processing method described above.
  • the forwarding chip in the network device can immediately process the message, such as forwarding the first message to the destination terminal when the message information of the first message is not stored locally in the network device.
  • a hardware forwarding chip is used to complete the message forwarding in multi-transmission selective receiving, which improves the message forwarding efficiency while ensuring the reliability of message transmission.
  • FIG1 is a schematic diagram of a primary-backup path mechanism
  • FIG2 is a schematic diagram of a multiple transmission and selective reception mechanism
  • FIG3 is a schematic diagram of a first flow chart of a data processing method provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a second flow chart of a data processing method provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of an IPv4 message header format provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of an IPv6 message header format provided in an embodiment of the present application.
  • FIG7 is a schematic diagram of an SRv6 message header format provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a correspondence between a service flow and a flow label range provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of a correspondence between an original message and a flow label provided in an embodiment of the present application.
  • FIG10 is a first schematic diagram of updating the message information of the second message to obtain the first message according to an embodiment of the present application
  • FIG11 is a first schematic diagram of extracting message information from a first message provided in an embodiment of the present application.
  • FIG. 12 is a second schematic diagram of updating the message information of the second message to obtain the first message according to an embodiment of the present application
  • FIG13 is a schematic diagram of message forwarding logic provided in an embodiment of the present application.
  • FIG14 is a second schematic diagram of extracting message information from a first message provided in an embodiment of the present application.
  • FIG15 is a first schematic diagram of a step of forwarding a first message provided in an embodiment of the present application.
  • FIG16 is a second schematic diagram of the step of forwarding a first message provided in an embodiment of the present application.
  • FIG17 is a schematic diagram of a third flow chart of a data processing method provided in an embodiment of the present application.
  • FIG18 is a fourth flow chart of the data processing method provided in an embodiment of the present application.
  • FIG19 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application.
  • Deterministic networks are one of the hot research technologies in the field of communication technology.
  • IETF Internet Engineering Task Force
  • deterministic networks need to provide 99.9999% reliability guarantee and can still provide service continuity when links and nodes fail.
  • the primary and backup paths are deployed between CE (Customer Edge) 1 and CE2.
  • the devices on the primary path include PE (Provider Edge) 1, P (Provider) 1, and PE3, and the devices on the backup path include PE1, PE2, P2, PE4, and PE3.
  • PE Provider Edge
  • P Provider
  • PE3 the devices on the backup path
  • the primary path fails, it is necessary to switch to the backup path and use the backup path to forward messages.
  • switching from the primary path to the backup path requires path detection and switching, and both path detection and switching take time.
  • the shortest convergence time of this process is about 50ms. During this period, messages will still be forwarded along the primary path, resulting in packet loss.
  • the 50ms convergence time is not a problem in consumer applications, but it is a big problem in industrial Internet such as autonomous driving or on-site production.
  • the 50ms convergence time is enough to cause major accidents. Therefore, a multiple-transmission selective reception mechanism is defined to ensure service continuity and ensure that there is no impact on forwarding services when any link or node fails.
  • the multiple-transmission selective reception mechanism means that the same service flow is sent to multiple paths at the same time, and is forwarded to the destination after de-duplication and sorting at the receiving end.
  • the sending end PE1 connected to the execution terminal replicates the message and forwards the message through the path 1 represented by the thick solid line and the path 2 represented by the thick dotted line.
  • the devices on path 1 include PE1, P1, P2 and PE2, and the devices on path 2 include PE1, P3, P4 and PE2.
  • the receiving end PE2 connected to the control end receives the message and performs de-duplication and sorting before forwarding the message. If any path fails, it will not affect the message forwarding, thus achieving high reliability of message forwarding.
  • the execution terminal can be a host or a camera, etc.
  • the multiple transmission and selective reception mechanism ensures high reliability, it also requires a price to perform multiple transmission and selective reception.
  • the same message needs to be copied and forwarded at the sending end, and the receiving end needs to select, deduplicate and sort, which increases the complexity of the device forwarding logic and consumes bandwidth.
  • the multiple transmission and selective reception mechanism in the prior art is implemented by software, and it is necessary to wait for all the same messages forwarded by the multiple transmission and selective reception path to be received before processing the message, which has low message forwarding efficiency.
  • the embodiment of the present application provides a data processing method, in which the forwarding chip in the network device can process the message immediately after obtaining the first message that needs to be forwarded through the multi-transmission selective receiving path, such as forwarding the first message to the destination terminal when the message information of the first message is not stored locally in the network device.
  • a hardware forwarding chip is used to complete the message forwarding in multi-transmission selective receiving, which improves the message forwarding efficiency while ensuring the reliability of message transmission.
  • an embodiment of the present application provides a data processing method, which is applied to any forwarding chip in a network device, which is a network device on a multi-transmit and selective receiving path, such as a source network device, such as PE1 in Figure 2; an intermediate network device, such as P1-P4 in Figure 2; a destination network device, such as PE2 in Figure 2.
  • a source network device such as PE1 in Figure 2
  • an intermediate network device such as P1-P4 in Figure 2
  • a destination network device such as PE2 in Figure 2.
  • the network device may be a device with communication functions such as a router and a switch.
  • the network device may include one or more forwarding chips, which may be a NP (Network Processor), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic devices, a Digital Signal Processor (DSP), a discrete gate or transistor logic device, a discrete hardware component or other hardware processing chip, or a combination of multiple chips, which is not limited to this.
  • NP Network Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • DSP Digital Signal Processor
  • the above data processing method comprises the following steps:
  • Step S31 obtaining a message that needs to be forwarded through a multiple transmission and reception path
  • Step S32 if the network device is a source network device on the multi-transmit selective receiving path, forwarding the first message to the next-hop network device on the multi-transmit selective receiving path respectively through the multiple paths included in the multi-transmit selective receiving path;
  • Step S33 if the network device is an intermediate network device on the multi-transmit selective receiving path, forward the first message to the next hop network device on the multi-transmit selective receiving path;
  • Step S34 if the network device is a destination network device on a multi-transmission and selective receiving path, extract message information from the first message.
  • the extracted message information is not stored in the network device, store the extracted message information and forward the first message to the destination terminal.
  • the message information of the first message is used to distinguish different messages of the same business flow and different messages of different business flows.
  • the forwarding chip in the network device after the forwarding chip in the network device obtains the first message that needs to be forwarded through the multi-transmission selective receiving path, it can immediately process the message, such as forwarding the first message to the destination terminal when the message information of the first message is not stored locally in the network device.
  • a hardware forwarding chip is used to complete the message forwarding in multi-transmission selective receiving, which improves the message forwarding efficiency while ensuring the reliability of message transmission.
  • the first message may be an IPv4 message, an IPv6 message or an SRv6 (Segment Routing IPv6, segment routing based on IPv6) message.
  • the multiple transmission and selective reception path includes at least two paths.
  • the multiple transmission and selective reception path may be implemented using an SR tunnel, an MPLS SR tunnel or an IPv6 SR tunnel, and is not limited thereto.
  • the network device may pre-store path information corresponding to the service flow forwarded through the multiple transmission and selective reception path, and the path information may include at least one of the following sets of information: a logical port for forwarding the service flow; a source address and a destination address corresponding to the service flow; and five-tuple information corresponding to the service flow.
  • the five-tuple information may include a source IP address, a destination IP address, a source port, a destination port, and a transport protocol.
  • the network device can identify the message that needs to be forwarded through the multiple transmission and reception selective path, that is, the first message, according to the pre-stored path information.
  • the network device detects whether the path information corresponding to the business flow to which the first message belongs matches the pre-stored path information; if so, it is determined that the first message is a message that needs to be forwarded through the multi-transmit selective receiving path; if not, it is determined that the first message is a message that does not need to be forwarded through the multi-transmit selective receiving path.
  • the network device After obtaining the first message that needs to be forwarded through the multiple transmission and selective reception path, the network device determines its role on the multiple transmission and selective reception path, which role is a source network device, an intermediate network device, or a destination network device.
  • the above step S32 is executed; when the network device is determined to be an intermediate network device on the multiple transmission and selective reception path, the above step S33 is executed; when the network device is determined to be a destination network device on the multiple transmission and selective reception path, the above step S34 is executed.
  • the source network device copies a first message on each path included in the multiple transmission and selective reception path, and then forwards the first message to the next-hop network device on the multiple transmission and selective reception path through the multiple paths included in the multiple transmission and selective reception path.
  • PE1 is the source network device, and PE1 copies a first message on each path represented by the thick solid line and the path represented by the thick dotted line, and forwards the message to the next-hop network devices P1 and P3 respectively, thereby realizing forwarding the same first message through two paths.
  • step S33 after the intermediate network device obtains the first message that needs to be forwarded through the multi-transmission selective receiving path, it directly forwards the first message to the next-hop network device on the multi-transmission selective receiving path, and refuses to perform other processing on the first message.
  • P1 is an intermediate network device. After P1 obtains the first message that needs to be forwarded through the multi-transmission selective receiving path, it forwards the message to the next-hop network device P2.
  • the destination network device extracts message information from the first message and determines whether the extracted message information is stored in the destination network device; if the destination network device does not store the extracted message information, it means that the first message currently received is the first message of the corresponding service flow received through the multi-transmission and selective receiving path, the destination network device stores the extracted message information, determines the destination terminal of the first message, and forwards the first message to the destination terminal.
  • the network device may store message information in the form of a table, may store message information in the form of a distributed database, or may store message information in other ways, without limitation.
  • a data processing method is further provided. As shown in FIG4 , the method may include the following steps:
  • Step S41 receiving a second message
  • Step S42 if it is determined that the second message is a message that needs to be forwarded through the multiple transmission and reception selection path, the first message is determined according to the second message;
  • Step S43 if the network device is a source network device on the multi-transmit selective receiving path, forwarding the first message to the next-hop network device on the multi-transmit selective receiving path respectively through the multiple paths included in the multi-transmit selective receiving path;
  • Step S44 if the network device is an intermediate network device on the multi-transmit selective receiving path, forward the first message to the next hop network device on the multi-transmit selective receiving path;
  • Step S45 if the network device is a destination network device on a multi-transmission and selective receiving path, extract message information from the first message.
  • the extracted message information is not stored in the network device, store the extracted message information and forward the first message to the destination terminal.
  • the message information of the first message is used to distinguish different messages of the same business flow and different messages of different business flows.
  • steps S43-S45 please refer to the relevant description of the above steps S32-S34.
  • the network device determines the first message based on the second message, so that the message information of the determined first message can distinguish different messages of the same business flow and different messages of different business flows, that is, different messages that need to be forwarded through the multi-transmit selective receiving path have different message information. This provides a basis for the destination network device on the multi-transmit selective receiving path to quickly and accurately perform deduplication processing at the forwarding chip layer.
  • the second message may be an IPv4 message or an IPv6 message, which is an original IP message sent by the host.
  • the network device may pre-store path information corresponding to the service flow forwarded through the multiple transmission and selective reception path.
  • the network device may identify whether the second message is a message that needs to be forwarded through the multiple transmission and selective reception path based on the pre-stored path information.
  • the network device detects whether the path information corresponding to the business flow to which the second message belongs matches the pre-stored path information; if so, it determines that the second message is a message that needs to be forwarded through the multi-transmit selective receiving path; if not, it determines that the second message is a message that does not need to be forwarded through the multi-transmit selective receiving path.
  • the above-mentioned execution step S42 can be: the source network device updates the message information of the second message to obtain the first message. Since the second message is a message that needs to be forwarded through the multi-transmission selective receiving path, the first message obtained based on the second message is also a message that needs to be forwarded through the multi-transmission selective receiving path.
  • the updated message information of the second message can be used to distinguish different messages of the same service flow and different messages of different service flows. This facilitates the destination network device on the multiple transmission and reception path to accurately distinguish the same message from different messages, thereby quickly and accurately completing the deduplication process.
  • the intermediate network device can consider that the received second message is the message after the source network device updates the message information, that is, the message information of the second message can be used to distinguish different messages of the same business flow and different messages of different business flows, and directly determine the second message as the first message.
  • the network device can directly forward the second message, such as querying a routing table to determine a next-hop network device, and then forwarding the second message to the determined next-hop network device.
  • the message information may include a flow label.
  • the flow label is used to indicate the service flow information.
  • the message information may also include first transmission information, and the first transmission information may include any one of the following groups of information: a source address and a destination address corresponding to the service flow; and five-tuple information corresponding to the service flow.
  • whether the first transmission information is represented by the source address and destination address corresponding to the business flow or by the five-tuple information corresponding to the business flow can be determined according to the size of the business flow. For example, when the traffic of the business flow forwarded through the multi-transmission and selective receiving path is greater than the preset traffic threshold, the first transmission information is represented by the five-tuple information corresponding to the business flow, which improves the accuracy of distinguishing different messages of the same business flow and different messages of different business flows, and improves the accuracy of the destination network device in performing message deduplication processing; when the traffic of the business flow forwarded through the multi-transmission and selective receiving path is less than or equal to the preset traffic threshold, the first transmission information is represented by the source address and destination address corresponding to the business flow, so as to reduce the efficiency of the destination network device in performing message deduplication processing.
  • the source address and destination address or five-tuple information corresponding to the service flow is encapsulated in the message header of the original message.
  • the IPv4 message header includes version, header length, service type, total length, identification, flags, fragmentation offset, time to live, protocol, header checksum, source IP address and destination IP address, etc.
  • the IPv4 message header is combined with the data to be transmitted to form an IPv4 message.
  • the source network device can extract the source address and destination address or five-tuple information from the IPv4 message header.
  • the IPv6 message header includes a 40-byte basic header and a variable-length extension header.
  • the basic header includes version, traffic class, flow label, payload length, next header, hop limit, source IP address, and destination IP address.
  • the IPv6 message header is combined with the data to be transmitted to form an IPv6 message.
  • the source network device can extract the source address and destination address from the IPv6 message header.
  • the flow label is encapsulated in the tunnel header.
  • the tunnel header is SRv6 message header, as shown in FIG7, in addition to the basic header in the above IPv6 message header, it also includes SRH (Segment Routing Header), SRH includes next header, extended header length (Hdr Ext Len), routing type (Routing type), remaining number of segments (Segment Left), index of the last element (last entry), flags, tags, segment list (Segment list) and optional TLV (Type Length Value), etc.
  • SRv6 message header and IPv6 payload are combined to form SRv6 message.
  • IPv6 payload in SRv6 message is the second message received by the source network device on the multi-transmission and selective receiving path.
  • the network device may include multiple forwarding chips.
  • the flow label ranges configured by all forwarding chips do not overlap.
  • the flow label range corresponding to the network device may overlap or not overlap with the flow label ranges corresponding to other network devices in the network to which the network device belongs.
  • a different flow label range is assigned to each forwarding chip to ensure that the flow label ranges of different forwarding chips do not overlap, that is, for a network device, each flow label is unique and does not overlap. This can avoid assigning the same flow label to different messages of the same service flow, causing the destination network device to discard messages that are not the same message, affecting the message forwarding efficiency.
  • the flow label ranges of different network devices can overlap, that is, the label ranges of different service flows corresponding to different network devices can overlap.
  • the message information can also include other information, such as the above-mentioned first transmission information, etc., combined with the flow label and the first transmission information, it is possible to accurately distinguish between messages with the same flow label belonging to different service flows, and thus messages that are not the same message will not be discarded.
  • the flow label ranges corresponding to different service flows may be the same or different.
  • the flow label ranges 1 to M corresponding to the four service flows shown in FIG8 are the same.
  • DIP (Destination IP) 1 + SIP (Source IP) 1 represents a service flow
  • DIP1 + SIP2 represents a service flow
  • DIP2 + SIP1 represents a service flow
  • DIP2 + SIP2 represents a service flow.
  • the flow labels corresponding to the same message are the same, and the flow labels corresponding to different messages are different.
  • the four lines of messages include flow labels, external IP, SRH and original IP, that is, the four lines of messages correspond to the original message whose original IP is DIP+SIP, the flow label is the flow label in the IPv6 basic header, and the external IP is the source IP and destination IP in the IPv6 basic header.
  • the first two lines correspond to the same original message, and the messages in the first two lines are forwarded through the two multi-transmission selective receiving paths indicated by SRH1 and SRH2, respectively, and the flow labels in their tunnel headers are all flow label 1.
  • the last two lines correspond to the same original message, and the messages in the last two lines are forwarded through the two multi-transmission selective receiving paths indicated by SRH1 and SRH2, respectively, and the flow labels in their tunnel headers are all flow label 2.
  • the messages in the first two lines and the messages in the last two lines belong to the same service flow, and flow label 1 is different from flow label 2. It can be seen that in a service flow, the flow label and the original message correspond one-to-one.
  • the destination network device on the multiple transmission and selective reception path can accurately achieve deduplication.
  • the source network device updates the message information of the second message to obtain the first message, which may include:
  • Step S101 Obtain a first count value of a current flow label of a service flow to which a second message belongs.
  • a counter is configured for each service flow, and the value range of the counter is consistent with the flow label range corresponding to the service flow.
  • the counting rule of the counter is: each time a message is sent, the count value is increased by 1.
  • the flow label in the second message may be assigned a value of 0, which results in the flow label not being able to uniquely represent a service flow, let alone being able to uniquely identify a message.
  • the source network device assigns a value to the flow label of the original message (i.e., the second message), such as determining the service flow to which the second message belongs based on the five-tuple information of the second message, and then obtaining the count value of the current flow label of the service flow, i.e., the first count value.
  • the first count value is the current count value of the counter corresponding to the service flow to which the second message belongs.
  • Step S102 encapsulate a tunnel header for the second message to obtain a first message, wherein the value in the flow label field of the tunnel header is the obtained first count value.
  • the source network device may update the value of the flow label field of the tunnel header to the first count value, and encapsulate the updated tunnel header for the second message to obtain the first message.
  • the source network device may further encapsulate the updated tunnel header for the second message to obtain the first message, and then update the value of the flow label field of the tunnel header in the first message to the first count value.
  • the source network device after the source network device encapsulates the tunnel header for the second message and obtains the first message, it adds 1 to the first count value of the current flow label. That is, the source network device adds 1 to the current count value of the counter corresponding to the service flow to which the second message belongs, and when the message of the service flow to which the second message belongs is subsequently received, the first count value recorded in the source network device can be directly obtained to complete the message information update.
  • the message information extracted by the destination network device may include a flow label and the first transmission information.
  • the step of extracting message information from the first message in the above step S34 may include steps S111 - S113 .
  • Step S111 extracting the flow label of the first message from the tunnel header of the first message.
  • the flow label is a value rewritten by the source network device and is used to uniquely identify a message.
  • the destination network device parses the tunnel header of the first message and extracts the flow label of the first message from the tunnel header of the first message.
  • Step S112 stripping the tunnel header of the first message to obtain a third message.
  • the destination network device After obtaining the flow label of the first message in the tunnel header, the destination network device performs tunnel termination, that is, strips the tunnel header of the first message to obtain a third message.
  • the third message is the original message.
  • Step S113 extract the first transmission information from the message header of the third message.
  • the message header of the original message stores complete transmission information.
  • the network device parses the message header of the third message to obtain the transmission information carried by the message header of the third message.
  • the destination network device determines that the extracted message information is not stored, the third message is forwarded to the destination terminal.
  • the network device accurately extracts the message information, and based on the extracted message information, a message can be uniquely determined, thereby ensuring accurate deduplication of the message.
  • the message information may include an identification value, such as the identification in FIG5.
  • the message information may also include second transmission information, and the second transmission information may include one or more of quintuple information, more fragmentation flags (such as the flags in FIG5), and fragmentation offset.
  • the second transmission information is encapsulated in the message header of the original message.
  • the identification value is used to distinguish fragment information.
  • the identification values of each fragment message of an original message are consistent; when there are no fragment messages, an identification value can be assigned to each original message according to the five-tuple information. Therefore, to distinguish a message of a certain service flow, a five-tuple + identification value (Identification) + MF (More Fragment, more fragments flag bit) + fragment offset (FragOffset) can be used to uniquely represent it.
  • MF is the flags flag bit in the IPv4 header. For example, the flags value is 1 when there are fragments, and the flags value is 0 when there are no fragments.
  • the network device may include multiple forwarding chips.
  • the identification value ranges configured by all forwarding chips do not overlap.
  • the identification value range corresponding to the network device may overlap or not overlap with the identification value ranges corresponding to other network devices in the network to which the network device belongs.
  • each forwarding chip For network devices including multiple forwarding chips, such as frame devices, a different range of identification values is assigned to each forwarding chip to ensure that the identification value ranges of different forwarding chips do not overlap, that is, for a network device, each identification value is unique and does not overlap. This can avoid assigning the same identification value to different messages of the same service flow, causing the destination network device to discard messages that are not the same message, affecting the message forwarding efficiency.
  • the identification value ranges for different network devices may overlap, that is, the label ranges for different service flows corresponding to different network devices may overlap.
  • the message information may also include other information, such as the second transmission information mentioned above. The combination of the identification value and the second transmission information can accurately distinguish between messages with the same identification value and belonging to different service flows, and thus messages that are not the same message will not be discarded.
  • the range of identification values corresponding to different service flows may be the same or different.
  • the identification values corresponding to the same message are the same, and the identification values corresponding to different messages are different.
  • the source network device updates the message information of the second message to obtain the first message, which may include:
  • Step S121 If the value in the identification field in the message header of the second message is empty, obtain a second count value of the current identification value of the service flow to which the second message belongs.
  • a counter is configured for each service flow, and the value range of the counter is consistent with the range of the identification value corresponding to the service flow.
  • the counting rule of the counter is: each time a message is sent, the count value is increased by 1.
  • the source network device assigns an identification value to the original message (i.e., the second message), such as determining the service flow to which the second message belongs based on the five-tuple information of the second message, and then obtaining the count value of the current identification value of the service flow, i.e., the second count value.
  • the second count value is the current count value of the counter corresponding to the service flow to which the second message belongs.
  • Step S122 fill the second count value into the identification field in the message header of the second message, and encapsulate the tunnel header for the second message to obtain the first message.
  • the source network device can update the value of the identification field in the message header of the second message to the second count value, and encapsulate the tunnel header for the second message to obtain the first message.
  • the tunnel header here can refer to the SRv6 message header shown in FIG. 7 above.
  • the identification value count value of each business flow is used to provide different identification values for different message fragments in a business flow. This helps the destination network device on the multi-transmission and reception path to distinguish different messages from the same message, and thus accurately perform deduplication processing.
  • the second count value of the current identification value is increased by 1. That is, the source network device increases the current count value of the counter corresponding to the service flow to which the second message belongs by 1, and when a message of the service flow to which the second message belongs is subsequently received, the second count value recorded in the source network device can be directly obtained to complete the message information update.
  • the source network device if the identification field in the message header of the second message is filled with an identification value, the source network device no longer updates the message information, and directly encapsulates the tunnel header for the second message to obtain the first message.
  • the source network device can forward the first message to the next-hop network device on the multiple transmission and selective reception path through the multiple paths included in the multiple transmission and selective reception path.
  • the source network device forwards the original IP message through the three paths indicated by SR1-SR3.
  • SR indicates that the intermediate tunnel bearer of the multiple transmission and selective reception path is segment routing.
  • the intermediate tunnel may also be MPLS SR or IPv6SR, without limitation.
  • the message information extracted by the destination network device may include an identification value and the second transmission information.
  • the step of extracting message information from the first message in the above step S34 may include steps S141 - S142 .
  • Step S141 stripping the tunnel header of the first message to obtain a third message.
  • the destination network device After obtaining the first message, the destination network device performs tunnel termination, that is, strips the tunnel header of the first message to obtain a third message.
  • the third message is the original message.
  • Step S142 extracting the identification value and the second transmission information from the message header of the third message.
  • the message header of the original message stores complete transmission information.
  • the network device parses the message header of the third message to obtain the transmission information carried by the message header of the third message.
  • the destination network device determines that the extracted message information is not stored, the third message is forwarded to the destination terminal.
  • the network device accurately extracts the message information, and based on the extracted message information, a message can be uniquely determined, thereby ensuring accurate deduplication of the message.
  • the destination network device determines that the extracted message information is stored in the destination network device, it means that the first message currently received is not the first message of the corresponding service flow received through the multi-transmission and selective receiving path, that is, the first message currently received is a duplicated message.
  • the destination network device can directly discard the first message to complete the deduplication processing.
  • the destination network device is configured with an aging mechanism, and the destination network device uses the configured aging mechanism to implement dynamic deletion of message information to avoid the expansion of message information and also to avoid the problem of erroneous discard of messages due to message information flipping.
  • the aging mechanism can be implemented by any one or more of the following triggering methods:
  • Method 1, matching trigger can be specifically: after extracting message information from the first message, when the acquired message information of the first message matches the message information stored in the network device, that is, the network device stores the message information extracted from the first message, the aging mechanism is triggered to execute, that is, to detect whether the extracted message information stored in the network device has reached the aging time; if the aging time is reached, the extracted message information stored in the network device is deleted.
  • periodic triggering may specifically include: periodically detecting whether each message information stored in the network device has reached the aging time; and then deleting the message information that has reached the aging time from the message information stored in the network device.
  • real-time triggering may specifically include: real-time monitoring of each message information stored in the network device; when it is detected that any message information reaches the aging time, the message information is deleted.
  • the aging mechanism may also be implemented by other triggering methods, which are not limited to this.
  • the step of the intermediate network device and the destination network device forwarding the first message to the destination terminal may be refined into the following steps:
  • Step S151 detect whether the sequence number of the current to-be-sent message corresponding to the service flow to which the first message belongs is the same as the sequence number of the first message; if they are the same, execute step S152; if they are different, execute step S153.
  • Step S152 forward the first message to the destination terminal.
  • Step S153 waiting for a preset time period.
  • Step S154 before the preset time is reached, if the sequence number of the current message to be sent is the same as the sequence number of the first message, the first message is forwarded to the destination terminal.
  • Step S155 after the preset time has elapsed, if the sequence number of the message to be sent is different from the sequence number of the first message, the first message is forwarded to the destination terminal.
  • the network device may first write the first message into a reordering buffer and detect whether the sequence number of the current message to be sent corresponding to the business flow to which the first message belongs is the same as the sequence number of the first message.
  • the network device directly forwards the first message to the destination terminal and updates the sequence number of the current message to be sent corresponding to the business flow to which the first message belongs to the sequence number of the next message of the first message.
  • step S151 can be successfully repeated to detect whether the sequence number of the current message to be sent corresponding to the business flow to which the first message belongs is the same as the sequence number of the first message.
  • the first message is forwarded to the destination terminal, and the sequence number of the current message to be sent corresponding to the business flow to which the first message belongs is updated to the sequence number of the next message of the first message.
  • the network device After the preset duration is reached, if the sequence number of the current message to be sent corresponding to the service flow to which the first message belongs is still different from the sequence number of the first message, it means that the last message to be forwarded is lost, and the network device directly forwards the first message to the destination terminal, and updates the sequence number of the current message to be sent corresponding to the service flow to which the first message belongs to the sequence number of the next message of the first message.
  • the preset duration can be set according to actual needs.
  • the network device detects that the sequence number of the current message to be sent corresponding to the business flow to which the first message belongs is the same as the sequence number of the first message, it forwards the first message to the destination terminal and updates the sequence number of the current message to be sent corresponding to the business flow to which the first message belongs to the sequence number of the next message of the first message.
  • the network device implements message order preservation through the sequence number of the message, thereby ensuring that the destination terminal performs correct service processing based on the message.
  • the step of the intermediate network device and the destination network device forwarding the first message to the destination terminal may be refined into the following steps:
  • Step S161 store the first message in the scheduling queue corresponding to the service flow to which the first message belongs.
  • the network device for a network device supporting forwarding at a specified period, is configured with scheduling queues corresponding to different service flows. After acquiring the first message, the network device determines the scheduling queue corresponding to the service flow to which the first message belongs, and then stores the first message in the determined scheduling queue.
  • Step S162 sorting the messages in the scheduling queue according to the sequence numbers of the messages.
  • the network device After storing the first message in the determined scheduling queue, the network device sorts all messages in the scheduling queue.
  • Step S163 when the scheduling period of the scheduling queue is reached, forward the message in the scheduling queue to the destination terminal.
  • the network device can monitor in real time whether the scheduling period of the scheduling queue has been reached. When the scheduling period of the scheduling queue has been reached, the network device can directly forward the sorted messages in the scheduling queue.
  • the network device realizes message order preservation through the sequence number of the message, ensuring that the destination terminal performs correct service processing based on the message.
  • forwarding messages according to the specified period can ensure that the transmission delay and jitter are within the predetermined range, achieving deterministic transmission, making the technical solution provided by the embodiment of the present application more suitable for industrial Internet.
  • the destination network device is used as the execution subject
  • the tunnel is an SR tunnel
  • the transmission information includes the source IP (SIP) and the destination IP (DIP).
  • Step S171 The destination network device receives a message.
  • the message may be obtained by performing SR tunnel encapsulation on an IPv4 message, or may be obtained by performing SR tunnel encapsulation on an IPv6 message, or may be an IPv4 message or an IPv6 message.
  • Step S172 the destination network device determines whether the message comes from the multiple transmission and selective reception path. If the message comes from the multiple transmission and selective reception path, step S174 is executed; if the message does not come from the multiple transmission and selective reception path, step S173 is executed;
  • Step S173 The destination network device forwards the message normally.
  • the received message is an IPv4 message or an IPv6 message, etc.
  • Step S174 The destination network device extracts the flow label in the tunnel header of the message.
  • Step S175 The destination network device performs SR tunnel termination, that is, strips off the tunnel header of the message to obtain the original message.
  • Step S176 The destination network device extracts the SIP+DIP of the original message.
  • Step S177 The destination network device performs a table lookup operation according to the extracted flow label, SIP, and DIP.
  • the table stores the message information such as flow labels, SIP and DIP extracted from the messages received in the multiple transmission and selective reception paths.
  • Step S178 the destination network device determines whether the extracted flow label, SIP and DIP exist in the table. If yes, execute step S179; if not, execute step S1710.
  • Step S179 the destination network device discards the message; then execute step S1711.
  • Step S1710 The destination network device adds an entry including the extracted flow label, SIP, and DIP to the table; then, step S1713 is executed.
  • Step S1711 the destination network device detects whether the table entries including the extracted flow label, SIP and DIP have reached the aging time; if so, execute step S1712; if not, execute step S1713.
  • Step S1712 The destination network device deletes the table entry including the extracted flow label, SIP, and DIP.
  • the aging mechanism is used to dynamically delete table entries to avoid expansion of table entries and to avoid the problem of erroneous packet discarding due to flow label flipping.
  • Step S1713 The destination network device waits to receive the next message.
  • the destination network device is used as the execution subject
  • the tunnel is an SR tunnel
  • the second transmission information includes quintuple information, MF and fragment offset.
  • Step S181 The destination network device receives a message.
  • the message may be a message obtained by performing SR tunnel encapsulation on an IPv4 message, or may be an IPv4 message or an IPv6 message.
  • Step S182 the destination network device determines whether the message comes from the multiple transmission and selective reception path. If the message comes from the multiple transmission and selective reception path, step S184 is executed; if the message does not come from the multiple transmission and selective reception path, step S183 is executed;
  • Step S183 The destination network device forwards the message normally.
  • the received message is an IPv4 message or an IPv6 message, etc.
  • Step S184 The destination network device performs SR tunnel termination, that is, strips off the tunnel header of the message to obtain the original message.
  • Step S185 The destination network device extracts the identification value, five-tuple information, MF and fragment offset of the original message.
  • Step S186 The destination network device performs a table lookup operation according to the extracted identification value, quintuple information, MF and fragment offset.
  • the table stores message information such as identification value, five-tuple information, MF and fragment offset extracted from messages received in the multiple transmission and selective reception path.
  • Step S187 the destination network device determines whether the extracted identification value, five-tuple information, MF and fragment offset exist in the table. If yes, execute step S188; if not, execute step S189.
  • Step S188 the destination network device discards the message; then execute step S1810.
  • Step S189 The destination network device adds a table entry including the extracted identification value, five-tuple information, MF and fragment offset to the table; then executes step S1812.
  • Step S1810 the destination network device detects whether the table entry including the extracted identification value, five-tuple information, MF and fragment offset reaches the aging time; if so, execute step S1811; if not, execute step S1812.
  • Step S1811 The destination network device deletes the table entry including the extracted identification value, quintuple information, MF and fragment offset.
  • the aging mechanism is used to dynamically delete table entries to avoid expansion of table entries and to avoid the problem of erroneous packet discarding due to flow label flipping.
  • Step S1812 The destination network device waits to receive the next message.
  • the network device may also set an aging task separately to delete the table entries that have reached the aging time but have not been actively deleted because they are not matched by subsequent messages, such as the table entries that have not been actively deleted due to the description of the above steps S178-S1713 or the above steps S187-S1812 not being executed.
  • the aging task may be implemented by hardware or software, or both, and this is not limited.
  • an embodiment of the present application further provides a data processing device, as shown in FIG. 19 , which is applied to any forwarding chip in a network device, and the network device is a network device on a multiple transmission and selective reception path, and the device includes:
  • An acquisition unit 191 is used to acquire a first message that needs to be forwarded through a multiple transmission and reception selection path;
  • the first processing unit 192 is configured to forward the first message to the next-hop network device on the multi-transmitting and selectively receiving path respectively through the multiple paths included in the multi-transmitting and selectively receiving path if the network device is a source network device on the multi-transmitting and selectively receiving path;
  • the second processing unit 193 is configured to forward the first message to a next-hop network device on the multi-transmitting and selectively receiving path if the network device is an intermediate network device on the multi-transmitting and selectively receiving path;
  • the third processing unit 194 is used to extract message information from the first message if the network device is a destination network device on a multi-transmission and selective receiving path, and when the extracted message information is not stored in the network device, store the extracted message information and forward the first message to the destination terminal, and the message information of the first message is used to distinguish different messages of the same business flow and different messages of different business flows.
  • the acquisition unit 191 may be specifically configured to:
  • the first message is determined according to the second message.
  • the acquisition unit 191 may be specifically configured to:
  • the message information of the second message is updated to obtain the first message
  • the second message is determined to be the first message.
  • the acquisition unit 191 may also be used to:
  • the second message is forwarded to the determined next-hop network device.
  • the data processing device may further include a determination unit, configured to determine whether the second message is a message that needs to be forwarded through a multiple transmission and reception selection path, and may be specifically configured to:
  • the second message is a message that needs to be forwarded through the multiple transmission and reception path
  • the second message is a message that does not need to be forwarded through the multiple transmission and reception selection path.
  • the path information may include at least one of the following information:
  • the message information may include a flow label
  • a tunnel header is encapsulated for the second message to obtain a first message, wherein the value in the flow label field of the tunnel header is the obtained first count value.
  • the acquisition unit 191 may also be used to:
  • the first count value of the current flow label is increased by 1.
  • the message information includes a flow label and first transmission information
  • the first transmission information includes any one of the following groups of information: a source address and a destination address corresponding to the service flow; five-tuple information corresponding to the service flow;
  • the third processing unit 194 may be specifically configured to:
  • the transmission information is extracted from the message header of the third message.
  • the flow label ranges configured for all forwarding chips do not overlap, and the flow label range corresponding to the network device overlaps or does not overlap with the flow label ranges corresponding to other network devices in the network to which the network device belongs.
  • the flow label ranges corresponding to different service flows are the same or different; in a service flow, the flow labels corresponding to the same message are the same, and the flow labels corresponding to different messages are different.
  • the message information may include an identification value
  • the acquisition unit 191 may be specifically used for:
  • the acquired second count value is filled into the identification field in the message header of the second message, and a tunnel header is encapsulated for the second message to obtain the first message.
  • the acquisition unit 191 may also be used to:
  • the second count value of the current identification value is increased by 1.
  • the acquisition unit 191 may also be used to:
  • the tunnel header is encapsulated into the second message to obtain the first message.
  • the message information may include an identification value and second transmission information, and the second transmission information includes one or more of quintuple information, a more fragmentation flag bit, and a fragmentation offset;
  • the third processing unit 194 may be specifically configured to:
  • the identification value ranges configured for all forwarding chips do not overlap; the identification value range corresponding to the network device overlaps or does not overlap with the identification value ranges corresponding to other network devices in the network to which the network device belongs.
  • the ranges of identification values corresponding to different business flows are the same or different; in a business flow, the identification values corresponding to the same message are the same, and the identification values corresponding to different messages are different.
  • the data processing device may further include:
  • the discarding unit is used to discard the first message if the extracted message information is stored in the network device after extracting the message information from the first message.
  • the data processing device may further include: an aging unit,
  • the extracted message information After extracting the message information from the first message, if the extracted message information is stored in the network device, detecting whether the extracted message information stored in the network device has reached an aging time; if the aging time has been reached, deleting the extracted message information stored in the network device; or
  • the third processing unit 194 may be specifically configured to:
  • sequence number of the current to-be-sent message corresponding to the service flow to which the first message belongs is the same as the sequence number of the first message, forwarding the first message to the destination terminal;
  • the first message is forwarded to the destination terminal.
  • the third processing unit 194 may be specifically configured to:
  • the message in the scheduling queue is forwarded to the destination terminal.
  • the forwarding chip in the network device after the forwarding chip in the network device obtains the first message that needs to be forwarded through the multi-transmission selective receiving path, it can immediately process the message, such as forwarding the first message to the destination terminal when the message information of the first message is not stored locally in the network device.
  • a hardware forwarding chip is used to complete the message forwarding in multi-transmission selective receiving, which improves the message forwarding efficiency while ensuring the reliability of message transmission.
  • an embodiment of the present application further provides a forwarding chip that executes any of the above-mentioned data processing method steps.
  • an embodiment of the present application further provides a network device, which includes at least one forwarding chip, and the forwarding chip is used to execute any of the steps of the above-mentioned data processing method.
  • the forwarding chip can be a hardware processing chip such as NP (Network Processor), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, digital signal processors (DSP), discrete gate or transistor logic devices, discrete hardware components, etc., or a combination of multiple chips, without limitation.
  • NP Network Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP digital signal processors
  • discrete gate or transistor logic devices discrete hardware components, etc., or a combination of multiple chips, without limitation.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated.
  • the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
  • SSD Solid State Disk

Abstract

一种数据处理方法、装置、转发芯片及网络设备,该方法包括:获取需要通过多发选收路径转发的第一报文;若网络设备为多发选收路径上的源网络设备,则通过多发选收路径包括的多条路径,分别向多发选收路径上的下一跳网络设备转发第一报文;若网络设备为多发选收路径上的中间网络设备,则向多发选收路径上的下一跳网络设备转发第一报文;若网络设备为多发选收路径上的目的网络设备,则从第一报文中提取报文信息;若网络设备中未存储所提取的报文信息,则存储所提取的报文信息,并向目的终端转发第一报文。应用本申请实施例提供的技术方案,能够提高报文转发效率。

Description

一种数据处理方法、装置、转发芯片及网络设备 技术领域
本申请涉及通信技术领域,特别是涉及一种数据处理方法、装置、转发芯片及网络设备。
背景技术
为保证互联网服务的连续性,常采用多发选收机制,转发报文。目前,多发选收机制是通过软件实现,转发逻辑复杂,报文转发效率低。
发明内容
本申请实施例的目的在于提供一种数据处理方法、装置、转发芯片及网络设备,以提高报文转发效率。具体技术方案如下:
第一方面,本申请实施例提供了一种数据处理方法,应用于网络设备中的任一转发芯片,所述网络设备为多发选收路径上的网络设备,所述方法包括:
获取需要通过所述多发选收路径转发的第一报文;
若所述网络设备为所述多发选收路径上的源网络设备,则通过所述多发选收路径包括的多条路径,分别向所述多发选收路径上的下一跳网络设备转发所述第一报文;
若所述网络设备为所述多发选收路径上的中间网络设备,则向所述多发选收路径上的下一跳网络设备转发所述第一报文;
若所述网络设备为所述多发选收路径上的目的网络设备,则从所述第一报文中提取报文信息,在所述网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发所述第一报文,所述第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
第二方面,本申请实施例还提供了一种数据处理装置,应用于网络设备中的任一转发芯片,所述网络设备为多发选收路径上的网络设备,所述装置包括:
获取单元,用于获取需要通过所述多发选收路径转发的第一报文;
第一处理单元,用于若所述网络设备为所述多发选收路径上的源网络设备,则通过所述多发选收路径包括的多条路径,分别向所述多发选收路径上的下一跳网络设备转发所述第一报文;
第二处理单元,用于若所述网络设备为所述多发选收路径上的中间网络设备,则向所述多发选收路径上的下一跳网络设备转发所述第一报文;
第三处理单元,用于若所述网络设备为所述多发选收路径上的目的网络设备,则从所述第一报文中提取报文信息,在所述网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发所述第一报文,所述第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
第三方面,本申请实施例提供了一种转发芯片,执行上述任一所述的数据处理方法步骤。
第四方面,本申请实施例提供了一种网络设备,所述网络设备包括至少一个转发芯片,所述转发芯片用于执行上述任一所述的数据处理方法步骤。
本申请实施例提供的技术方案中,网络设备中的转发芯片在获取到需要通过多发选收路径转发的第一报文后,可以立即对报文进行处理,如在网络设备本地未存储第一报文的报文信息时,向目的终端转发第一报文。相对于使用软件实现多发选收中的报文转发时,需要等待接收到多发选收路径转发的所有 第一报文后才对报文进行处理,本申请实施例提供的技术方案中,使用硬件的转发芯片完成多发选收中的报文转发,在保证报文传输可靠性的同时,提高了报文转发效率。
当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。
附图说明
为了更清楚地说明本发明实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为主备路径机制的一种示意图;
图2为多发选收机制的一种示意图;
图3为本申请实施例提供的数据处理方法的第一种流程示意图;
图4为本申请实施例提供的数据处理方法的第二种流程示意图;
图5为本申请实施例提供的IPv4报文头格式的一种示意图;
图6为本申请实施例提供的IPv6报文头格式的一种示意图;
图7为本申请实施例提供的SRv6报文头格式的一种示意图;
图8为本申请实施例提供的业务流与流标签范围的对应关系的一种示意图;
图9为本申请实施例提供的原始报文与流标签的对应关系的一种示意图;
图10为本申请实施例提供的更新第二报文的报文信息得到第一报文的第一种示意图;
图11为本申请实施例提供的从第一报文中提取报文信息的第一种示意图;
图12为本申请实施例提供的更新第二报文的报文信息得到第一报文的第二种示意图;
图13为本申请实施例提供的报文转发逻辑的一种示意图;
图14为本申请实施例提供的从第一报文中提取报文信息的第二种示意图;
图15为本申请实施例提供的转发第一报文步骤的第一种示意图;
图16为本申请实施例提供的转发第一报文步骤的第二种示意图;
图17为本申请实施例提供的数据处理方法的第三种流程示意图;
图18为本申请实施例提供的数据处理方法的第四种流程示意图;
图19为本申请实施例提供的数据处理装置的一种结构示意图。
具体实施方式
为使本发明的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本发明进一步详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
确定性网络是通信技术领域的研究热点技术之一,IETF(The Internet Engineering Task Force,国际互联网工程任务组)成立了专门的工作组聚焦网络的可靠性、时延和抖动等相关技术的研究。在工业场景中,确定性网络需要提供99.9999%的可靠性保障,在链路和节点故障时仍然能提供服务的连续性。
在传统的IP(Internet Protocol,网际协议)转发、MPLS(Multi-Protocol Label Switching,多协议标签交换)或SR(Segment Routing,分段路由)转发中,可靠性保障通过者主备路径的方式进行。但是上述主备路径的方式存在一个显著问题,也就是,在路径或者节点发生故障时,需要时间收敛,收敛 的时间一般为50ms(毫秒)。
如图1所示的主备路径机制,在CE(Customer Edge,用户边缘设备)1和CE2之间部署了主路径和备路径,其中,主路径上的设备包括PE(Provider Edge,提供商边缘设备)1、P(Provider,提供商设备)1和PE3等节点,备路径上的设备包括PE1、PE2、P2、PE4和PE3等节点。当主路径故障时,需要切换至备路径,利用备路径转发报文。但是从主路径切换至备路径,需要进行路径检测和切换,而路径检测和切换均需要时间,该过程的最短收敛时间在50ms左右,这段时间内报文仍然会沿主路径转发,进而导致丢包。
50ms的收敛时间在消费类应用中是没有问题的,但是在自动驾驶或现场生产等产业互联网中存在很大的问题,50ms的收敛时间足够产生重大事故,因此定义了多发选收机制,来保障服务的连续性,实现在任何一个链路或节点发生故障时,对转发业务没有任何影响。多发选收机制表示同一条业务流被同时发往多条路径,在接收端进行去重排序后,再转发给目的端。
如图2所示的多发选收机制,与执行终端连接的发送端PE1进行报文复制,同时通过粗实线表示的路径1和粗虚线表示的路径2转发报文,路径1上的设备包括PE1、P1、P2和PE2,路径2上的设备包括PE1、P3、P4和PE2;与控制端连接的接收端PE2收到报文后进行去重排序后,再转发报文。任何一条路径发生故障,对报文转发没有影响,从而实现了报文转发的高可靠性。其中,执行终端可以为主机或相机等。
在多发选收机制保障了高可靠性的同时,执行多发选收也是需要代价的,需要对同样的报文在发送端进行复制转发,接收端需要选收、去重和排序,这增加了设备转发逻辑的复杂度,同时带来带宽的消耗。此外,现有技术中的多发选收机制通过软件实现,需要等待接收到多发选收路径转发的所有同一报文后才对报文进行处理,报文转发效率低。
为提高报文转发效率,本申请实施例提供了一种数据处理方法,该方法中,网络设备中的转发芯片在获取到需要通过多发选收路径转发的第一报文后,可以立即对报文进行处理,如在网络设备本地未存储第一报文的报文信息时,向目的终端转发第一报文。相对于使用软件实现多发选收中的报文转发时,需要等待接收到多发选收路径转发的所有第一报文后才对报文进行处理,本申请实施例提供的技术方案中,使用硬件的转发芯片完成多发选收中的报文转发,在保证报文传输可靠性的同时,提高了报文转发效率。
下面通过具体实施例,对本申请实施例提供的数据处理方法进行详细说明。
如图3所示,本申请实施例提供了一种数据处理方法,该方法应用于网络设备中的任一转发芯片,该网络设备为多发选收路径上的网络设备,如源网络设备,如图2中的PE1;中间网络设备,如图2中的P1-P4;目的网络设备,如图2中的PE2。
本申请实施例中,网络设备可以为路由器、交换机等具有通信功能的设备。网络设备可以包括一个或多个转发芯片,转发芯片可以为NP(Network Processor,网络处理器)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、数字信号处理器(Digital Signal Processor,DSP)、分立门或者晶体管逻辑器件、分立硬件组件等硬件处理芯片,也可以采用多个芯片结合,对此不进行限定。
参见图3,上述数据处理方法包括如下步骤:
步骤S31,获取需要通过多发选收路径转发的报文;
步骤S32,若网络设备为多发选收路径上的源网络设备,则通过多发选收路径包括的多条路径,分别向多发选收路径上的下一跳网络设备转发第一报文;
步骤S33,若网络设备为多发选收路径上的中间网络设备,则向多发选收路径上的下一跳网络设备转发第一报文;
步骤S34,若网络设备为多发选收路径上的目的网络设备,则从第一报文中提取报文信息,在网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发第一报文,第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
本申请实施例提供的数据处理方法中,网络设备中的转发芯片在获取到需要通过多发选收路径转发的第一报文后,可以立即对报文进行处理,如在网络设备本地未存储第一报文的报文信息时,向目的终端转发第一报文。相对于使用软件实现多发选收中的报文转发时,需要等待接收到多发选收路径转发的所有第一报文后才对报文进行处理,本申请实施例提供的技术方案中,使用硬件的转发芯片完成多发选收中的报文转发,在保证报文传输可靠性的同时,提高了报文转发效率。
上述步骤S31中,第一报文可以为IPv4报文、IPv6报文或SRv6(Segment Routing IPv6,基于IPv6的分段路由)报文。多发选收路径包括至少两条路径。多发选收路径可以采用SR隧道、MPLS SR隧道或者IPv6SR隧道实现,对此不进行限定。
本申请实施例中,网络设备可以预先存储通过多发选收路径转发的业务流所对应的路径信息,该路径信息可以包括以下至少一组信息:用于转发业务流的逻辑口;业务流对应的源地址和目的地址;业务流对应的五元组信息。五元组信息可以包括源IP地址、目的IP地址、源端口、目的端口和传输协议等。
网络设备可以根据预先存储的路径信息,识别出需要通过多发选收路径转发的报文,即第一报文。
例如,网络设备检测第一报文所属业务流对应的路径信息与预先存储的路径信息是否匹配;若匹配,则确定第一报文为需要通过多发选收路径转发的报文;若不匹配,则确定第一报文为不需要通过多发选收路径转发的报文。
在获取到需要通过多发选收路径转发的第一报文后,网络设备判定自身在多发选收路径上的角色,该角色为源网络设备、中间网络设备或目的网络设备。当判定网络设备在多发选收路径上的源网络设备时,执行上述步骤S32;当判定网络设备在多发选收路径上的中间网络设备时,执行上述步骤S33;当判定网络设备在多发选收路径上的目的网络设备时,执行上述步骤S34。
上述步骤S32中,源网络设备在多发选收路径包括的每条路径上分别复制一份第一报文,进而通过多发选收路径包括的多条路径,分别向多发选收路径上的下一跳网络设备转发第一报文。如上述图2所示,PE1为源网络设备,PE1在分别复制一份第一报文,在粗实线表示的路径和粗虚线表示的路径上,分别向下一跳网络设备P1和P3转发报文,进而实现通过两条路径转发同一个第一报文。
上述步骤S33中,中间网络设备在获取到需要通过多发选收路径转发的第一报文后,直接向多发选收路径上的下一跳网络设备转发第一报文,拒绝对第一报文进行其他处理。如上述图2所示,P1为中间网络设备,P1获取到需要通过多发选收路径转发的第一报文后,向下一跳网络设备P2转发报文。
上述步骤S34中,目的网络设备从第一报文中提取报文信息,并判断目的网络设备中是否存储有所提取的报文信息;若目的网络设备未存储所提取的报文信息,则说明当前接收的第一报文为通过多发选收路径接收到的相应业务流的第一个报文,目的网络设备存储所提取的报文信息,确定第一报文的目的终端,并向目的终端转发第一报文。
本申请实施例中,网络设备可以采用表格的形式存储报文信息,也可以采用分布式数据库的方式存储报文信息,还可以采用其他方式存储报文信息,对此不进行限定。
在一些实施例中,基于图3所示实施例,还提供了一种数据处理方法,如图4所示,该方法可以包括如下步骤:
步骤S41,接收第二报文;
步骤S42,若确定第二报文为需要通过多发选收路径转发的报文,则根据第二报文,确定第一报文;
步骤S43,若网络设备为多发选收路径上的源网络设备,则通过多发选收路径包括的多条路径,分别向多发选收路径上的下一跳网络设备转发第一报文;
步骤S44,若网络设备为多发选收路径上的中间网络设备,则向多发选收路径上的下一跳网络设备转发第一报文;
步骤S45,若网络设备为多发选收路径上的目的网络设备,则从第一报文中提取报文信息,在网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发第一报文,第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
步骤S43-S45部分可以参见上述步骤S32-S34部分的相关描述。
本申请实施例提供的技术方案中,对于需要通过多发选收路径转发的第二报文,网络设备根据第二报文,确定第一报文,使得所确定的第一报文的报文信息能够区分同一条业务流的不同报文和不同业务流的不同报文,也就是,需要通过多发选收路径转发的不同报文,其报文信息不同。这为多发选收路径上的目的网络设备在转发芯片层快速准确的去重处理提供了基础。
上述步骤S41中,第二报文可以为IPv4报文或IPv6报文,为主机发送的原始IP报文。
本申请实施例中,网络设备可以预先存储通过多发选收路径转发的业务流对应的路径信息。网络设备可以根据预先存储的路径信息,识别出第二报文是否为需要通过多发选收路径转发的报文。
例如,网络设备检测第二报文所属业务流对应的路径信息与预先存储的路径信息是否匹配;若匹配,则确定第二报文为需要通过多发选收路径转发的报文;若不匹配,则确定第二报文为不需要通过多发选收路径转发的报文。
在确定第二报文为需要通过多发选收路径转发的报文时,对于源网络设备,上述执行步骤S42可以为:源网络设备更新第二报文的报文信息,得到第一报文。由于第二报文为需要通过多发选收路径转发的报文,则基于第二报文所获得的第一报文也是需要通过多发选收路径转发的报文。
另外,更新后的第二报文的报文信息,也就是第一报文的报文信息可以用于区分同一条业务流的不同报文和不同业务流的不同报文。这便于多发选收路径上的目的网络设备准确地区分出同一报文和不同报文,进而快速准确地完成去重处理。
在确定第二报文为需要通过多发选收路径转发的报文时,对于中间网络设备或目的网络设备,以中间网络设备为例,中间网络设备可以认为所接收的第二报文为源网络设备更新了报文信息后的报文,即第二报文的报文信息可以用于区分同一条业务流的不同报文和不同业务流的不同报文,将第二报文直接确定为第一报文。
在一些实施例中,若第二报文为不需要通过多发选收路径转发的报文,则网络设备可以直接转发第二报文,如查询路由表,确定出下一跳网络设备,进而向确定出的下一跳网络设备转发第二报文。
在一些实施例中,报文信息可以包括流标签。流标签用于表示业务流信息。为了提高区分不同报文 的准确性,报文信息还可以包括第一传输信息,第一传输信息包括以下任一组信息:业务流对应的源地址和目的地址;业务流对应的五元组信息。
本申请实施例中,第一传输信息采用业务流对应的源地址和目的地址表示,还是采用业务流对应的五元组信息表示,可以根据业务流的大小确定。例如,当通过多发选收路径转发的业务流的流量大于预设流量阈值时,第一传输信息采用业务流对应的五元组信息表示,提高区分同一条业务流的不同报文和不同业务流的不同报文的精度,提高了目的网络设备进行报文去重处理的准确度;当通过多发选收路径转发的业务流的流量小于或等于预设流量阈值时,第一传输信息采用业务流对应的源地址和目的地址表示,以降低目的网络设备进行报文去重处理的效率。
其中,业务流对应的源地址和目的地址或五元组信息封装在原始报文的报文头中。
以原始报文为IPv4报文为例,IPv4报文头格式如图5所示,IPv4报文头中包括版本(version)、头部长度(helen)、服务类型(service type)、总长度(total length)、标识(Identification)、标记(flags)、分片偏移(fragmentation Offset)、生存时间(time to live)、协议(Protocol)、头部校验和(header checksum)、源IP地址和目的IP地址等。IPv4报文头结合需要传输的数据构成IPv4报文。从图5可以获取,源网络设备可以从IPv4报文头中提取到源地址和目的地址或五元组信息。
以原始报文为IPv6报文为例,IPv6报文头格式如图6所示,IPv6报文头中包括40个八字节的基本头和长度可变的扩展头,基本头包括版本(version)、业务类别(traffic class)、流标签(flow lable)、有效载荷长度(payload length)、下一个头(next header)、跳数限制(hop limit)、源IP地址和目的IP地址等。IPv6报文头结合需要传输的数据构成IPv6报文。从图6可以获取,源网络设备可以从IPv6报文头中提取到源地址和目的地址。
另外,流标签封装在隧道头中。
以SRv6报文为例,隧道头为SRv6报文头,如图7所示,除包括上述IPv6报文头中的基本头外,还包括SRH(Segment Routing Header,分段路由头),SRH包括下一个头(next header)、扩展头长度(Hdr Ext Len)、路由类型(Routing type)、剩余分段数(Segment Left)、最后一个元素的索引(last entry)、标记(flags)、标签(tag)、分段列表(Segment list)和可选的TLV(Type Length Value,类型长度值)等。结合SRv6报文头和IPv6有效载荷构成SRv6报文,本申请实施例中,SRv6报文中IPv6有效载荷为多发选收路径上的源网络设备接收的第二报文。
本申请实施例中,网络设备可以包括多个转发芯片。在网络设备包括的转发芯片数量为多个时,所有转发芯片配置的流标签范围均不重叠。另外,网络设备对应的流标签范围与该网络设备所属网络中的其他网络设备对应的流标签范围可以重叠,也可以不重叠。
对于包括多个转发芯片的网络设备,如框式设备,为每个转发芯片分配不同的流标签范围,以保证不同转发芯片的流标签范围不重叠,也就是,对于一个网络设备而言,每个流标签是唯一的,不存在重叠的。这可以避免为同一条业务流的不同报文分配了相同的流标签,导致目的网络设备将并非同一报文的报文被丢弃,影响报文转发效率。
另外,对于不同网络设备的流标签范围是可以重叠的,也就是不同网络设备对应的不同业务流的标签范围是可以重叠的,基于此,报文信息中除包括流标签外,还可以包括其他信息,如上述第一传输信息等,结合流标签和第一传输信息可以准确地区分具有相同流标签、属于不同业务流的报文,进而不会出现将并非同一报文的报文被丢弃的情况。
本申请实施例中,不同业务流对应的流标签范围可以相同,也可以不同。如图8所示的4条业务流对应的流标签范围1~M相同。图8中,DIP(Destination IP,目的IP)1+SIP(Source IP,源IP)1表示一条业务流,DIP1+SIP2表示一条业务流,DIP2+SIP1表示一条业务流,DIP2+SIP2表示一条业务流。
另外,一条业务流中,同一个报文对应的流标签相同,不同报文对应的流标签不同。如图9所示,四行报文包括流标签、外部IP、SRH和原始IP,即四行报文对应原始IP为DIP+SIP的原始报文,流标签为IPv6基本头中的流标签,外部IP为IPv6基本头中的源IP和目的IP。前两行对应同一个原始报文,这个前两行的报文分别通过SRH1和SRH2指示的两个多发选收路径转发,其隧道头中的流标签均为流标签1。后两行对应同一个原始报文,这个后两行的报文分别通过SRH1和SRH2指示的两个多发选收路径转发,其隧道头中的流标签均为流标签2。前两行的报文和后两行的报文属于同一业务流,流标签1与流标签2不同。可见,在一条业务流中,流标签和原始报文一一对应。
通过上述配置,多发选收路径上的目的网络设备可以准确地实现去重。
在一些实施例中,在报文信息包括流标签的情况下,如图10所示,上述源网络设备更新第二报文的报文信息,得到第一报文的步骤,可以包括:
步骤S101,获取第二报文所属业务流的当前流标签的第一计数值。
本申请实施例中,为每条业务流配置一个计数器,该计数器的取值范围与业务流对应的流标签范围一致。计数器的计数规则为:每发送一次报文,计数值加1。
实际应用中,存在某些应用或者操作系统不支持流标签的情况,第二报文中的流标签可能被赋值为0,这导致流标签不能唯一表示一条业务流,更无法作为一个报文的唯一标识。为准确地区分同一条业务流的不同报文,源网络设备为原始报文(即第二报文)的流标签赋值,如基于第二报文的五元组信息,确定第二报文所属的业务流,进而获取该业务流的当前流标签的计数值,即第一计数值。该第一计数值即为第二报文所属业务流对应的计数器的当前计数值。
步骤S102,为第二报文封装隧道头,得到第一报文,隧道头的流标签字段中的值为所获取的第一计数值。
在获取到第一计数值后,源网络设备可以将隧道头的流标签字段的值更新为第一计数值,并为第二报文封装更新后的隧道头,得到第一报文。
在获取到第一计数值后,源网络设备还可以为第二报文封装更新后的隧道头,得到第一报文,之后,将第一报文中隧道头的流标签字段的值更新为第一计数值。
本申请实施例提供的技术方案中,通过每条业务流的流标签计数值,为一条业务流中的不同报文分片不同的流标签,这有助于多发选收路径上的目的网络设备区分不同的报文和相同的报文,进而准确地进行去重处理。
在一些实施例中,源网络设备在为第二报文封装隧道头,得到第一报文之后,将当前流标签的第一计数值加1。也就是,源网络设备将第二报文所属业务流对应的计数器的当前计数值加1,后续再接收到第二报文所属业务流的报文时,可以直接获取源网络设备中记录的第一计数值,完成报文信息更新。
在一些实施例中,当网络设备为多发选收路径上的目的网络设备时,目的网络设备所提取的报文信息可以包括流标签和上述第一传输信息。
这种情况下,如图11所示,上述步骤S34中的从第一报文中提取报文信息的步骤可以包括步骤S111-S113。
步骤S111,从第一报文的隧道头中提取第一报文的流标签。
本申请实施例中,流标签为源网络设备重写的值,用于唯一标识一个报文。目的网络设备解析第一报文的隧道头,从第一报文的隧道头中提取第一报文的流标签。
步骤S112,剥离第一报文的隧道头,得到第三报文。
在获得隧道头中的第一报文的流标签后,目的网络设备执行隧道终结,即剥离第一报文的隧道头,得到第三报文。该第三报文为原始报文。
步骤S113,从第三报文的报文头中提取第一传输信息。
原始报文的报文头中存储有完整的传输信息。网络设备在得到第三报文后,对第三报文的报文头进行解析,得到第三报文的报文头所携带的传输信息。
后续,目的网络设备若确定未存储所提取的报文信息,则向目的终端转发第三报文。
本申请实施例提供的技术方案中,网络设备准确地提取到报文信息,基于提取到的报文信息,可以唯一确定出一个报文,进而保证了报文的准确去重。
在一些实施例中,报文信息可以包括标识值,如图5中的标识(Identification)。为了提取区分不同报文的准确性,报文信息还可以包括第二传输信息,第二传输信息可以包括五元组信息、更多分片标记位(如图5中的标记(flags))和分片偏移中的一种或多种。其中,第二传输信息均封装在原始报文的报文头中。
标识值用于区分分片信息,在存在分片报文的情况下,一个原始报文的各个分片报文的标识值一致;在不存在分片报文的情况下,可以按五元组信息赋予每个原始报文一个标识值,因此,区分某个业务流的某个报文,可以采用五元组+标识值(Identification)+MF(More Fragment,更多分片标记位)+分片偏移(FragOffset)来唯一表示。其中MF是IPv4头中的flags标记位,如存在分片时flags值为1,不存在分片时flags值为0。
通过上述标识值和第二传输信息,可以准确地区分不同的报文和相同的报文,进而准确地进行去重处理。
本申请实施例中,网络设备可以包括多个转发芯片。在网络设备包括的转发芯片数量为多个时,所有转发芯片配置的标识值范围均不重叠。网络设备对应的标识值范围与网络设备所属网络中的其他网络设备对应的标识值范围可以重叠,也可以不重叠。
对于包括多个转发芯片的网络设备,如框式设备,为每个转发芯片分配不同的标识值范围,以保证不同转发芯片的标识值范围不重叠,也就是,对于一个网络设备而言,每个标识值是唯一的,不存在重叠的。这可以避免为同一条业务流的不同报文分配了相同的标识值,导致目的网络设备将并非同一报文的报文被丢弃,影响报文转发效率。
另外,对于不同网络设备的标识值范围是可以重叠的,也就是不同网络设备对应的不同的业务流的标签范围是可以重叠的,而报文信息中除包括标识值外,还可以包括其他信息,如上述第二传输信息等,结合标识值和第二传输信息可以准确地区分具有相同标识值、属于不同业务流的报文,进而不会出现将并非同一报文的报文被丢弃的情况。
本申请实施例中,不同业务流对应的标识值范围可以相同,也可以不同。另外,一条业务流中,同一个报文对应的标识值相同,不同报文对应的标识值不同。通过上述配置,多发选收路径上的目的网络设备可以准确地实现去重。
在一些实施例中,在报文信息包括标识值的情况下,如图12所示,上述源网络设备更新第二报文的报文信息,得到第一报文的步骤,可以包括:
步骤S121,若第二报文的报文头中的标识字段中的值为空,则获取第二报文所属业务流的当前标识值的第二计数值。
本申请实施例中,为每条业务流配置一个计数器,该计数器的取值范围与业务流对应的标识值范围一致。计数器的计数规则为:每发送一次报文,计数值加1。
实际应用中,存在某些应用或者操作系统对原始报文的标识值不赋值的情况。为准确的区分同一条业务流的不同报文,源网络设备为原始报文(即第二报文)的标识值赋值,如基于第二报文的五元组信息,确定第二报文所属的业务流,进而获取该业务流的当前标识值的计数值,即第二计数值。该第二计数值即为第二报文所属业务流对应的计数器的当前计数值。
步骤S122,将第二计数值填充至第二报文的报文头中的标识字段,并为第二报文封装隧道头,得到第一报文。
在获取到第二计数值后,源网络设备可以将第二报文的报文头中的标识字段的值更新为第二计数值,并为第二报文封装隧道头,得到第一报文。这里的隧道头可参见上述图7所示的SRv6报文头。
本申请实施例提供的技术方案中,通过每条业务流的标识值计数值,为一条业务流中的不同报文分片不同的标识值,这有助于多发选收路径上的目的网络设备区分不同的报文和相同的报文,进而准确地进行去重处理。
在一些实施例中,源网络设备在为第二报文封装隧道头,得到第一报文之后,将当前标识值的第二计数值加1。也就是,源网络设备将第二报文所属业务流对应的计数器的当前计数值加1,后续再接收到第二报文所属业务流的报文时,可以直接获取源网络设备中记录的第二计数值,完成报文信息更新。
在一些实施例中,若第二报文的报文头中的标识字段填充有标识值,则源网络设备不再更新报文信息,直接为第二报文封装隧道头,得到第一报文。
后续,源网络设备可以通过多发选收路径包括的多条路径,分别向多发选收路径上的下一跳网络设备转发第一报文。如图13所示,源网络设备通过SR1-SR3所指示的3条路径转发原始的IP报文。图13中,SR表示多发选收路径的中间隧道承载是分段路由。
本申请实施例中,中间隧道承载也可以是MPLS SR或者IPv6SR,对此不进行限定。
在一些实施例中,当网络设备为多发选收路径上的目的网络设备时,目的网络设备所提取的报文信息可以包括标识值和上述第二传输信息。
这种情况下,如图14所示,上述步骤S34中的从第一报文中提取报文信息的步骤可以包括步骤S141-S142。
步骤S141,剥离第一报文的隧道头,得到第三报文。
在获得第一报文后,目的网络设备执行隧道终结,即剥离第一报文的隧道头,得到第三报文。该第三报文为原始报文。
步骤S142,从第三报文的报文头中提取标识值和第二传输信息。
原始报文的报文头中存储有完整的传输信息。网络设备在得到第三报文后,对第三报文的报文头进行解析,得到第三报文的报文头所携带的传输信息。
后续,目的网络设备若确定未存储所提取的报文信息,则向目的终端转发第三报文。
本申请实施例提供的技术方案中,网络设备准确地提取到报文信息,基于提取到的报文信息,可以唯一确定出一个报文,进而保证了报文的准确去重。
在一些实施例中,若目的网络设备判定目的网络设备中存储有所提取的报文信息,则说明当前接收的第一报文不是通过多发选收路径接收到的相应业务流的第一个报文,即当前接收的第一报文为重复接收的报文,目的网络设备可以直接丢弃第一报文,完成去重处理。
在一些实施例中,目的网络设备配置老化机制,目的网络设备利用配置的老化机制,来实现报文信息的动态删除,以避免报文信息的膨胀,同时也避免报文信息翻转导致误丢弃报文的问题。
本申请实施例中,老化机制可以采用以下任一种或多种触发方式实现:
方式1,匹配式触发,具体可以为:在从第一报文中提取到报文信息之后,当获取到的第一报文的报文信息与网络设备中存储的报文信息匹配,即网络设备中存储有从第一报文中所提取的报文信息时,触发执行老化机制,也就是,检测网络设备中存储的所提取的报文信息是否达到老化时间;若达到老化时间,则删除网络设备中存储的所提取的报文信息。
方式2,周期式触发,具体可以为:周期性检测网络设备中存储的每个报文信息是否达到老化时间;进而从网络设备中存储的报文信息中,删除到达老化时间的报文信息。
方式3,实时式触发,具体可以为:实时监测网络设备中存储的每个报文信息;当监测到任一报文信息到达老化时间时,删除该任一报文信息。
本申请实施例中,老化机制还可以采用其他触发方式实现,对此不进行限定。
在一些实施例中,如图15所示,中间网络设备和目的网络设备向目的终端转发第一报文的步骤,可以细化为如下步骤:
步骤S151,检测第一报文所属业务流对应的当前待发送报文的序列号是否与第一报文的序列号相同;若相同,则执行步骤S152;若不同,则执行步骤S153。
步骤S152,向目的终端转发第一报文。
步骤S153,等待预设时长。
步骤S154,在到达预设时长前,若当前待发送报文的序列号与第一报文的序列号相同,则向目的终端转发第一报文。
步骤S155,在到达预设时长后,若当前待发送报文的序列号与第一报文的序列号不同,则向目的终端转发第一报文。
本申请实施例中,对于不支持指定周期转发的网络设备,第一报文被发出前,网络设备可以先将第一报文写入重排序缓冲器(buffer)中,并检测第一报文所属业务流对应的当前待发送报文的序列号是否与第一报文的序列号相同。
若相同,则说明在顺序转发报文时,正好轮到第一报文的转发,网络设备直接向目的终端转发第一报文,并更新第一报文所属业务流对应的当前待发送报文的序列号为第一报文的下一个报文的序列号。
若不同,则说明在顺序转发报文时,未轮到第一报文的转发,上一个需要转发的报文未接收到,网络设备暂时拒绝转发第一报文,等待预设时长;在等待的过程后,成功可以重复执行步骤S151,检测第一报文所属业务流对应的当前待发送报文的序列号是否与第一报文的序列号相同。
在到达预设时长前,若检测到第一报文所属业务流对应的当前待发送报文的序列号与第一报文的序列号相同,则向目的终端转发第一报文,并更新第一报文所属业务流对应的当前待发送报文的序列号为 第一报文的下一个报文的序列号。
在到达预设时长后,若第一报文所属业务流对应的当前待发送报文的序列号与第一报文的序列号仍然不同,则说明上一个需要转发的报文丢失,网络设备直接向目的终端转发第一报文,并更新第一报文所属业务流对应的当前待发送报文的序列号为第一报文的下一个报文的序列号。预设时长可以根据实际需求进行设定。
若等待预设时长过程中,网络设备检测到第一报文所属业务流对应的当前待发送报文的序列号与第一报文的序列号相同,则向目的终端转发第一报文,并更新第一报文所属业务流对应的当前待发送报文的序列号为第一报文的下一个报文的序列号。
本申请实施例提供的技术方案中,网络设备通过报文的序列号,实现了报文保序,保证了目的终端基于报文进行正确的业务处理。
在另一些实施例中,如图16所示,中间网络设备和目的网络设备向目的终端转发第一报文的步骤,可以细化为如下步骤:
步骤S161,将第一报文存储至第一报文所属业务流对应的调度队列。
本申请实施例中,对于支持指定周期转发的网络设备,网络设备配置了不同业务流对应的调度队列。在获取到第一报文后,网络设备确定第一报文所属业务流对应的调度队列,进而将第一报文存储至所确定的调度队列。
步骤S162,按照报文的序列号,对调度队列中的报文进行排序。
在将第一报文存储至所确定的调度队列后,网络设备对调度队列中的所有报文进行排序。
步骤S163,当到达调度队列的调度周期时,向目的终端转发调度队列中的报文。
网络设备可以实时监测是否到达调度队列的调度周期。当监测到到达调度队列的调度周期时,网络设备可以直接转发调度队列中的已排序好的报文。
本申请实施例提供的技术方案中,网络设备通过报文的序列号,实现了报文保序,保证了目的终端基于报文进行正确的业务处理。此外,按照指定周期转发报文,可以保证传输时延和抖动在预定范围内,实现确定性传输,使得本申请实施例提供的技术方案更为适用于产业互联网。
下面结合图17对本申请实施例提供的数据处理方法进行说明。图17中,以目的网络设备为执行主体,隧道为SR隧道,传输信息包括源IP(SIP)和目的IP(DIP)为例进行说明。
步骤S171,目的网络设备接收报文。该报文可以由IPv4报文进行SR隧道封装得到,也可以为由IPv6报文进行SR隧道封装得到,还可以为IPv4报文或IPv6报文等。
步骤S172,目的网络设备判断报文是否来自多发选收路径。若报文来自多发选收路径,则执行步骤S174;若报文不是来自多发选收路径,则执行步骤S173;
步骤S173,目的网络设备正常转发报文。
此时,所接收的报文为IPv4报文或IPv6报文等。
步骤S174,目的网络设备提取报文的隧道头中的流标签。
步骤S175,目的网络设备执行SR隧道终结,即剥离报文的隧道头,得到原始报文。
步骤S176,目的网络设备提取原始报文的SIP+DIP。
步骤S177,目的网络设备根据所提取的流标签、SIP和DIP,执行查表操作。
其中,表中存储有多发选收路径中已接收的报文中所提取的流标签、SIP和DIP等报文信息。
步骤S178,目的网络设备判断表中是否存在所提取的流标签、SIP和DIP。若存在,则执行步骤S179;若不存在,则执行步骤S1710。
步骤S179,目的网络设备丢弃报文;之后执行步骤S1711。
步骤S1710,目的网络设备在表中添加包括所提取的流标签、SIP和DIP的表项;之后执行步骤S1713。
步骤S1711,目的网络设备检测包括所提取的流标签、SIP和DIP的表项是否到达老化时间;若是,则执行步骤S1712;若否,则执行步骤S1713。
步骤S1712,目的网络设备删除包括所提取的流标签、SIP和DIP的表项。
通过老化机制来实现表项的动态删除,以避免表项的膨胀,同时也避免流标签翻转导致误丢弃报文的问题。
步骤S1713,目的网络设备等待接收下一个报文。
上述步骤S171-S1713部分描述相对简单,具体可参见上述图4-图11部分的相关描述。
下面结合图18对本申请实施例提供的数据处理方法进行说明。图18中,以目的网络设备为执行主体,隧道为SR隧道,第二传输信息包括五元组信息、MF和分片偏移为例进行说明。
步骤S181,目的网络设备接收报文。该报文可以为由IPv4报文进行SR隧道封装得到的报文,还可以为IPv4报文或IPv6报文等。
步骤S182,目的网络设备判断报文是否来自多发选收路径。若报文来自多发选收路径,则执行步骤S184;若报文不是来自多发选收路径,则执行步骤S183;
步骤S183,目的网络设备正常转发报文。
此时,所接收的报文为IPv4报文或IPv6报文等。
步骤S184,目的网络设备执行SR隧道终结,即剥离报文的隧道头,得到原始报文。
步骤S185,目的网络设备提取原始报文的标识值、五元组信息、MF和分片偏移。
步骤S186,目的网络设备根据所提取的标识值、五元组信息、MF和分片偏移,执行查表操作。
其中,表中存储有多发选收路径中已接收的报文中所提取的标识值、五元组信息、MF和分片偏移等报文信息。
步骤S187,目的网络设备判断表中是否存在所提取的标识值、五元组信息、MF和分片偏移。若存在,则执行步骤S188;若不存在,则执行步骤S189。
步骤S188,目的网络设备丢弃报文;之后执行步骤S1810。
步骤S189,目的网络设备在表中添加包括所提取的标识值、五元组信息、MF和分片偏移的表项;之后执行步骤S1812。
步骤S1810,目的网络设备检测包括所提取的标识值、五元组信息、MF和分片偏移的表项是否到达老化时间;若是,则执行步骤S1811;若否,则执行步骤S1812。
步骤S1811,目的网络设备删除包括所提取的标识值、五元组信息、MF和分片偏移的表项。
通过老化机制来实现表项的动态删除,以避免表项的膨胀,同时也避免流标签翻转导致误丢弃报文的问题。
步骤S1812,目的网络设备等待接收下一个报文。
上述步骤S181-S1812部分描述相对简单,具体可参见上述图4-图9和图12-图16部分的相关描述。
本申请实施例中,网络设备还可以单独设置一个老化任务,用来删除达到老化时间、但因为没有被 后续报文匹配导致没有被主动删除的表项,如没有执行上述步骤S178-S1713部分的描述,或上述步骤S187-S1812,导致没有被主动删除的表项。该老化任务可以由硬件或软件实现,也可以二者配合,对此不进行限定。
与上述数据处理方法对应,本申请实施例还提供了一种数据处理装置,如图19所示,应用于网络设备中的任一转发芯片,网络设备为多发选收路径上的网络设备,该装置包括:
获取单元191,用于获取需要通过多发选收路径转发的第一报文;
第一处理单元192,用于若网络设备为多发选收路径上的源网络设备,则通过多发选收路径包括的多条路径,分别向多发选收路径上的下一跳网络设备转发第一报文;
第二处理单元193,用于若网络设备为多发选收路径上的中间网络设备,则向多发选收路径上的下一跳网络设备转发第一报文;
第三处理单元194,用于若网络设备为多发选收路径上的目的网络设备,则从第一报文中提取报文信息,在网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发第一报文,第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
在一些实施例中,获取单元191,具体可以用于:
接收第二报文;
若确定第二报文为需要通过多发选收路径转发的报文,则根据第二报文,确定第一报文。
在一些实施例中,获取单元191,具体可以用于:
若网络设备为多发选收路径上的源网络设备,则更新第二报文的报文信息,得到第一报文;
若网络设备为多发选收路径上的中间网络设备或目的网络设备,则确定第二报文为第一报文。
在一些实施例中,获取单元191,还可以用于:
若确定第二报文为不需要通过多发选收路径转发的报文,则向确定出的下一跳网络设备转发第二报文。
在一些实施例中,上述数据处理装置还可以包括确定单元,用于确定第二报文是否为需要通过多发选收路径转发的报文,具体可以用于:
判断第二报文所属业务流对应的路径信息与预先存储的路径信息是否匹配,预先存储的路径信息为通过所述多发选收路径转发的业务流对应的路径信息;
若匹配,则确定第二报文为需要通过多发选收路径转发的报文;
若不匹配,则确定第二报文为不需要通过多发选收路径转发的报文。
在一些实施例中,路径信息可以包括以下至少一组信息:
用于转发业务流的逻辑口;
业务流对应的源地址和目的地址;
业务流对应的五元组信息。
在一些实施例中,报文信息可以包括流标签;
获取单元,具体用于:
获取第二报文所属业务流的当前流标签的第一计数值;
为第二报文封装隧道头,得到第一报文,隧道头的流标签字段中的值为所获取的第一计数值。
在一些实施例中,获取单元191,还可以用于:
在为第二报文封装隧道头,得到第一报文之后,将当前流标签的第一计数值加1。
在一些实施例中,报文信息包括流标签和第一传输信息,第一传输信息包括以下任一组信息:业务流对应的源地址和目的地址;业务流对应的五元组信息;
第三处理单元194,具体可以用于:
从第一报文的隧道头中提取第一报文的流标签;
剥离第一报文的隧道头,得到第三报文;
从第三报文的报文头中提取传输信息。
在一些实施例中,在网络设备包括的转发芯片数量为多个时,所有转发芯片配置的流标签范围均不重叠,网络设备对应的流标签范围与网络设备所属网络中的其他网络设备对应的流标签范围重叠或不重叠。
在一些实施例中,不同业务流对应的流标签范围相同或不同;一条业务流中,同一个报文对应的流标签相同,不同报文对应的流标签不同。
在一些实施例中,报文信息可以包括标识值;
获取单元191,具体可以用于:
若第二报文的报文头中的标识字段中的值为空,则获取第二报文所属业务流的当前标识值的第二计数值;
将所获取的第二计数值填充至第二报文的报文头中的标识字段,并为第二报文封装隧道头,得到第一报文。
在一些实施例中,获取单元191,还可以用于:
在为第二报文封装隧道头,得到第一报文之后,将当前标识值的第二计数值加1。
在一些实施例中,获取单元191,还可以用于:
若第二报文的报文头中的标识字段填充有标识值,则为第二报文封装隧道头,得到第一报文。
在一些实施例中,报文信息可以包括标识值和第二传输信息,第二传输信息包括五元组信息、更多分片标记位和分片偏移中的一种或多种;
第三处理单元194,具体可以用于:
剥离第一报文的隧道头,得到第三报文;
从第三报文的报文头中提取报文信息。
在一些实施例中,在网络设备包括的转发芯片数量为多个时,所有转发芯片配置的标识值范围均不重叠;网络设备对应的标识值范围与网络设备所属网络中的其他网络设备对应的标识值范围重叠或不重叠。
在一些实施例中,不同业务流对应的标识值范围相同或不同;一条业务流中,同一个报文对应的标识值相同,不同报文对应的标识值不同。
在一些实施例中,上述数据处理装置还可以包括:
丢弃单元,用于在从第一报文中提取报文信息之后,若网络设备中存储有所提取的报文信息,则丢弃第一报文。
在一些实施例中,上述数据处理装置还可以包括:老化单元,
用于在从所述第一报文中提取报文信息之后,若网络设备中存储有所提取的报文信息,则检测网络 设备中存储的所提取的报文信息是否达到老化时间;若达到老化时间,则删除网络设备中存储的所提取的报文信息;或
用于周期性从网络设备中存储的报文信息中,删除到达老化时间的报文信息;或
用于实时监测网络设备中存储的每个报文信息;当监测到任一报文信息到达老化时间时,删除任一报文信息。
在一些实施例中,第三处理单元194,具体可以用于:
若第一报文所属业务流对应的当前待发送报文的序列号与第一报文的序列号相同,则向目的终端转发第一报文;
若第一报文所属业务流对应的当前待发送报文的序列号与第一报文的序列号不同,则等待预设时长;
在到达所述预设时长前,若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号相同,则向目的终端转发所述第一报文;
在到达所述预设时长后,若第一报文所属业务流对应的当前待发送报文的序列号与第一报文的序列号不同,则向目的终端转发第一报文。
在一些实施例中,第三处理单元194,具体可以用于:
将第一报文存储至第一报文所属业务流对应的调度队列;
按照报文的序列号,对调度队列中的报文进行排序;
当到达调度队列的调度周期时,向目的终端转发调度队列中的报文。
本申请实施例提供的技术方案中,网络设备中的转发芯片在获取到需要通过多发选收路径转发的第一报文后,可以立即对报文进行处理,如在网络设备本地未存储第一报文的报文信息时,向目的终端转发第一报文。相对于使用软件实现多发选收中的报文转发时,需要等待接收到多发选收路径转发的所有第一报文后才对报文进行处理,本申请实施例提供的技术方案中,使用硬件的转发芯片完成多发选收中的报文转发,在保证报文传输可靠性的同时,提高了报文转发效率。
与上述数据处理方法对应,本申请实施例还提供了一种转发芯片,执行上述任一所述的数据处理方法步骤。
与上述数据处理方法对应,本申请实施例还提供了一种网络设备,该网络设备包括至少一个转发芯片,转发芯片用于执行上述任一所述的数据处理方法步骤。
转发芯片可以为NP(Network Processor,网络处理器)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、数字信号处理器(Digital Signal Processor,DSP)、分立门或者晶体管逻辑器件、分立硬件组件等硬件处理芯片,也可以采用多个芯片结合,对此不进行限定。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服 务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、转发芯片实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。

Claims (44)

  1. 一种数据处理方法,其特征在于,应用于网络设备中的任一转发芯片,所述网络设备为多发选收路径上的网络设备,所述方法包括:
    获取需要通过所述多发选收路径转发的第一报文;
    若所述网络设备为所述多发选收路径上的源网络设备,则通过所述多发选收路径包括的多条路径,分别向所述多发选收路径上的下一跳网络设备转发所述第一报文;
    若所述网络设备为所述多发选收路径上的中间网络设备,则向所述多发选收路径上的下一跳网络设备转发所述第一报文;
    若所述网络设备为所述多发选收路径上的目的网络设备,则从所述第一报文中提取报文信息,在所述网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发所述第一报文,所述第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
  2. 根据权利要求1所述的方法,其特征在于,所述获取需要通过多发选收路径转发的第一报文的步骤,包括:
    接收第二报文;
    若确定所述第二报文为需要通过多发选收路径转发的报文,则根据所述第二报文,确定第一报文。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第二报文,确定第一报文的步骤,包括:
    若所述网络设备为所述多发选收路径上的源网络设备,则更新所述第二报文的报文信息,得到第一报文;
    若所述网络设备为所述多发选收路径上的中间网络设备或目的网络设备,则确定所述第二报文为第一报文。
  4. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    若确定所述第二报文为不需要通过多发选收路径转发的报文,则向确定出的下一跳网络设备转发所述第二报文。
  5. 根据权利要求2-4任一项所述的方法,其特征在于,通过如下步骤确定所述第二报文是否为需要通过多发选收路径转发的报文:
    判断所述第二报文所属业务流对应的路径信息与预先存储的路径信息是否匹配,预先存储的路径信息为通过所述多发选收路径转发的业务流对应的路径信息;
    若匹配,则确定所述第二报文为需要通过多发选收路径转发的报文;
    若不匹配,则确定所述第二报文为不需要通过多发选收路径转发的报文。
  6. 根据权利要求5所述的方法,其特征在于,所述路径信息包括以下至少一组信息:
    用于转发业务流的逻辑口;
    业务流对应的源地址和目的地址;
    业务流对应的五元组信息。
  7. 根据权利要求3所述的方法,其特征在于,所述报文信息包括流标签;
    所述更新所述第二报文的报文信息,得到第一报文的步骤,包括:
    获取所述第二报文所属业务流的当前流标签的第一计数值;
    为所述第二报文封装隧道头,得到第一报文,所述隧道头的流标签字段中的值为所获取的第一计数值。
  8. 根据权利要求7所述的方法,其特征在于,在所述为所述第二报文封装隧道头,得到第一报文的步骤之后,所述方法还包括:
    将所述当前流标签的第一计数值加1。
  9. 根据权利要求1所述的方法,其特征在于,所述报文信息包括流标签和第一传输信息,所述第一传输信息包括以下任一组信息:业务流对应的源地址和目的地址;业务流对应的五元组信息;
    所述从所述第一报文中提取报文信息的步骤,包括:
    从所述第一报文的隧道头中提取所述第一报文的流标签;
    剥离所述第一报文的隧道头,得到第三报文;
    从所述第三报文的报文头中提取第一传输信息。
  10. 根据权利要求7-9任一项所述的方法,其特征在于,在所述网络设备包括的转发芯片数量为多个时,所有转发芯片配置的流标签范围均不重叠,所述网络设备对应的流标签范围与所述网络设备所属网络中的其他网络设备对应的流标签范围重叠或不重叠。
  11. 根据权利要求7-9任一项所述的方法,其特征在于,不同业务流对应的流标签范围相同或不同;一条业务流中,同一个报文对应的流标签相同,不同报文对应的流标签不同。
  12. 根据权利要求3所述的方法,其特征在于,所述报文信息包括标识值;
    所述更新所述第二报文的报文信息,得到第一报文的步骤,包括:
    若所述第二报文的报文头中的标识字段中的值为空,则获取所述第二报文所属业务流的当前标识值的第二计数值;
    将所获取的第二计数值填充至所述第二报文的报文头中的标识字段,并为所述第二报文封装隧道头,得到第一报文。
  13. 根据权利要求12所述的方法,其特征在于,在所述为所述第二报文封装隧道头,得到第一报文的步骤之后,所述方法还包括:
    将所述当前标识值的第二计数值加1。
  14. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    若所述第二报文的报文头中的标识字段填充有标识值,则为所述第二报文封装隧道头,得到第一报文。
  15. 根据权利要求1所述的方法,其特征在于,所述报文信息包括标识值和第二传输信息,所述第二传输信息包括五元组信息、更多分片标记位和分片偏移中的一种或多种;
    所述从所述第一报文中提取报文信息的步骤,包括:
    剥离所述第一报文的隧道头,得到第三报文;
    从所述第三报文的报文头中提取标识值和第二传输信息。
  16. 根据权利要求12-15任一项所述的方法,其特征在于,在所述网络设备包括的转发芯片数量为多个时,所有转发芯片配置的标识值范围均不重叠;所述网络设备对应的标识值范围与所述网络设备所属网络中的其他网络设备对应的标识值范围重叠或不重叠。
  17. 根据权利要求12-15任一项所述的方法,其特征在于,不同业务流对应的标识值范围相同或不 同;一条业务流中,同一个报文对应的标识值相同,不同报文对应的标识值不同。
  18. 根据权利要求1所述的方法,其特征在于,在所述从所述第一报文中提取报文信息的步骤之后,所述方法还包括:
    若所述网络设备中存储有所提取的报文信息,则丢弃所述第一报文。
  19. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述从所述第一报文中提取报文信息的步骤之后,若所述网络设备中存储有所提取的报文信息,则检测所述网络设备中存储的所提取的报文信息是否达到老化时间;若达到老化时间,则删除所述网络设备中存储的所提取的报文信息;或
    周期性从所述网络设备中存储的报文信息中,删除到达老化时间的报文信息;或
    实时监测所述网络设备中存储的每个报文信息;当监测到任一报文信息到达老化时间时,删除所述任一报文信息。
  20. 根据权利要求1、18或19所述的方法,其特征在于,所述向目的终端转发所述第一报文的步骤,包括:
    若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号相同,则向目的终端转发所述第一报文;
    若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号不同,则等待预设时长;
    在到达所述预设时长前,若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号相同,则向目的终端转发所述第一报文;
    在到达所述预设时长后,若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号不同,则向目的终端转发所述第一报文。
  21. 根据权利要求1、18或19所述的方法,其特征在于,所述向目的终端转发所述第一报文的步骤,包括:
    将所述第一报文存储至所述第一报文所属业务流对应的调度队列;
    按照报文的序列号,对所述调度队列中的报文进行排序;
    当到达所述调度队列的调度周期时,向目的终端转发所述调度队列中的报文。
  22. 一种数据处理装置,其特征在于,应用于网络设备中的任一转发芯片,所述网络设备为多发选收路径上的网络设备,所述装置包括:
    获取单元,用于获取需要通过所述多发选收路径转发的第一报文;
    第一处理单元,用于若所述网络设备为所述多发选收路径上的源网络设备,则通过所述多发选收路径包括的多条路径,分别向所述多发选收路径上的下一跳网络设备转发所述第一报文;
    第二处理单元,用于若所述网络设备为所述多发选收路径上的中间网络设备,则向所述多发选收路径上的下一跳网络设备转发所述第一报文;
    第三处理单元,用于若所述网络设备为所述多发选收路径上的目的网络设备,则从所述第一报文中提取报文信息,在所述网络设备中未存储所提取的报文信息时,存储所提取的报文信息,并向目的终端转发所述第一报文,所述第一报文的报文信息用于区分同一条业务流的不同报文和不同业务流的不同报文。
  23. 根据权利要求22所述的装置,其特征在于,所述获取单元,具体用于:
    接收第二报文;
    若确定所述第二报文为需要通过多发选收路径转发的报文,则根据所述第二报文,确定第一报文。
  24. 根据权利要求23所述的装置,其特征在于,所述获取单元,具体用于:
    若所述网络设备为所述多发选收路径上的源网络设备,则更新所述第二报文的报文信息,得到第一报文;
    若所述网络设备为所述多发选收路径上的中间网络设备或目的网络设备,则确定所述第二报文为第一报文。
  25. 根据权利要求23所述的装置,其特征在于,所述获取单元,还用于:
    若确定所述第二报文为不需要通过多发选收路径转发的报文,则向确定出的下一跳网络设备转发所述第二报文。
  26. 根据权利要求23-25任一项所述的装置,其特征在于,所述装置还包括确定单元,用于确定所述第二报文是否为需要通过多发选收路径转发的报文,具体用于:
    判断所述第二报文所属业务流对应的路径信息与预先存储的路径信息是否匹配,所述预先存储的路径信息为通过所述多发选收路径转发的业务流对应的路径信息;
    若匹配,则确定所述第二报文为需要通过多发选收路径转发的报文;
    若不匹配,则确定所述第二报文为不需要通过多发选收路径转发的报文。
  27. 根据权利要求26所述的装置,其特征在于,所述路径信息包括以下至少一组信息:
    用于转发业务流的逻辑口;
    业务流对应的源地址和目的地址;
    业务流对应的五元组信息。
  28. 根据权利要求24所述的装置,其特征在于,所述报文信息包括流标签;
    所述获取单元,具体用于:
    获取所述第二报文所属业务流的当前流标签的第一计数值;
    为所述第二报文封装隧道头,得到第一报文,所述隧道头的流标签字段中的值为所获取的第一计数值。
  29. 根据权利要求28所述的装置,其特征在于,所述获取单元,还用于:
    在为所述第二报文封装隧道头,得到第一报文之后,将所述当前流标签的第一计数值加1。
  30. 根据权利要求22所述的装置,其特征在于,所述报文信息包括流标签和第一传输信息,所述第一传输信息包括以下任一组信息:业务流对应的源地址和目的地址;业务流对应的五元组信息;
    所述第三处理单元,具体用于:
    从所述第一报文的隧道头中提取所述第一报文的流标签;
    剥离所述第一报文的隧道头,得到第三报文;
    从所述第三报文的报文头中提取第一传输信息。
  31. 根据权利要求28-30任一项所述的装置,其特征在于,在所述网络设备包括的转发芯片数量为多个时,所有转发芯片配置的流标签范围均不重叠,所述网络设备对应的流标签范围与所述网络设备所属网络中的其他网络设备对应的流标签范围重叠或不重叠。
  32. 根据权利要求28-30任一项所述的装置,其特征在于,不同业务流对应的流标签范围相同或不同;一条业务流中,同一个报文对应的流标签相同,不同报文对应的流标签不同。
  33. 根据权利要求24所述的装置,其特征在于,所述报文信息包括标识值;
    所述获取单元,具体用于:
    若所述第二报文的报文头中的标识字段中的值为空,则获取所述第二报文所属业务流的当前标识值的第二计数值;
    将所获取的第二计数值填充至所述第二报文的报文头中的标识字段,并为所述第二报文封装隧道头,得到第一报文。
  34. 根据权利要求33所述的装置,其特征在于,所述获取单元,还用于:
    在为所述第二报文封装隧道头,得到第一报文之后,将所述当前标识值的第二计数值加1。
  35. 根据权利要求33所述的装置,其特征在于,所述获取单元,还用于:
    若所述第二报文的报文头中的标识字段填充有标识值,则为所述第二报文封装隧道头,得到第一报文。
  36. 根据权利要求22所述的装置,其特征在于,所述报文信息包括标识值和第二传输信息,所述第二传输信息包括五元组信息、更多分片标记位和分片偏移中的一种或多种;
    所述第三处理单元,具体用于:
    剥离所述第一报文的隧道头,得到第三报文;
    从所述第三报文的报文头中提取标识值和第二传输信息。
  37. 根据权利要求33-36任一项所述的装置,其特征在于,在所述网络设备包括的转发芯片数量为多个时,所有转发芯片配置的标识值范围均不重叠;所述网络设备对应的标识值范围与所述网络设备所属网络中的其他网络设备对应的标识值范围重叠或不重叠。
  38. 根据权利要求33-36任一项所述的装置,其特征在于,不同业务流对应的标识值范围相同或不同;一条业务流中,同一个报文对应的标识值相同,不同报文对应的标识值不同。
  39. 根据权利要求22所述的装置,其特征在于,所述装置还包括:
    丢弃单元,用于在从所述第一报文中提取报文信息之后,若所述网络设备中存储有所提取的报文信息,则丢弃所述第一报文。
  40. 根据权利要求22所述的装置,其特征在于,所述装置还包括:老化单元,
    用于在从所述第一报文中提取报文信息之后,若所述网络设备中存储有所提取的报文信息,则检测所述网络设备中存储的所提取的报文信息是否达到老化时间;若达到老化时间,则删除所述网络设备中存储的所提取的报文信息;或
    用于周期性从所述网络设备中存储的报文信息中,删除到达老化时间的报文信息;或
    用于实时监测所述网络设备中存储的每个报文信息;当监测到任一报文信息到达老化时间时,删除所述任一报文信息。
  41. 根据权利要求22、39或40所述的装置,其特征在于,所述第三处理单元,具体用于:
    若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号相同,则向目的终端转发所述第一报文;
    若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号不同,则等待 预设时长;
    在到达所述预设时长前,若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号相同,则向目的终端转发所述第一报文;
    在到达所述预设时长后,若所述第一报文所属业务流对应的当前待发送报文的序列号与所述第一报文的序列号不同,则向目的终端转发所述第一报文。
  42. 根据权利要求22、39或40所述的装置,其特征在于,所述第三处理单元,具体用于:
    将所述第一报文存储至所述第一报文所属业务流对应的调度队列;
    按照报文的序列号,对所述调度队列中的报文进行排序;
    当到达所述调度队列的调度周期时,向目的终端转发所述调度队列中的报文。
  43. 一种转发芯片,其特征在于,执行权利要求1-21任一项所述的方法步骤。
  44. 一种网络设备,其特征在于,所述网络设备包括至少一个转发芯片,所述转发芯片用于执行权利要求1-21任一项所述的方法步骤。
PCT/CN2022/123398 2022-09-30 2022-09-30 一种数据处理方法、装置、转发芯片及网络设备 WO2024065732A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/123398 WO2024065732A1 (zh) 2022-09-30 2022-09-30 一种数据处理方法、装置、转发芯片及网络设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/123398 WO2024065732A1 (zh) 2022-09-30 2022-09-30 一种数据处理方法、装置、转发芯片及网络设备

Publications (1)

Publication Number Publication Date
WO2024065732A1 true WO2024065732A1 (zh) 2024-04-04

Family

ID=90475702

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/123398 WO2024065732A1 (zh) 2022-09-30 2022-09-30 一种数据处理方法、装置、转发芯片及网络设备

Country Status (1)

Country Link
WO (1) WO2024065732A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868683A (zh) * 2012-08-23 2013-01-09 东南大学 一种基于端到端的语音安全多路径通信系统及方法
US20210211937A1 (en) * 2018-09-25 2021-07-08 Huawei Technologies Co., Ltd. Data Transmission Method, Apparatus, and System
CN113949667A (zh) * 2021-12-07 2022-01-18 新华三大数据技术有限公司 分段网络中的报文处理方法及节点设备
CN114710810A (zh) * 2022-05-31 2022-07-05 新华三技术有限公司 一种数据传输方法、装置及系统
CN114793210A (zh) * 2022-06-23 2022-07-26 北京轻网科技有限公司 一种数据报文多发选收发送、接收方法、装置及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868683A (zh) * 2012-08-23 2013-01-09 东南大学 一种基于端到端的语音安全多路径通信系统及方法
US20210211937A1 (en) * 2018-09-25 2021-07-08 Huawei Technologies Co., Ltd. Data Transmission Method, Apparatus, and System
CN113949667A (zh) * 2021-12-07 2022-01-18 新华三大数据技术有限公司 分段网络中的报文处理方法及节点设备
CN114710810A (zh) * 2022-05-31 2022-07-05 新华三技术有限公司 一种数据传输方法、装置及系统
CN114793210A (zh) * 2022-06-23 2022-07-26 北京轻网科技有限公司 一种数据报文多发选收发送、接收方法、装置及系统

Similar Documents

Publication Publication Date Title
US11316783B2 (en) Method for forwarding packet and network device
US11979322B2 (en) Method and apparatus for providing service for traffic flow
US10122614B2 (en) Failure protection for traffic-engineered bit indexed explicit replication
US8169910B1 (en) Network traffic analysis using a flow table
US7787442B2 (en) Communication statistic information collection apparatus
US7995477B2 (en) Collecting network traffic information
CN110505147B (zh) 分组片段转发方法和网络设备
US20220103461A1 (en) Multicast data packet processing method, and apparatus
CN108809759A (zh) 检测链路状态的方法、装置和路由器
CN111801911B (zh) 业务功能链拥塞跟踪
WO2017128901A1 (zh) 一种转发控制方法及设备
US20080130503A1 (en) Method and system for forwarding ethernet frames over redundant networks with all links enabled
WO2024065732A1 (zh) 一种数据处理方法、装置、转发芯片及网络设备
US20230327983A1 (en) Performance measurement in a segment routing network
CN115242892B (zh) 一种流标识获取方法、装置、设备及介质
JP7035771B2 (ja) パケット取得装置、パケット取得方法、およびパケット取得プログラム
CN114079640B (zh) 一种数据处理方法、用户面功能及装置
CN114697408B (zh) 一种隧道报文的处理方法和装置
US11115506B2 (en) Inner VXLAN tunnel packet detection
WO2022242775A1 (zh) 一种报文处理的方法、系统和网络设备
WO2024065481A1 (zh) 一种数据处理方法、装置、网络设备及存储介质
US20240163208A1 (en) Packet processing method and apparatus, and storage medium and electronic apparatus
WO2023093227A1 (zh) 信息的收集方法、装置、存储介质及电子装置
WO2023125563A1 (zh) 路由信息的编辑方法、装置、存储介质及电子装置
CN109167731B (zh) 报文发送方法及装置