CN109005116B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN109005116B
CN109005116B CN201710422799.7A CN201710422799A CN109005116B CN 109005116 B CN109005116 B CN 109005116B CN 201710422799 A CN201710422799 A CN 201710422799A CN 109005116 B CN109005116 B CN 109005116B
Authority
CN
China
Prior art keywords
forwarding
packet
forwarding device
message
equipment
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710422799.7A
Other languages
Chinese (zh)
Other versions
CN109005116A (en
Inventor
管兴华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710422799.7A priority Critical patent/CN109005116B/en
Publication of CN109005116A publication Critical patent/CN109005116A/en
Application granted granted Critical
Publication of CN109005116B publication Critical patent/CN109005116B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L45/20Hop count for routing purposes, e.g. TTL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric

Landscapes

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

Abstract

A method and a device for forwarding a message are used for solving the problem that in the prior art, more system resources are consumed due to more processing times of a TT L value of an IP message in an SDN network, a controller determines that a forwarding path between source equipment and destination equipment comprises N forwarding equipment, determines that the number of times of forwarding the IP message to be forwarded from the source equipment to the destination equipment is N, determines a first forwarding strategy of first forwarding equipment according to the number of times of forwarding N, so that the first forwarding equipment performs N reduction processing on the TT L value in the IP message corresponding to the IP address of the destination equipment, and forwards the processed IP message, and determines a second forwarding strategy of at least one second forwarding equipment, so that each second forwarding equipment forwards the IP message corresponding to the IP address of the destination equipment.

Description

Message forwarding method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
A software-defined network (SDN) is a communication network that separates the control and forwarding layers. The SDN network comprises an SDN controller and a plurality of forwarding devices. The SDN controller is configured to control and manage the multiple forwarding devices, generate a forwarding policy of each forwarding device according to Internet Protocol (IP) addresses of hosts connected to the multiple forwarding devices and a topology of the multiple forwarding devices, and instruct the forwarding device to forward an IP packet including a destination IP address corresponding to the forwarding policy. Each forwarding device is used for determining a corresponding forwarding strategy according to the destination IP address of the IP message after receiving the IP message, and forwarding the IP message according to the determined forwarding strategy.
Currently, the SDN controller configures a forwarding policy for each forwarding device in a plurality of forwarding devices on each forwarding path, where the forwarding policy is to perform a time to live (TT L) value included in an IP packet and forward the processed IP packet, the SDN controller sends the forwarding policy to the forwarding devices, and each forwarding device in the forwarding devices subtracts one from a TT L value included in the received IP packet according to the forwarding policy and then forwards the processed IP packet.
However, when multiple forwarding devices on one forwarding path all forward the received IP packet through the forwarding policy, each forwarding device needs to process the TT L value in the IP packet, so that the processing times of the TT L value of each IP packet in the SDN network is large, and the consumed system resources are large.
Disclosure of Invention
The application provides a message forwarding method and a message forwarding device, which are used for solving the problem that in the prior art, the number of times of processing TT L values of each IP message in an SDN network is large, so that system resources are consumed more.
In a first aspect, the present application provides a packet forwarding method, including:
the controller determines a forwarding path between a source device and a destination device, wherein the forwarding path comprises N forwarding devices, determines that the number of times of forwarding an IP message to be forwarded from the source device to the destination device is N, determines a first forwarding strategy of a first forwarding device according to the number of times of forwarding, and determines a second forwarding strategy of at least one second forwarding device, then sends the first forwarding strategy to the first forwarding device, and respectively sends the second forwarding strategies to the at least one second forwarding device, wherein N is a positive integer greater than or equal to 2, the first forwarding device is any one of the N forwarding devices, the at least one second forwarding device is a forwarding device other than the first forwarding device among the N forwarding devices, the first forwarding strategy comprises first indication information of the IP message after performing N subtraction processing on a TT L value included in the IP message corresponding to the IP address of the destination device, and forwarding the IP message after the N subtraction processing, and the second forwarding strategy comprises L indication information of a second indication value of the IP message corresponding to the IP address of the destination device, and the second indication information of the IP message corresponding to the TT L value.
By the above method, after the first forwarding device receives the IP packet corresponding to the IP address of the destination device, N reduction processing may be performed on the TT L value included in the IP packet according to the first indication information, and the processed IP packet may be sent to the next hop device of the first forwarding device, and each second forwarding device of the at least one second forwarding device may forward the received IP packet corresponding to the IP address of the destination device to the next hop device of the second forwarding device according to the second indication information.
In one possible design, the controller may be, but is not limited to, an SDN controller or the like.
In one possible design, the forwarding device may be, but is not limited to, a switch, a router, etc., wherein the forwarding device may be a three-tier switch when the forwarding device is a switch.
In one possible design, the controller may send the first forwarding policy to the first forwarding device in two cases:
in the first case: when the controller establishes connection with the first forwarding equipment, the controller sends the first forwarding strategy to the first forwarding equipment;
in the second case: and after receiving a forwarding policy request sent by the first forwarding device, the controller sends the first forwarding policy to the first forwarding device.
By the method, the controller can successfully send the first forwarding policy to the first forwarding device, so that the first forwarding device processes and forwards the received IP packet according to the first forwarding policy.
In a possible design, when the controller sends the first forwarding policy to the first forwarding device, the first forwarding policy may be carried in a flow table issued by the controller to the first forwarding device.
By the method, the controller can successfully send the first forwarding policy to the first forwarding device, so that the first forwarding device processes and forwards the received IP packet according to the first forwarding policy.
In one possible design, the controller sends the second forwarding policy to each of the at least one second forwarding device in two cases:
in the first case: when the controller establishes connection with each second forwarding device, the controller sends the second forwarding strategy to the second forwarding device;
in the second case: and after receiving a forwarding strategy request sent by any second forwarding equipment, the controller sends the second forwarding strategy to the second forwarding equipment.
Through the method, the controller can successfully send the second forwarding strategies to the at least one second forwarding device respectively, so that the at least one second forwarding device forwards the received IP messages according to the second forwarding strategies.
In a possible design, when the controller sends the second forwarding policy to any one of the second forwarding devices, the second forwarding policy may be carried in a flow table issued by the controller to the second forwarding device.
Through the method, the controller can successfully send the second forwarding strategies to the at least one second forwarding device respectively, so that the at least one second forwarding device forwards the received IP messages according to the second forwarding strategies.
In a second aspect, an embodiment of the present application further provides another packet forwarding method, where the method includes:
the method comprises the steps that a first forwarding device receives a first forwarding strategy sent by a controller, the first forwarding device is any one of N forwarding devices on a forwarding path between a source device and a destination device, the first forwarding strategy comprises first indication information for executing N subtraction processing on a TT L value included in an IP message sent from the source device to the destination device and forwarding the processed IP message, after the IP message corresponding to an IP address of the destination device is received, the N subtraction processing is executed on the TT L value included in the IP message according to the first indication information to obtain the processed IP message, and then the processed IP message is sent to a next hop device of the first forwarding device, wherein N is a positive integer larger than or equal to 2.
Through the method, the N reduction processing can be performed on the TT L value included in the IP packet received from the source device and sent to the destination device according to the first indication information included in the first forwarding policy, so that other forwarding devices do not need to process the TT L value in the IP packet, thereby reducing the processing times of the TT L value and reducing the system resource consumption.
In one possible design, the first forwarding device receives the IP packet sent by a previous-hop device from the first forwarding device. Optionally, a previous hop device of the first forwarding device is a source device or another forwarding device, where when the first forwarding device is a first forwarding device on a forwarding path between the source device and a destination device, the previous hop device of the first forwarding device is the source device; and when the first forwarding device is a forwarding device other than the first forwarding device in the forwarding path, the previous hop device of the first forwarding device is another forwarding device.
In one possible design, after the first forwarding device receives the IP packet, before performing N reduction processing on the TT L value included in the IP packet, the first forwarding device further performs the following steps:
and the first forwarding equipment calculates the checksum of the IP message and determines that the calculated checksum is consistent with the checksum included in the IP message.
By the method, the first forwarding device can verify the integrity of the received IP message, that is, the head of the IP message is not damaged or tampered in the process of receiving the IP message by the first forwarding device, so that the first forwarding device can be ensured to process and forward the complete IP message, the first forwarding device can be prevented from processing and forwarding the IP message with the damaged or tampered head, and further, the waste of system resources can be avoided.
In a possible design, when the first forwarding device determines that the calculated checksum is inconsistent with the checksum included in the IP packet, it indicates that the header of the IP packet is damaged or tampered, and at this time, the first forwarding device discards the IP packet, or the first forwarding device sends the IP packet to the controller. Therefore, the first forwarding device and the forwarding device behind the first forwarding device in the forwarding path do not need to process and forward the IP message, thereby avoiding wasting system resources and improving the utilization rate of network bandwidth.
In a possible design, after the first forwarding device receives the IP packet, before performing N reduction processing on the TT L value included in the IP packet, the first forwarding device determines that the TT L value is greater than N (for example, the TT L value is 4, and N is 3).
In a possible design, when the first forwarding device determines that the TT L value is less than or equal to N in the above process (for example, when the TT L value is 3 and N is 3), it indicates that the IP packet cannot be forwarded to a destination device, and the IP packet becomes an illegal packet (that is, TT L is less than or equal to 0), at this time, the first forwarding device discards the IP packet, or the first forwarding device sends the IP packet to the controller.
In one possible design, the next-hop device of the first forwarding device is a destination device or another forwarding device, and when the first forwarding device is the last forwarding device in a forwarding path through which the IP packet is to pass, the next-hop device of the first forwarding device is the destination device; and when the first forwarding device is a forwarding device except the last forwarding device in the forwarding path, the next hop device of the first forwarding device is another forwarding device.
In a possible design, before the first forwarding device sends the processed IP packet to the next hop device of the first forwarding device, the first forwarding device calculates a checksum of the processed IP packet, and replaces the checksum included in the IP packet with the calculated checksum.
By the method, the checksum of the IP message can be more accurate, and the next forwarding skip device of the first forwarding device can verify the integrity of the IP message more accurately according to the updated checksum of the IP message.
In one possible design, the first forwarding device may be, but is not limited to, a switch, a router, etc., wherein the first forwarding device may be a three-tier switch when the first forwarding device is a switch.
In a third aspect, an embodiment of the present application further provides another packet forwarding method, where the method includes:
the method comprises the steps that forwarding equipment receives a forwarding strategy sent by a controller, wherein the forwarding strategy comprises indication information of forwarding an IP message sent from source equipment to destination equipment, and then after the forwarding equipment receives the IP message of which the destination IP address is the IP address of the destination equipment, the forwarding equipment forwards the IP message to next-hop equipment of the forwarding equipment according to the indication information, wherein the forwarding strategy does not comprise indication information of processing the TT L value of the IP message corresponding to the IP address of the destination equipment.
By the method, the forwarding equipment only needs to forward the received IP message without processing the TT L value of the IP message, so that the processing times of the TT L value are reduced, and the consumption of system resources is further reduced.
In one possible design, the forwarding device receives the IP packet sent by a previous-hop device of the forwarding device. Optionally, a previous hop device of the forwarding device is a source device or another forwarding device, where when the forwarding device is a first forwarding device in a forwarding path through which the IP packet is to pass, the previous hop device of the forwarding device is the source device; and when the forwarding device is a forwarding device in the forwarding path except the first forwarding device, the previous hop device of the forwarding device is another forwarding device.
In a possible design, after the forwarding device receives the IP packet, before forwarding the IP packet to a next-hop device of the forwarding device, the forwarding device further performs the following steps:
the forwarding device calculates the checksum of the IP packet, and determines that the calculated checksum is consistent with the checksum included in the IP packet.
By the method, the forwarding device can verify the integrity of the received IP message, namely, the head of the IP message is not damaged or tampered in the process of receiving the IP message by the forwarding device, so that the forwarding device can be ensured to forward the complete IP message, the forwarding device can be prevented from forwarding the IP message with the damaged or tampered head, and further system resources can be prevented from being wasted.
In a possible design, when the forwarding device determines that the calculated checksum is inconsistent with the checksum included in the IP packet, it indicates that the header of the IP packet has been damaged or tampered with, and at this time, the forwarding device discards the IP packet, or the forwarding device sends the IP packet to the controller. Therefore, the forwarding device and the forwarding device behind the forwarding device in the forwarding path do not need to process and forward the IP message, thereby avoiding wasting system resources and improving the utilization rate of network bandwidth.
In one possible design, a next-hop device of the forwarding device is a destination device or another forwarding device, and when the forwarding device is a last forwarding device in a forwarding path through which the IP packet is to pass, the next-hop device of the forwarding device is the destination device; and when the forwarding device is a forwarding device except the last forwarding device in the forwarding path, the next hop device of the forwarding device is another forwarding device.
In one possible design, the forwarding device may be, but is not limited to, a switch, a router, etc., wherein the second forwarding device may be a three-tier switch when the second forwarding device is a switch.
In a fourth aspect, an embodiment of the present application further provides a controller, where the controller has a function of implementing the controller behavior in the foregoing method example. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In a possible design, the structure of the controller includes a processing unit and a sending unit, and these units may perform corresponding functions in the method example in the first aspect, for specific reference, detailed description in the method example is given, and details are not repeated here.
In one possible design, the controller has a structure including a communication interface, a processor and a memory, the communication interface is used for receiving and transmitting data, and the processor is configured to support the controller to perform corresponding functions in the method of the first aspect. The memory is coupled to the processor and holds the necessary program instructions and data for the controller.
In a fifth aspect, an embodiment of the present application further provides a forwarding device, where the forwarding device has a function of implementing a behavior of the first forwarding device in the foregoing method example. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In a possible design, the structure of the forwarding device includes a receiving unit, a processing unit, and a sending unit, and these units may perform corresponding functions in the method example in the second aspect, for which specific reference is made to the detailed description in the method example, and details are not repeated here.
In one possible design, the structure of the forwarding device includes a communication interface, a processor and a memory, the communication interface is used for receiving and sending data, and the processor is configured to support the forwarding device to perform the corresponding functions in the method in the second aspect. The memory is coupled to the processor and retains program instructions and data necessary for the forwarding device.
In a sixth aspect, an embodiment of the present application further provides a forwarding device, where the forwarding device has a function of implementing a behavior of a second forwarding device in the foregoing method example. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In a possible design, the structure of the forwarding device includes a receiving unit and a sending unit, and these units may perform corresponding functions in the method example in the third aspect, for which specific reference is made to the detailed description in the method example, and details are not repeated here.
In one possible design, the structure of the forwarding device includes a communication interface, a processor and a memory, the communication interface is used for receiving and sending data, and the processor is configured to support the forwarding device to perform the corresponding functions in the method in the third aspect. The memory is coupled to the processor and retains program instructions and data necessary for the forwarding device.
In a seventh aspect, an embodiment of the present application further provides a communication network, where the communication network includes a controller and multiple forwarding devices, the controller is the controller in the fourth aspect, a first forwarding device in the multiple forwarding devices is the forwarding device in the fifth aspect, and other forwarding devices in the multiple forwarding devices are the forwarding devices in the sixth aspect.
In an eighth aspect, embodiments of the present application further provide a computer storage medium storing computer-executable instructions for causing a computer to perform any one of the methods described above.
In the embodiment of the application, a controller determines a forwarding path between a source device and a destination device, where the forwarding path includes N forwarding devices, where N is a positive integer greater than or equal to 2, the controller determines that the number of times to be forwarded of an IP packet to be forwarded from the source device to the destination device is N, and determines a first forwarding policy of a first forwarding device according to the number of times to be forwarded N, so that the first forwarding device performs N reduction processing on a L value in the IP packet corresponding to an IP address of the destination device first, and then sends the processed IP packet to a next-hop device of the first forwarding device, and the controller determines a second forwarding policy of at least one second forwarding device, so that each second forwarding device of the at least one second forwarding device forwards the IP packet corresponding to the IP address of the destination device to the next-hop device of the second forwarding device, in the method, since the controller sends different forwarding policies to the first forwarding device and the at least one second forwarding device, and further, when the IP packet forwarding policy of the SDN forwarding device processes the IP packet, the IP packet corresponding to the IP address of the first forwarding device, the next-hop device, the IP packet forwarding device may only process one IP packet value of the first forwarding device 3632, and thus, the IP packet forwarding policy may reduce the IP packet value of each forwarding device, and the IP forwarding device may only one forwarding device may process one IP forwarding network TT 36.
Drawings
Fig. 1 is a schematic architecture diagram of a communication network provided in the present application;
fig. 2 is a schematic flowchart of a message forwarding method provided in the present application;
FIG. 3 is a schematic structural diagram of a controller provided in the present application;
fig. 4 is a schematic structural diagram of a forwarding device provided in the present application;
fig. 5 is a schematic structural diagram of another forwarding device provided in the present application;
FIG. 6 is a block diagram of another controller provided herein;
FIG. 7 is a block diagram of another forwarding device provided herein;
fig. 8 is a block diagram of another forwarding device provided in the present application.
Detailed Description
The present application will be described in further detail below with reference to the accompanying drawings.
The embodiment of the application provides a message forwarding method and a message forwarding device, which are used for solving the problem that in the prior art, the number of times of processing TT L values of each IP message in an SDN network is large, so that system resources are consumed more, wherein the method and the device are based on the same inventive concept, and because the principles of solving the problems of the method and the device are similar, the device and the method can be mutually implemented, and repeated parts are not repeated.
In the technical scheme of the embodiment of the application, a controller determines a forwarding path between a source device and a destination device, wherein the forwarding path includes N forwarding devices, N is a positive integer greater than or equal to 2, the controller determines that the number of times to be forwarded of an IP packet to be forwarded from the source device to the destination device is N, and determines a first forwarding policy of a first forwarding device according to the number of times to be forwarded N, so that the first forwarding device performs N subtraction on a TT L value in the IP packet corresponding to an IP address of the destination device first, and then sends the processed IP packet to a next-hop device of the first forwarding device, and the controller determines a second forwarding policy of at least one second forwarding device, so that each second forwarding device of the at least one second forwarding device forwards the IP packet corresponding to the IP address of the destination device to the next-hop device of the second forwarding device, in the method, because the controller sends different IP packets to the first forwarding device and the at least one second forwarding device, the forwarding device only needs to process one more IP packet values in a network forwarding path (TT L) as compared with the first forwarding device, when processing the value of the IP packet is reduced, the value of the first forwarding policy is reduced, so that when the value of the IP packet is processed by the SDN forwarding device, the second forwarding device, the forwarding policy of the forwarding device, and the forwarding device, the forwarding policy of the forwarding device, and the forwarding device, so that the forwarding device, when.
Hereinafter, some terms in the present application are explained to facilitate understanding by those skilled in the art.
1) The controller according to the embodiment of the present application can control and manage a plurality of forwarding devices, and configure forwarding policies of IP packets corresponding to different destination IP addresses for each forwarding device. Wherein the controller may be, but is not limited to, an SDN controller or the like.
2) The first forwarding device and the second forwarding device related to the embodiment of the present application are devices for forwarding an IP packet, such as a switch and a router. When the first forwarding device and the second forwarding device are switches, they may be three-layer switches.
3) The term "plurality" in the embodiments of the present application means two or more.
4) The terms "first," "second," and the like in the description of the present application are used for descriptive purposes only and are not intended to indicate or imply relative importance nor order to be construed.
In order to more clearly describe the technical solution of the embodiment of the present application, the following describes in detail a message forwarding method and a message forwarding apparatus provided in the embodiment of the present application with reference to the accompanying drawings.
Fig. 1 shows a possible communication network to which the packet forwarding method provided in the embodiment of the present application is applied, where the communication network includes: a controller and a plurality of forwarding devices. The plurality of forwarding devices are used for realizing communication between the source device and the destination device. The controller is configured to determine a forwarding path between the source device and the destination device, configure a forwarding policy of an IP packet corresponding to a different destination IP address for each of multiple forwarding devices on the forwarding path, and send the configured forwarding policy to the corresponding forwarding device. For example, based on the communication network shown in fig. 1, it is assumed that a forwarding path between the source device and the destination device includes a forwarding device a, a forwarding device B, and a forwarding device C, that is, an IP packet sent by the source device needs to pass through the forwarding device a, the forwarding device B, and the forwarding device C to reach the destination device. The controller configures a forwarding policy a, a forwarding policy B, and a forwarding policy C for the forwarding device a, the forwarding device B, and the forwarding device C, respectively, and then sends the forwarding policy a to the forwarding device a, the forwarding policy B to the forwarding device B, and the forwarding policy C to the forwarding device C.
Optionally, when the controller sends the corresponding forwarding policy to one forwarding device, the controller may carry the forwarding policy in a corresponding flow table issued to the forwarding device by the controller.
The multiple forwarding devices, such as the forwarding device a, the forwarding device B, and the forwarding device C shown in fig. 1, are multi-hop forwarding devices through which the IP packet needs to pass when being forwarded from the source device to the destination device. Each forwarding device in the multiple forwarding devices is configured to receive the forwarding policy sent by the controller, and perform corresponding processing and forwarding on the received IP packet according to the forwarding policy.
For example, when the forwarding policy a, the forwarding policy B, and the forwarding policy C in the above example all perform a subtraction process on a TT L value included in an IP packet having a destination IP address of the destination device and forward the processed IP packet to a corresponding next-hop device, the forwarding device a receives the IP packet sent to the destination device, performs a subtraction process on a TT L value included in the IP packet, and sends the processed IP packet to the forwarding device B, the forwarding device B receives the IP packet, continues to perform a subtraction process on a TT L value included in the IP packet, and then sends the processed IP packet to the forwarding device C, and the forwarding device C continues to perform a subtraction process on a TT L value included in the IP packet, and then sends the processed IP packet to the destination device (i.e., a next-hop device of the forwarding device C).
By the method, the forwarding of the IP message is completed in the communication network.
The message forwarding method provided by the embodiment of the application is suitable for the communication network shown in fig. 1. Referring to fig. 2, the specific process of the method includes:
step 201, the controller determines a forwarding path between the source device and the destination device, where the forwarding path includes N forwarding devices, and N is a positive integer greater than or equal to 2.
The controller manages forwarding devices in the entire communication network, so that the controller obtains the topology of the entire communication network and the terminal devices connected to each forwarding device, takes one of any two terminal devices as a source device and the other terminal device as a destination device, and calculates a forwarding path between the source device and the destination device, that is, the forwarding path through which an IP packet sent from the source device to the destination device passes and the number of the forwarding devices included in the forwarding path can be accurately determined.
Optionally, the controller may be, but is not limited to, an SDN controller or the like; the forwarding device may be, but is not limited to, a switch, a router, etc., wherein the forwarding device may be a three-tier switch when the forwarding device is a switch.
Step 202, the controller determines that the number of times to be forwarded of the to-be-forwarded IP packet sent from the source device to the destination device is N.
For example, when the controller determines that forwarding devices included in a forwarding path through which an IP packet sent by the source device to the destination device needs to pass are three forwarding devices as shown in fig. 1, the controller determines that the number of times to be forwarded of the IP packet is 3 according to the number 3 of the forwarding devices, so that the controller executes step 203 according to the determined number of times to be forwarded.
Step 203, the controller determines a first forwarding policy of the first forwarding device according to the number N of times to be forwarded, and determines a second forwarding policy of at least one second forwarding device.
The first forwarding device is any one of the N forwarding devices, and the at least one second forwarding device is a forwarding device of the N forwarding devices except the first forwarding device.
Taking fig. 1 as an example, the first forwarding device may be the forwarding device a, the forwarding device B, or the forwarding device C. When the first forwarding device is the forwarding device a, the at least one second forwarding device is the forwarding device B and the forwarding device C; when the first forwarding device is the forwarding device B or the forwarding device C, the principle is the same as that when the first forwarding device is the forwarding device a, and details are not described here.
Specifically, the first forwarding strategy comprises first indication information for executing N reduction processing on a TT L value included in an IP message corresponding to the IP address of the destination device and forwarding the processed IP message, and the second forwarding strategy comprises second indication information for forwarding the IP message corresponding to the IP address of the destination device, wherein the IP message corresponding to the IP address of the destination device is the IP message of which the destination IP address is the IP address of the destination device.
By the forwarding strategy, in the process of forwarding the IP packet from the source device to the destination device, the first forwarding device only needs to process the TT L value of the IP packet once, and the at least one second forwarding device does not need to process the TT L value, so that the processing times of the TT L value can be reduced, and the consumption of system resources can be reduced.
And step 204, the controller sends the first forwarding strategy to the first forwarding device.
Optionally, the controller may execute step 204 under two conditions:
in the first case: when the controller establishes a connection with the first forwarding device, the controller performs step 204.
In the second case: after receiving the forwarding policy request sent by the first forwarding device, the controller executes step 204.
Specifically, in the second case, after receiving the IP packet corresponding to the IP address of the destination device, the first forwarding device sends a forwarding policy request to the controller when the corresponding forwarding policy is not found locally, so that the controller sends the corresponding forwarding policy to the first forwarding device.
Optionally, when the controller executes step 204, the controller may carry the first forwarding policy in a flow table that is issued to the first forwarding device by the controller.
Step 205, after receiving the IP packet corresponding to the IP address of the destination device, the first forwarding device performs N reduction processing on the TT L value included in the IP packet according to the first indication information included in the first forwarding policy, so as to obtain the processed IP packet.
And the first forwarding equipment receives the IP message sent by the last hop equipment of the first forwarding equipment. Optionally, a previous hop device of the first forwarding device is a source device or another forwarding device, where when the first forwarding device is a first forwarding device in a forwarding path through which the IP packet is to pass, the previous hop device of the first forwarding device is the source device; and when the first forwarding device is a forwarding device other than the first forwarding device in the forwarding path, the previous hop device of the first forwarding device is another forwarding device.
For example, as shown in fig. 1, when the first forwarding device is the forwarding device a, a previous hop device of the first forwarding device is a source device; and when the first forwarding device is the forwarding device B, the previous hop device of the first forwarding device is the forwarding device a.
Optionally, after the first forwarding device receives the IP packet, before performing N reduction processing on the TT L value included in the IP packet, the first forwarding device further performs the following steps:
the first forwarding equipment calculates the checksum of the IP message;
and the first forwarding equipment determines that the calculated checksum is consistent with the checksum included in the IP message.
Through the above steps, the first forwarding device may verify the integrity of the received IP packet, that is, in the process of receiving the IP packet by the first forwarding device, the header of the IP packet is not damaged or tampered, so that it is ensured that the first forwarding device processes and forwards the complete IP packet, and the first forwarding device can avoid processing and forwarding the IP packet whose header is damaged or tampered, thereby avoiding wasting system resources.
Optionally, in the above step, when the first forwarding device determines that the calculated checksum is inconsistent with the checksum included in the IP packet, it indicates that the header of the IP packet is damaged or tampered, at this time, the first forwarding device discards the IP packet, or the first forwarding device sends the IP packet to the controller. Therefore, the first forwarding device and the forwarding device behind the first forwarding device on the forwarding path do not need to process and forward the IP message, thereby avoiding wasting system resources and improving the utilization rate of network bandwidth.
Optionally, when the first forwarding device is the first forwarding device on the forwarding path, after the first forwarding device receives the IP packet, before performing N reduction processing on the TT L value included in the IP packet, the first forwarding device determines that the TT L value is greater than N (for example, the TT L value is 4 and N is 3).
Optionally, when the first forwarding device determines that the TT L value is less than or equal to N in the foregoing process (for example, when the TT L value is 3 and N is 3), it indicates that the IP packet cannot be forwarded to a destination device, and the IP packet becomes an illegal packet (that is, TT L is less than or equal to 0), at this time, the first forwarding device discards the IP packet, or the first forwarding device sends the IP packet to the controller.
Step 206, the first forwarding device sends the processed IP packet to a next hop device of the first forwarding device.
The next hop device of the first forwarding device is a destination device or another forwarding device, and when the first forwarding device is the last forwarding device in a forwarding path through which the IP packet is to pass, the next hop device of the first forwarding device is the destination device; and when the first forwarding device is a forwarding device except the last forwarding device in the forwarding path, the next hop device of the first forwarding device is another forwarding device.
For example, as shown in fig. 1, when the first forwarding device is the forwarding device C, a next hop device of the first forwarding device is the destination device; and when the first forwarding device is the forwarding device B, a next hop device of the first forwarding device is the forwarding device C.
Optionally, before the first forwarding device performs step 206, the first forwarding device further performs the following steps:
and the first forwarding equipment calculates the checksum of the processed IP message and replaces the checksum included in the IP message with the calculated checksum.
In general, after each forwarding device receives an IP packet, it needs to check whether the IP packet is complete through the checksum of the IP packet, so that, by the above method, the checksum of the IP packet can be more accurate, and then the next forwarding device of the first forwarding device can verify the integrity of the IP packet more accurately according to the updated checksum of the IP packet.
And step 207, the controller sends the second forwarding policies to the at least one second forwarding device, respectively.
Optionally, the method for the controller to execute step 207 is the same as the method for the controller to send the first forwarding policy to the first forwarding device, which may specifically refer to step 204 above, and details are not described here.
Step 208, after receiving the IP packet corresponding to the IP address of the destination device, the at least one second forwarding device forwards the IP packet to a next-hop device of the second forwarding device according to the second indication information included in the second forwarding policy, respectively.
Each second forwarding device receives the IP packet sent by the previous-hop device of the second forwarding device, and because the first forwarding device and the at least one second forwarding device are randomly sequenced, the previous-hop device of each second forwarding device has the same condition as the previous-hop device of the first forwarding device, which can be referred to as the previous-hop device of the first forwarding device in step 205.
Similarly, the next-hop device of each second forwarding device is the same as the next-hop device of the first forwarding device, which can be referred to as the next-hop device of the first forwarding device in step 206.
Optionally, after each second forwarding device receives the IP packet, before forwarding the IP packet to a next hop device of the second forwarding device, the following steps are further performed:
the second forwarding equipment calculates the checksum of the IP message;
and the second forwarding device determines that the calculated checksum is consistent with the checksum included in the IP packet.
The beneficial effect of each second forwarding device performing the above steps is the same as that of the first forwarding device performing the same steps in step 205.
Moreover, the operation when each second forwarding device determines that the calculated checksum is inconsistent with the checksum included in the IP packet is the same as the operation when the first forwarding device determines that the calculated checksum is inconsistent with the checksum included in the IP packet in step 205, and thus the beneficial effects are the same.
In step 208, each of the at least one second forwarding device directly forwards the IP packet to the next hop device of the second forwarding device, and the TT L value of the IP packet does not need to be processed any more, thereby reducing the processing times of the TT L value and reducing the consumption of system resources.
Further, in a general case, when the forwarding device needs to recalculate and update the checksum of the processed IP packet after processing the TT L value of the IP packet, by using the method in the embodiment of the present application, since the at least one second forwarding device does not need to process the TT L value of the IP packet, and further does not need to recalculate and update the checksum of the processed IP packet, the calculation and update times of the checksum of the IP packet can be reduced, and further the consumption of system resources can be reduced.
By adopting the message forwarding method provided by the embodiment of the application, the controller determines a forwarding path between a source device and a destination device, the forwarding path includes N forwarding devices, N is a positive integer greater than or equal to 2, the controller determines that the number of times to be forwarded of an IP message to be forwarded sent from the source device to the destination device is N, and determines a first forwarding policy of a first forwarding device according to the number of times to be forwarded N, so that the first forwarding device performs N subtraction on a TT L value in the IP message corresponding to an IP address of the destination device first, and then sends the processed IP message to a next-hop device of the first forwarding device, and the controller determines a second forwarding policy of at least one second forwarding device, so that each second forwarding device of the at least one second forwarding device forwards the IP message corresponding to the IP address of the destination device to the next-hop device, in the method, because the controller sends different IP message forwarding devices to the first forwarding device and the at least one second forwarding device, the number of IP messages forwarded by the second forwarding device is reduced, and the forwarding policy is more than that when the IP message forwarding device processes another IP message forwarding policy of the first forwarding device (TT 3632) in an SDN forwarding network, the forwarding policy is processed, so that the number of the IP message forwarding device is reduced, and the value of the forwarding policy of the forwarding device is reduced.
It should be noted that the sequence of the steps 204-206 and 207-208 is only an example, and the sequence is not limited in this application. Optionally, because the first forwarding device and the at least one second forwarding device are randomly ordered in a forwarding path through which the IP packet to be forwarded passes, the first forwarding device may be a first forwarding device in the forwarding path, and the at least one second forwarding device is a forwarding device behind the first forwarding device; or the first forwarding device is the last forwarding device in the forwarding path, and the at least one second forwarding device is a forwarding device before the first forwarding device; or the first forwarding device is interspersed at any location between the at least one second forwarding device. Thus, optionally, the above step 204 and 208 may be adjusted according to the actual ordering of the first forwarding device and the at least one second forwarding device.
Based on the above embodiment, because the first forwarding device and the at least one second forwarding device are randomly ordered in the forwarding path, in order to avoid a situation that a plurality of forwarding devices do no work and waste system resources due to the fact that an IP packet that will be discarded or sent to the controller is discarded after being forwarded by a plurality of forwarding devices or sent to the controller, the controller may use a first forwarding device in the forwarding path as the first forwarding device, send the first forwarding policy to the first forwarding device, so that the first forwarding device performs validity judgment on the IP packet to be forwarded, thereby determining validity of the IP packet to be forwarded in the forwarding path at the first time, and further discarding or sending an illegal IP packet to the controller in advance, to avoid wasting resources.
Still taking fig. 1 as an example, the controller determines that the forwarding device a is the first forwarding device, the forwarding device B and the forwarding device C are the second forwarding devices, the first forwarding policy determined by the controller includes first indication information for performing minus 3 processing on a TT L value included in an IP packet sent to the destination device and forwarding the processed IP packet, after the controller sends the first forwarding policy to the forwarding device a, when the forwarding device a receives the IP packet sent to the destination device, it determines whether a TT L value in the IP packet is greater than 3, and when it is determined that the TT L value in the IP packet is less than or equal to 3, the IP packet is discarded or sent to the controller, so that when the IP packet is forwarded to the forwarding device B or to the forwarding device C, the forwarding device B or the forwarding device C performs a validity check again, thereby saving a flow, and simultaneously avoiding unnecessary forwarding of the IP packet and avoiding waste of resources of the IP system.
Based on the above embodiments, the embodiments of the present application further provide a controller, where the controller is applied to the communication network shown in fig. 1, and is used to implement the message forwarding method shown in fig. 2. Referring to fig. 3, the controller 300 includes: a processing unit 301 and a transmitting unit 302, wherein,
the processing unit 301 is configured to determine a forwarding path between a source device and a destination device, where the forwarding path includes N forwarding devices, and N is a positive integer greater than or equal to 2;
determining the number of times to be forwarded of the to-be-forwarded internet protocol IP message sent from the source equipment to the destination equipment to be N; and
determining a first forwarding strategy of a first forwarding device according to the number N of times N to be forwarded, and determining a second forwarding strategy of at least one second forwarding device, wherein the first forwarding device is any one of the N forwarding devices, the at least one second forwarding device is a forwarding device other than the first forwarding device among the N forwarding devices, the first forwarding strategy comprises first indication information for performing N reduction processing on a TT L value included in an IP message corresponding to an IP address of the destination device and forwarding the processed IP message, the second forwarding strategy comprises second indication information for forwarding the IP message corresponding to the IP address of the destination device, the second forwarding strategy does not comprise indication information for processing a TT L value of the IP message corresponding to the IP address of the destination device, the sending unit 302 is configured to send the first forwarding strategy to the first forwarding device, and
and respectively sending the second forwarding strategies to the at least one second forwarding device.
Optionally, the forwarding device is a switch or a router.
The method includes the steps of determining a forwarding path between a source device and a destination device by using a controller provided by an embodiment of the application, wherein the forwarding path includes N forwarding devices, N is a positive integer greater than or equal to 2, determining the number of times to be forwarded of an IP packet to be forwarded from the source device to the destination device as N, determining a first forwarding policy of a first forwarding device according to the number of times to be forwarded N, so that the first forwarding device performs N subtraction on a TT L value in the IP packet corresponding to an IP address of the destination device, and then sends the processed IP packet to a next-hop device of the first forwarding device, and determining a second forwarding policy of at least one second forwarding device by using the controller, so that each second forwarding device of the at least one second forwarding device forwards the IP packet corresponding to the IP address of the destination device to the next-hop device of the second forwarding device, and the controller only needs to process one more IP packet forwarding network TT 32 values in an SDN packet forwarding process, and thus the number of the IP packet forwarding network TT 36 is reduced, and the IP packet is processed by the controller in an SDN forwarding network with no more processing system, so that the number of the first forwarding device is reduced by the first forwarding device (TFN).
Based on the above embodiments, the embodiments of the present application further provide a forwarding device, where the forwarding device is applied to the communication network shown in fig. 1, and is used to implement the function of the first forwarding device in the message forwarding method shown in fig. 2. Referring to fig. 4, the forwarding device 400 includes: a receiving unit 401, a processing unit 402 and a transmitting unit 403, wherein,
the receiving unit 401 is configured to receive a first forwarding policy sent by a controller, where the forwarding device 400 is any one of N forwarding devices on a forwarding path between a source device and a destination device, the first forwarding policy includes first indication information for performing N subtraction on a TT L value included in an IP packet sent from the source device to the destination device and forwarding the processed IP packet, N is a positive integer greater than or equal to 2, and
receiving an IP message corresponding to the IP address of the target equipment;
the processing unit 402 is configured to, after the receiving unit 401 receives the IP packet corresponding to the IP address of the destination device, perform N subtraction on the TT L value included in the IP packet according to the first indication information, to obtain the processed IP packet;
the sending unit 403 is configured to send the processed IP packet to a next hop device of the forwarding device 400.
Optionally, the processing unit 402 is further configured to:
after the receiving unit 401 receives the IP packet, before performing N subtraction processing on the TT L value included in the IP packet, it is determined that the TT L value is greater than N.
Optionally, the processing unit 402 is further configured to:
before the sending unit 403 sends the processed IP packet to the next hop device of the forwarding device 400, calculating a checksum of the processed IP packet, and replacing the checksum included in the IP packet with the calculated checksum.
Optionally, the forwarding device 400 is a switch or a router.
By adopting the forwarding device provided by the embodiment of the application, the first forwarding strategy sent by the controller is received, wherein the first forwarding strategy comprises executing N reduction processing on a TT L value included in an IP message sent from a source device to a destination device and forwarding first indication information of the processed IP message, and after the IP message corresponding to the IP address of the destination device is received, executing N reduction processing on the TT L value included in the IP message according to the first indication information to obtain the processed IP message, and then sending the processed IP message to a next hop device of the forwarding device.
Based on the foregoing embodiments, the present application further provides another forwarding device, where the forwarding device is applied to the communication network shown in fig. 1, and is configured to implement a function of a second forwarding device in the message forwarding method shown in fig. 2. Referring to fig. 5, the forwarding device 500 includes: a receiving unit 501 and a transmitting unit 502, wherein,
the receiving unit 501 is configured to receive a forwarding policy sent by a controller, where the forwarding policy includes indication information for forwarding an IP packet sent from a source device to a destination device; and
receiving an IP message corresponding to the IP address of the target equipment;
the sending unit 502 is configured to forward the IP packet to a next hop device of the forwarding device 500 according to the indication information after the receiving unit 501 receives the IP packet corresponding to the IP address of the destination device.
Optionally, the forwarding device 500 is a switch or a router.
By adopting the forwarding equipment provided by the embodiment of the application, the forwarding strategy sent by the controller is received, the forwarding strategy comprises the indication information of the IP message sent from the source equipment to the destination equipment, and the IP message is forwarded to the next hop equipment of the forwarding equipment according to the indication information after the IP message corresponding to the IP address of the destination equipment is received.
It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Based on the above embodiments, the embodiments of the present application further provide a controller, where the controller is applied to the communication network shown in fig. 1, and is used to implement the message forwarding method shown in fig. 2. Referring to fig. 6, the controller 600 includes: a communication interface 601, a processor 602, and a memory 603, wherein,
the communication interface 601, the processor 602 and the memory 603 are connected to each other. Optionally, the communication interface 601, the processor 602 and the memory 603 are connected to each other through a bus 604; the bus 604 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
When the controller 600 implements the packet forwarding method shown in fig. 2:
the communication interface 601 is used for receiving and sending data;
the processor 602 is configured to determine a forwarding path between a source device and a destination device, where the forwarding path includes N forwarding devices; n is a positive integer greater than or equal to 2;
determining the number of times to be forwarded of the IP message to be forwarded, which is sent from the source device to the destination device, to be N;
determining a first forwarding strategy of first forwarding equipment and a second forwarding strategy of at least one second forwarding equipment according to the number N of times to be forwarded, wherein the first forwarding equipment is any one of the N forwarding equipments, and the at least one second forwarding equipment is the forwarding equipment except the first forwarding equipment in the N forwarding equipments;
controlling the communication interface 601 to send the first forwarding policy to the first forwarding device;
controlling the communication interface 601 to send the second forwarding policies to the at least one second forwarding device, respectively.
Optionally, the forwarding device is a switch or a router.
The memory 603 is used for storing programs and the like. In particular, the program may include program code comprising computer operating instructions. The memory 603 may include a RAM, and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 602 executes the application program stored in the memory 603 to implement the above functions, thereby implementing the message forwarding method shown in fig. 2.
The method includes the steps of determining a forwarding path between a source device and a destination device by using a controller provided by an embodiment of the application, wherein the forwarding path includes N forwarding devices, N is a positive integer greater than or equal to 2, determining the number of times to be forwarded of an IP packet to be forwarded from the source device to the destination device as N, determining a first forwarding policy of a first forwarding device according to the number of times to be forwarded N, so that the first forwarding device performs N subtraction on a TT L value in the IP packet corresponding to an IP address of the destination device, and then sends the processed IP packet to a next-hop device of the first forwarding device, and determining a second forwarding policy of at least one second forwarding device by using the controller, so that each second forwarding device of the at least one second forwarding device forwards the IP packet corresponding to the IP address of the destination device to the next-hop device of the second forwarding device, and the controller only needs to process one more IP packet forwarding network TT 32 values in an SDN packet forwarding process, and thus the number of the IP packet forwarding network TT 36 is reduced, and the IP packet is processed by the controller in an SDN forwarding network with no more processing system, so that the number of the first forwarding device is reduced by the first forwarding device (TFN).
Based on the above embodiments, the embodiments of the present application further provide a forwarding device, where the forwarding device is applied to the communication network shown in fig. 1, and is used to implement the function of the first forwarding device in the message forwarding method shown in fig. 2. Referring to fig. 7, the forwarding device 700 includes: a communication interface 701, a processor 702, and a memory 703, wherein,
the communication interface 701, the processor 702 and the memory 703 are connected to each other. Optionally, the communication interface 701, the processor 702 and the memory 703 are connected to each other through a bus 704; the bus 704 may be a PCI bus or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
When the forwarding device 700 implements the packet forwarding method shown in fig. 2:
the communication interface 701 is configured to receive and transmit data;
the processor 702 is configured to control the communication interface 701 to receive a first forwarding policy sent by a controller, where the forwarding device is any one of N forwarding devices on a forwarding path between a source device and a destination device, and the first forwarding policy includes first indication information for performing N subtraction on a TT L value included in an IP packet sent from the source device to the destination device and forwarding the processed IP packet;
after controlling the communication interface 701 to receive the IP packet corresponding to the IP address of the destination device, performing N subtraction on the TT L value included in the IP packet according to the first indication information to obtain the processed IP packet;
controlling the communication interface 701 to send the processed IP packet to the next hop device of the forwarding device 700.
The processor 702 is further configured to:
after controlling the communication interface 701 to receive the IP packet, determining that the TT L value is greater than N before performing N-subtracting processing on the TT L value included in the IP packet.
The processor 702 is further configured to:
before controlling the communication interface 701 to send the processed IP packet to the next hop device of the forwarding device 700, calculating a checksum of the processed IP packet, and replacing the checksum included in the IP packet with the calculated checksum.
Optionally, the forwarding device 700 is a switch or a router.
The memory 703 is used for storing programs and the like. In particular, the program may include program code comprising computer operating instructions. The memory 703 may include RAM, and may also include non-volatile memory, such as at least one disk memory. The processor 702 executes the application program stored in the memory 703 to implement the above functions, thereby implementing the message forwarding method shown in fig. 2.
By adopting the forwarding device provided by the embodiment of the application, the first forwarding strategy sent by the controller is received, wherein the first forwarding strategy comprises executing N reduction processing on a TT L value included in an IP message sent from a source device to a destination device and forwarding first indication information of the processed IP message, and after the IP message corresponding to the IP address of the destination device is received, executing N reduction processing on the TT L value included in the IP message according to the first indication information to obtain the processed IP message, and then sending the processed IP message to a next hop device of the forwarding device.
Based on the foregoing embodiments, the present application further provides another forwarding device, where the forwarding device is applied to the communication network shown in fig. 1, and is configured to implement a function of a second forwarding device in the message forwarding method shown in fig. 2. Referring to fig. 8, the forwarding device 800 includes: a communication interface 801, a processor 802, and a memory 803, wherein,
the communication interface 801, the processor 802 and the memory 803 are interconnected. Optionally, the communication interface 801, the processor 802 and the memory 803 are connected to each other through a bus 804; the bus 804 may be a PCI bus or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
When the forwarding device 800 implements the packet forwarding method shown in fig. 2:
the communication interface 801 is used for receiving and sending data;
the processor 802 is configured to control the communication interface 801 to receive a forwarding policy sent by a controller, where the forwarding policy includes indication information for forwarding an IP packet sent from a source device to a destination device; and
after controlling the communication interface 801 to receive the IP packet corresponding to the IP address of the destination device, controlling the communication interface 801 to forward the IP packet to the next-hop device of the forwarding device 800 according to the indication information.
Optionally, the forwarding device 800 is a switch or a router.
The memory 803 is used for storing programs and the like. In particular, the program may include program code comprising computer operating instructions. The memory 803 may include RAM and may also include non-volatile memory, such as at least one disk memory. The processor 802 executes the application program stored in the memory 803 to implement the above functions, thereby implementing the message forwarding method shown in fig. 2.
By adopting the forwarding equipment provided by the embodiment of the application, the forwarding strategy sent by the controller is received, the forwarding strategy comprises the indication information of the IP message sent from the source equipment to the destination equipment, and the IP message is forwarded to the next hop equipment of the forwarding equipment according to the indication information after the IP message corresponding to the IP address of the destination equipment is received.
In summary, an embodiment of the present application provides a method and an apparatus for forwarding a packet, where a controller determines a forwarding path between a source device and a destination device, where the forwarding path includes N forwarding devices, where N is a positive integer greater than or equal to 2, the controller determines that the number of times to be forwarded of an IP packet to be forwarded, which is sent from the source device to the destination device, is N, and determines a first forwarding policy of a first forwarding device according to the number of times to be forwarded N, so that the first forwarding device performs N subtraction on a value TT L in an IP packet corresponding to an IP address of the destination device first, and then sends the processed IP packet to a next-hop device of the first forwarding device, and the controller determines a second forwarding policy of at least one second forwarding device, so that each second forwarding device of the at least one second forwarding device forwards an IP packet corresponding to the IP address of the destination device to a next-hop device of the second forwarding device, and thus, when the controller processes another IP packet through the forwarding policy, the IP packet forwarding device may only need to process a value of the first forwarding device 3632, and thus, the value of the IP packet forwarding device is reduced by the second forwarding policy (i.e., when the IP packet forwarding device is processed by the SDN) of the forwarding device, the forwarding policy, the IP packet forwarding device, the IP packet forwarding device may only needs to process a value of the forwarding policy of the forwarding network forwarding device, which is reduced by the forwarding device, so that the forwarding network forwarding device, and the forwarding device, so that the forwarding network forwarding device is reduced by the forwarding device, and the forwarding device is.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include such modifications and variations.

