A method for route advertisement and related devices

By implementing the routing notification method of single-stack function in network devices, network devices can carry IPv4 or IPv6 services on the basis of only consuming IPv6 or IPv4 address resources, solving the problems of complex network configuration and insufficient address, and realizing the simplified bearer of IPv4 and IPv6 services.

CN116389358BActive Publication Date: 2025-08-01HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210227226.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-12-23
Filing Date
2022-03-08
Publication Date
2025-08-01
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

Network devices need to enable both IPv4 and IPv6 dual-stack functions to carry IPv4 and IPv6 services, resulting in large address resource consumption and complex network configuration. As the network scale expands, IPv4 addresses are insufficient.

Method used

By implementing the routing advertisement method of the single-stack function in a network device, a network device that enables the IPv4 or IPv6 single-stack function can advertise IPv4 or IPv6 routing information based on the internal gateway protocol, thereby hosting another version of the service on the basis of consuming only one version of the IP address resources.

Benefits of technology

It simplifies network configuration, saves address resources, solves the problem of insufficient IPv4 addresses, and realizes the bearer of IPv4 and IPv6 services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389358B_ABST
    Figure CN116389358B_ABST
Patent Text Reader

Abstract

The present application discloses a method for route advertisement and related devices. In order to save IP address resources and simplify the configuration and maintenance costs of network devices, it is not required that all network devices in the network enable the IPv4 and IPv6 dual-stack function. By enabling only the IPv4 or IPv6 single-stack function on the network devices in this network, the services of IPv4 and IPv6 can be carried. Specifically, when implemented, the route advertisement message for advertising IPv4 routes can carry the route information corresponding to the IPv6 address, or the route advertisement message for advertising IPv6 routes can carry the route information corresponding to the IPv4 address. Thus, the network devices receiving the route advertisement message in the network can implement the carrying of services of another version of IP based on the function of one version of the IP protocol stack and the corresponding IP address resources.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of a Chinese patent application with an application number of 202111589941.X and an application title of "A Method and Device for Data Transmission" submitted to the China National Intellectual Property Administration on December 23, 2021. The entire content of which is incorporated herein by reference. Technical Field

[0002] This application relates to the field of communication technologies, and in particular, to a method for route advertisement and related devices. Background Art

[0003] Currently, network devices usually enable the dual-stack function of the Internet Protocol version 4 (IPv4) and the Internet Protocol version 6 (IPv6) to carry IPv4 and IPv6 services. Each network device needs to be configured to enable IPv4 and IPv6, consuming valuable IPv4 address and IPv6 address resources on the network device, and the configuration and maintenance are relatively complex for network devices. Summary of the Invention

[0004] Based on this, this application provides a method for route advertisement and related devices. When a network device enables the single-stack function of IPv4 or IPv6, it can advertise IPv4 route information and IPv6 route information based on the Interior Gateway Protocol (IGP), so that the network device that only enables the single-stack function can carry IPv4 and IPv6 services.

[0005] In a first aspect, the present application provides a method for route advertisement. For example, the method may include: a first network device obtains a first route advertisement message, where the first route advertisement message includes an Open Shortest Path First Version 3 (OSPFv3) message or an Intermediate System-to-Intermediate System Internet Protocol version 6 (IS-ISv6) message. The first route advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address. Then, the first network device sends the first route advertisement message to a second network device. Thus, the second network device can generate a first forwarding entry based on the trigger of the first route advertisement message, and the first forwarding entry is used by the second network device to forward packets with the destination address being the first IPv4 address. In this way, there is no need to enable the IPv4 function on the second network device, nor to configure the IPv4 address on the second network device. When a packet with the destination address being the first IPv4 address is received in this network, the second network device can complete the processing of the packet based on the first forwarding entry. That is, the network device that receives the route advertisement message in the network can carry IPv4 services on the basis of only consuming IPv6 address resources. In this way, on the basis of ensuring that IPv4 and IPv6 services can be carried by the network, the method provided by the present application simplifies network configuration, saves address resources, and solves the problem of insufficient IPv4 addresses caused by network development.

[0006] In some possible implementation manners, the first IPv4 routing information may include a prefix of the first IPv4 address. Then, the first forwarding entry may be an IPv4 forwarding entry, and the first forwarding entry includes the prefix of the first IPv4 address and first next-hop information. The first next-hop information includes one or more of the following: an IPv6 address, a Neighbor Discovery (ND) index, or a Media Access Control (MAC) address.

[0007] As an example, in this implementation manner, the first route advertisement message may include indication information, and the indication information is used to indicate that the first route advertisement message is used to advertise IPv4 routes.

[0008] In some other possible implementation manners, the first IPv4 routing information may include the prefix of the first IPv6 address. Before the first network device obtains the first routing advertisement message, the method provided by this application may further include: the first network device obtains the prefix of the first IPv4 address according to the second IPv4 routing information; the first network device converts the prefix of the first IPv4 address into the prefix of the first IPv6 address. Among them, converting the prefix of the first IPv4 address into the prefix of the first IPv6 address may be, for example, converting the prefix 1.1.1.1 of the first IPv4 address into the prefix ::1.1.1.1 of the first IPv6 address; or for another example, it may also be implemented using any conversion rule agreed upon in the network. For example, placing the prefix of the first IPv4 address at a preset position (such as the last 32 bits) of the 128-bit first IPv6 address to obtain the 128-bit first IPv6 address. In this way, it prepares for the subsequent first network device to obtain the first routing advertisement message carrying the prefix of the first IPv6 address.

[0009] As an example, in this implementation manner, the first forwarding entry may be an IPv6 forwarding entry, and the first forwarding entry includes the prefix of the first IPv6 address and the first next-hop information, and the first next-hop information includes one or more of the following: IPv6 address, ND index, or MAC address.

[0010] It should be noted that in this application, an IPv4 forwarding entry refers to a forwarding entry whose prefix of the IP address is the prefix of an IPv4 address, and an IPv6 forwarding entry refers to a forwarding entry whose prefix of the IP address is the prefix of an IPv6 address. That is to say, the difference between an IPv4 forwarding entry and an IPv6 forwarding entry lies in whether the type of the prefix of the IP address is the prefix of an IPv4 address or the prefix of an IPv6 address.

[0011] In some possible implementation manners, in the method provided by this application, the first network device may be a dual-stack device supporting both IPv4 and IPv6 functions. Then, before the first network device obtains the first routing advertisement message, it may further include: the first network device receives a second routing advertisement message sent by a third network device, where the second routing advertisement message includes an Open Shortest Path First Version 2 (OSPFv2) message or an Intermediate System-to-Intermediate System Internet Protocol version 4 (IS-ISv4) message, the second routing advertisement message carries the second IPv4 routing information, and the second IPv4 routing information includes the routing information corresponding to the first IPv4 address; then, the first network device generates a second forwarding entry according to the second routing advertisement message, and the second forwarding entry is used to guide the first network device to forward a message whose destination address is the first IPv4 address. In this implementation manner, for the first network device to obtain the first routing advertisement message, for example, it may include: the first network device generates the first routing advertisement message according to the second routing advertisement message.

[0012] In some other possible implementation manners, in the method provided by this application, the first network device may be a single-stack device supporting IPv6 functions. Then, for the first network device to obtain the first routing advertisement message, for example, it may include: the first network device receives the first routing advertisement message sent by a fourth network device. Among them, the fourth network device may be an edge node or an intermediate node in a network that only supports IPv6 functions, or may also be a dual-stack device supporting both IPv4 and IPv6 functions.

[0013] As an example, in this implementation manner, the method provided by this application may further include: the first network device generates a third forwarding entry according to the first routing advertisement message, and the third forwarding entry is used to guide the first network device to forward a message whose destination address is the first IPv4 address. Among them, for the first network device to generate the third forwarding entry according to the first routing advertisement message, for example, it may include: the first network device performs path calculation according to the first IPv4 routing information to generate the third forwarding entry, and the third forwarding entry is an IPv4 forwarding entry or an IPv6 forwarding entry.

[0014] Second aspect, the present application also provides a method for route advertisement, which may include: a second network device receives a first route advertisement message, the first route advertisement message includes an OSPFv3 message or an IS-ISv6 message, the first route advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; the second network device generates a first forwarding entry according to the first IPv4 routing information, and the first forwarding entry is used to guide the second network device to forward a packet with a destination address being the first IPv4 address. In this way, it is not necessary to enable the IPv4 function on the second network device again, nor to configure the IPv4 address for the second network device again. When a packet with a destination address being the first IPv4 address is received in this network, the second network device can complete the processing of the packet based on the first forwarding entry, that is, the network device receiving the route advertisement message in the network can carry IPv4 services on the basis of only consuming IPv6 address resources. Thus, on the basis of ensuring that IPv4 and IPv6 services can be carried by the network, the method provided by the present application simplifies network configuration, saves address resources, and solves the problem of insufficient IPv4 addresses caused by network development.

[0015] In some possible implementation manners, the first IPv4 routing information may include a prefix of the first IPv4 address. Then, the first forwarding entry may be an IPv4 forwarding entry, and the first forwarding entry includes the prefix of the first IPv4 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, an ND index, or a MAC address.

[0016] In some other possible implementation manners, the first IPv4 routing information may include a prefix of a first IPv6 address, and the prefix of the first IPv6 address is obtained by converting the prefix of the first IPv4 address. Then, the first forwarding entry may be an IPv6 forwarding entry, and the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, an ND index, or a media access control MAC address.

[0017] In some possible implementation manners, the second network device generates a first forwarding entry according to the first IPv4 routing information, for example, may include: the second network device performs path calculation according to the first IPv4 routing information to generate the first forwarding entry.

[0018] In a third aspect, the present application also provides a method for route advertisement. This method may include, for example: a first network device obtains a first route advertisement message, where the first route advertisement message includes an OSPFv2 message or an IS-ISv4 message, the first route advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; the first network device sends the first route advertisement message to a second network device, and the second network device generates a first forwarding entry based on the trigger of the first route advertisement message, and the first forwarding entry is used to guide the second network device to forward a message with a destination address being the first IPv6 address. In this way, it is not necessary to enable the IPv6 function on the second network device anymore, nor to configure an IPv6 address for the second network device. When a message with a destination address being the first IPv6 address is received in this network, the second network device can complete the processing of this message based on the first forwarding entry, that is, the network device receiving the route advertisement message in the network can carry IPv6 services on the basis of only consuming IPv4 address resources. Thus, on the basis of ensuring that IPv4 and IPv6 services can be carried by the network, the method provided by the present application simplifies network configuration and saves address resources.

[0019] In some possible implementation manners, in the method provided by the present application, the first network device may be a dual-stack device supporting both IPv4 and IPv6 functions. Then, before the first network device obtains the first route advertisement message, it may further include: the first network device receives a second route advertisement message sent by a third network device, where the second route advertisement message includes an OSPFv3 message or an IS-ISv6 message, the second route advertisement message carries second IPv6 routing information, and the second IPv6 routing information includes routing information corresponding to the first IPv6 address; the first network device generates a second forwarding entry according to the second route advertisement message, and the second forwarding entry is used to guide the first network device to forward a message with a destination address being the first IPv6 address. As an example, in this implementation manner, the first network device obtains the first route advertisement message, for example, may include: the first network device generates the first route advertisement message according to the second route advertisement message.

[0020] In other possible implementation manners, in the method provided by the present application, the first network device may be a single-stack device supporting IPv4 function. Then, the first network device obtains the first route advertisement message, for example, may include: the first network device receives the first route advertisement message sent by a fourth network device. Among them, the fourth network device may be an edge node or an intermediate node in a network supporting only IPv4 function, or may also be a dual-stack device supporting both IPv4 and IPv6 functions.

[0021] As an example, in this implementation manner, the method provided by this application may further include: a first network device generates a third forwarding entry according to the first routing advertisement message, and the third forwarding entry is used to guide the first network device to forward a packet whose destination address is the first IPv6 address. If the first IPv6 routing information includes a prefix of the first IPv6 address, then, the first network device generates a third forwarding entry according to the first routing advertisement message. For example, it may include: the first network device performs path calculation according to the prefix of the first IPv6 address to generate the third forwarding entry, the third forwarding entry is an IPv6 forwarding entry, and the third forwarding entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv4 address, an Address Resolution Protocol (ARP) index, or a MAC address.

[0022] It should be noted that the first routing advertisement message may include indication information, and the indication information is used to indicate that the first routing advertisement message is used to advertise IPv6 routing.

[0023] In a fourth aspect, this application further provides a method for routing advertisement. For example, the method may include: a second network device receives a first routing advertisement message, the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; the second network device generates a first forwarding entry according to the first IPv6 routing information, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address. In this way, it is not necessary to enable the IPv6 function for the second network device again, nor to configure an IPv6 address for the second network device again. When a packet whose destination address is the first IPv6 address is received in this network, the second network device can complete the processing of the packet based on the first forwarding entry. That is, a network device that receives a routing advertisement message in the network can carry IPv6 services on the basis of only consuming IPv4 address resources. In this way, on the basis of ensuring that IPv4 and IPv6 services can be carried by the network, the method provided by this application simplifies network configuration and saves address resources.

[0024] In some possible implementation manners, the first IPv6 routing information may include a prefix of the first IPv6 address, the first forwarding entry is an IPv6 forwarding entry, the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv4 address, an ARP index, or a MAC address.

[0025] As an example, the second network device generates a first forwarding entry according to the first IPv6 routing information. For example, it may include: the second network device performs path calculation based on the prefix of the first IPv6 address to generate the first forwarding entry.

[0026] It should be noted that in the methods provided in the above first aspect to the fourth aspect, the first forwarding entry may further include egress interface information.

[0027] In a fifth aspect, the present application provides a routing advertisement device, which is characterized in that it is applied to a first network device, and the device includes: an obtaining unit and a sending unit. Among them, the obtaining unit is used to obtain a first routing advertisement message, the first routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, the first routing advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; the sending unit is used to send the first routing advertisement message to a second network device, and the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv4 address.

[0028] In some possible implementation manners, the first IPv4 routing information includes the prefix of the first IPv4 address. The first forwarding entry is an IPv4 forwarding entry, and the first forwarding entry includes the prefix of the first IPv4 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, an ND index, or a MAC address. Among them, the first routing advertisement message includes indication information, and the indication information is used to indicate that the first routing advertisement message is used to advertise IPv4 routing.

[0029] In some other possible implementation manners, the first IPv4 routing information includes the prefix of a first IPv6 address, and the device further includes: a conversion unit. Among them, the obtaining unit is further used to obtain the prefix of the first IPv4 address according to second IPv4 routing information; the conversion unit is used to convert the prefix of the first IPv4 address into the prefix of the first IPv6 address. The first forwarding entry is an IPv6 forwarding entry, and the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, a neighbor discovery ND index, or a media access control MAC address.

[0030] In some possible implementations, the apparatus further includes: a receiving unit and a generating unit. The receiving unit is configured to receive a second routing advertisement message sent by a third network device before obtaining the first routing advertisement message. The second routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, and the second routing advertisement message carries the second IPv4 routing information, where the second IPv4 routing information includes routing information corresponding to the first IPv4 address. The generating unit is configured to generate a second forwarding entry according to the second routing advertisement message, and the second forwarding entry is used to guide the first network device to forward a message whose destination address is the first IPv4 address.

[0031] As an example, the obtaining unit is specifically configured to: generate the first routing advertisement message according to the second routing advertisement message.

[0032] In some other possible implementations, the obtaining unit is specifically configured to: receive the first routing advertisement message sent by a fourth network device.

