This application relates to the communication field, and in particular, to a method for making a host network performance requirement in a segment routing (SR) network programmable, a device, and a system.
SR is a protocol for data packet forwarding on a network that is designed based on a source routing concept, and supports explicit specification of a forwarding path of a data packet on a source network device.
This application provides a packet sending method, a device, and a system, so that a host that sends a packet is supported in directly imposing a programmable network performance requirement to an SR network, to resolve a technical problem that a configured network performance requirement is not flexible enough.
According to a first aspect, this application provides a packet sending method. A network device receives a first service packet from a host, where the first service packet includes a first identifier, and the first identifier indicates a network performance requirement of the first service packet, the network device adds a segment list to the first service packet based on an element to obtain a second service packet, where the element includes the first identifier, and a forwarding path corresponding to the segment list meets the network performance requirement, and the network device forwards the second service packet through the forwarding path.
This method may be performed by a gateway device in an SR network. The gateway device directly receives the network performance requirement imposed by the host, so that a manner of obtaining the network performance requirement is more flexible. In addition, the gateway device uses, as an element for determining a forwarding path of a service packet, the network performance requirement imposed by the host, so that network efficiency is improved.
In a possible design, before the network device receives the first service packet from the host, the method further includes that the network device sends a control packet to the host, where the control packet includes a second identifier, the first service packet includes a first segment identifier, the first segment identifier includes a locator field and a function field, the locator field includes an address of the network device, and the function field includes the first identifier and the second identifier. The network device obtains, from the control packet from the host, a type value corresponding to a function of receiving the network performance requirement, and adds, to the service packet in a form of an argument of the function, the first identifier indicating the network performance requirement.
In a possible design, the element further includes a destination address of the first service packet.
In a possible design, a value of the first identifier indicates color that is based on a service-level agreement requirement.
According to a second aspect, this application provides a method for imposing a network performance requirement. A host sends a first service packet to a network device, where the first service packet includes a first identifier, and the first identifier indicates a network performance requirement of the first service packet.
The method may be performed by the host. A manner in which the host directly imposes the network performance requirement by adding the network performance requirement to the service packet and then sending the service packet to a gateway device is more flexible.
In a possible design, before the host sends the first service packet to the network device, the method further includes that the host receives a control packet from the network device, where the control packet includes a second identifier, the first service packet includes a first segment identifier, the first segment identifier includes a locator field and a function field, the locator field includes an address of the network device, and the function field includes the first identifier and the second identifier.
In a possible design, the host runs a first application program and a second application program. The first application program is different from the second application program, the first service packet is a service packet of the first application program, and a second service packet is a service packet of the second application program. The method further includes that the host sends the second service packet to the network device, where the second service packet includes a third identifier, the third identifier indicates a network performance requirement of the second service packet, and the third identifier is different from the first identifier.
According to a third aspect, this application provides a network device, to perform the method according to any one of the first aspect or the possible implementations of the first aspect. Further, the network device includes a unit configured to perform the method according to any one of the first aspect or the possible implementations of the first aspect.
According to a fourth aspect, this application provides a host, to perform the method according to any one of the second aspect or the possible implementations of the second aspect. Further, the host includes a unit configured to perform the method according to any one of the second aspect or the possible implementations of the second aspect.
According to a fifth aspect, this application provides a network device. The network device includes a processor, a network interface, and a memory. The network interface may be a transceiver. The memory may be configured to store program code. The processor is configured to invoke the program code in the memory to perform the method according to any one of the first aspect or the possible implementations of the first aspect. Details are not described herein again.
According to a sixth aspect, this application provides a host. The host includes a processor, a network interface, and a memory. The network interface may be a transceiver. The memory may be configured to store program code. The processor is configured to invoke the program code in the memory to perform the method according to any one of the second aspect or the possible implementations of the second aspect. Details are not described herein again.
According to a seventh aspect, this application provides a network system. The network system includes the network device provided in the third aspect and the host provided in the fourth aspect, or the network system includes the network device provided in the fifth aspect and the host provided in the sixth aspect.
According to an eighth aspect, this application provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a computer, the computer is enabled to perform the methods according to the foregoing aspects.
According to a ninth aspect, this application provides a computer program product including computer program instructions. When the computer program product runs on a network device, the network device is enabled to perform the method according to any one of the first aspect, the second aspect, the possible implementations of the first aspect, or the possible implementations of the second aspect.
According to a tenth aspect, this application provides a chip. The chip includes a memory and a processor. The memory is configured to store a computer program. The processor is configured to invoke the computer program from the memory and run the computer program, to perform the method according to any one of the first aspect or the possible implementations of the first aspect, or perform the method according to any one of the second aspect or the possible implementations of the second aspect.
Optionally, the chip includes only the processor, and the processor is configured to read and execute the computer program stored in the memory. When the computer program is executed, the processor performs the method according to any one of the first aspect or the possible implementations of the first aspect, or the processor performs the method according to any one of the second aspect or the possible implementations of the second aspect.
The following describes embodiments of the present disclosure with reference to accompanying drawings.
Embodiments of the present disclosure provide a packet sending method, and a device and a system that are based on the method. The method, the device, and the system are based on a same concept. Principles of resolving problems by the method, the device, and the system are similar. Therefore, for the embodiments of the method, the device, and the system, refer to each other, and same or similar content is not described again.
As shown in
S211: The host 201 sends a service packet to the network device 202, where the service packet includes a first identifier, and the first identifier indicates a network performance requirement of the service packet.
The service packet may be a service packet generated by the host 201. Further, the service packet may be a service packet generated by an application program that is run by the host 201. The host 201 may be a terminal device such as a personal computer, a mobile phone, or a tablet computer. The host 201 may run different application programs. These application programs may separately generate different service packets. For example, the host 201 runs an application program 1 and an application program 2, and the application program 1 and the application program 2 are different application programs. The application program 1 generates a service packet 1, in other words, the service packet 1 is a service packet of the application program 1. The application program 2 generates a service packet 2, in other words, the service packet 2 is a service packet of the application program 2.
The service packet may carry an identifier indicating a network performance requirement of the service packet. The network performance requirement of the service packet may be a service-level agreement (SLA) requirement, such as a low delay, high bandwidth, or a minimum quantity of hops on a path. An identifier value carried in the service packet may indicate the SLA requirement. For example, a mapping relationship may be established between each SLA requirement and each identifier value, so that each identifier value may be used to indicate one SLA requirement. For example, a color attribute value of the SLA requirement may alternatively be used as the identifier value carried in the service packet. Each SLA requirement may be represented by one color attribute, each color attribute is mapped to one specific value, and a correspondence between the color attribute and the specific value is unified in an entire network. For example, a network performance requirement for a low delay may be represented by green, and a corresponding value is 20. For example, a network performance requirement for high bandwidth may be represented by blue, and a corresponding value is 40. The identifier value carried in the service packet may be the specific value to which the color attribute is mapped, for example, 20. Optionally, the network performance requirement may alternatively be a network performance argument value, and the identifier value carried in the service packet is the argument value. For example, if the network performance requirement is that an upper limit of an end-to-end delay is 10 milliseconds (ms), the identifier value carried in the service packet may be 10, and if the network performance requirement is that bandwidth is 100 megabytes (MB), the identifier value carried in the service packet may be 100. Optionally, the identifier value carried in the service packet is an identifier of a packet forwarding path that meets the network performance requirement. For example, if the packet forwarding path that meets the network performance requirement is a first path, and an identifier of the first path in a network is path A, the identifier value carried in the service packet may be A. Optionally, the service packet may include a plurality of network performance requirements at the same time.
In addition, different service packets may carry different identifiers, and service packets of different application programs may also carry different identifiers. For example, when the service packet 1 generated by the application program 1 includes a first identifier, and a value of the first identifier is 20, a green color attribute is indicated, in other words, a network performance requirement of the service packet 1 is a low delay, and when the service packet 2 generated by the application program 2 includes a second identifier, and a value of the second identifier is 40, a blue color attribute is indicated, in other words, a network performance requirement of the service packet 2 is high bandwidth. Therefore, by adding an identifier indicating the network performance requirement to the service packet, the host 201 can directly impose a network performance requirement of the host 201. This is more flexible. In addition, different network performance requirements can be imposed for different service packets, or different network performance requirements can be imposed based on different application programs.
For example, before the host 201 obtains the service packet including the first identifier, the network device 202 sends a control packet to the host 201 to notify the host 201 that the host 201 can impose the network performance requirement of the host 201. The control packet may be an RA packet in a Neighbor Discovery Protocol (NDP). An RA packet is periodically sent by a gateway to the host, or is sent in response to a Router Solicitation packet of the host, and is used to notify the host of related information of the gateway. With reference to the application scenario shown in
When the SR network may be an SR over Internet Protocol (IP) version 6 (IPv6) (SRv6) network, the network device 202 may further notify, by using the control packet, the host 201 of an SRv6 network function of receiving the network performance requirement. In the service packet generated by the host 201, the network performance requirement is carried as an argument of the function. Further, when the service packet is sent by the host 201 to the network device 202, the network device 202 may receive and process the network performance requirement in the service packet by using the function. The SRv6 network has a plurality of functions. Each function includes a corresponding operation step used to implement a specific function. A related argument may be involved in the operation step of the function. Each function may be represented by a function field that is of a specific value and that is included in a segment identifier (SID). Each argument may alternatively be represented by an argument field that is of a specific value and that is included in a SID, and the argument field representing the argument is usually placed after a function field representing the function. Optionally, a plurality of arguments is involved in each function. Correspondingly, a function field representing the function may be followed by a plurality of different argument fields representing different arguments. As shown in
For example, the control packet sent by the network device 202 to the host 201 may include a second identifier, and a value of the second identifier may be a function field that is of a specific value and that corresponds to the function of receiving the network performance requirement. Optionally, the control packet further includes a description field used to describe a correspondence between the function of receiving the network performance requirement and the function field of the specific value. For example, the description field may be a specific field in the RA packet. For example, the description field may be an SRv6 endpoint function field in the RA packet. The host 201 generates a service packet that includes the first identifier and the second identifier. Optionally, the second identifier and the first identifier may be included in a same SID of the service packet, the second identifier and the first identifier may be included in a function field of the SID, the value of the second identifier is used to indicate the function of receiving the network performance requirement, the value of the first identifier is used to indicate the network performance requirement, and the value of the first identifier is used as the argument of the function. Optionally, a locator field of the SID in the service packet may include an address prefix of the network device 202, in other words, the SID in the service packet is a segment identifier of the network device 202. In this embodiment of the present disclosure, that the SID is the segment identifier of the network device 202 means that the locator field of the SID includes the address prefix of the network device 202. For example, the SID may be a node SID of the network device 202, or may be an adjacent SID of a link of the network device 202. The foregoing descriptions of the segment identifier are also applicable to another network device other than the network device 202. Optionally, the second identifier may be included in a SID of the control packet. Optionally, the second identifier may be included in a function field of the SID. Optionally, a locator field of the SID in the control packet may include the address prefix of the network device 202, in other words, the SID in the control packet is a segment identifier of the network device 202.
An example is provided for description with reference to the application scenario shown in
Further, the segment identifier that is of the network device 202 and that includes the first identifier and the second identifier may be included in a segment list in a segment routing header (SRH) of the service packet.
An example is provided for description with reference to the application scenario shown in
S212: The network device 202 receives the service packet from the host 201, and adds a segment list to the service packet based on the first identifier in the service packet, where a forwarding path corresponding to the segment list meets the network performance requirement of the service packet. As a gateway device of the host 201, the network device 202 receives the service packet from the host 201, adds the segment list to the service packet, and further forwards the service packet through the forwarding path corresponding to the segment list. In this process, the network device 202 adds the segment list to the service packet based on the first identifier, and the forwarding path corresponding to the added segment list also meets the network performance requirement of the service packet. Therefore, it is ensured that the service packet is forwarded through the forwarding path that meets the network performance requirement of the service packet, and a network service is more targeted. Optionally, when the network device 202 adds the segment list to the service packet, in addition to the first identifier in the service packet, elements that need to be considered include a destination address of the service packet, in other words, the network device 202 adds the segment list to the service packet based on the destination address of the service packet and the first identifier. The destination address of the service packet is an address prefix of a receiving device of the service packet.
An example is provided for description with reference to the application scenario shown in
With reference to the foregoing descriptions, when the function field that is of the specific value and that corresponds to the function of receiving the network performance requirement is carried in the service packet, the network device 202 receives, by using the function, the network performance requirement imposed by the host 201, and adds the segment list to the service packet based on the network performance requirement. The forwarding path corresponding to the segment list meets the network performance requirement of the service packet.
An example is provided for description with reference to the application scenario shown in
With reference to the foregoing descriptions, the function of receiving the network performance requirement may be a variant of an End.B6.Insert function, and a specific execution process of the function includes inserting the segment list as a new SRH header. Alternatively, the function of receiving the network performance requirement may be a variation of an End.B6.Encaps function, and a specific execution process of the function includes encapsulating a new IPv6 packet header for the packet and inserting an SRH header that carries the segment list.
For example, the network device 202 may receive different service packets, and the different service packets include different network performance requirements. The network device 202 adds different segment lists to the different service packets based on the different network performance requirements, so that the different service packets are sent through forwarding paths that meet network performance requirements of the service packets.
An example is provided for description with reference to the application scenario shown in
It may be understood that Table 1 merely provides an example of the mapping relationship between a segment list and a combination of a final destination address and a network performance requirement. The mapping relationship between a combination of a final destination address and a network performance requirement and a segment list may be in a variety of forms. For example, the final destination address may be represented by a segment identifier of the receiving device X or other identification information of the receiving device X, and the network performance requirement information may also be represented by a color attribute, such as green.
S213: The network device 202 forwards the service packet through the forwarding path corresponding to the segment list.
That the network device 202 forwards the service packet through the forwarding path corresponding to the segment list means that the network device 202 sends the service packet to the first network device on the forwarding path, and the network device and each network device on the forwarding path sequentially send the service packet to a next network device on the forwarding path according to an indication of the segment list. With reference to the application scenario shown in
The receiving unit 601 is configured to receive a first service packet from a host, where the first service packet includes a first identifier, and the first identifier is used to indicate a network performance requirement of the first service packet.
The processing unit 602 is configured to add a segment list to the first service packet based on an element to obtain a second service packet, where the element includes the first identifier, and a forwarding path corresponding to the segment list meets the network performance requirement.
The sending unit 603 is configured to forward the second service packet through the forwarding path.
The memory 701 is configured to store instructions. When the embodiment shown in
The processor 702 is configured to execute the instructions in the memory 701 to perform the foregoing packet sending method applied to the embodiment shown in
The network interface 703 is configured to communicate with another network device. The network interface 703 may be an Ethernet interface, an Asynchronous Transfer Mode (ATM) interface, or the like.
The network interface 703, the processor 702, and the memory 701 are connected to each other. For example, the network interface 703, the processor 702, and the memory 701 are connected to each other through a bus. The bus may be a Peripheral Component Enterconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus in
In a specific embodiment, the processor 702 is configured to receive a first service packet from a host by using the network interface 703, where the first service packet includes a first identifier, and the first identifier indicates a network performance requirement of the first service packet, add a segment list to the first service packet based on an element to obtain a second service packet, where the element includes the first identifier, and a forwarding path corresponding to the segment list meets the network performance requirement, and forward, by using the network interface 703, the second service packet through the forwarding path. For a detailed processing process of the processor 702, refer to the detailed descriptions of the processes S212 and S213 in the foregoing embodiment shown in
The network interface 703 is used by the network device 700 to receive and send a packet by using a network system. For a specific process, refer to the detailed descriptions of the processes S212 and S213 in the foregoing embodiment shown in
The sending unit 801 is configured to send a first service packet to a network device, where the first service packet includes a first identifier, and the first identifier indicates a network performance requirement of the first service packet.
For example, the host 800 further includes a receiving unit 802. The unit may execute a corresponding function of the host in the foregoing method.
The receiving unit 802 is configured to receive a control packet from the network device, where the control packet includes a second identifier, the first service packet includes a first segment identifier, the first segment identifier includes a locator field and a function field, the locator field includes an address of the network device, and the function field includes the first identifier and the second identifier.
For example, the host 800 further includes a processing unit 803. The unit may execute a corresponding function of the host in the example of the foregoing method.
The processing unit 803 is configured to run a first application program and a second application program, where the first application program is different from the second application program, the first service packet is a service packet of the first application program, and a second service packet is a service packet of the second application program.
The sending unit 801 is further configured to send the second service packet to the network device, where the second service packet includes a third identifier, the third identifier indicates a network performance requirement of the second service packet, and the third identifier is different from the first identifier.
The memory 901 is configured to store instructions. When the embodiment shown in
The processor 902 is configured to execute the instructions in the memory 901 to perform the foregoing packet sending method applied in the foregoing embodiment shown in
The network interface 903 is configured to communicate with another network device. The network interface 903 may be a wired interface or a wireless interface.
The network interface 903, the processor 902, and the memory 901 are connected to each other. For example, the network interface 903, the processor 902, and the memory 901 are connected to each other through a bus. The bus may be a PCI bus, an EISA bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus in
In a specific embodiment, the processor 902 is configured to send a first service packet to a network device by using the network interface 903, where the first service packet includes a first identifier, and the first identifier indicates a network performance requirement of the first service packet. For a detailed processing process of the processor 902, refer to the detailed descriptions of the process S211 in the foregoing embodiment shown in
The network interface 903 is used by the host 900 to receive and send a packet by using a network system. For a specific process, refer to the detailed descriptions of the process S211 in the foregoing embodiment shown in
Further, the host is configured to send a first service packet to the network device, where the first service packet includes a first identifier, the first identifier indicates a network performance requirement of the first service packet.
The network device is configured to receive a first service packet from the host, add a segment list to the first service packet based on an element to obtain a second service packet, and forward the second service packet through a forwarding path corresponding to the segment list, where the element includes the first identifier, and the forwarding path meets the network performance requirement.
An embodiment of the present disclosure further provides a non-transient storage medium, configured to store software instructions used in the foregoing embodiments. The non-transient storage medium includes a program used to perform the methods shown in the foregoing embodiments. When the program is executed on a computer or a network device, the computer or the network device is enabled to perform the methods in the foregoing method embodiments.
An embodiment of the present disclosure further provides a computer program product including computer program instructions. When the computer program product runs on a computer, a network node is enabled to perform the methods in the foregoing method embodiments.
The “first” in the first service packet, the first identifier, the first segment identifier, and the first application program mentioned in the embodiments of the present disclosure is merely used as a name identifier, and does not represent the first in terms of sequence. The rule also applies to “second”, “third”, “fourth”, and the like.
It should be noted that any apparatus embodiment described above is merely an example. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the modules may be selected based on an actual requirement to achieve the objectives of the solutions of the embodiments. In addition, in accompanying drawings of embodiments of the network device or the host provided by the present disclosure, connection relationships between modules indicate that the modules have communication connections with each other, which may be implemented as one or more communication buses or signal cables. A person of ordinary skill in the art may understand and implement the embodiments without creative efforts.
Methods or algorithm steps described in the content disclosed in the embodiments of the present disclosure may be implemented by hardware, or may be implemented by a processor by executing software instructions. The software instructions may be formed by a corresponding software module. The software module may be stored in a random-access memory (RAM), a flash memory, a read-only memory (ROM), an erasable programmable ROM (EPROM), an electrically EPROM (EEPROM), a hard disk, a removable hard disk, an optical disc, or any other form of storage medium well-known in the art. A storage medium is coupled to a processor, so that the processor can read information from the storage medium. Certainly, the storage medium may be a component of the processor.
The objectives, technical solutions, and benefits of the present disclosure are further described in detail in the foregoing specific implementations. It should be understood that the foregoing descriptions are merely specific implementations of the present disclosure, but are not intended to limit the protection scope of the present disclosure. Any modification, replacement, or improvement made based on the technical solutions of the present disclosure shall fall within the protection scope of the present disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 201910844539.8 | Sep 2019 | CN | national |
This is a continuation of International Patent Application No. PCT/CN2020/113363 filed on Sep. 4, 2020, which claims priority to Chinese Patent Application No. 201910844539.8 filed on Sep. 6, 2019. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
| Number | Date | Country | |
|---|---|---|---|
| Parent | PCT/CN2020/113363 | Sep 2020 | US |
| Child | 17686983 | US |