Claims (9)

1. A message forwarding method is characterized by comprising the following steps:
the method comprises the steps that a controller determines a forwarding path between source equipment and destination equipment, wherein the forwarding path comprises N forwarding equipment, and N is a positive integer greater than or equal to 2;
the controller determines that the number of times to be forwarded of the to-be-forwarded Internet protocol IP message sent from the source equipment to the destination equipment is N;
the controller determines a first forwarding strategy of first forwarding equipment and a second forwarding strategy of at least one second forwarding equipment according to the number N of times to be forwarded, wherein the first forwarding equipment is any one of the N forwarding equipments, and the at least one second forwarding equipment is the forwarding equipment except the first forwarding equipment in the N forwarding equipments;
the controller sends the first forwarding policy to the first forwarding device;
and the controller respectively sends the second forwarding strategies to the at least one second forwarding device.
2. A message forwarding method is characterized by comprising the following steps:
a first forwarding device receives a first forwarding policy sent by a controller, wherein the first forwarding device is any one of N forwarding devices on a forwarding path between a source device and a destination device, and the first forwarding policy comprises first indication information for performing N subtraction processing on a survival time TT L value included in an internet protocol IP message sent from the source device to the destination device and forwarding the processed IP message;
after receiving the IP packet corresponding to the IP address of the destination device, the first forwarding device performs N subtraction on the TT L value included in the IP packet according to the first indication information, to obtain the processed IP packet;
the first forwarding equipment sends the processed IP message to next hop equipment of the first forwarding equipment;
in the process of forwarding the IP packet from the source device to the destination device, the first forwarding device only needs to process the TT L value of the IP packet once, and at least one second forwarding device does not need to process the TT L value, where the at least one second forwarding device is a forwarding device of the N forwarding devices except for the first forwarding device.
3. The method of claim 2, wherein after the first forwarding device receives the IP packet, prior to performing a N-reduction process on the TT L value included in the IP packet, the method further comprises:
the first forwarding device determines that the TT L value is greater than N.
4. The method according to claim 2 or 3, wherein before the first forwarding device sends the processed IP packet to the next-hop device of the first forwarding device, the method further comprises:
and the first forwarding equipment calculates the checksum of the processed IP message and replaces the checksum in the IP message with the calculated checksum.
5. A controller, comprising:
a memory for storing program instructions;
a communication interface for receiving and transmitting data;
a processor for calling program instructions stored in said memory to perform the following method:
determining a forwarding path between source equipment and destination equipment, wherein the forwarding path comprises N forwarding equipment, and N is a positive integer greater than or equal to 2;
determining the number of times to be forwarded of the to-be-forwarded internet protocol IP message sent from the source equipment to the destination equipment to be N;
determining a first forwarding strategy of first forwarding equipment and a second forwarding strategy of at least one second forwarding equipment according to the number N of times to be forwarded, wherein the first forwarding equipment is any one of the N forwarding equipments, and the at least one second forwarding equipment is the forwarding equipment except the first forwarding equipment in the N forwarding equipments;
controlling the communication interface to send the first forwarding policy to the first forwarding device;
and controlling the communication interface to respectively send the second forwarding strategies to the at least one second forwarding device.
6. A forwarding device, comprising:
a memory for storing program instructions;
a communication interface for receiving and transmitting data;
a processor for calling program instructions stored in said memory to perform the following method:
controlling the communication interface to receive a first forwarding strategy sent by a controller, wherein the forwarding device is any one of N forwarding devices on a forwarding path between a source device and a destination device, and the first forwarding strategy comprises first indication information for executing N reduction processing on a survival time TT L value included in an internet protocol IP message to be forwarded from the source device to the destination device and forwarding the processed IP message, wherein N is a positive integer greater than or equal to 2;
after controlling the communication interface to receive an IP message corresponding to the IP address of the destination device, executing N reduction processing on the TT L value included in the IP message according to the first indication information to obtain the processed IP message;
controlling the communication interface to send the processed IP message to a next hop device of the forwarding device;
in the process of forwarding the IP packet from the source device to the destination device, the forwarding device only needs to process the TT L value of the IP packet once, and does not need to process the TT L value by at least one second forwarding device, where the at least one second forwarding device is a forwarding device other than the forwarding device in the N forwarding devices.
7. The forwarding device of claim 6, wherein the processor is further configured to:
after controlling the communication interface to receive the IP packet, determining that the TT L value is greater than N before performing N-subtracting processing on the TT L value included in the IP packet.
8. The forwarding device of claim 6 or 7, wherein the processor is further configured to:
before controlling the communication interface to send the processed IP message to the next hop device of the forwarding device, calculating a checksum of the processed IP message, and replacing the checksum included in the IP message with the calculated checksum.
9. A computer storage medium, comprising:
the computer storage medium stores computer-executable instructions for causing the computer to perform the method of claim 1 or any of claims 2-4.
CN201710422799.7A 2017-06-07 2017-06-07 Message forwarding method and device Active CN109005116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710422799.7A CN109005116B (en) 2017-06-07 2017-06-07 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710422799.7A CN109005116B (en) 2017-06-07 2017-06-07 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN109005116A CN109005116A (en) 2018-12-14
CN109005116B true CN109005116B (en) 2020-07-24