[0033] In this implementation, the apparatus may further include a generating unit. The generating unit is configured to generate a third forwarding entry according to the first routing advertisement message, and the third forwarding entry is used to guide the first network device to forward a message whose destination address is the first IPv4 address. For example, the generating unit is specifically configured to: perform path calculation according to the first IPv4 routing information to generate the third forwarding entry, and the third forwarding entry is an IPv4 forwarding entry or an IPv6 forwarding entry.

[0034] It should be noted that the routing advertisement apparatus provided in this fifth aspect is used to perform the related operations mentioned in the first aspect above. For the specific implementation manners and achieved effects, reference may be made to the related descriptions in the first aspect above, which will not be elaborated here.

[0035] In a sixth aspect, the present application provides a routing advertisement apparatus applied to a second network device. The apparatus may include, for example: a receiving unit and a generating unit. Among them, the receiving unit is configured to receive a first routing advertisement message. The first routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, and the first routing advertisement message carries first IPv4 routing information, where the first IPv4 routing information includes routing information corresponding to the first IPv4 address. The generating unit is configured to generate a first forwarding entry according to the first IPv4 routing information, and the first forwarding entry is used to guide the second network device to forward a message whose destination address is the first IPv4 address.

[0036] In some possible implementations, the first IPv4 routing information includes a prefix of the first IPv4 address. Then, the first forwarding table entry may be an IPv4 forwarding table entry, and the first forwarding table entry includes the prefix of the first IPv4 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, an ND index, or a MAC address.

[0037] In some other possible implementations, the first IPv4 routing information includes a prefix of a first IPv6 address, and the prefix of the first IPv6 address is obtained by converting the prefix of the first IPv4 address. Then, the first forwarding table entry may be an IPv6 forwarding table entry, and the first forwarding table entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, a neighbor discovery (ND) index, or a media access control (MAC) address.

[0038] In some possible implementations, the generating unit is specifically configured to: perform path calculation according to the first IPv4 routing information to generate the first forwarding table entry.

[0039] It should be noted that the routing advertisement device provided in this sixth aspect is used to perform the related operations mentioned in the above second aspect. For its specific implementation manners and achieved effects, reference may be made to the relevant descriptions in the above second aspect, which will not be elaborated herein.

[0040] In a seventh aspect, the present application further provides a routing advertisement device, which is applied to a first network device. The device may include: an obtaining unit and a sending unit. The obtaining unit is configured to obtain a first routing advertisement message, where the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, and the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; the sending unit is configured to send the first routing advertisement message to a second network device, and the first routing advertisement message is used to trigger the second network device to generate a first forwarding table entry, and the first forwarding table entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address.

[0041] In some possible implementations, the apparatus further includes a receiving unit and a generating unit. The receiving unit is configured to receive a second routing advertisement message sent by a third network device before obtaining the first routing advertisement message. The second routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, and the second routing advertisement message carries second IPv6 routing information, where the second IPv6 routing information includes routing information corresponding to the first IPv6 address. The generating unit is configured to generate a second forwarding table entry according to the second routing advertisement message, and the second forwarding table entry is used to instruct the first network device to forward a message with a destination address being the first IPv6 address.

[0042] In this implementation, the obtaining unit is specifically configured to: generate the first routing advertisement message according to the second routing advertisement message.

[0043] In some other possible implementations, the obtaining unit is specifically configured to: receive the first routing advertisement message sent by a fourth network device.

[0044] In this implementation, the apparatus may further include a generating unit. The generating unit is configured to generate a third forwarding table entry according to the first routing advertisement message, and the third forwarding table entry is used to instruct the first network device to forward a message with a destination address being the first IPv6 address. Wherein, the first IPv6 routing information may include a prefix of the first IPv6 address. Then, the generating unit is specifically configured to: perform path calculation according to the prefix of the first IPv6 address to generate the third forwarding table entry. The third forwarding table entry is an IPv6 forwarding table entry, and the third forwarding table entry includes the prefix of the first IPv6 address and first next-hop information, where the first next-hop information includes one or more of the following: an IPv4 address, an ARP index, or a MAC address.

[0045] Wherein, the first routing advertisement message may include indication information, and the indication information is used to indicate that the first routing advertisement message is used to advertise IPv6 routing.

[0046] It should be noted that the routing advertisement apparatus provided in this seventh aspect is used to perform the related operations mentioned in the above third aspect. For the specific implementation manners and achieved effects, reference may be made to the related descriptions in the above third aspect, which will not be elaborated herein.

[0047] In an eighth aspect, the present application further provides a routing advertisement device, which is applied to a second network device. The device may include, for example: a receiving unit and a generating unit. Among them, the receiving unit is configured to receive a first routing advertisement message, where the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; the generating unit is configured to generate a first forwarding entry according to the first IPv6 routing information, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address.

[0048] In some possible implementation manners, the first IPv6 routing information may include a prefix of the first IPv6 address, the first forwarding entry is an IPv6 forwarding entry, the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv4 address, an ARP index, or a MAC address.

[0049] In some possible implementation manners, the generating unit is specifically configured to: perform path calculation according to the prefix of the first IPv6 address to generate the first forwarding entry.

[0050] It should be noted that the routing advertisement device provided in this eighth aspect is used to perform the related operations mentioned in the fourth aspect above. For its specific implementation manners and achieved effects, reference may be made to the related descriptions in the fourth aspect above, and details are not repeated here.

[0051] It should be noted that in the devices provided in the fifth to eighth aspects above, the first forwarding entry may further include outgoing interface information.

[0052] In a ninth aspect, the present application further provides a network device, which includes: a processor and a memory, where: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the network device executes the methods provided in any possible implementation manner of the first aspect above, the methods provided in any possible implementation manner of the second aspect above, the methods provided in any possible implementation manner of the third aspect above, or the methods provided in any possible implementation manner of the fourth aspect above.

[0053] In a tenth aspect, the present application further provides a communication system, which includes: a first network device and a second network device, where:

[0054] The first network device is used to execute the methods provided in any possible implementation manner of the first aspect above;

[0055] The second network device is configured to execute the method provided in any one of the possible implementation manners of the second aspect above;

[0056] Or,

[0057] The first network device is configured to execute the method provided in any one of the possible implementation manners of the third aspect above;

[0058] The second network device is configured to execute the method provided in any one of the possible implementation manners of the fourth aspect above.

[0059] Or, it can also be understood that the communication system includes: the device for route advertisement of the fifth aspect and the device for route advertisement of the sixth aspect; or, the communication system includes: the device for route advertisement of the seventh aspect and the device for route advertisement of the eighth aspect.

[0060] Eleventh aspect, the present application further provides a computer-readable storage medium, in which program code or instructions are stored, and when it runs on a processor, it enables the computer to execute the method provided in any one of the possible implementation manners of the first aspect, second aspect, third aspect or fourth aspect above.

[0061] Twelfth aspect, the present application further provides a computer program product, when the computer program product runs on a processor, it enables the processor to execute the method provided in any one of the possible implementation manners of the first aspect, second aspect, third aspect or fourth aspect above.

[0062] Thirteenth aspect, the present application provides a chip, including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory to execute the method provided in any one of the possible implementation manners of the first aspect, second aspect, third aspect or fourth aspect above.

[0063] Optionally, the above chip only includes a processor, the processor is used to read and execute the computer program stored in the memory, and when the computer program is executed, the processor executes the method provided in any one of the possible implementation manners of the first aspect, second aspect, third aspect or fourth aspect above. Description of the Drawings

[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments recorded in the present application, and those of ordinary skill in the art can also obtain other drawings based on these drawings.

[0065] Figure 1Schematic diagram of a network scenario enabling dual-stack function provided by an embodiment of the present application;

[0066] Figure 2 Schematic diagram of a network scenario enabling single-stack function for a part of the network provided by an embodiment of the present application;

[0067] Figure 3a Flow schematic diagram of a routing advertisement method 100 provided by an embodiment of the present application;

[0068] Figure 3b Flow schematic diagram of a routing advertisement method 200 provided by an embodiment of the present application;

[0069] Figure 4 Structural schematic diagram of a routing advertisement device 400 provided by an embodiment of the present application;

[0070] Figure 5 Structural schematic diagram of a routing advertisement device 500 provided by an embodiment of the present application;

[0071] Figure 6 Structural schematic diagram of a network device 600 or a communication device 600 provided by an embodiment of the present application;

[0072] Figure 7 Structural schematic diagram of a network device 700 or a communication device 700 provided by an embodiment of the present application;

[0073] Figure 8 Structural schematic diagram of a communication system 800 provided by an embodiment of the present application. Detailed implementation manners

[0074] Currently, services and protocols in the network are usually isolated. For example, the prefix of an IPv4 address can only be published in the IPv4 network topology, and the next hop of an IPv4 route can only be an IPv4 address. That is, IPv4 services can only be carried on the IPv4 network and cannot be carried on the IPv6 network. Similarly, the prefix of an IPv6 address can only be published in the IPv6 network topology, and the next hop of an IPv6 route can only be an IPv6 address. That is, IPv6 services can only be carried on the IPv6 network and cannot be carried on the IPv4 network. Therefore, in order for the network to carry IPv4 and IPv6 services, network devices in the network need to support both IPv4 and IPv6 protocols and enable the IPv4 and IPv6 dual-stack function. However, enabling the IPv4 and IPv6 dual-stack function on each network device in the network will not only consume valuable IPv4 and IPv6 address resources, but also require separate network configuration and maintenance for IPv4 and IPv6, making network management and operation and maintenance services complex. In addition, with the development of services, the network scale is getting larger and larger, which continues to consume valuable IPv4 address resources. In the case of insufficient IPv4 addresses, service development is restricted.

[0075] Taking Figure 1 the network shown as an example, this network includes a metropolitan area network 10, a backbone network 20, and an Internet Data Center (IDC) 30. Among them, the metropolitan area network 10 can be connected to multiple terminal devices 01 through a Broadband Remote Access Server (BRAS) 11, for example. The metropolitan area network 10 can also include at least one network device 12, and the network device 12 is used to access the backbone network 20. The backbone network 20 can include multiple network devices. Taking the backbone network 20 including network devices 21, 22, and 23 as an example for subsequent description, where the network device 21 is connected to the metropolitan area network 10, the network device 21 is connected to the network device 23 through the network device 22, and the network device 23 is connected to the IDC 30. The IDC 30 includes at least one network device 31, and the network device 31 provides corresponding services for the applications on the terminal device 01.

[0076] Currently, not only are the network devices 12 and 31 required to enable the IPv4 and IPv6 dual-stack function, but all network devices in the backbone network 20 also need to enable the IPv4 and IPv6 dual-stack function. That is, the backbone network 20 cannot be an IPv4 network or an IPv6 network, and the IPv4 backbone network 20 or the IPv6 backbone network 20 cannot carry IPv4 and IPv6 services.

[0077] Based on this, in order to save IP address resources and simplify the configuration and maintenance costs of network devices, an embodiment of the present application provides a method for route announcement, which does not require all network devices in the backbone network 20 to enable the IPv4 and IPv6 dual-stack functions. All network devices in the backbone network 20 only enable the IPv4 or IPv6 single-stack functions to carry IPv4 and IPv6 services. In the method provided by the embodiment of the present application, the route announcement message issued by the network device for announcing IPv4 routes can carry IPv6 routing information indicating IPv6 addresses, and the route announcement message for announcing IPv6 routes can carry IPv4 routing information indicating IPv4 addresses. Based on this, the network devices that receive the route announcement message in the network can realize the carrying of services of another version of IP on the basis of consuming only one version of IP address resources.

[0078] In the first implementation, for example Figure 2 The backbone network 20 is deployed in a network scenario where a single-stack IPv6 device is deployed. The network includes a first network device and a second network device. The network can carry both IPv4 and IPv6 services. For example, Figure 2 As shown, the first network device is the network device 31, the second network device is the network device 23, and for example Figure 2 As shown, the first network device is the network device 23, the second network device is the network device 22, and for example Figure 2 As shown, the first network device is network device 22, and the second network device is network device 21. Before the network carries IPv4 services, the method for routing announcement provided by the embodiment of the present application may, for example, include: the first network device obtains a routing announcement message for announcing IPv6 routes, and the routing announcement message carries the first IPv4 routing information corresponding to the first IPv4 address. In this way, the first network device sends the routing announcement message to the second network device, which can instruct the second network device to generate a first forwarding table item, and the first forwarding table item is used for the second network device to forward messages with the destination address being the first IPv4 address. In this way, there is no need to enable the IPv4 function of the second network device again, and there is no need to reconfigure the IPv4 address for the second network device. When a message with the destination address being the first IPv4 address is received in the network, the second network device can complete the processing of the message based on the first forwarding table item. That is, on the basis of ensuring that IPv4 and IPv6 services can be carried by the network, the method provided by the embodiment of the present application simplifies network configuration, saves address resources, and solves the problem of insufficient IPv4 addresses caused by network development.

[0079] Among them, the routing advertisement message for advertising IPv6 routes can be an Open Shortest Path First Version 3 (OSPFv3) message or an Intermediate System-to-Intermediate System Internet Protocol version 6 (IS-ISv6) message. The first IPv4 routing information includes any routing information corresponding to the first IPv4 address, and the specific content of the first IPv4 routing information is not limited in the embodiments of this application. In one case, the first IPv4 routing information may include the prefix of the first IPv4 address; in another case, the first IPv4 routing information may include the prefix of the first IPv6 address after the prefix conversion of the first IPv4 address.

[0080] In the second implementation manner, for a network scenario where IPv4 single-stack devices are deployed in the backbone network 20 as Figure 2 shown, this network includes a first network device and a second network device, which can carry IPv4 and IPv6 services. For example, as Figure 2 shown, the first network device is network device 31, and the second network device is network device 23. Another example is as Figure 2 shown, the first network device is network device 23, and the second network device is network device 22. Another example is as Figure 2 shown, the first network device is network device 22, and the second network device is network device 21. Before this network carries IPv6 services, the method for routing advertisement provided by the embodiments of this application may include, for example: the first network device obtains a routing advertisement message for advertising IPv4 routes, and the first IPv6 routing information corresponding to the first IPv6 address is carried in the routing advertisement message. In this way, when the first network device sends the routing advertisement message to the second network device, it can instruct the second network device to generate a first forwarding entry, and the first forwarding entry is used for the second network device to forward data packets with the destination address being the first IPv6 address. In this way, it is not necessary to enable the IPv6 function on the second network device again, nor to configure the IPv6 address for the second network device again. When a data packet with the destination address being the first IPv6 address is received in this IPv4 network, the second network device can complete the processing of the data packet based on the first forwarding entry. That is, on the basis of ensuring that IPv4 and IPv6 services can be carried by the network, the method provided by the embodiments of this application simplifies network configuration and saves address resources.

[0081] Among them, the routing advertisement message for advertising IPv4 routes can be an Open Shortest Path First Version 2 (OSPFv2) message or an Intermediate System-to-Intermediate System Internet Protocol version 4 (IS-ISv4) message. The first IPv6 routing information includes any routing information corresponding to the first IPv6 address, and the specific content of the first IPv6 routing information is not limited in the embodiments of the present application. In one case, the first IPv6 routing information may include a prefix of the first IPv6 address.

[0082] Taking Figure 2 the network shown as an example, assume Figure 2 and Figure 1 have the same network architecture, and the difference is that: Figure 1 all network devices in Figure 2 enable both IPv4 and IPv6 dual-stack functions, however, Figure 2 in at least one network in Figure 2 the network devices can only enable IPv4 or IPv6 single-stack functions. For example, the network devices (including network device 12) in Metropolitan Area Network 10 can only enable IPv4 or IPv6 single-stack functions; or, the network devices (including network devices 21 and 22) in Backbone Network 20 can only enable IPv4 or IPv6 single-stack functions.

[0083] Assume Figure 2 that all the network devices deployed in Backbone Network 20 in

[0084] The network device 31 is a dual-stack device. The network device 31 obtains an IPv4 routing advertisement message from a certain network device in the IDC 30. The IPv4 routing advertisement message includes routing information of one or more IPv4 addresses, including the routing information of IPv4 address 1. The network device 31 generates a forwarding entry according to the routing information of IPv4 address 1. The forwarding entry is used for the network device 31 to forward packets with the destination address of IPv4 address 1. The above IPv4 routing advertisement message includes an Open Shortest Path First Version 2 (OSPFv2) message or an Intermediate System to Intermediate System Version 4 (IS-ISv4) message of the Internet Protocol Version 4. According to the publishing mechanism of the above routing protocol, the network device 31 publishes the routing information of IPv4 address 1 to adjacent network devices. For example, the network device 31 publishes the routing information of IPv4 address 1 to the network device 23. Since the network device 23 is an IPv6 single-stack device, the network device 31 sends an IPv6 routing advertisement message to the network device 23. The IPv6 routing advertisement message includes an Open Shortest Path First Version 3 (OSPFv3) message or an Intermediate System to Intermediate System Version 6 (IS-ISv6) message of the Internet Protocol Version 6. The IPv6 routing advertisement message includes the routing information corresponding to IPv4 address 1.

[0085] For example, the process of the network device 31 publishing the routing information of IPv4 address 1 to the backbone network 20 may include:

[0086] S11. The network device 23 receives the IPv6 routing advertisement message 1 sent by the network device 31, obtains the routing information corresponding to IPv4 address 1 from the IPv6 routing advertisement message 1, and generates a forwarding entry 1 based on the routing information 1 corresponding to IPv4 address 1. The forwarding entry 1 is used to guide the network device 23 to forward packets with the destination address of IPv4 address 1.

[0087] If the routing information 1 corresponding to IPv4 address 1 in the IPv6 routing advertisement message 1 is IPv4 address 1, then the IPv6 routing advertisement message 1 may further include indication information indicating that the IPv6 routing advertisement message 1 is used to advertise the IPv4 address. In one case, the forwarding table entry 1 is an IPv4 forwarding table entry, including the prefix of IPv4 address 1 and the next-hop information 1. For example, network device 23 can directly generate an IPv4 forwarding table entry based on IPv4 address 1, denoted as forwarding table entry 1; for another example, network device 23 can convert IPv4 address 1 into IPv6 address 1, generate an IPv6 forwarding table entry according to IPv6 address 1, and then restore the prefix of IPv6 address 1 in the IPv6 forwarding table entry to the prefix of IPv4 address 1 to obtain forwarding table entry 1, and the forwarding table entry 1 includes the prefix of IPv4 address 1 and the next-hop information 1. In another case, network device 23 can convert IPv4 address 1 into IPv6 address 1, generate a forwarding table entry 1 according to IPv6 address 1, the forwarding table entry 1 is an IPv6 forwarding table entry, and the forwarding table entry 1 includes the prefix of IPv6 address 1 and the next-hop information 1.

[0088] S12. Network device 23 publishes an IPv6 routing advertisement message 2 in the backbone network 20, and the IPv6 routing advertisement message 2 includes the routing information 2 corresponding to IPv4 address 1.

[0089] In one case, network device 23 can directly forward the IPv6 routing advertisement message 1 in the backbone network 20. Then, the IPv6 routing advertisement message 2 and the IPv6 routing advertisement message 1 are the same message, and the routing information 2 corresponding to IPv4 address 1 and the routing information 1 corresponding to IPv4 address 1 are the same.

[0090] In another case, if the routing information of IPv4 address 1 in the IPv6 routing advertisement message 1 is IPv4 address 1, then network device 23 can convert IPv4 address 1 into IPv6 address 1, so as to generate an IPv6 routing advertisement message 2 according to IPv6 address 1, and the routing information 2 corresponding to IPv4 address 1 included in the IPv6 routing advertisement message 2 is IPv6 address 1.

[0091] S13. Network device 22 receives the IPv6 routing advertisement message 2, and generates a forwarding table entry 2 according to the routing information 2 corresponding to IPv4 address 1. The forwarding table entry 2 is used to guide network device 22 to forward the packet with the destination address of IPv4 address 1.

[0092] S14. Network device 21 receives the IPv6 routing advertisement message 2, and generates a forwarding table entry 3 according to the routing information 2 corresponding to IPv4 address 1. The forwarding table entry 3 is used to guide network device 21 to forward the packet with the destination address of IPv4 address 1.

[0093] Among them, the network device 23 publishes the IPv6 routing advertisement message 2 in the backbone network 20. In one case, the network device 23 may send the IPv6 routing advertisement message 2 to the network device 22 and the network device 21 respectively; in another case, the network device 23 may also send the IPv6 routing advertisement message 2 to the network device 22, and the network device 22 sends the IPv6 routing advertisement message 2 to the network device 21; in still another case, the network device 23 may also send the IPv6 routing advertisement message 2 to the route reflector (RR) 24 in the backbone network 20, and the RR 24 sends the IPv6 routing advertisement message 2 to the network device 22 and the network device 21 respectively.

[0094] Among them, the forwarding table entry 1 may include the prefix of the IPv4 address 1 and the next-hop information 1, or may also include the prefix of the IPv6 address 1 and the next-hop information 1. The next-hop information 1 is used to indicate the next-hop node 1 from the network device 23 to the network device 31. In one case, the next-hop information 1 may be, for example, the IPv4 address 2 of the next-hop node 1. If the network device 23 and the network device 31 are directly connected, then the next-hop node 1 is the network device 31, and the IPv4 address 2 is the IPv4 address of the network device 31; if the network device 23 and the network device 31 are not directly connected, then the IPv4 address 2 indicates the next-hop node of the network device 23 on the path from the network device 23 to the network device 31. In another case, the next-hop information 1 may also be, for example, the Address Resolution Protocol (ARP) index 1, and the network device 23 can find the corresponding ARP table entry 1 based on the ARP index 1 to accurately determine the next-hop node 1. In still another case, the next-hop information 1 may also be, for example, the Media Access Control (MAC) address 1, and the network device 23 can accurately determine the next-hop node 1 based on the MAC address 1.

[0095] The forwarding table entry 2 may include the prefix of IPv4 address 1 and the next-hop information 2, or may include the prefix of IPv6 address 1 and the next-hop information 2. The next-hop information 2 is used to indicate the next-hop node 2 from network device 22 to network device 23. In one case, the next-hop information 2 may be, for example, the IPv6 address 2 of the next-hop node 2. If network device 22 and network device 23 are directly connected, then the next-hop node 2 is network device 23, and the IPv6 address 2 is the IPv6 address of network device 23; if network device 22 and network device 23 are not directly connected, then the IPv6 address 2 may be the next-hop node 2 of network device 22 on the path from network device 22 to network device 23, and the IPv6 address 2 is the IPv6 address of the next-hop node 2. In another case, the next-hop information 2 may also be, for example, the Neighbor Discovery (ND) index 1, and network device 22 can accurately determine the next-hop node 2 based on the ND index 1 by looking up the corresponding ND table entry 1. In yet another case, the next-hop information 2 may also be, for example, the MAC address 2, and network device 22 can accurately determine the next-hop node 2 based on the MAC address 2.

[0096] The forwarding table entry 3 may include the prefix of IPv4 address 1 and the next-hop information 3, or may include the prefix of IPv6 address 1 and the next-hop information 3. The next-hop information 3 is used to indicate the next-hop node 3 from network device 21 to network device 22. In one case, the next-hop information 3 may be, for example, the IPv6 address 3 of the next-hop node 3. If network device 21 and network device 22 are directly connected, then the next-hop node 3 is network device 22, and the IPv6 address 3 is the IPv6 address of network device 22; if network device 21 and network device 22 are not directly connected, then the IPv6 address 3 may be the next-hop node 3 of network device 21 on the path from network device 21 to network device 22, and the IPv6 address 3 is the IPv6 address of the next-hop node 3. In another case, the next-hop information 3 may also be, for example, the ND index 2, and network device 22 can accurately determine the next-hop node 3 based on the ND index 2 by looking up the corresponding ND table entry 2. In yet another case, the next-hop information 3 may also be, for example, the MAC address 3, and network device 21 can accurately determine the next-hop node 3 based on the MAC address 3.

[0097] The forwarding table entry 1, the forwarding table entry 2, and the forwarding table entry 3 may be as shown in Table 1 below for example. The forwarding table entry 1, the forwarding table entry 2, and the forwarding table entry 3 include the prefix of IPv4 address 1:

[0098] Table 1

[0099] Forwarding table entry IP address prefix Next-hop information Forwarding table entry 1 Prefix of IPv4 address 1 Next-hop information 1 (IPv4 address 2 or ARP index 1 or MAC address 1) Forwarding table entry 2 Prefix of IPv4 address 1 Next-hop information 2 (IPv6 address 2 or ND index 1 or MAC address 2) Forwarding table entry 3 Prefix of IPv4 address 1 Next-hop information 3 (IPv6 address 3 or ND index 2 or MAC address 3)

[0100] Alternatively, the forwarding table entries 1, 2, and 3 can be referred to, for example, in Table 2 below. The forwarding table entries 1, 2, and 3 include the prefix of the IPv4 address 6:

[0101] Table 2

[0102] Forwarding table entry IP address prefix Next-hop information Forwarding table entry 1 Prefix of IPv6 address 1 Next-hop information 1 (IPv4 address 2 or ARP index 1 or MAC address 1) Forwarding table entry 2 Prefix of IPv6 address 1 Next-hop information 2 (IPv6 address 2 or ND index 1 or MAC address 2) Forwarding table entry 3 Prefix of IPv6 address 1 Next-hop information 3 (IPv6 address 3 or ND index 2 or MAC address 3)

[0103] It should be noted that if the address of the next hop of a network device is an IPv6 address, then the network device may include an ND table, and the next hop for generating the forwarding table entry by the network device can be any information capable of determining the next hop. For example, it can be the IPv6 address itself of the next hop. Another example is that it can also be the ND index used to determine the next hop. Still another example is that it can also be the MAC address corresponding to the next hop. If the address of the next hop of a network device is an IPv4 address, then the network device may include an ARP table, and the next hop for generating the forwarding table entry by the network device can be any information capable of determining the next hop. For example, it can be the IPv4 address itself of the next hop. Another example is that it can also be the ARP index used to determine the next hop. Still another example is that it can also be the MAC address corresponding to the next hop.

[0104] The IPv6 routing advertisement messages 1 and 2 can be internal gateway protocol (IGP) messages for advertising IPv6 addresses. For example, they can be OSPFv3 messages or IS-ISv6 messages. Taking the routing advertisement message 1 as an OSPFv3 message as an example, specifically, it can be an Autonomous System External Link-State Advertisement (AS-External-LSA).

[0105] Among them, if the routing information 1 corresponding to the IPv4 address 1 is a prefix of the IPv4 address 1, then the IPv6 routing advertisement message 1 includes indication information, which is used to indicate that the IPv6 routing advertisement message 1 is used to advertise the IPv4 routing. Similarly, if the routing information 2 corresponding to the IPv4 address 1 is a prefix of the IPv4 address 1, then the IPv6 routing advertisement message 2 includes indication information, which is used to indicate that the IPv6 routing advertisement message 2 is used to advertise the IPv4 routing. For example, the indication information can be any field in the AS-External-LSA that can be reused or extended. Defining this field indicates whether the route advertised by the AS-External-LSA is an IPv4 route or an IPv6 route. It can also be understood that this field indicates whether the AS-External-LSA carries an IPv4 address or an IPv6 address. For example, when the value of the field corresponding to the indication information in the AS-External-LSA is equal to 0, it indicates that the route advertised by the AS-External-LSA is an IPv6 route; when the value of the field corresponding to the indication information in the AS-External-LSA is equal to 1, it indicates that the route advertised by the AS-External-LSA is an IPv4 route.

[0106] The network device 31 publishes the routing information 1 of the IPv4 address 1 to the network device 23. Since the network device 23 is an IPv6 single-stack device, the network device 31 sends the IPv6 routing advertisement message 1 to the network device 23. The IPv6 routing advertisement message 1 includes the IPv4 routing information 1, and the IPv4 routing information 1 includes the routing information 1 corresponding to the IPv4 address 1. As an example, the IPv4 routing information 1 includes a prefix of the IPv4 address 1. The IPv6 routing advertisement message 1 includes indication information, which is used to indicate that the IPv6 routing advertisement message is used to advertise the IPv4 routing. The network device 23 sends the IPv6 routing advertisement message 2 to the network device 22. The IPv6 routing advertisement message 2 includes the IPv4 routing information 2, and the IPv4 routing information 2 includes a prefix of the IPv4 address 1 or a prefix of the IPv6 address 1. As another example, the IPv4 routing information 1 includes a prefix of the IPv6 address 1. The IPv6 routing advertisement message 1 may include indication information, which is used to indicate that the IPv6 routing advertisement message 1 is used to advertise the IPv6 routing; or, the IPv6 routing advertisement message 1 may not include indication information, and the IPv6 routing advertisement message 1 without indication information can be defaulted to be used for IPv6 routing. The network device 23 sends the IPv6 routing advertisement message 2 to the network device 22. The IPv6 routing advertisement message 2 includes the IPv4 routing information 2, and the IPv4 routing information 2 includes a prefix of the IPv4 address 1 or a prefix of the IPv6 address 1.

[0107] Among them, if the IPv4 routing information 1 includes the prefix of IPv4 address 1 and the IPv4 routing information 2 includes the prefix of IPv6 address 1, then the network device 23 can perform the operation of converting the prefix of IPv4 address 1 into the prefix of IPv6 address 1; if the IPv4 routing information 1 includes the prefix of IPv4 address 1 and the IPv4 routing information 2 includes the prefix of IPv4 address 1, then all network devices in the backbone network 20 may not perform the operation of converting the prefix of IPv4 address 1 into the prefix of IPv6 address 1, or any other network device in the backbone network 20 except the network device 23 may choose to perform the operation of converting the prefix of IPv4 address 1 into the prefix of IPv6 address 1; if the IPv4 routing information 1 includes the prefix of IPv6 address 1 and the IPv6 routing information 2 includes the prefix of IPv6 address 1, then the network device 31 can perform the operation of converting the prefix of IPv4 address 1 into the prefix of IPv6 address 1; if the IPv4 routing information 1 includes the prefix of IPv6 address 1 and the IPv4 routing information 2 includes the prefix of IPv4 address 1, then the network device 31 can perform the operation of converting the prefix of IPv4 address 1 into the prefix of IPv6 address 1, and the network device 23 can perform the operation of converting the prefix of IPv6 address 1 into the prefix of IPv4 address 1.

[0108] For the implementation method of a network device to generate a forwarding table entry, the process of the network device 21 generating the forwarding table entry 3 is taken as an example for illustration. If the IPv6 routing advertisement message 2 includes the IPv4 address 1, then, in one case, the process of the network device 21 generating the forwarding table entry 3 may include: The network device 21 performs path calculation based on the prefix of the IPv4 address 1 to generate the forwarding table entry 3. The forwarding table entry 3 is an IPv4 routing table entry, and the forwarding table entry 3 includes the prefix of the IPv4 address 1 and the next-hop information 3. The next-hop information 3 includes one or more of the following: the IPv6 address 2 of the next-hop node 3, the ND index 2, or the MAC address 3; in another case, the process of the network device 21 generating the forwarding table entry 3 may include: The network device 21 converts the prefix of the IPv4 address 1 into the prefix of the IPv6 address 3. Then, the network device 21 performs path calculation based on the prefix of the IPv6 address 3 to generate the forwarding table entry 3'. The forwarding table entry 3' is an IPv6 forwarding table entry, and the forwarding table entry 3' includes the prefix of the IPv6 address 3 and the next-hop information 3. The next-hop information 3 includes one or more of the following: the IPv6 address 2 of the next-hop node 3, the ND index 2, or the MAC address 3; optionally, the network device 21 may restore the prefix of the IPv6 address 3 in the forwarding table entry 3' to the prefix of the IPv4 address 1 to obtain the forwarding table entry 3. The forwarding table entry 3 is an IPv4 forwarding table entry, or the network device 21 may denote the forwarding table entry 3' as the forwarding table entry 3. The forwarding table entry 3 is an IPv6 forwarding table entry. If the IPv6 routing advertisement message 2 includes the IPv6 address 1, then, the process of the network device 21 generating the forwarding table entry 3 may include: The network device 21 performs path calculation based on the prefix of the IPv6 address 1 to generate the forwarding table entry 3'. The forwarding table entry 3' is an IPv6 routing table entry, and the forwarding table entry 3' includes the prefix of the IPv6 address 1 and the next-hop information 3. The next-hop information 3 includes one or more of the following: the IPv6 address 2 of the next-hop node 3, the ND index 2, or the MAC address 3; optionally, the network device 21 may restore the prefix of the IPv6 address 1 in the forwarding table entry 3' to the prefix of the IPv4 address 1 to obtain the forwarding table entry 3. The forwarding table entry 3 is an IPv4 forwarding table entry, or the network device 21 may denote the forwarding table entry 3' as the forwarding table entry 3. The forwarding table entry 3 is an IPv6 forwarding table entry; in another case, the process of the network device 21 generating the forwarding table entry 3 may include: The network device 21 converts the prefix of the IPv6 address 1 into the prefix of the IPv4 address 1. Then, the network device 21 performs path calculation based on the prefix of the IPv4 address 1 to generate the forwarding table entry 3. The forwarding table entry 3 is an IPv4 forwarding table entry, and the forwarding table entry 3 includes the prefix of the IPv4 address 1 and the next-hop information 3. The next-hop information 3 includes one or more of the following: the IPv6 address 2 of the next-hop node 3, the ND index 2, or the MAC address 3.

[0109] It should be noted that the prefix of IPv4 address 1 is converted into the prefix of IPv6 address 1. For example, the prefix 1.1.1.1 of IPv4 address 1 is converted into the prefix ::1.1.1.1 of IPv6 address 1; Another example is that it can also be implemented using any conversion rules agreed upon in the backbone network 20. For example, the prefix of IPv4 address 1 is placed at a preset position (such as the last 32 bits) of the 128-bit IPv6 address 1 to obtain the 128-bit IPv6 address 3.

[0110] Taking the direct connection between network device 21 and network device 22, and the direct connection between network device 22 and network device 23 as an example, when network device 21 receives a packet 1 (such as data packet 1) sent by any terminal device 01 through the metropolitan area network 10, and the value of the Destination Address (DA) field of this packet 1 is IPv4 address 1, then the process for the backbone network 20 to process this packet 1 may include: S21, network device 21 searches for a forwarding table entry 3 that matches IPv4 address 1 (or the converted IPv6 address 1 of IPv4 address 1) to obtain the next-hop information 3; S22, network device 21 sends packet 1 to network device 22 according to the next-hop information 3; S23, network device 22 searches for a forwarding table entry 2 that matches IPv4 address 1 (or the converted IPv6 address 1 of IPv4 address 1) based on the destination address of packet 1, which is IPv4 address 1, to obtain the next-hop information 2; S24, network device 22 sends packet 1 to network device 23 according to the next-hop information 2; S25, network device 23 searches for a forwarding table entry 1 that matches IPv4 address 1 (or the converted IPv6 address 1 of IPv4 address 1) based on the destination address of packet 1, which is IPv4 address 1, to obtain the next-hop information 1; S26, network device 23 sends packet 1 to IDC 30 according to the next-hop information 1. Among them, when network device A sends a packet to network device B according to the next-hop information, it may include: network device A encapsulates the packet according to the next-hop information and sends the encapsulated packet to network device B. For example, when network device 21 sends packet 1 to network device 22 according to the next-hop information 3, it includes: network device 21 encapsulates packet 1 according to the next-hop information 3 and sends the encapsulated packet 1 to network device 22.

[0111] In addition, the IP address released by the network device 31 may also include an IPv6 address 4. The process of the network device 31 releasing the IPv6 address 4 may include: S31, the network device 23 receives the IPv6 routing advertisement message 3 sent by the network device 31, obtains the IPv6 address 4 from the IPv6 routing advertisement message 3, and generates a forwarding table entry 4 based on the IPv6 address 4. The forwarding table entry 4 is used to guide the network device 23 to forward the packet with the destination address being the IPv6 address 4; S32, the network device 23 releases the IPv6 routing advertisement message 3 in the backbone network 20 for releasing the IPv6 address 4 in the backbone network 20; S33, the network device 22 receives the IPv6 routing advertisement message 3 and generates a forwarding table entry 5 according to the IPv6 address 4. The forwarding table entry 5 is used to guide the network device 22 to forward the packet with the destination address being the IPv6 address 4; S34, the network device 21 receives the IPv6 routing advertisement message 3 and generates a forwarding table entry 6 according to the IPv6 address 4. The forwarding table entry 6 is used to guide the network device 21 to forward the packet with the destination address being the IPv6 address 4. Still taking the direct connection between the network device 21 and the network device 22, and the direct connection between the network device 22 and the network device 23 as an example, when the network device 21 receives the packet 2 sent by any terminal device 01 through the metropolitan area network 10, and the value of the DA field of the packet 2 is the IPv6 address 4, then the process of the backbone network 20 processing the packet 2 may include: S41, the network device 21 looks up the forwarding table entry 6 that matches the IPv6 address 4, and sends the packet 2 to the network device 22 according to the forwarding table entry 6; S42, the network device 22 looks up the forwarding table entry 5 that matches the IPv6 address 4 according to the destination address of the packet 2, i.e., the IPv6 address 4, and sends the packet 2 to the network device 23 according to the forwarding table entry 5; S43, the network device 23 looks up the forwarding table entry 4 that matches the IPv6 address 4 according to the destination address of the packet 2, i.e., the IPv6 address 4, and sends the packet 2 to the IDC 30 according to the forwarding table entry 4.

[0112] It can be seen that based on the method provided in the embodiments of the present application, the backbone network 20 only enables the IPv6 single-stack function, without enabling the IPv4 single-stack function, and without configuring IPv4 addresses for each network device in the backbone network 20, and can carry IPv4 and IPv6 services and users, simplifies network configuration, and saves IPv4 address resources.

[0113] It should be noted that the network devices in the backbone network 20 can maintain the forwarding table entries of both IPv4 and IPv6 at the same time. For example, the network device 21 can maintain the forwarding table entry 3 and the forwarding table entry 6 at the same time, the network device 22 can maintain the forwarding table entry 2 and the forwarding table entry 5 at the same time, and the network device 23 can maintain the forwarding table entry 1 and the forwarding table entry 4 at the same time. In this way, the backbone network 20 can carry IPv4 and IPv6 services and users at the same time, and intelligently select and match the corresponding forwarding table entries based on the destination address type of the processed packet (whether the destination address is an IPv4 address or an IPv6 address) to achieve accurate processing of the packet.

[0114] Suppose Figure 2 All the devices deployed in the backbone network 20 are IPv4 single-stack devices, that is, the network device 21, the network device 22, and the network device 23 are all IPv4 single-stack devices, and the technical solution corresponding to the second implementation manner in the method provided by the embodiments of the present application will be introduced.

[0115] The network device 31 is a dual-stack device. The network device 31 obtains an IPv6 route advertisement packet from a certain network device in the IDC 30. The IPv6 route advertisement packet includes routing information of one or more IPv6 addresses, including the routing information of the IPv6 address 5. The network device 31 generates a forwarding table entry according to the routing information of the IPv6 address 5. The forwarding table entry is used for the network device 31 to forward packets with the destination address being the IPv6 address 5. The above IPv6 route advertisement packet includes an OSPFv3 packet or an IS-ISv6 packet. According to the publishing mechanism of the above routing protocol, the network device 31 publishes the routing information of the IPv6 address 5 to adjacent network devices. For example, the network device 31 publishes the routing information of the IPv6 address 5 to the network device 23. Since the network device 23 is an IPv4 single-stack device, the network device 31 sends an IPv4 route advertisement packet to the network device 23. The IPv4 route advertisement packet includes an OSPFv2 packet or an IS-ISv4 packet. The IPv4 route advertisement packet includes the routing information corresponding to the IPv6 address 5.

[0116] For example, the process of the network device 31 publishing the routing information of the IPv6 address 5 to the backbone network 20 may include:

[0117] S51, the network device 23 receives the IPv4 route advertisement packet 4 sent by the network device 31, obtains the routing information 5 corresponding to the IPv6 address 5 from the IPv4 route advertisement packet 4, and generates a forwarding table entry 7 based on the routing information 5 corresponding to the IPv6 address 5. The forwarding table entry 7 is used to guide the network device 23 to forward packets with the destination address being the IPv6 address 5.

[0118] If the routing information corresponding to the IPv6 address 5 in the IPv4 routing advertisement message 4 is the IPv6 address 5, then the IPv4 routing advertisement message 4 may further include indication information indicating that the IPv4 routing advertisement message 4 is used to advertise the IPv6 address. Among them, the forwarding table entry 7 is an IPv6 forwarding table entry, including the prefix of the IPv6 address 5 and the next-hop information 4.

[0119] S52, the network device 23 publishes an IPv4 routing advertisement message 1 in the backbone network 20, and the IPv6 routing advertisement message 1 includes the routing information 1 corresponding to the IPv6 address 5.

[0120] S53, the network device 22 receives the IPv4 routing advertisement message 4, generates a forwarding table entry 8 according to the routing information 5 corresponding to the IPv6 address 5, and the forwarding table entry 8 is used to guide the network device 22 to forward the packet with the destination address being the IPv6 address 5.

[0121] S54, the network device 21 receives the IPv4 routing advertisement message 4, generates a forwarding table entry 9 according to the routing information 5 corresponding to the IPv6 address 5, and the forwarding table entry 9 is used to guide the network device 21 to forward the packet with the destination address being the IPv6 address 5.

[0122] Among them, the network device 23 publishes the IPv4 routing advertisement message 4 in the backbone network 20. In one case, the network device 23 may send the IPv4 routing advertisement message 4 to the network device 22 and the network device 21 respectively; in another case, the network device 23 may also send the IPv4 routing advertisement message 4 to the network device 22, and the network device 22 sends the IPv4 routing advertisement message 4 to the network device 21; in still another case, the network device 23 may also send the IPv4 routing advertisement message 4 to the RR 24 in the backbone network 20, and the RR 24 sends the IPv4 routing advertisement message 4 to the network device 22 and the network device 21 respectively.

[0123] Among them, the forwarding table entry 7 may include the prefix of the IPv6 address 5 and the next-hop information 4, and the next-hop information 4 is used to indicate the next-hop node 4 from the network device 23 to the network device 31. The next-hop information 4 includes one or more of the following: the IPv6 address 6 of the next-hop node 4, the ND index 3, or the MAC address 4.

[0124] The forwarding table entry 8 may include the prefix of the IPv6 address 5 and the next-hop information 5, and the next-hop information 5 is used to indicate the next-hop node 5 from the network device 22 to the network device 23. The next-hop information 5 includes one or more of the following: the IPv4 address 3 of the next-hop node 5, the ARP index 2, or the MAC address 5.

[0125] The forwarding table entry 9 may include the prefix of the IPv6 address 5 and the next-hop information 6, and the next-hop information 6 is used to indicate the next-hop node 6 from the network device 21 to the network device 22. The next-hop information 6 includes one or more of the following: the IPv4 address 4 of the next-hop node 6, the ARP index 3, or the MAC address 6.

[0126] The forwarding table entries 7, 8, and 9 can be seen in Table 3 below, for example:

[0127] Table 3

[0128] Forwarding table entry IP address prefix Next-hop information Forwarding table entry 7 Prefix of IPv6 address 5 Next-hop information 4 (IPv6 address 6 or ND index 3 or MAC address 4) Forwarding table entry 8 Prefix of IPv6 address 5 Next-hop information 5 (IPv4 address 3 or ARP index 2 or MAC address 5) Forwarding table entry 9 Prefix of IPv6 address 5 Next-hop information 6 (IPv4 address 4 or ARP index 3 or MAC address 6)

[0129] Taking the direct connection between the network device 21 and the network device 22, and the direct connection between the network device 22 and the network device 23 as an example, when the network device 21 receives a packet 3 sent from any one of the terminal devices 01 through the metropolitan area network 10, and the value of the DA field of the packet 3 is the IPv6 address 5, then the process of the backbone network 20 processing the packet 3 may include: S61, the network device 21 searches for the forwarding table entry 9 that matches the IPv6 address 5 to obtain the next-hop information 6; S62, the network device 21 sends the packet 3 to the network device 22 according to the next-hop information 6; S63, the network device 22 searches for the forwarding table entry 8 that matches the IPv6 address 5 according to the destination address of the packet 3 - the IPv6 address 5, to obtain the next-hop information 5; S64, the network device 22 sends the packet 3 to the network device 23 according to the next-hop information 5; S65, the network device 23 searches for the forwarding table entry 7 that matches the IPv6 address 5 according to the destination address of the packet 3 - the IPv6 address 5, to obtain the next-hop information 4; S66, the network device 23 sends the packet 3 to the IDC 30 according to the next-hop information 4.

[0130] In addition, the IP address released by the network device 31 may also include the IPv4 address 5. The process of the network device 31 releasing the IPv4 address 5 may include: S71, the network device 23 receives the IPv4 routing advertisement packet 5 sent by the network device 31, obtains the IPv4 address 5 from the IPv4 routing advertisement packet 5, and generates a forwarding table entry 10 based on the IPv4 address 5. The forwarding table entry 10 is used to guide the network device 23 to forward the packet with the destination address being the IPv4 address 5; S72, the network device 23 releases the IPv4 routing advertisement packet 5 in the backbone network 20 for releasing the IPv4 address 5 in the backbone network 20; S73, the network device 22 receives the IPv4 routing advertisement packet 5 and generates a forwarding table entry 11 according to the IPv4 address 5. The forwarding table entry 11 is used to guide the network device 22 to forward the packet with the destination address being the IPv4 address 5; S74, the network device 21 receives the IPv4 routing advertisement packet 5 and generates a forwarding table entry 12 according to the IPv4 address 5. The forwarding table entry 12 is used to guide the network device 21 to forward the packet with the destination address being the IPv4 address 5. Still taking the direct connection between the network device 21 and the network device 22 and the direct connection between the network device 22 and the network device 23 as an example, when the network device 21 receives a packet 4 sent by any terminal device 01 through the metropolitan area network 10 and the value of the DA field of the packet 4 is the IPv4 address 5, then the process of the backbone network 20 processing the packet 4 may include: S81, the network device 21 searches for the forwarding table entry 12 matching the IPv4 address 5 and sends the packet 4 to the network device 22 according to the forwarding table entry 12; S82, the network device 22 searches for the forwarding table entry 11 matching the IPv4 address 5 according to the destination address of the packet 4, i.e., the IPv4 address 5, and sends the packet 4 to the network device 23 according to the forwarding table entry 11; S83, the network device 23 searches for the forwarding table entry 10 matching the IPv4 address 5 according to the destination address of the packet 4, i.e., the IPv4 address 5, and sends the packet 4 to the IDC 30 according to the forwarding table entry 10.

[0131] It can be seen that based on the method provided in the embodiments of the present application, the backbone network 20 only enables the IPv4 single-stack function, without enabling the IPv6 single-stack function, and without configuring IPv6 addresses for each network device in the backbone network 20, and can carry IPv4 and IPv6 services and users, simplifies network configuration, and saves IP address resources.

[0132] It should be noted that the network devices in the backbone network 20 can maintain forwarding table entries for both IPv4 and IPv6 simultaneously. For example, network device 21 can maintain forwarding table entry 9 and forwarding table entry 12 simultaneously, network device 22 can maintain forwarding table entry 8 and forwarding table entry 11 simultaneously, and network device 23 can maintain forwarding table entry 7 and forwarding table entry 10 simultaneously. In this way, the backbone network 20 can carry IPv4 and IPv6 services and users simultaneously, and intelligently select and match the corresponding forwarding table entries based on the destination address type of the processed packet to achieve accurate processing of the packet.

[0133] It should be noted that the forwarding table entries in the embodiments of the present application may further include outgoing interface information, and the outgoing interface information indicates the interface among the local interfaces that is connected to the next-hop node. For example, the forwarding table entry 1 may further include outgoing interface information 1, and the outgoing interface information 1 is used to indicate interface 1 on network device 23 that is connected to the next-hop node 1. When a network device sends a packet, it may be a process in which the network device encapsulates the packet based on the next-hop and outgoing interface information in the forwarding table entry that matches the destination address of the packet, and then sends out the encapsulated packet.

[0134] It should be noted that the network devices and nodes in the embodiments of the present application have the same meaning and can be understood and used interchangeably. A network device may refer to a communication device with packet forwarding functions such as a switch, a router, a virtual routing device, or a virtual forwarding device.

[0135] The above is an introduction to the embodiments of the present application in the form of scenario embodiments. The following will describe in detail the specific implementation manners of the embodiments of the present application with reference to the accompanying drawings.

[0136] Figure 3a and Figure 3b FIG. is a schematic flowchart of a method for route advertisement provided by an embodiment of the present application. In order to more clearly introduce the method provided by the embodiment of the present application, this method is described in the way of interaction between a first network device and a second network device in the network. Among them, the networks to which the first network device and the second network device belong can carry IPv4 and IPv6 services.

[0137] Figure 3a FIG. is a schematic flowchart of a method 100 for route advertisement provided by an embodiment of the present application. The method 100 corresponds to the first implementation manner in the embodiments of the present application, that is, IPv6 single-stack devices are deployed in at least one network. As Figure 3a shown, the method 100 may include the following S101 to S105:

[0138] S101, the first network device obtains a first route advertisement packet, and the first route advertisement packet carries first IPv4 route information, and the first IPv4 route information is route information indicating a first IPv4 address.

[0139] Among them, the first route advertisement message may be an IGP message for advertising an IPv6 address, such as an OSPFv3 message or an IS-ISv6 message.

[0140] As an example, the first IPv4 routing information may include the prefix of the first IPv4 address. The first route advertisement message includes indication information for indicating that the first route advertisement message is used to advertise an IPv4 route. For example, if the first route advertisement message is an OSPFv3 message AS-External-LSA, then any reusable or extensible field value in the AS-External-LSA can be used as the indication information, and it is defined that this field represents whether the route advertised by the AS-External-LSA is an IPv4 route or an IPv6 route. It can also be understood that this field represents whether the AS-External-LSA carries an IPv4 address or an IPv6 address. For example, when the value of the field corresponding to the indication information in the AS-External-LSA is equal to 0, it indicates that the route advertised by the AS-External-LSA is an IPv6 route; when the value of the field corresponding to the indication information in the AS-External-LSA is equal to 1, it indicates that the route advertised by the AS-External-LSA is an IPv4 route.

[0141] As another example, the first IPv4 routing information may include the prefix of the first IPv6 address. Before S101, the method 100 may further include: a process of converting an IPv4 address to an IPv6 address, which may include: the first network device obtains the prefix of the first IPv4 address according to the second IPv4 routing information in the second route advertisement message; then, the first network device converts the prefix of the first IPv4 address to the prefix of the first IPv6 address.

[0142] Among them, converting the prefix of the first IPv4 address to the prefix of the first IPv6 address, for example, may be converting the prefix 1.1.1.1 of the first IPv4 address to the prefix ::1.1.1.1 of the first IPv6 address; or, it can also be implemented using any conversion rule agreed upon in the network to which the first network device belongs. For example, placing the prefix of the first IPv4 address at a preset position (such as the last 32 bits) of the 128-bit first IPv6 address to obtain a 128-bit first IPv6 address, and then determining the prefix of the first IPv6 address.

[0143] In some implementation manners, the first network device may be a network device with dual-stack functionality enabling both IPv6 and IPv4 functions. For example, for Figure 2In the scenario of publishing the IPv4 address 1 in IDC 30, the first network device may be network device 31; for another example, for Figure 2 In the scenario of publishing the routes of the network devices in the terminal device 01 or the metropolitan area network 10, the first network device may be network device 12. Then, before S101, the method 100 may further include: S100, the first network device receives a second route advertisement message sent by a third network device, the second route advertisement message includes an OSPFv2 message or an IS-ISv4 message, the second route advertisement message carries second IPv4 route information, and the second IPv4 route information is route information indicating a first IPv4 address. In this way, the first network device obtains the first IPv4 address that needs to be advertised through the second route advertisement message.

[0144] Among them, the third network device may be a single-stack device enabled with the IPv4 function, or a dual-stack device enabled with both the IPv4 and IPv6 functions. For example, if the first network device is Figure 2 The network device 12 in, then, the third network device may be Figure 2 The BRAS 11 in.

[0145] In order to enable the first network device to process the packets with the destination address being the first IPv4 address, after S100, the method 100 may further include: S101’, the first network device generates a second forwarding entry according to the second route advertisement message, and the second forwarding entry is used to guide the first network device to forward the packets with the destination address being the first IPv4 address. It should be noted that the execution order of S101’ and S101 is not limited.

[0146] In this implementation manner, S101 may include, for example: the first network device generates a first route advertisement message according to the second route advertisement message. Specifically, when the first network device receives the second route advertisement message, it parses the second route advertisement message to obtain the first IPv4 route information, and thus generates a first route advertisement message for advertising the first IPv4 address according to the first IPv4 route information.

[0147] It should be noted that for the specific implementation manner and effect of S101 when the first network device is a dual-stack device enabled with both the IPv4 and IPv6 functions, reference can be made to the relevant description of the network device 31 generating the route advertisement message 1 in the introduction of the first implementation manner in the corresponding scenario embodiment above, that is, the relevant description of S11. Figure 2 In some other implementation manners, the first network device may be a network device enabled with the IPv6 single-stack function. For example, for

[0148] Figure 2 Figure 2Advertise the route of IPv4 address 1 in IDC 30, or, for Figure 2 Advertise the routes of network devices in terminal device 01 or MAN 10, the first network device may be network device 23, network device 22 or network device 21. Then, S101 may include, for example: The first network device receives the first route advertisement message sent by the fourth network device. Among them, the fourth network device may be a dual-stack device that supports both IPv4 and IPv6 functions connected to the first network device. For example, for Figure 2 Advertise the route of IPv4 address 1 in IDC 30, when the first network device is network device 23, the fourth network device may be network device 31. Or, the fourth network device may be a single-stack device that supports IPv6 functions connected to the first network device. For example, for Figure 2 Advertise the route of IPv4 address 1 in IDC 30, when the first network device is network device 22, the fourth network device may be network device 23.

[0149] To enable the first network device to process packets with the destination address being the first IPv4 address, after S101, the method 100 may further include: The first network device generates a third forwarding entry according to the first route advertisement message, and the third forwarding entry is used to guide the first network device to forward packets with the destination address being the first IPv4 address.

[0150] If the first IPv4 routing information includes the prefix of the first IPv4 address, then, the first network device generates a third forwarding entry according to the first route advertisement message. For example, it may include: The first network device performs path calculation according to the prefix of the first IPv4 address to generate the third forwarding entry. The third forwarding entry is an IPv4 forwarding entry, and the third forwarding entry includes the prefix of the first IPv4 address and the second next-hop information. The second next-hop information includes one or more of the following: IPv6 address, ND index or MAC address.

[0151] If the first IPv4 routing information includes the prefix of the first IPv6 address, and the prefix of the first IPv6 address is obtained by converting the prefix of the first IPv4 address, then, in one case, the first network device generates a third forwarding entry according to the first routing advertisement message. For example, it may include: the first network device performs path calculation according to the prefix of the first IPv6 address to generate the third forwarding entry. The third forwarding entry is an IPv6 forwarding entry, and the third forwarding entry includes the prefix of the first IPv6 address and the second next-hop information. The second next-hop information includes one or more of the following: IPv6 address, ND index, or MAC address. In another case, the first network device generates a third forwarding entry according to the first routing advertisement message. For example, it may include: the first network device performs path calculation according to the prefix of the first IPv6 address to generate a fourth forwarding entry. The fourth forwarding entry is an IPv6 forwarding entry, and the fourth forwarding entry includes the prefix of the first IPv6 address and the second next-hop information. The second next-hop information includes one or more of the following: IPv6 address, ND index, or MAC address; then, the first network device restores the prefix of the first IPv6 address in the fourth forwarding entry to the prefix of the first IPv4 address to generate a third forwarding entry.

[0152] It should be noted that for the specific implementation manner and effect of S101 when the first network device is a single-stack device enabled with the IPv6 function, reference can be made to the relevant description of the first implementation manner in the corresponding scenario embodiment above, where the network device 23 generates the forwarding entry 1, the network device 22 generates the forwarding entry 2, and the network device 21 generates the forwarding entry 3, that is, the relevant descriptions of S11, S13, and S14. Reference can also be made to the relevant description of S103 below. Figure 2 For the relevant descriptions of the network device 23 generating the forwarding entry 1, the network device 22 generating the forwarding entry 2, and the network device 21 generating the forwarding entry 3 in the introduction of the first implementation manner in the corresponding scenario embodiment, that is, the relevant descriptions of S11, S13, and S14. Reference can also be made to the relevant description of S103 below.

[0153] S102, the first network device sends a first routing advertisement message to the second network device, and the first routing advertisement message is used to instruct the second network device to generate a first forwarding entry.

[0154] S103, the second network device generates a first forwarding entry according to the first routing advertisement message, and the first forwarding entry is used to guide the second network device to forward a packet with the destination address being the first IPv4 address.

[0155] As an example, the first IPv4 routing information may include the prefix of the first IPv4 address. In this case, the first forwarding entry is an IPv4 forwarding entry, and the first forwarding entry includes the prefix of the first IPv4 address and the first next-hop information. S102 may include, for example: The second network device performs path calculation based on the prefix of the first IPv4 address to generate an IPv4 forwarding entry, denoted as the first forwarding entry. Among them, the first next-hop information in the first forwarding entry may include one or more of the following: IPv6 address, ND index, or MAC address.

[0156] As another example, the first IPv4 routing information may include the prefix of the first IPv6 address.

[0157] In this example, in one case, the first forwarding entry may be an IPv4 forwarding entry. The first forwarding entry includes the prefix of the first IPv4 address and the first next-hop information, and the first next-hop information includes one or more of the following: IPv6 address, ND index, or MAC address. S103 may include, for example: The second network device performs path calculation based on the prefix of the first IPv6 address to generate an IPv6 forwarding entry; then, the second network device restores the prefix of the first IPv6 address in the IPv6 forwarding entry to the prefix of the first IPv4 address to obtain an IPv4 forwarding entry, denoted as the first forwarding entry.

[0158] In another case, the first forwarding entry may also be an IPv6 forwarding entry. The first forwarding entry includes the prefix of the first IPv6 address and the first next-hop information, and the first next-hop information includes one or more of the following: IPv6 address, ND index, or MAC address. S103 may include, for example: The second network device performs path calculation based on the prefix of the first IPv6 address to generate an IPv6 forwarding entry, denoted as the first forwarding entry. In this example, the processing process of the second network device for a packet with the destination address being the first IPv4 address may include: The second network device converts the destination address in the packet into the first IPv6 address; then, the second network device determines that it matches the first forwarding entry with the first IPv6 address as the destination address; then, the second network device encapsulates and forwards the packet based on the first forwarding entry. Or, the second network device may also set a matching rule. In this case, the processing process of the second network device for a packet with the destination address being the first IPv4 address may include: The second network device determines that the destination address in the packet and the prefix of the first IPv6 address in the first forwarding entry satisfy the matching rule; then, the second network device encapsulates and forwards the packet based on the first forwarding entry.

[0159] It should be noted that for the specific implementation manners and effects of S102 to S103, reference may be made to the above Figure 2In the description of the first implementation manner in the corresponding scenario embodiment, the related descriptions of the network device 23 generating the forwarding table entry 1, the network device 22 generating the forwarding table entry 2, and the network device 21 generating the forwarding table entry 3, that is, the related descriptions of S11, S13, and S14.

[0160] In this way, by generating the first forwarding table entry, a data basis is provided for the second network device to carry IPv4 services and users, making it possible for the second network device enabled with the IPv6 single-stack function to carry IPv4 services and users.

[0161] S104, the second network device receives a first packet, and the destination address of the first packet is the first IPv4 address.

[0162] S105, the second network device sends the first packet based on the first forwarding table entry.

[0163] As an example, if the first forwarding table entry includes the prefix of the first IPv4 address and the first next-hop information, then, after the second network device receives the first packet, it can parse to obtain that the destination address of the first packet is the first IPv4 address. Then, it searches for the first forwarding table entry that matches the first IPv4 address. Then, it encapsulates the first packet with the first next-hop information in the first forwarding table entry and sends it out. Among them, the first forwarding table entry matching the first IPv4 address may mean that the prefix of the first IPv4 address in the first forwarding table entry matches the first IPv4 address in the first packet. For example, the prefix of the first IPv4 address in the first forwarding table entry is the same as the prefix of the first IPv4 address in the first packet.

[0164] As another example, if the first forwarding table entry includes the prefix of the first IPv6 address and the first next-hop information, then, in one case, after receiving the first packet, the second network device can parse the destination address of the first packet as the first IPv4 address, look up the first forwarding table entry that matches the first IPv4 address, and then encapsulate the first packet using the first next-hop information in the first forwarding table entry and send it out. Among them, the first forwarding table entry matching the first IPv4 address can mean that the prefix of the first IPv6 address in the first forwarding table entry matches the first IPv4 address in the first packet. For example, it can be that the prefix of the first IPv6 address and the first IPv4 address (or the prefix of the first IPv4 address) conform to a preset conversion rule. In another case, after receiving the first packet, the second network device can parse the destination address of the first packet as the first IPv4 address, convert the first IPv4 address into the first IPv6 address (or the prefix of the first IPv6 address) according to the preset conversion rule, then look up the first forwarding table entry that matches the converted first IPv6 address (or the prefix of the first IPv6 address), and then encapsulate the first packet using the first next-hop information in the first forwarding table entry and send it out. Among them, the first forwarding table entry matching the converted first IPv6 address (or the prefix of the first IPv6 address) can mean that the prefix of the first IPv6 address in the first forwarding table entry matches the converted first IPv6 address (or the prefix of the first IPv6 address). Among them, the preset conversion rule can be, for example, placing the prefix of the first IPv4 address at a preset position (such as the last 32 bits) of the 128-bit first IPv6 address to obtain the 128-bit first IPv6 address.

[0165] It should be noted that for the specific implementation manners and effects of S104 to S105, reference can be made to the relevant descriptions in the above Figure 2 corresponding scenario embodiment for the introduction of the first implementation manner, regarding the relevant descriptions of network device 21 forwarding packet 1, network device 22 forwarding packet 1, or network device 23 forwarding packet 1, that is, the relevant descriptions of S21 to S22, S23 to S24, or S25 to S26.

[0166] It can be seen that based on this method 100, the network only enables the IPv6 single-stack function, without enabling the IPv4 single-stack function, and without configuring IPv4 addresses for each network device in the network, it can carry IPv4 services and users, simplifies network configuration, and saves IPv4 address resources.

[0167] In addition, the method 100 can further include the process of the IPv6 network advertising the IPv6 address to implement carrying IPv6 services and users, that is, the method 100 can further include S106 to S110 as follows:

[0168] S106. The first network device obtains a third route advertisement message, where the third route advertisement message carries second IPv6 route information, and the second IPv6 route information is route information indicating a second IPv6 address.

[0169] S107. The first network device sends the third route advertisement message to the second network device, and the third route advertisement message is used to instruct the second network device to generate a fifth forwarding entry.

[0170] S108. The second network device generates a fifth forwarding entry according to the third route advertisement message, and the fifth forwarding entry is used to guide the second network device to forward a message whose destination address is the second IPv6 address.

[0171] S109. The second network device receives a second message, and the destination address of the second message is the second IPv6 address.

[0172] S110. The second network device sends the second message based on the fifth forwarding entry.

[0173] It should be noted that for the specific implementation manners and effects of S106 to S110, reference can be made to Figure 2 the relevant descriptions of S31 to S34 and S41 to S43 in the introduction of the first implementation manner in the corresponding scenario embodiment. Among them, the second IPv6 address may correspond to IPv6 address 4, the third route advertisement message corresponds to IPv6 route advertisement message 3, and the second message corresponds to message 2. In one case, the first network device may be Figure 2 the network device 31 shown, and the second network device is Figure 2 the network device 23 shown, and the fifth forwarding entry corresponds to forwarding entry 4; in another case, the first network device may be Figure 2 the network device 23 shown, and the second network device is Figure 2 the network device 22 shown, and the fifth forwarding entry corresponds to forwarding entry 5; in still another case, the first network device may be Figure 2 the network device 22 shown, and the second network device is Figure 2 the network device 21 shown, and the fifth forwarding entry corresponds to forwarding entry 6.

[0174] It can be seen that in this method 100, the network only enables the IPv6 single-stack function, without enabling the IPv4 single-stack function, and without configuring IPv4 addresses for each network device in the network, and can carry IPv4 and IPv6 services and users, simplifying the network configuration and saving IPv4 address resources.

[0175] Figure 3bSchematic diagram of the process of a method 200 for route advertisement provided by an embodiment of the present application. This method 200 corresponds to the second implementation manner in the embodiments of the present application, that is, IPv4 single-stack devices are deployed in at least one network. As Figure 3b shown, this method 200 may include the following S201 to S205, for example:

[0176] S201, a first network device obtains a first route advertisement message, the first route advertisement message carries first IPv6 route information, and the first IPv6 route information is route information indicating a first IPv6 address.

[0177] Among them, the first route advertisement message may be an IGP message for advertising an IPv4 address, for example, it may be an OSPFv2 message or an IS-ISv4 message. The first IPv6 route information may include a prefix of the first IPv6 address.

[0178] The first route advertisement message includes indication information, and the indication information is used to indicate that the first route advertisement message is used to advertise an IPv6 route. For example, if the first route advertisement message is an OSPFv2 message AS-External-LSA, then, any field value that can be reused or extended in the AS-External-LSA can be used as the indication information, and it is defined that this field represents whether the route advertised by this AS-External-LSA is an IPv4 route or an IPv6 route. It can also be understood that this field represents whether the AS-External-LSA carries an IPv4 address or an IPv6 address. For example, when the value of the field corresponding to the indication information in the AS-External-LSA is equal to 0, it indicates that the route advertised by this AS-External-LSA is an IPv4 route; when the value of the field corresponding to the indication information in the AS-External-LSA is equal to 1, it indicates that the route advertised by this AS-External-LSA is an IPv6 route. It should be noted that although the AS-External-LSA of the OSPFv3 message and the OSPFv2 message has the same name, the format of the OSPFv2 message AS-External-LSA is based on the OSPFv2 protocol, and the format of the OSPFv3 message AS-External-LSA is based on the OSPFv3 protocol.

[0179] In some implementation manners, the first network device may be a network device with dual-stack functions enabling IPv6 and IPv4 functions. For example, for Figure 2 publishing the route of IPv6 address 5 in IDC 30, the first network device may be network device 31; for another example, for Figure 2The first network device may be network device 12. Prior to step S201, method 200 may further include: S200: The first network device receives a second route advertisement message sent by a third network device. The second route advertisement message includes an OSPFv3 message or an IS-ISv6 message. The second route advertisement message carries second IPv6 routing information, and the second IPv6 routing information is routing information indicating the first IPv6 address. Thus, the first network device obtains the first IPv6 address to be advertised via the second route advertisement message.

[0180] The third network device may be a single-stack device with IPv6 enabled, or a dual-stack device with both IPv4 and IPv6 enabled. For example, if the first network device is Figure 2 The network device 12 in the example, then the third network device can be Figure 2 BRAS 11 in.

[0181] In order to enable the first network device to process a message whose destination address is the first IPv6 address, after S200, the method 200 may further include: S201', the first network device generating a second forwarding table entry based on the second route advertisement message, the second forwarding table entry being used to guide the first network device to forward a message whose destination address is the first IPv6 address. It should be noted that the order in which S201' and S201 are performed is not limited.

[0182] In this implementation, S201 may include, for example, the first network device generating a first route advertisement message based on the second route advertisement message. Specifically, after receiving the second route advertisement message, the first network device parses the second route advertisement message to obtain the first IPv6 routing information, thereby generating the first route advertisement message for announcing the first IPv6 address based on the first IPv6 routing information.

[0183] It should be noted that, when the first network device is a dual-stack device with IPv4 and IPv6 functions enabled, the specific implementation and effect of S201 can be found in the above Figure 2 In the introduction of the second implementation method in the corresponding scenario embodiment, the network device 31 generates a relevant description of the IPv4 route advertisement message 4, that is, a relevant description of S51.

[0184] In other implementations, the first network device may be a network device that enables IPv4 single stack functionality, for example, Figure 2 Publish the route to IPv6 address 5 in IDC 30, or, for Figure 2The first network device may be network device 23, network device 22 or network device 21. Then, S201 may include, for example: the first network device receives the first route advertisement message sent by the fourth network device. The fourth network device may be a dual-stack device supporting IPv4 and IPv6 functions connected to the first network device, for example, Figure 2 When the first network device is the network device 23, the fourth network device may be the network device 31. Alternatively, the fourth network device may be a single stack device supporting IPv4 function connected to the first network device. For example, Figure 2 The route of IPv6 address 5 in IDC 30 is published, the first network device is network device 21, and the fourth network device may be network device 22.

[0185] In order to enable the first network device to process the message whose destination address is the first IPv6 address, after S201, the method 200 may also include: the first network device generates a third forwarding table entry based on the first routing announcement message, and the third forwarding table entry is used to guide the first network device to forward the message whose destination address is the first IPv6 address.

[0186] It should be noted that, when the first network device is a single-stack device with IPv4 enabled, the specific implementation and effect of S201 can be found in the above Figure 2 In the introduction to the second implementation in the corresponding scenario embodiment, the description of network device 23 generating forwarding entry 7, network device 22 generating forwarding entry 8, and network device 21 generating forwarding entry 9, i.e., the description of S51, S53, and S54. Please also refer to the description of S203 below.

[0187] S202: The first network device sends a first route advertisement message to the second network device, where the first route advertisement message is used to instruct the second network device to generate a first forwarding entry.

[0188] S203: The second network device generates a first forwarding table entry according to the first route advertisement message, where the first forwarding table entry is used to guide the second network device to forward a message whose destination address is the first IPv6 address.

[0189] As an example, the first IPv6 routing information may include the prefix of the first IPv6 address. Then, the first forwarding table entry is an IPv6 forwarding table entry, and the first forwarding table entry includes the prefix of the first IPv6 address and the first next-hop information. S202 may include, for example: The second network device performs path calculation based on the prefix of the first IPv6 address to generate an IPv6 forwarding table entry, denoted as the first forwarding table entry. Among them, the first next-hop information in the first forwarding table entry may include one or more of the following: IPv6 address, ARP index, or MAC address.

[0190] It should be noted that for the specific implementation manners and effects of S202 to S203, reference may be made to the relevant descriptions in the above Figure 2 corresponding scenario embodiment in the introduction of the second implementation manner, the relevant descriptions of the network device 23 generating the forwarding table entry 7, the network device 22 generating the forwarding table entry 8, and the network device 21 generating the forwarding table entry 9, that is, the relevant descriptions of S51, S53, and S54.

[0191] S204, the second network device receives a first packet, and the destination address of the first packet is the first IPv6 address.

[0192] S205, the second network device sends the first packet based on the first forwarding table entry.

[0193] As an example, if the first forwarding table entry includes the prefix of the first IPv6 address and the first next-hop information, then after the second network device receives the first packet, it can parse to obtain that the destination address of the first packet is the first IPv6 address. Then, it searches for the first forwarding table entry that matches the first IPv6 address. Then, it encapsulates the first packet using the first next-hop information in the first forwarding table entry and sends it out. Among them, the first forwarding table entry matching the first IPv6 address may mean that the prefix of the first IPv6 address in the first forwarding table entry matches the first IPv6 address in the first packet. For example, the prefix of the first IPv6 address in the first forwarding table entry is the same as the prefix of the first IPv6 address in the first packet.

[0194] It should be noted that for the specific implementation manners and effects of S204 to S205, reference may be made to the relevant descriptions in the above Figure 2 corresponding scenario embodiment in the introduction of the second implementation manner, the relevant descriptions of the network device 21 forwarding the packet 3, the network device 22 forwarding the packet 3, or the network device 23 forwarding the packet 3, that is, the relevant descriptions of S61 to S62, S63 to S64, or S65 to S66.

[0195] It can be seen that based on the method 200, the network only enables the IPv4 single-stack function, without enabling the IPv6 single-stack function, and without configuring IPv6 addresses for each network device in the network, it can carry IPv6 services and users, simplifying network configuration and saving IPv6 address resources.

[0196] In addition, the method 200 may further include a process in which the IPv4 network advertises the IPv4 address to implement carrying IPv4 services and users, that is, the method 200 may further include S206 to S210 as follows:

[0197] S206, a first network device obtains a third route advertisement message, where the third route advertisement message carries second IPv4 routing information, and the second IPv4 routing information is routing information indicating a second IPv4 address.

[0198] S207, the first network device sends the third route advertisement message to a second network device, and the third route advertisement message is used to instruct the second network device to generate a fourth forwarding entry.

[0199] S208, the second network device generates a fourth forwarding entry according to the third route advertisement message, and the fourth forwarding entry is used to guide the second network device to forward a packet whose destination address is the second IPv4 address.

[0200] S209, the second network device receives a second packet, and the destination address of the second packet is the second IPv4 address.

[0201] S210, the second network device sends the second packet based on the fourth forwarding entry.

[0202] It should be noted that for the specific implementation manners and effects of S206 to S210, reference can be made to Figure 2 the relevant descriptions of S71 to S74 and S81 to S83 in the introduction of the second implementation manner in the corresponding scenario embodiments. Among them, the second IPv4 address may correspond to IPv4 address 5, the third route advertisement message corresponds to IPv4 route advertisement message 5, and the second packet corresponds to packet 4. In one case, the first network device may be Figure 2 the network device 31 shown, and the second network device is Figure 2 the network device 23 shown, and the fourth forwarding entry corresponds to forwarding entry 10; in another case, the first network device may be Figure 2 the network device 23 shown, and the second network device is Figure 2 the network device 22 shown, and the fourth forwarding entry corresponds to forwarding entry 11. In yet another case, the first network device may be Figure 2 the network device 22 shown, and the second network device is Figure 2The network device 21 shown, the fourth forwarding table entry corresponds to the forwarding table entry 12.

[0203] It can be seen that in this method 200, the network only enables the IPv4 single-stack function, without enabling the IPv6 single-stack function, and without configuring IPv6 addresses for each network device in the network, it can carry IPv4 and IPv6 services and users, simplifies network configuration, and saves IPv6 address resources.

[0204] Correspondingly, an embodiment of the present application further provides a routing advertisement device 400, as Figure 4 shown. The device 400 is applied to the first network device, and the device 400 may include: an obtaining unit 401 and a sending unit 402.

[0205] As an example, the device 400 may correspond to Figure 3a the first network device in the method 100 shown, and implement the functions of the first network device in the method 100.

[0206] In this example, the obtaining unit 401 is configured to obtain a first routing advertisement message, the first routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, the first routing advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address. The obtaining unit 401 may execute Figure 3a S101 shown.

[0207] The sending unit 402 is configured to send the first routing advertisement message to a second network device, and the first routing advertisement message is used to trigger the second network device to generate a first forwarding table entry, and the first forwarding table entry is used to guide the second network device to forward a packet with a destination address of the first IPv4 address. The sending unit 402 may execute Figure 3a S102 shown.

[0208] In some possible implementation manners, the first IPv4 routing information includes a prefix of the first IPv4 address. The first forwarding table entry is an IPv4 forwarding table entry, and the first forwarding table entry includes a prefix of the first IPv4 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, an ND index, or a MAC address. Among them, the first routing advertisement message includes indication information, and the indication information is used to indicate that the first routing advertisement message is used to advertise IPv4 routing.

[0209] In some other possible implementation manners, the first IPv4 routing information includes a prefix of the first IPv6 address, and the apparatus further includes: a conversion unit. The obtaining unit 401 is further configured to obtain a prefix of the first IPv4 address according to the second IPv4 routing information; the conversion unit is configured to convert the prefix of the first IPv4 address into the prefix of the first IPv6 address. The first forwarding entry is an IPv6 forwarding entry, and the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information, where the first next-hop information includes one or more of the following: an IPv6 address, a neighbor discovery (ND) index, or a media access control (MAC) address.

[0210] In some possible implementation manners, the apparatus 400 further includes: a receiving unit and a generating unit. The receiving unit is configured to receive a second routing advertisement message sent by a third network device before obtaining the first routing advertisement message, where the second routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, the second routing advertisement message carries the second IPv4 routing information, and the second IPv4 routing information includes routing information corresponding to the first IPv4 address; the generating unit is configured to generate a second forwarding entry according to the second routing advertisement message, and the second forwarding entry is used to guide the first network device to forward a packet whose destination address is the first IPv4 address.

[0211] In this implementation manner, the obtaining unit 401 is specifically configured to: generate the first routing advertisement message according to the second routing advertisement message.

[0212] In some other possible implementation manners, the obtaining unit 401 is specifically configured to: receive the first routing advertisement message sent by a fourth network device.

[0213] In this implementation manner, the apparatus 400 may further include a generating unit. The generating unit is configured to generate a third forwarding entry according to the first routing advertisement message, and the third forwarding entry is used to guide the first network device to forward a packet whose destination address is the first IPv4 address. For example, the generating unit is specifically configured to: perform path calculation according to the first IPv4 routing information to generate the third forwarding entry, and the third forwarding entry is an IPv4 forwarding entry or an IPv6 forwarding entry.

[0214] It should be noted that in this example Figure 4 the routing advertisement apparatus 400 shown may be Figure 3a the first network device in the embodiment shown. Therefore, for various specific implementation manners of the routing advertisement apparatus 400 in this example, reference may be made to Figure 3a the relevant introduction of the corresponding method 100, which will not be elaborated in this embodiment.

[0215] As another example, the apparatus 400 may correspond to the first network device in Figure 3b the method 200 shown, and implement the functions of the first network device in the method 200.

[0216] In this example, an obtaining unit 401 is configured to obtain a first routing advertisement message, where the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address. The obtaining unit 401 may execute Figure 3a S201 shown.

[0217] A sending unit 402 is configured to send the first routing advertisement message to a second network device, where the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address. The sending unit 402 may execute Figure 3b S202 shown.

[0218] In some possible implementation manners, the apparatus 400 further includes a receiving unit and a generating unit. The receiving unit is configured to receive a second routing advertisement message sent by a third network device before obtaining the first routing advertisement message, where the second routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, the second routing advertisement message carries second IPv6 routing information, and the second IPv6 routing information includes routing information corresponding to the first IPv6 address; the generating unit is configured to generate a second forwarding entry according to the second routing advertisement message, and the second forwarding entry is used to guide the first network device to forward a packet whose destination address is the first IPv6 address.

[0219] In this implementation manner, the obtaining unit 401 is specifically configured to: generate the first routing advertisement message according to the second routing advertisement message.

[0220] In some other possible implementation manners, the obtaining unit is specifically configured to: receive the first routing advertisement message sent by a fourth network device.

[0221] In this implementation manner, the device 400 may further include a generating unit. The generating unit is configured to generate a third forwarding table entry according to the first routing advertisement message, and the third forwarding table entry is used to direct the first network device to forward a message whose destination address is the first IPv6 address. Wherein, the first IPv6 routing information may include a prefix of the first IPv6 address. Then, the generating unit is specifically configured to: perform path calculation according to the prefix of the first IPv6 address to generate the third forwarding table entry, the third forwarding table entry being an IPv6 forwarding table entry, and the third forwarding table entry includes the prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: IPv4 address, ARP index or MAC address.

[0222] Wherein, the first routing advertisement message may include indication information, and the indication information is used to indicate that the first routing advertisement message is used to advertise IPv6 routing.

[0223] It should be noted that in this example Figure 4 the device 400 for routing advertisement shown may be Figure 3b the first network device in the embodiment shown. Therefore, for various specific implementation manners of the device 400 for routing advertisement in this example, reference may be made to Figure 3b the relevant introduction of the corresponding method 200, which will not be elaborated in this embodiment.

[0224] Correspondingly, an embodiment of the present application further provides a device 500 for routing advertisement, as Figure 5 shown. The device 500 is applied to a second network device, and the device 500 may include: a receiving unit 501 and a generating unit 502.

[0225] As an example, the device 500 may correspond to Figure 3a the second network device in the method 100 shown, and implement the functions of the second network device in the method 100.

[0226] In this example, the receiving unit 501 is configured to receive a first routing advertisement message, the first routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, and the first routing advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to the first IPv4 address. The receiving unit 501 may execute Figure 3a S102 shown.

[0227] The generating unit 502 is configured to generate a first forwarding table entry according to the first IPv4 routing information, and the first forwarding table entry is used to direct the second network device to forward a message whose destination address is the first IPv4 address. The generating unit 502 may execute Figure 3aS103 shown above.

[0228] In some possible implementation manners, the first IPv4 routing information includes a prefix of the first IPv4 address. Then, the first forwarding entry may be an IPv4 forwarding entry, and the first forwarding entry includes the prefix of the first IPv4 address and first next-hop information, where the first next-hop information includes one or more of the following: an IPv6 address, an ND index, or a MAC address.

[0229] In some other possible implementation manners, the first IPv4 routing information includes a prefix of a first IPv6 address, and the prefix of the first IPv6 address is obtained by converting the prefix of the first IPv4 address. Then, the first forwarding entry may be an IPv6 forwarding entry, and the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information, where the first next-hop information includes one or more of the following: an IPv6 address, a neighbor discovery (ND) index, or a media access control (MAC) address.

[0230] In some possible implementation manners, the generating unit 502 is specifically configured to: perform path calculation according to the first IPv4 routing information to generate the first forwarding entry.

[0231] It should be noted that in this example Figure 5 the routing advertisement device 500 shown above may be Figure 3a the second network device in the embodiment shown above. Therefore, for various specific implementation manners of the routing advertisement device 500 in this example, reference may be made to Figure 3a the relevant introduction of the corresponding method 100, which will not be elaborated in this embodiment.

[0232] As another example, the device 500 may correspond to Figure 3b the second network device in the method 200 shown above, and implement the functions of the second network device in the method 200.

[0233] In this example, the receiving unit 501 is configured to receive a first routing advertisement message, where the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, and the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address. The receiving unit 501 may execute Figure 3b S202 shown above.

[0234] The generating unit 502 is configured to generate a first forwarding entry according to the first IPv6 routing information, and the first forwarding entry is used to guide the second network device to forward a message whose destination address is the first IPv6 address. The generating unit 502 may execute Figure 3b S203 shown above.

[0235] In some possible implementations, the first IPv6 routing information may include the prefix of the first IPv6 address, the first forwarding table entry is an IPv6 forwarding table entry, the first forwarding table entry includes the prefix of the first IPv6 address and the first next-hop information, and the first next-hop information includes one or more of the following: an IPv4 address, an ARP index, or a MAC address.

[0236] In some possible implementations, the generating unit 502 is specifically configured to: perform path calculation according to the prefix of the first IPv6 address, and generate the first forwarding table entry.

[0237] It should be noted that in this example Figure 5 the routing advertisement device 500 shown may be Figure 3b the second network device in the embodiment shown. Therefore, for various specific implementation manners of the routing advertisement device 500 in this example, reference may be made to Figure 3b the relevant introduction of the corresponding method 200, which will not be elaborated in this embodiment.

[0238] It should be noted that in the above routing advertisement device 400 and routing advertisement device 500, the first forwarding table entry may further include the outgoing interface information.

[0239] See Figure 6 , an embodiment of the present application provides a network device 600 (which may also be referred to as a communication device 600). The network device 600 may be the network device in any of the above embodiments. For example, it may be Figure 3a the first network device or the second network device in Figure 3b ; or for another example, it may also be Figure 4 the first network device or the second network device in Figure 5 . Or, the network device 600 may also be the routing advertisement device in any of the above embodiments. For example, it may be Figure 4 the routing advertisement device 400 in Figure 5 ; or for another example, it may also be Figure 5 the routing advertisement device 500 in . The network device 600 can implement the functions of various network devices in the above embodiments. The network device 600 includes at least one processor 601, a bus system 602, a memory 603, and at least one communication interface 604.

[0240] The network device 600 is a hardware-structured device and can be used to implement Figure 4 the functional modules in the routing advertisement device 400 shown. For example, those skilled in the art can think of Figure 4The obtaining unit 401 and the sending unit 402 in the routing advertisement device 400 shown can be implemented by the at least one processor 601 invoking the code in the memory 603. Also, for example, those skilled in the art can conceive that Figure 5 The receiving unit 501 and the generating unit 502 in the routing advertisement device 500 shown can be implemented by the at least one processor 601 invoking the code in the memory 603.

[0241] Optionally, the network device 600 can also be used to implement the functions of the network device in any of the above embodiments.

[0242] Optionally, the above-mentioned processor 601 can be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the solution of the present application.

[0243] The above bus system 602 may include a path for transmitting information between the above components.

[0244] The above communication interface 604 is used to communicate with other devices or communication networks.

[0245] The above memory 603 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.

[0246] Among them, the memory 603 is used to store the application program code for executing the solution of this application, and is controlled and executed by the processor 601. The processor 601 is used to execute the application program code stored in the memory 603, so as to implement the functions in the method of this application.

[0247] In a specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 in

[0248] In a specific implementation, as an embodiment, the network device 600 may include multiple processors, such as Figure 6 the processor 601 and the processor 607 in

[0249] Figure 7 FIG. 14 is a schematic structural diagram of another network device 700 (which may also be referred to as a communication device 700) provided by an embodiment of the present application. The network device 700 may be the network device in any of the above embodiments, for example, it may be Figure 3a the first network device or the second network device in Figure 3b ; or for another example, it may also be Figure 4 the first network device or the second network device in Figure 5 ; or the network device 600 may also be the device for route advertisement in any of the above embodiments, for example, it may be Figure 4 the device 400 for route advertisement in Figure 5 ; or for another example, it may also be Figure 5 the device 500 for route advertisement in

[0250] The network device 700 includes: a main control board 710 and an interface board 730.

[0251] The main control board 710 is also referred to as a main processing unit (MPU) or a route processor card. The main control board 710 controls and manages various components in the network device 700, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 710 includes: a central processing unit 711 and a memory 712.

[0252] The interface board 730 is also referred to as a line processing unit (LPU), a linecard, or a service board. The interface board 730 is used to provide various service interfaces and implement the forwarding of data packets. The service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc. The Ethernet interface is, for example, a Flexible Ethernet Clients (FlexE Clients). The interface board 730 includes: a central processing unit 731, a network processor 732, a forwarding table entry memory 734, and a physical interface card (PIC) 733.

[0253] The central processing unit 731 on the interface board 730 is used to control and manage the interface board 730 and communicate with the central processing unit 711 on the main control board 710.

[0254] The network processor 732 is used to implement the forwarding and processing of packets. The form of the network processor 732 can be a forwarding chip. Specifically, the processing of upstream packets includes: the processing of the packet input interface and the lookup of the forwarding table; the processing of downstream packets: the lookup of the forwarding table, etc.

[0255] The physical interface card 733 is used to implement the docking function at the physical layer. The original traffic enters the interface board 730 from here, and the processed packets are sent out from the physical interface card 733. The physical interface card 733 includes at least one physical interface, which is also called a physical port. The physical interface card 733 corresponds to the FlexE physical interface in the system architecture. The physical interface card 733 is also called a daughter card and can be installed on the interface board 730. It is responsible for converting optical and electrical signals into packets, performing a legality check on the packets, and then forwarding them to the network processor 732 for processing. In some embodiments, the central processing unit 731 of the interface board 730 can also execute the function of the network processor 732, such as implementing software forwarding based on a general CPU, so that the network processor 732 is not required in the physical interface card 733.

[0256] Optionally, the network device 700 includes multiple interface boards. For example, the network device 700 further includes an interface board 740, which includes: a central processing unit 741, a network processor 742, a forwarding table entry memory 744, and a physical interface card 743.

[0257] Optionally, the network device 700 further includes a switch fabric board 720. The switch fabric board 720 may also be referred to as a switch fabric unit (SFU). In the case where the network device has multiple interface boards 730, the switch fabric board 720 is used to complete data exchange between the interface boards. For example, communication between the interface board 730 and the interface board 740 can be achieved through the switch fabric board 720.

[0258] The main control board 710 is coupled to the interface board 730. For example, the main control board 710, the interface board 730, the interface board 740, and the switch fabric board 720 are interconnected through a system bus and a system backplane. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 710 and the interface board 730, and communication between the main control board 710 and the interface board 730 is carried out through the IPC channel.

[0259] Logically, the network device 700 includes a control plane and a forwarding plane. The control plane includes the main control board 710 and the central processing unit 731, and the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 734, a physical interface card 733, and a network processor 732. The control plane executes functions such as acting as a router, generating a forwarding table, processing signaling and protocol packets, and configuring and maintaining the status of the device. The control plane distributes the generated forwarding table to the forwarding plane. In the forwarding plane, the network processor 732 performs table lookup and forwarding on the packets received by the physical interface card 733 based on the forwarding table distributed by the control plane. The forwarding table distributed by the control plane can be stored in the forwarding table entry memory 734. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same device.

[0260] If the network device 700 is configured as a first network device, as an example, the central processing unit 711 may obtain a first routing advertisement message, where the first routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, the first routing advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; the network processor 732 may trigger the physical interface card 733 to send the first routing advertisement message to a second network device, and the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv4 address. As an example, the central processing unit 711 may obtain a first routing advertisement message, where the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; the network processor 732 may trigger the physical interface card 733 to send the first routing advertisement message to a second network device, and the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address.

[0261] It should be understood that the sending unit 402 in the routing advertisement device 400 and the communication interface 604 in the network device 600 may be equivalent to the physical interface card 733 or the physical interface card 743 in the network device 700; the obtaining unit 401 in the routing advertisement device 400 and the processor 601 in the network device 600 may be equivalent to the central processing unit 711 or the central processing unit 731 in the network device 700.

[0262] If the network device 700 is configured as a second network device, as an example, the network processor 732 may trigger the physical interface card 733 to receive a first routing advertisement message, where the first routing advertisement message includes an OSPFv3 message or an IS-ISv6 message, the first routing advertisement message carries first IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; the central processor 711 may generate a first forwarding table entry according to the first IPv4 routing information, and the first forwarding table entry is used to guide the second network device to forward a message whose destination address is the first IPv4 address. As an example, the network processor 732 may trigger the physical interface card 733 to receive a first routing advertisement message, where the first routing advertisement message includes an OSPFv2 message or an IS-ISv4 message, the first routing advertisement message carries first IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; the central processor 711 may generate a first forwarding table entry according to the first IPv6 routing information, and the first forwarding table entry is used to guide the second network device to forward a message whose destination address is the first IPv6 address.

[0263] It should be understood that the receiving unit 501 in the routing advertisement device 500 and the communication interface 604 in the network device 600 may be equivalent to the physical interface card 733 or the physical interface card 743 in the network device 700; the generating unit 502 in the routing advertisement device 500 and the processor 601 in the network device 600 may be equivalent to the central processor 711 or the central processor 731 in the network device 700.

[0264] It should be understood that the operations on the interface board 740 in the embodiments of the present application are the same as those on the interface board 730, and for the sake of brevity, they will not be described in detail. It should be understood that the network device 700 in this embodiment may correspond to the routing advertisement device or the network device in each of the above method embodiments, and the main control board 710, the interface board 730, and / or the interface board 740 in the network device 700 may implement the functions and / or various steps implemented in the routing advertisement device 400, the routing advertisement device 500, or the network device 600 in each of the above method embodiments. For the sake of brevity, they will not be described here.

[0265] It should be understood that there may be one or more main control boards. When there are multiple main control boards, it may include an active main control board and a standby main control board. There may be one or more interface boards. The stronger the data processing capacity of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching fabric board, or there may be one or more switching fabric boards. When there are multiple switching fabric boards, they can jointly achieve load sharing and redundant backup. In a centralized forwarding architecture, the network device may not require a switching fabric board, and the interface board undertakes the processing function of the service data of the entire system. In a distributed forwarding architecture, the network device may have at least one switching fabric board, and data exchange between multiple interface boards is achieved through the switching fabric board, providing a large-capacity data exchange and processing capacity. Therefore, the data access and processing capacity of the network device with a distributed architecture is greater than that of the device with a centralized architecture. Optionally, the form of the network device may also be a single board, that is, there is no switching fabric board, and the functions of the interface board and the main control board are integrated on this single board. At this time, the central processing unit on the interface board and the central processing unit on the main control board can be combined into one central processing unit on this single board to execute the functions after their superposition. The data exchange and processing capacity of this form of device is relatively low (for example, network devices such as low-end switches or routers). Which architecture to specifically adopt depends on the specific networking deployment scenario.

[0266] In some possible embodiments, the above-mentioned various network devices or network devices can be implemented as virtualized devices. For example, the virtualized device can be a virtual machine (VM for short) running a program for the function of sending packets, and the virtual machine is deployed on a hardware device (for example, a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The virtual machine can be configured as each network device in the embodiments of the present application. For example, each network device or network device can be implemented based on a general physical server combined with network function virtualization (NFV) technology. Each network device or network device is a virtual host, a virtual router, or a virtual switch. Those skilled in the art can virtualize each network device or network device with the above functions on a general physical server by reading this application in combination with NFV technology, which will not be elaborated here.

[0267] It should be understood that the network devices in the above various product forms respectively have any functions of the network devices or communication devices in the above method embodiments, which will not be elaborated here.

[0268] Embodiments of this application also provide a chip, including a processor and an interface circuit. The interface circuit is configured to receive instructions and transmit them to the processor. The processor, for example, can be a specific implementation form of the message processing device in the embodiments of this application, and can be used to execute the above-mentioned message processing method. Among them, the processor is coupled to a memory, and the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0269] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that implements by reading software code stored in the memory.

[0270] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or can be separately arranged from the processor, and this application does not limit it. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be separately arranged on different chips. This application does not make specific limitations on the type of the memory and the setting manner of the memory and the processor.

[0271] Exemplarily, the chip system can be a field programmable gate array (FPGA), can be an application specific integrated circuit (ASIC), can also be a system on chip (SoC), can also be a central processing unit (CPU), can also be a network processor (NP), can also be a digital signal processing circuit (DSP), can also be a micro controller unit (MCU), can also be a programmable logic device (PLD) or other integrated chips.

[0272] In addition, embodiments of this application also provide a communication system 800, see Figure 8The communication system 800 may include: a first network device 801 and a second network device 802. Among them, the first network device 801 is configured to perform the corresponding steps of the first network device in any possible implementation manner of the above method 100; the second network device 802 is configured to perform the corresponding steps of the second network device in any possible implementation manner of the above method 100. Alternatively, the first network device 801 is configured to perform the corresponding steps of the first network device in any possible implementation manner of the above method 200; the second network device 802 is configured to perform the corresponding steps of the second network device in any possible implementation manner of the above method 200

[0273] In addition, an embodiment of the present application further provides a computer-readable storage medium. Program code or instructions are stored in the computer-readable storage medium. When it runs on a computer, the computer is caused to execute the above Figure 3a or Figure 3b the method in any implementation manner of the embodiments shown

[0274] In addition, an embodiment of the present application further provides a computer program product. When it runs on a computer, the computer is caused to execute the method in any implementation manner of the foregoing method 100 or method 200

[0275] It should be understood that "determining B according to A" mentioned in the embodiments of the present application does not mean determining B only according to A, but also B can be determined according to A and / or other information

[0276] The "first" in the names such as "first routing advertisement message" mentioned in the present application is only used as a name identifier and does not represent the first in order. The same rule applies to "second" and the like

[0277] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, magnetic disk, optical disc, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of the present application

[0278] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for system embodiments and device embodiments, since they are basically similar to method embodiments, they are described relatively simply, and reference can be made to the relevant parts of the method embodiments for the relevant content. The device and system embodiments described above are only illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0279] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that for those of ordinary skill in the art in this technical field, several improvements and refinements can be made without departing from the premise of the present application, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for route advertisement, characterized in that, including: A first network device obtains a first routing advertisement message, where the first routing advertisement message includes an Open Shortest Path First version 3 (OSPFv3) message or an Intermediate System to Intermediate System version 6 (IS-ISv6) message of Internet Protocol version 6, the first routing advertisement message carries first Internet Protocol version 4 (IPv4) routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; The first network device sends the first routing advertisement message to a second network device, and the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a message whose destination address is the first IPv4 address.