Family

ID=64573985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710422799.7A Active CN109005116B (en) 2017-06-07 2017-06-07 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN109005116B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787593B (en) * 2019-04-03 2022-08-30 大唐移动通信设备有限公司 Data transmission method and node
CN115086227B (en) * 2022-07-14 2023-10-03 中国联合网络通信集团有限公司 Method, device, equipment and storage medium for determining forwarding strategy
CN115865682A (en) * 2022-12-15 2023-03-28 中国联合网络通信集团有限公司 SDN link detection processing method, controller, system and medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1613267A (en) * 2001-11-16 2005-05-04 M2网络股份有限公司 A method and implementation for a flow specific modified selective-repeat ARQ communication system
CN101145856A (en) * 2006-09-13 2008-03-19 中兴通讯股份有限公司 A multi-broadcast communication method and device for automatic protection switching
CN103257626A (en) * 2012-01-31 2013-08-21 费希尔-罗斯蒙特系统公司 Apparatus and method for establishing maintenance routes within a process control system
CN103401726A (en) * 2013-07-19 2013-11-20 华为技术有限公司 Network path detecting method, device and system
EP2672668A1 (en) * 2012-06-06 2013-12-11 Juniper Networks, Inc. Creating searchable and global database of user visible process traces
CN104506482A (en) * 2014-10-10 2015-04-08 香港理工大学 Detection method and detection device for network attack
CN104796344A (en) * 2014-01-16 2015-07-22 中兴通讯股份有限公司 Method, system, Openflow switch and server for realizing message forwarding based on SDN
CN105516184A (en) * 2015-12-31 2016-04-20 清华大学深圳研究生院 Increment deployment SDN network-based method for defending link flooding attack
CN105634839A (en) * 2014-10-29 2016-06-01 华为技术有限公司 Method and device for acquiring accessible address space of network
CN105634842A (en) * 2014-10-29 2016-06-01 华为技术有限公司 Method and system for detecting bandwidth, and devices
WO2016123314A1 (en) * 2015-01-28 2016-08-04 Hewlett-Packard Development Company, L.P. Data loop determination in a software-defined network
CN106027388A (en) * 2016-05-13 2016-10-12 清华大学 SDN inter-domain routing information transferring method
CN106375207A (en) * 2016-09-05 2017-02-01 上海斐讯数据通信技术有限公司 Time exceeded message control method and system based on SDN (Software Defined Network)
CN106464725A (en) * 2014-05-22 2017-02-22 高通股份有限公司 Systems and methods of operating a device of a data path group network
CN106559325A (en) * 2015-09-25 2017-04-05 华为技术有限公司 Path detection method and device
CN106612211A (en) * 2015-10-23 2017-05-03 华为技术有限公司 A rout detecting method, a controller and a network device in a VxLAN

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1613267A (en) * 2001-11-16 2005-05-04 M2网络股份有限公司 A method and implementation for a flow specific modified selective-repeat ARQ communication system
CN101145856A (en) * 2006-09-13 2008-03-19 中兴通讯股份有限公司 A multi-broadcast communication method and device for automatic protection switching
CN103257626A (en) * 2012-01-31 2013-08-21 费希尔-罗斯蒙特系统公司 Apparatus and method for establishing maintenance routes within a process control system
EP2672668A1 (en) * 2012-06-06 2013-12-11 Juniper Networks, Inc. Creating searchable and global database of user visible process traces
CN103401726A (en) * 2013-07-19 2013-11-20 华为技术有限公司 Network path detecting method, device and system
CN104796344A (en) * 2014-01-16 2015-07-22 中兴通讯股份有限公司 Method, system, Openflow switch and server for realizing message forwarding based on SDN
CN106464725A (en) * 2014-05-22 2017-02-22 高通股份有限公司 Systems and methods of operating a device of a data path group network
CN104506482A (en) * 2014-10-10 2015-04-08 香港理工大学 Detection method and detection device for network attack
CN105634839A (en) * 2014-10-29 2016-06-01 华为技术有限公司 Method and device for acquiring accessible address space of network
CN105634842A (en) * 2014-10-29 2016-06-01 华为技术有限公司 Method and system for detecting bandwidth, and devices
WO2016123314A1 (en) * 2015-01-28 2016-08-04 Hewlett-Packard Development Company, L.P. Data loop determination in a software-defined network
CN106559325A (en) * 2015-09-25 2017-04-05 华为技术有限公司 Path detection method and device
CN106612211A (en) * 2015-10-23 2017-05-03 华为技术有限公司 A rout detecting method, a controller and a network device in a VxLAN
CN105516184A (en) * 2015-12-31 2016-04-20 清华大学深圳研究生院 Increment deployment SDN network-based method for defending link flooding attack
CN106027388A (en) * 2016-05-13 2016-10-12 清华大学 SDN inter-domain routing information transferring method
CN106375207A (en) * 2016-09-05 2017-02-01 上海斐讯数据通信技术有限公司 Time exceeded message control method and system based on SDN (Software Defined Network)