2. The method according to claim 1, characterized in that, The first IPv4 routing information includes a prefix of the first IPv4 address.

3. The method according to claim 2, wherein The first forwarding entry is an IPv4 forwarding entry, and the first forwarding entry includes a prefix of the first IPv4 address and first next-hop information, and the first next-hop information includes one or more of the following: an Internet Protocol version 6 (IPv6) address, a Neighbor Discovery (ND) index, or a Media Access Control (MAC) address.

4. The method according to claim 2, wherein The first routing advertisement message includes indication information, and the indication information is used to indicate that the first routing advertisement message is used to advertise IPv4 routing.

5. The method according to claim 1, wherein The first IPv4 routing information includes a prefix of a first IPv6 address, and the method further includes: The first network device obtains the prefix of the first IPv4 address according to second IPv4 routing information; The first network device converts the prefix of the first IPv4 address into the prefix of the first IPv6 address.

6. The method according to claim 5, wherein The first forwarding entry is an IPv6 forwarding entry, and the first forwarding entry includes a prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, a Neighbor Discovery (ND) index, or a Media Access Control (MAC) address.

7. The method according to any one of claims 1 to 6, characterized in that, Before the first network device obtains the first routing advertisement message, the method further includes: The first network device receives a second routing advertisement message sent by a third network device, where the second routing advertisement message includes an Open Shortest Path First version 2 (OSPFv2) message or an Intermediate System to Intermediate System version 4 (IS-ISv4) message of Internet Protocol version 4, the second routing advertisement message carries the second IPv4 routing information, and the second IPv4 routing information includes routing information corresponding to the first IPv4 address; The first network device generates a second forwarding entry according to the second routing advertisement message, and the second forwarding entry is used to guide the first network device to forward a message whose destination address is the first IPv4 address.

8. The method according to claim 7, characterized in that, The first network device obtaining the first routing advertisement message includes: The first network device generates the first routing advertisement message according to the second routing advertisement message.

9. The method according to any one of claims 1 to 6, characterized in that, The first network device obtaining the first routing advertisement message includes: The first network device receives the first routing advertisement message sent by a fourth network device.

10. The method according to claim 9, wherein, The method further includes: The first network device generates a third forwarding entry according to the first routing advertisement message, and the third forwarding entry is used to guide the first network device to forward a message with a destination address of the first IPv4 address.

11. The method according to claim 10, wherein The first network device generating a third forwarding entry according to the first routing advertisement message includes: The first network device performs path calculation according to the first IPv4 routing information to generate the third forwarding entry, and the third forwarding entry is an IPv4 forwarding entry or an IPv6 forwarding entry.

12. The method according to claim 3 or 6, characterized in that, The first forwarding entry further includes egress interface information.

13. A method for route advertisement, characterized in that, including: A second network device receives a first routing advertisement message, where the first routing advertisement message includes a third version of the Open Shortest Path First OSPFv3 message or an Intermediate System to Intermediate System IS-ISv6 message of the sixth version of the Internet Protocol, and the first routing advertisement message carries first Internet Protocol version 4 IPv4 routing information, and the first IPv4 routing information includes routing information corresponding to the first IPv4 address; The second network device generates a first forwarding entry according to the first IPv4 routing information, and the first forwarding entry is used to guide the second network device to forward a message with a destination address of the first IPv4 address.

14. The method according to claim 13, characterized in that, The first IPv4 routing information includes a prefix of the first IPv4 address.

15. The method according to claim 14, wherein The first forwarding entry is an IPv4 forwarding entry, and the first forwarding entry includes a prefix of the first IPv4 address and first next-hop information, and the first next-hop information includes one or more of the following: an Internet Protocol version 6 IPv6 address, a Neighbor Discovery ND index, or a Media Access Control MAC address.

16. The method according to claim 13, wherein The first IPv4 routing information includes a prefix of a first IPv6 address, and the prefix of the first IPv6 address is obtained by converting the prefix of the first IPv4 address.

17. The method according to claim 16, characterized in that, The first forwarding entry is an IPv6 forwarding entry, and the first forwarding entry includes a prefix of the first IPv6 address and first next-hop information, and the first next-hop information includes one or more of the following: an IPv6 address, a Neighbor Discovery ND index, or a Media Access Control MAC address.

18. The method according to any one of claims 13 to 17, characterized in that, The second network device generating a first forwarding entry according to the first IPv4 routing information includes: The second network device performs path calculation according to the first IPv4 routing information to generate the first forwarding entry.

19. The method according to claim 15 or 17, characterized in that The first forwarding entry further includes egress interface information.

20. A method for route advertisement, characterized in that, including: A first network device obtains a first routing advertisement message, where the first routing advertisement message includes a second version of the Open Shortest Path First OSPFv2 message or an Intermediate System to Intermediate System IS-ISv4 message of the fourth version of the Internet Protocol, and the first routing advertisement message carries first Internet Protocol version 6 IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to the first IPv6 address; The first network device sends the first route advertisement message to the second network device, where the first route advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward packets with the destination address being the first IPv6 address.

21. The method according to claim 20, wherein Before the first network device obtains the first route advertisement message, the method further includes: The first network device receives a second route advertisement message sent by a third network device, where the second route advertisement message includes a third version of the Open Shortest Path First OSPFv3 message or an Intermediate System to Intermediate System IS-ISv6 message of Internet Protocol version 6. The second route advertisement message carries second IPv6 routing information, and the second IPv6 routing information includes routing information corresponding to the first IPv6 address; The first network device generates a second forwarding entry according to the second route advertisement message, and the second forwarding entry is used to guide the first network device to forward packets with the destination address being the first IPv6 address.

22. The method according to claim 21, wherein The first network device obtains the first route advertisement message, including: The first network device generates the first route advertisement message according to the second route advertisement message.

23. The method according to claim 20, characterized in that, The first network device obtains the first route advertisement message, including: The first network device receives the first route advertisement message sent by a fourth network device.

24. The method according to claim 23, wherein, The method further includes: The first network device generates a third forwarding entry according to the first route advertisement message, and the third forwarding entry is used to guide the first network device to forward packets with the destination address being the first IPv6 address.

25. The method according to claim 24, wherein, The first IPv6 routing information includes a prefix of the first IPv6 address. The first network device generates the third forwarding entry according to the first route advertisement message, including: The first network device performs path calculation according to the prefix of the first IPv6 address to generate the third forwarding entry. The third forwarding entry is an IPv6 forwarding entry, and the third forwarding entry includes the prefix of the first IPv6 address and first next-hop information. The first next-hop information includes one or more of the following: Internet Protocol version 4 address, Address Resolution Protocol ARP index, or Media Access Control MAC address.

26. The method according to any one of claims 20-25, characterized in that, The first route advertisement message includes indication information, and the indication information is used to indicate that the first route advertisement message is used to advertise IPv6 routes.

27. A method for route advertisement, characterized in that, Including: The second network device receives a first route advertisement message, where the first route advertisement message includes a second version of the Open Shortest Path First OSPFv2 message or an Intermediate System to Intermediate System IS-ISv4 message of Internet Protocol version 4. The first route advertisement message carries first Internet Protocol version 6 IPv6 routing information, and the first IPv6 routing information includes routing information corresponding to the first IPv6 address; The second network device generates a first forwarding entry according to the first IPv6 routing information, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address.

28. The method according to claim 27, characterized in that, The first IPv6 routing information includes a prefix of the first IPv6 address. The first forwarding entry is an IPv6 forwarding entry, and the first forwarding entry includes the prefix of the first IPv6 address and first next-hop information. The first next-hop information includes one or more of the following: Internet Protocol version 4 (IPv4) address, Address Resolution Protocol (ARP) index, or Media Access Control (MAC) address.

29. The method according to claim 27 or 28, characterized in that, The second network device generating a first forwarding entry according to the first IPv6 routing information includes: The second network device performs path calculation according to the prefix of the first IPv6 address to generate the first forwarding entry.

30. The method according to claim 27 or 28, characterized in that, The first forwarding entry further includes outgoing interface information.

31. A device for route advertisement, characterized in that Applied to a first network device, the apparatus includes: An obtaining unit, configured to obtain a first routing advertisement message, where the first routing advertisement message includes an Open Shortest Path First version 3 (OSPFv3) message or an Intermediate System to Intermediate System version 6 (IS-ISv6) message of Internet Protocol version 6. The first routing advertisement message carries first Internet Protocol version 4 (IPv4) routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; A sending unit, configured to send the first routing advertisement message to a second network device, where the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv4 address.

32. A device for route advertisement, characterized in that, Applied to a second network device, the apparatus includes: A receiving unit, configured to receive a first routing advertisement message, where the first routing advertisement message includes an Open Shortest Path First version 3 (OSPFv3) message or an Intermediate System to Intermediate System version 6 (IS-ISv6) message of Internet Protocol version 6. The first routing advertisement message carries first Internet Protocol version 4 (IPv4) routing information, and the first IPv4 routing information includes routing information corresponding to a first IPv4 address; A generating unit, configured to generate a first forwarding entry according to the first IPv4 routing information, where the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv4 address.

33. A device for route advertisement, characterized in that Applied to a first network device, the apparatus includes: An obtaining unit, configured to obtain a first routing advertisement message, where the first routing advertisement message includes an Open Shortest Path First version 2 (OSPFv2) message or an Intermediate System to Intermediate System version 4 (IS-ISv4) message of Internet Protocol version 4. The first routing advertisement message carries first Internet Protocol version 6 (IPv6) routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; A sending unit, configured to send the first routing advertisement message to a second network device, where the first routing advertisement message is used to trigger the second network device to generate a first forwarding entry, and the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address.

34. A device for route advertisement, characterized in that, Applied to a second network device, the apparatus includes: A receiving unit, configured to receive a first routing advertisement message, where the first routing advertisement message includes a second version of Open Shortest Path First (OSPFv2) message or an Intermediate System to Intermediate System (IS-ISv4) message of Internet Protocol version 4, the first routing advertisement message carries first Internet Protocol version 6 (IPv6) routing information, and the first IPv6 routing information includes routing information corresponding to a first IPv6 address; A generating unit, configured to generate a first forwarding entry according to the first IPv6 routing information, where the first forwarding entry is used to guide the second network device to forward a packet whose destination address is the first IPv6 address.

35. A network device, characterized in that, The network device includes a memory and a processor; The memory is configured to store instructions; The processor is configured to execute the instructions in the memory and execute the method according to any one of claims 1-30.

36. A communication system, characterized in that, The communication system includes a first network device and a second network device; The first network device is configured to execute the method according to any one of claims 1-12; The second network device is configured to execute the method according to any one of claims 13-19; Or, The first network device is configured to execute the method according to any one of claims 20-26; The second network device is configured to execute the method according to any one of claims 27-30.

37. A computer-readable storage medium, comprising instructions, characterized in that, When the instructions run on the processor, the method according to any one of claims 1-30 is implemented.

38. A computer program product, characterized in that, When the computer program product runs on the processor, the method according to any one of claims 1-30 is implemented.

Citation Information

Patent Citations

  • Mobile terminal as well as method and device of implementing single-PDP (Packet Data Protocol) dual-stack connection thereof

    CN104333608A

  • Method and system for terminal to access network

    CN105049241A