Also Published As

Publication number Publication date
CN109005116A (en) 2018-12-14

Similar Documents

Publication Publication Date Title
US10938748B2 (en) Packet processing method, computing device, and packet processing apparatus
CN105657748B (en) Communication method and network equipment based on tunnel binding
EP2587750B1 (en) Addressing the large flow problem for equal cost multi-path in the datacenter
US9178811B2 (en) Method, apparatus and system for generating label forwarding table on ring topology
CN108809847B (en) Method, device and network system for realizing load balance
CN106878194B (en) Message processing method and device
US10498641B2 (en) Forward entry generating method, forward node, and controller
CN109005116B (en) Message forwarding method and device
CN106664235B (en) Method and device for fusing software defined network and traditional network
US20190238949A1 (en) Multicast service providing method and software defined networking controller
US11805047B2 (en) Method and apparatus for controlling network traffic path
CN111193756B (en) VXLAN tunnel load balancing method and related equipment
US20170222953A1 (en) User packet forwarding control method and processing node
WO2018001373A1 (en) Method and device for limiting transmission speed of messages
US9521073B2 (en) Enhanced fine-grained overlay transport virtualization multi-homing using per-network authoritative edge device synchronization
EP3166263B1 (en) Routing calculation method and device for trill isis
WO2018219103A1 (en) Method and device for determining link state
US20160269325A1 (en) Method, apparatus, and system for controlling forwarding of service data in virtual network
US10826825B2 (en) Access network system, and data packet processing method and apparatus
US20220124036A1 (en) Network congestion handling method and related apparatus
CN109005120B (en) Message processing method and network equipment
CN111600798B (en) Method and equipment for sending and obtaining assertion message
CN104320352B (en) A kind of method and apparatus synchronous for VRRP and IGP
US20160277280A1 (en) Flow entry delivery method and communication system
JP2019521609A (en) Method and device for obtaining path information of data packet

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant