Movatterモバイル変換


[0]ホーム

URL:


CN117811984A - Message processing method and related equipment - Google Patents

Message processing method and related equipment
Download PDF

Info

Publication number
CN117811984A
CN117811984ACN202211213546.6ACN202211213546ACN117811984ACN 117811984 ACN117811984 ACN 117811984ACN 202211213546 ACN202211213546 ACN 202211213546ACN 117811984 ACN117811984 ACN 117811984A
Authority
CN
China
Prior art keywords
network device
address
sid
message
bsid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211213546.6A
Other languages
Chinese (zh)
Inventor
赵浩宾
唐湜
曾毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN202211213546.6ApriorityCriticalpatent/CN117811984A/en
Publication of CN117811984ApublicationCriticalpatent/CN117811984A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The application discloses a message processing method and related equipment, wherein first network equipment obtains a first service message matched with a first SRv6policy, a first output interface is determined according to a first source IP address of a first IPv6 header in the first service message, and the first output interface is an output interface of the first network equipment on a first forwarding path indicated by a first SRv6 policy; updating a first source IP address in the first service message into a second source IP address to obtain a second service message, wherein the first source IP address indicates first network equipment, and the second source IP address indicates next hop equipment of the first network equipment in a first forwarding path; and sending a second service message from the first outlet interface to the second network equipment. In this way, the transmission efficiency of the service message in the SRv policy scene is improved.

Description

Translated fromChinese
一种报文处理方法及相关设备A message processing method and related equipment

技术领域Technical Field

本申请涉及通信技术领域,特别是涉及一种报文处理方法及相关设备。The present application relates to the field of communication technology, and in particular to a message processing method and related equipment.

背景技术Background Art

分段路由(Segment Routing,SR)是基于源路由理念而设计的在网络上转发业务报文的协议,SR策略(policy)是一种引流策略,SR policy通常包括颜色(color)、尾节点(Endpoint)和分段列表(segment list),如果业务报文的目的地址与SR policy匹配,那么,在该业务报文中插入一个分段路由头(Segment Routing Header,SRH),在SRH中压入一个显式的segment list,中间节点通过不断更新目的地址和用于指示segment list中分段标识(Segment Identifier,SID)的偏移地址的操作来完成逐跳转发。Segment Routing (SR) is a protocol designed based on the source routing concept to forward service messages on the network. The SR policy is a traffic diversion strategy. The SR policy usually includes color, endpoint, and segment list. If the destination address of the service message matches the SR policy, a segment routing header (SRH) is inserted into the service message, and an explicit segment list is pushed into the SRH. The intermediate node completes hop-by-hop forwarding by continuously updating the destination address and the offset address used to indicate the segment identifier (Segment Identifier, SID) in the segment list.

对于基于第六版互联网协议的分段路由的策略(Segment Routing on IPv6policy,SRv6 policy,其中,IPv6英文全称为Internet Protocol version 6),segmentlist中的SID或BSID为128比特的第六版互联网协议(Internet Protocol version 6,IPv6)地址的形式,这样,业务报文进入SRv6 policy所指示的SR隧道时,需要为该业务报文封装较多的内容,导致业务报文的传输效率大打折扣。For the Segment Routing on IPv6 policy (SRv6 policy, where IPv6 stands for Internet Protocol version 6), the SID or BSID in the segmentlist is in the form of a 128-bit Internet Protocol version 6 (IPv6) address. In this way, when a service message enters the SR tunnel indicated by the SRv6 policy, more content needs to be encapsulated for the service message, which greatly reduces the transmission efficiency of the service message.

发明内容Summary of the invention

基于此,本申请提供了一种报文处理方法及相关设备,通过定义新的SRv6 policy的封装和转发机制,使得进入SR隧道的业务报文无需封装SRH即可实现基于SRv6 policy的转发,提高业务报文的传输效率。Based on this, the present application provides a message processing method and related equipment. By defining a new SRv6 policy encapsulation and forwarding mechanism, the service message entering the SR tunnel can be forwarded based on SRv6 policy without SRH encapsulation, thereby improving the transmission efficiency of the service message.

第一方面,本申请提供了一种报文处理方法,该方法例如可以包括:第一网络设备获得与第一SRv6 policy匹配的第一业务报文,该第一业务报文包括第一IPv6头,那么,第一网络设备能够根据第一业务报文中第一IPv6头的第一源IP地址确定第一出接口,所述第一出接口为第一网络设备在第一SRv6 policy指示的第一转发路径上的出接口;接着,第一网络设备将第一业务报文中的第一源IP地址更新为第二源IP地址,获得第二业务报文,其中,第一源IP地址指示所述第一网络设备,而第二源IP地址指示第二网络设备,第二网络设备为第一网络设备在第一转发路径的下一跳设备;从而,第一网络设备即可从第一出接口向第二网络设备发送第二业务报文。这样,对于经过SRv6 policy所指示的转发路径转发的业务报文,通过IPv6头的源IP地址携带相应的路径信息,网络设备接收到业务报文后,通过业务报文中IPv6头的源IP地址即可完成对业务报文的处理,使得业务报文能够在SRv6policy所指示的转发路径中准确的完成传输,不再需要为通过SRv6 policy所指示的转发路径传输的业务报文封装SRH,也不再需要将封装了SRH的业务报文在SRv6 policy所指示的转发路径包括的各网络设备之间传输,提高了SRv6 policy场景下业务报文的传输效率,也节约了业务报文传输过程中对网络链路带宽的消耗。In a first aspect, the present application provides a message processing method, which may, for example, include: a first network device obtains a first service message matching a first SRv6 policy, the first service message including a first IPv6 header, then, the first network device can determine a first output interface according to a first source IP address of the first IPv6 header in the first service message, the first output interface being the output interface of the first network device on a first forwarding path indicated by the first SRv6 policy; then, the first network device updates the first source IP address in the first service message to a second source IP address, and obtains a second service message, wherein the first source IP address indicates the first network device, and the second source IP address indicates the second network device, the second network device being the next hop device of the first network device on the first forwarding path; thereby, the first network device can send the second service message from the first output interface to the second network device. In this way, for the service packets forwarded through the forwarding path indicated by the SRv6 policy, the corresponding path information is carried by the source IP address of the IPv6 header. After the network device receives the service packet, it can complete the processing of the service packet through the source IP address of the IPv6 header in the service packet, so that the service packet can be accurately transmitted in the forwarding path indicated by the SRv6 policy. It is no longer necessary to encapsulate SRH for the service packets transmitted through the forwarding path indicated by the SRv6 policy, and it is no longer necessary to transmit the service packets encapsulated with SRH between the network devices included in the forwarding path indicated by the SRv6 policy. This improves the transmission efficiency of the service packets in the SRv6 policy scenario and saves the consumption of network link bandwidth during the transmission of the service packets.

在一些可能的实现方式中,第一网络设备接收到第一业务报文时,可以通过判断IPv6头中的源IP地址是否与转发映射表匹配,确定是基于源IP地址转发还是基于目的IP地址转发。转发映射表用于指导通过SRv6 policy对应的转发路径转发的业务报文在该第一网络设备的处理。如果第一源IP地址与转发映射表匹配,则,执行所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口的操作。如果第一源IP地址与转发映射表不匹配,则,不执行所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口的操作,该方法还可以包括:第一网络设备根据所述第一IPv6头中的第一目的IP地址处理所述第一业务报文。第一网络设备根据第一目的IP地址处理所述第一业务报文,可以包括:判断第一目的IP地址是否与本地SID表匹配,如果匹配,则,按照与第一目的IP地址匹配的本地SID表项中的动作处理第一业务报文,如果不匹配,则,按照第一目的IP地址查转发表对第一业务报文进行转发。In some possible implementations, when the first network device receives the first service message, it can determine whether the forwarding is based on the source IP address or the destination IP address by judging whether the source IP address in the IPv6 header matches the forwarding mapping table. The forwarding mapping table is used to guide the processing of the service message forwarded by the forwarding path corresponding to the SRv6 policy on the first network device. If the first source IP address matches the forwarding mapping table, the operation of determining the first outbound interface according to the first source Internet Protocol IP address of the first IPv6 header is performed. If the first source IP address does not match the forwarding mapping table, the operation of determining the first outbound interface according to the first source Internet Protocol IP address of the first IPv6 header is not performed, and the method may also include: the first network device processes the first service message according to the first destination IP address in the first IPv6 header. The first network device processes the first service message according to the first destination IP address, which may include: judging whether the first destination IP address matches the local SID table, if it matches, processing the first service message according to the action in the local SID table entry matching the first destination IP address, and if it does not match, forwarding the first service message according to the first destination IP address.

在一些可能的实现方式中,所述转发映射表可以为Sub-BSID映射表,第一源IP地址为所述第一网络设备的第一Sub-BSID,所述第一Sub-BSID包括第一分段列表的标识和SL,所述第一SRv6 policy包括所述第一分段列表,所述SL指示所述第一网络设备在所述第一分段列表中的位置,所述Sub-BSID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述Sub-BSID映射表包括所述第一Sub-BSID和本地的第一分段标识SID的对应关系,所述第一SID与所述第一出接口对应。In some possible implementations, the forwarding mapping table may be a Sub-BSID mapping table, the first source IP address is the first Sub-BSID of the first network device, the first Sub-BSID includes an identifier and SL of a first segment list, the first SRv6 policy includes the first segment list, the SL indicates the position of the first network device in the first segment list, the Sub-BSID mapping table is used to guide the processing of service packets transmitted through the forwarding path corresponding to the SRv6 policy on the first network device, the Sub-BSID mapping table includes a correspondence between the first Sub-BSID and a local first segment identifier SID, and the first SID corresponds to the first output interface.

该实现方式中,在第一网络设备获得第一业务报文之前,该方法还可以包括:第一网络设备获得携带所述第一SRv6 policy的第一消息,所述第一SRv6 policy包括第一BSID,第一BSID用于标识第一SRv6 policy,所述第一SRv6 policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;接着,第一网络设备基于所述第一BSID和所述至少一个分段列表,获得所述Sub-BSID映射表。In this implementation, before the first network device obtains the first service message, the method may also include: the first network device obtains a first message carrying the first SRv6 policy, the first SRv6 policy includes a first BSID, the first BSID is used to identify the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list; then, the first network device obtains the Sub-BSID mapping table based on the first BSID and the at least one segment list.

对于第一网络设备为第一转发路径上的网络设备,且第一网络设备不是第一转发路径的尾节点的情况,所述第一网络设备根据第一IPv6头的第一源IP地址确定第一出接口,例如可以包括:第一网络设备从所述Sub-BSID映射表中,确定与所述第一源IP地址中的所述第一Sub-BSID匹配的所述第一SID;第一网络设备从本地SID表中,确定与所述第一SID匹配的所述第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。该情况下,第一网络设备将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,例如可以包括:第一网络设备更新所述第一源IP地址中SL字段的值,获得所述第二业务报文,所述第二业务报文中的第二源IP地址中SL字段的值指示所述第二网络设备在所述第一分段列表中的位置,所述第二源IP地址为所述第二网络设备的第二Sub-BSID。例如,第二源IP地址中SL的值可以是第一源IP地址中SL的值减一。In the case where the first network device is a network device on the first forwarding path, and the first network device is not the tail node of the first forwarding path, the first network device determines the first outbound interface according to the first source IP address of the first IPv6 header, for example, the first network device determines the first SID matching the first Sub-BSID in the first source IP address from the Sub-BSID mapping table; the first network device determines the first outbound interface matching the first SID from the local SID table, and the local SID table includes the correspondence between the first SID and the first outbound interface. In this case, the first network device updates the first source IP address in the first service message to the second source IP address, and obtains the second service message, for example, the first network device updates the value of the SL field in the first source IP address, and obtains the second service message, the value of the SL field in the second source IP address in the second service message indicates the position of the second network device in the first segment list, and the second source IP address is the second Sub-BSID of the second network device. For example, the value of SL in the second source IP address can be the value of SL in the first source IP address minus one.

对于第一网络设备为第一转发路径的头节点的情况,第一网络设获得第一业务报文,例如可以包括:第一网络设备接收第三业务报文,所述第三业务报文与所述第一SRv6policy匹配;第一网络设备在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SRv6 policy中所述第一SID对应的所述第一Sub-BSID,所述第一SID为所述第一分段列表中的第一个SID。For the case where the first network device is the head node of the first forwarding path, the first network device obtains the first service message, which may include, for example: the first network device receives the third service message, and the third service message matches the first SRv6 policy; the first network device encapsulates the first IPv6 header on the third service message to obtain the first service message, and the first source IP address of the first IPv6 header is the first Sub-BSID corresponding to the first SID in the first SRv6 policy, and the first SID is the first SID in the first segment list.

对于第一网络设备为第一转发路径的尾节点的情况,该方法例如还可以包括:第一网络设备获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;若确定所述第三IPv6地址中的第三源IP地址与所述Sub-BSID映射表匹配,且所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为所述第一网络设备的第三Sub-BSID,所述第三Sub-BSID包括第二分段列表的标识和SL,所述第二SRv6 policy包括所述第二分段列表,所述SL指示所述第一网络设备在所述第二分段列表中的位置。其中,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,可以包括:判断第三目的IP地址是否与本地SID表匹配,如果匹配,则,按照与第三目的IP地址匹配的本地SID表项中的动作处理第四业务报文,如果不匹配,则,按照第三目的IP地址查转发表对第四业务报文进行转发。第一网络设备对第四业务报文进行处理或转发,例如可以包括:第一网络设备解除所述第四业务报文中与所述第二SRv6policy相关的封装,获得第五业务报文;第一网络设备转发所述第五业务报文。For the case where the first network device is the tail node of the first forwarding path, the method may also include, for example: the first network device obtains a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header; if it is determined that the third source IP address in the third IPv6 address matches the Sub-BSID mapping table, and the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, the third source IP address is the third Sub-BSID of the first network device, the third Sub-BSID includes an identifier and SL of a second segment list, the second SRv6 policy includes the second segment list, and the SL indicates the position of the first network device in the second segment list. The first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, which may include: determining whether the third destination IP address matches the local SID table; if so, processing the fourth service message according to the action in the local SID table entry that matches the third destination IP address; if not, forwarding the fourth service message by searching the forwarding table according to the third destination IP address. The first network device processes or forwards the fourth service message, which may include, for example: the first network device removes the encapsulation related to the second SRv6policy in the fourth service message to obtain the fifth service message; and the first network device forwards the fifth service message.

其中,以第一Sub-BSID为例介绍本申请定义的Sub-BSID的格式,第一Sub-BSID可以包括Locator、Function和Arguments,所述Locator和Function与第一BSID一致,Arguments包括所述第一分段列表的标识和SL,所述第一BSID用于标识所述第一SRv6policy。Among them, the format of the Sub-BSID defined in this application is introduced by taking the first Sub-BSID as an example. The first Sub-BSID may include Locator, Function and Arguments. The Locator and Function are consistent with the first BSID. The Arguments include the identifier and SL of the first segment list. The first BSID is used to identify the first SRv6 policy.

在另一些可能的实现方式中,所述转发映射表也可以为SID映射表,所述第一源IP地址为所述第一网络设备的第一分段标识SID,所述第一SID为所述第一SRv6 policy所包括的第一分段列表中所述第一网络设备的标识,所述SID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括所述第一SID和第二SID的对应关系,所述第二SID为所述第一分段列表中所述第二网络设备的标识。In some other possible implementations, the forwarding mapping table may also be a SID mapping table, the first source IP address is the first segment identifier SID of the first network device, the first SID is the identifier of the first network device in the first segment list included in the first SRv6 policy, the SID mapping table is used to guide the processing of service packets transmitted through the forwarding path corresponding to the SRv6 policy on the first network device, the SID mapping table includes the correspondence between the first SID and the second SID, and the second SID is the identifier of the second network device in the first segment list.

该实现方式中,在第一网络设备获得第一业务报文之前,该方法还可以包括:第一网络设备获得第一消息,所述第一消息携带所述第一SRv6 policy,所述第一SRv6 policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;第一网络设备基于所述至少一个分段列表,获得SID映射表。In this implementation, before the first network device obtains the first service message, the method may also include: the first network device obtains a first message, the first message carries the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list; the first network device obtains the SID mapping table based on the at least one segment list.

对于第一网络设备为第一转发路径上的网络设备,且第一网络设备不是第一转发路径的尾节点的情况,所述第一网络设备根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,可以包括:第一网络设备从本地SID表中,确定与所述第一源IP地址中的所述第一SID匹配的第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。第一网络设备将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,可以包括:第一网络设备从所述SID映射表中,获得所述第一源IP地址关联的所述第二SID;第一网络设备将所述第一源IP地址中的所述第一SID更新为所述第二SID,获得所述第二业务报文,所述第二业务报文的所述第二源IP地址为所述第二SID。In the case where the first network device is a network device on the first forwarding path, and the first network device is not the tail node of the first forwarding path, the first network device determines the first output interface according to the first source Internet Protocol IP address of the first IPv6 header, which may include: the first network device determines the first output interface matching the first SID in the first source IP address from the local SID table, and the local SID table includes the correspondence between the first SID and the first output interface. The first network device updates the first source IP address in the first service message to the second source IP address to obtain the second service message, which may include: the first network device obtains the second SID associated with the first source IP address from the SID mapping table; the first network device updates the first SID in the first source IP address to the second SID to obtain the second service message, and the second source IP address of the second service message is the second SID.

对于第一网络设备为第一转发路径的头节点的情况,第一网络设获得第一业务报文,例如可以包括:第一网络设备接收第三业务报文,所述第三业务报文与所述第一SRv6policy匹配;第一网络设备在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SID,所述第一SID为所述第一分段列表中的第一个SID。For the case where the first network device is the head node of the first forwarding path, the first network device obtains the first service message, which may include, for example: the first network device receives the third service message, and the third service message matches the first SRv6policy; the first network device encapsulates the first IPv6 header on the third service message to obtain the first service message, the first source IP address of the first IPv6 header is the first SID, and the first SID is the first SID in the first segment list.

对于第一网络设备为第一转发路径的尾节点的情况,该方法例如还可以包括:第一网络设备获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;若确定所述第三源IP地址指示所述第一网络设备为所述第二SRv6policy的尾节点,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为第三SID,所述第三SID为所述第二SRv6 policy所包括的第二分段列表中所述第一网络设备的标识。For the case where the first network device is the tail node of the first forwarding path, the method may also include, for example: the first network device obtains a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header; if it is determined that the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, the third source IP address is a third SID, and the third SID is the identifier of the first network device in the second segment list included in the second SRv6 policy.

本申请实施例中,无论所述转发映射表为Sub-BSID映射表还是SID映射表,所述第三IPv6头的所述第三目的IP地址为业务SID,所述第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,例如可以包括:第一网络设备解除所述第四业务报文中与所述第二SRv6 policy相关的封装,获得第五业务报文;第一网络设备基于所述业务SID,转发所述第五业务报文。In an embodiment of the present application, regardless of whether the forwarding mapping table is a Sub-BSID mapping table or a SID mapping table, the third destination IP address of the third IPv6 header is a service SID, and the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, for example, it may include: the first network device removes the encapsulation related to the second SRv6 policy in the fourth service message to obtain the fifth service message; the first network device forwards the fifth service message based on the service SID.

对于OAM的ping场景,所述第一业务报文可以为ping报文,所述第一业务报文还可以包括ICMPv6头。该方法还可以包括:第一网络设备获得第六业务报文,所述第六业务报文包括所述ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一转发路径的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;第一网络设备按照所述第四IPv6头的目的IP地址转发所述第六业务报文。For the OAM ping scenario, the first service message may be a ping message, and the first service message may also include an ICMPv6 header. The method may also include: the first network device obtains a sixth service message, the sixth service message includes the ICMPv6 header and the fourth IPv6 header, the source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header, the destination IP address of the fourth IPv6 header corresponds to the last hop of the first forwarding path, and the sixth service message is a response message to the first service message; the first network device forwards the sixth service message according to the destination IP address of the fourth IPv6 header.

对于OAM的tracert场景,所述第一业务报文和所述第二业务报文均为tracert报文,所述第二业务报文的跳限度HL比所述第一业务报文中的跳限度HL小1。该方法还可以包括:第一网络设备获得第六业务报文,所述第六业务报文包括ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一业务报文的跳限度指示的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;第一网络设备按照所述第四IPv6头的目的IP地址转发所述第六业务报文。For the tracert scenario of OAM, the first service message and the second service message are both tracert messages, and the hop limit HL of the second service message is 1 less than the hop limit HL in the first service message. The method may also include: the first network device obtains a sixth service message, the sixth service message includes an ICMPv6 header and a fourth IPv6 header, the source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header, the destination IP address of the fourth IPv6 header corresponds to the last hop indicated by the hop limit of the first service message, and the sixth service message is a response message to the first service message; the first network device forwards the sixth service message according to the destination IP address of the fourth IPv6 header.

第二方面,本申请提供了一种报文处理方法,该方法应用于第一网络设备,该方法例如可以包括:第一网络设备接收第一消息,所述第一消息携带基于SRv6 policy,所述SRv6 policy包括至少一个分段列表,所述SRv6 policy与所述第一网络设备的本地定位符(locator)匹配;第一网络设备基于所述至少一个分段列表,获得转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。这样,SRv6 policy所指示的转发路径上的各网络设备,都基于接收到的SRv6policy建立并维护一张转发映射表,该转发映射表用于指导通过该SRv6 policy对应的转发路径转发的业务报文在该网络设备的处理,为后续基于本申请提供的SRv6 policy的简化封装和转发机制对业务报文的处理做好了准备,使得提高SRv6 policy场景下业务报文的传输效率,节约业务报文传输过程中对网络链路带宽的消耗成为可能。In the second aspect, the present application provides a message processing method, which is applied to a first network device. The method may include, for example: the first network device receives a first message, the first message carries an SRv6 policy, the SRv6 policy includes at least one segment list, and the SRv6 policy matches the local locator of the first network device; the first network device obtains a forwarding mapping table based on the at least one segment list, and the forwarding mapping table is used to guide the processing of the service message forwarded by the forwarding path corresponding to the SRv6 policy in the first network device. In this way, each network device on the forwarding path indicated by the SRv6 policy establishes and maintains a forwarding mapping table based on the received SRv6policy, and the forwarding mapping table is used to guide the processing of the service message forwarded by the forwarding path corresponding to the SRv6 policy in the network device, and is prepared for the subsequent processing of the service message based on the simplified encapsulation and forwarding mechanism of the SRv6 policy provided by the present application, so as to improve the transmission efficiency of the service message in the SRv6 policy scenario and save the consumption of the network link bandwidth during the transmission of the service message.

在一些可能的实现方式中,所述第一消息还可以包括BSID,所述BSID用于标识所述SRv6 policy,所述第一网络设备基于所述至少一个分段列表,获得转发映射表,可以包括:第一网络设备基于所述BSID和所述至少一个分段列表,获得Sub-BSID映射表,所述Sub-BSID映射表包括Sub-BSID和本地分段标识SID的对应关系,所述Sub-BSID与所述本地定位符匹配,所述Sub-BSID包括分段列表的标识和SL。In some possible implementations, the first message may also include a BSID, where the BSID is used to identify the SRv6 policy. The first network device obtains a forwarding mapping table based on the at least one segment list, which may include: the first network device obtains a Sub-BSID mapping table based on the BSID and the at least one segment list, where the Sub-BSID mapping table includes a correspondence between the Sub-BSID and a local segment identifier SID, the Sub-BSID matches the local locator, and the Sub-BSID includes an identifier of the segment list and an SL.

该实现方式中,所述SRv6 policy与所述第一网络设备的本地定位符匹配,可以包括所述SRv6 policy中的SID与所述本地定位符属于相同网段。In this implementation, the SRv6 policy matches the local locator of the first network device, which may include that the SID in the SRv6 policy and the local locator belong to the same network segment.

作为一个示例,所述BSID与所述本地定位符属于相同网段。那么,该方法还可以包括:第一网络设备将所述BSID保存在本地SID表,所述本地SID表包括所述第一网络设备的SID和处理动作的对应关系。As an example, the BSID and the local locator belong to the same network segment. Then, the method may further include: the first network device saves the BSID in a local SID table, wherein the local SID table includes a correspondence between the SID of the first network device and a processing action.

作为另一个示例,所述BSID与所述本地定位符不属于相同网段,但所述至少一个分段列表中的任意一个SID与所述本地定位符属于相同网段。As another example, the BSID and the local locator do not belong to the same network segment, but any one SID in the at least one segment list and the local locator belong to the same network segment.

对于所述第一网络设备基于所述BSID和所述至少一个分段列表,获得子绑定分段标识Sub-BSID映射表,例如可以包括:第一网络设备基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID;第一网络设备基于所确定的Sub-BSID和每个Sub-BSID对应的本地SID,获得所述Sub-BSID映射表。作为一个示例,所述第一网络设备基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID,可以包括:第一网络设备基于所述BSID计算所述至少一个分段列表中每个分段列表的各SID的Sub-BSID;第一网络设备从计算的所有Sub-BSID中筛选与所述本地定位符属于同一网段的Sub-BSID。作为另一个示例,所述第一网络设备基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID,可以包括:第一网络设备从所述至少一个分段列表中每个分段列表的各SID中筛选与所述本地定位符属于同一网段的SID;第一网络设备基于所述BSID计算所筛选出的SID对应的Sub-BSID。For the first network device to obtain the sub-binding segment identifier Sub-BSID mapping table based on the BSID and the at least one segment list, for example, it may include: the first network device determines the Sub-BSID that matches the local locator based on the BSID and the at least one segment list; the first network device obtains the Sub-BSID mapping table based on the determined Sub-BSID and the local SID corresponding to each Sub-BSID. As an example, the first network device determines the Sub-BSID that matches the local locator based on the BSID and the at least one segment list, which may include: the first network device calculates the Sub-BSID of each SID of each segment list in the at least one segment list based on the BSID; the first network device filters the Sub-BSID that belongs to the same network segment as the local locator from all calculated Sub-BSIDs. As another example, the first network device determines the Sub-BSID that matches the local locator based on the BSID and the at least one segment list, which may include: the first network device filters the SID belonging to the same network segment as the local locator from each SID in each segment list of the at least one segment list; the first network device calculates the Sub-BSID corresponding to the filtered SID based on the BSID.

其中,Sub-BSID可以包括Locator、Function和Arguments,所述Locator和Function与所述BSID一致,Arguments包括所述分段列表的标识和SL。The Sub-BSID may include a Locator, a Function, and Arguments, wherein the Locator and the Function are consistent with the BSID, and the Arguments include an identifier of the segment list and the SL.

在另一些可能的实现方式中,所述第一网络设备基于所述至少一个分段列表,获得转发映射表,可以包括:第一网络设备基于所述至少一个分段列表,获得SID映射表,所述SID映射表用于指导通过所述转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括第一SID和第二SID的对应关系,所述第一SID为第一分段列表中所述第一网络设备的标识,所述第二SID为所述第一分段列表中第二网络设备的标识,所述第二网络设备为所述第一网络设备在所述转发路径的下一跳设备,所述至少一个分段列表包括所述第一分段列表,所述第一分段列表与所述转发路径对应。In some other possible implementations, the first network device obtains a forwarding mapping table based on the at least one segment list, which may include: the first network device obtains a SID mapping table based on the at least one segment list, the SID mapping table is used to guide the processing of the service message transmitted through the forwarding path on the first network device, the SID mapping table includes a correspondence between a first SID and a second SID, the first SID is an identifier of the first network device in the first segment list, the second SID is an identifier of the second network device in the first segment list, the second network device is the next hop device of the first network device on the forwarding path, the at least one segment list includes the first segment list, and the first segment list corresponds to the forwarding path.

其中,所述第一消息可以为BGP SR policy报文。或者,所述第一消息也可以为PCEP报文。The first message may be a BGP SR policy message, or the first message may be a PCEP message.

本申请实施例中,在第一网络设备生成转发映射表后,还可以包括:第一网络设备获得第一业务报文,所述第一业务报文与所述SRv6 policy匹配,所述第一业务报文包括第一IPv6头;第一网络设备根据所述第一IPv6头的第一源IP地址确定第一出接口,所述第一出接口为所述第一网络设备在所述转发路径上的出接口;第一网络设备将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;第一网络设备从所述第一出接口向所述第二网络设备发送所述第二业务报文。如此,按照本申请提供的SRv6 policy的简化封装和转发机制对业务报文的处理,提高了SRv6 policy场景下业务报文的传输效率,节约了业务报文传输过程中对网络链路带宽的消耗。In an embodiment of the present application, after the first network device generates a forwarding mapping table, it may also include: the first network device obtains a first service message, the first service message matches the SRv6 policy, and the first service message includes a first IPv6 header; the first network device determines a first output interface according to the first source IP address of the first IPv6 header, and the first output interface is the output interface of the first network device on the forwarding path; the first network device updates the first source IP address in the first service message to a second source IP address, obtains a second service message, the first source IP address indicates the first network device, the second source IP address indicates the second network device, and the second network device is the next hop device of the first network device on the first forwarding path; the first network device sends the second service message from the first output interface to the second network device. In this way, the processing of service messages according to the simplified encapsulation and forwarding mechanism of the SRv6 policy provided in the present application improves the transmission efficiency of service messages in the SRv6 policy scenario, and saves the consumption of network link bandwidth during the transmission of service messages.

第三方面,本申请还提供了一种报文处理方法,应用于控制实体,所述方法可以包括:确定SRv6 policy,所述SRv6 policy包括至少一个分段列表;发送第一消息,所述第一消息包括所述SRv6 policy,所述第一消息用于指示本地定位符与所述SRv6 policy匹配的第一网络设备基于所述至少一个分段列表生成转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。这样,控制实体发送的第一消息被与SRv6 policy相关的网络设备处理,而不是仅被SRv6 policy的头节点处理,使得本申请提供的SRv6 policy的简化封装和转发机制能够得以实施,为后续按照本申请提供的方法对业务报文的处理做好了准备,使得提高SRv6 policy场景下业务报文的传输效率,节约业务报文传输过程中对网络链路带宽的消耗成为可能。In the third aspect, the present application also provides a message processing method, which is applied to a control entity, and the method may include: determining an SRv6 policy, wherein the SRv6 policy includes at least one segment list; sending a first message, wherein the first message includes the SRv6 policy, and the first message is used to indicate that a first network device whose local locator matches the SRv6 policy generates a forwarding mapping table based on the at least one segment list, and the forwarding mapping table is used to guide the processing of the service message forwarded through the forwarding path corresponding to the SRv6 policy in the first network device. In this way, the first message sent by the control entity is processed by the network device related to the SRv6 policy, rather than only by the head node of the SRv6 policy, so that the simplified encapsulation and forwarding mechanism of the SRv6 policy provided by the present application can be implemented, and preparations are made for the subsequent processing of the service message according to the method provided by the present application, so that it is possible to improve the transmission efficiency of the service message in the SRv6 policy scenario and save the consumption of network link bandwidth during the transmission of the service message.

作为一个示例,控制实体发送第一消息,可以包括:控制实体向所述转发路径经过的所述第一网络设备发送所述第一消息,所述转发路径经过的所有第一网络设备与所述控制实体均为边界网关协议BGP邻居。As an example, the control entity sending the first message may include: the control entity sending the first message to the first network devices through which the forwarding path passes, and all the first network devices through which the forwarding path passes and the control entity are Border Gateway Protocol BGP neighbors.

作为另一个示例,控制实体发送第一消息,也可以包括:控制实体通过RR向所述转发路径经过的所述第一网络设备发送所述第一消息。As another example, the controlling entity sending the first message may also include: the controlling entity sending the first message to the first network device through which the forwarding path passes through, through the RR.

上述示例中,所述第一消息可以为BGP SR policy报文。In the above example, the first message may be a BGP SR policy message.

在另一些实现方式中,所述第一消息也可以为PCEP报文。In some other implementations, the first message may also be a PCEP message.

其中,所述第一消息还可以包括BSID,所述BSID用于标识所述SRv6 policy。The first message may further include a BSID, where the BSID is used to identify the SRv6 policy.

第四方面,本申请还提供了一种报文处理装置,应用于第一网络设备,所述装置可以包括:获得单元、处理单元和发送单元。其中,获得单元,用于获得第一业务报文,所述第一业务报文与第一基于第六版互联网协议的分段路由策略SRv6 policy匹配,所述第一业务报文包括第一第六版互联网协议IPv6头;处理单元,用于根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,所述第一出接口为所述第一网络设备在第一转发路径上的出接口,所述第一SRv6 policy指示所述第一转发路径;所述处理单元,还用于将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;发送单元,用于从所述第一出接口向所述第二网络设备发送所述第二业务报文。In the fourth aspect, the present application also provides a message processing device, which is applied to a first network device, and the device may include: an obtaining unit, a processing unit, and a sending unit. Among them, the obtaining unit is used to obtain a first service message, the first service message matches the first segment routing policy SRv6 policy based on the sixth version of the Internet Protocol, and the first service message includes a first sixth version of the Internet Protocol IPv6 header; the processing unit is used to determine the first output interface according to the first source Internet Protocol IP address of the first IPv6 header, the first output interface is the output interface of the first network device on the first forwarding path, and the first SRv6 policy indicates the first forwarding path; the processing unit is also used to update the first source IP address in the first service message to a second source IP address, and obtain a second service message, the first source IP address indicates the first network device, the second source IP address indicates the second network device, and the second network device is the next hop device of the first network device on the first forwarding path; the sending unit is used to send the second service message from the first output interface to the second network device.

在一些实现方式中,所述处理单元,还用于:在所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口之前,确定所述第一源IP地址与转发映射表匹配。In some implementations, the processing unit is further used to: before determining the first outbound interface based on the first source Internet Protocol IP address of the first IPv6 header, determine that the first source IP address matches a forwarding mapping table.

在一些实现方式中,所述处理单元,还用于:若确定所述第一源IP地址与所述转发映射表不匹配,则,根据所述第一IPv6头中的第一目的IP地址处理所述第一业务报文。In some implementations, the processing unit is further used to: if it is determined that the first source IP address does not match the forwarding mapping table, then, process the first service message according to the first destination IP address in the first IPv6 header.

在一些实现方式中,所述转发映射表为子绑定分段标识Sub-BSID映射表,所述第一源IP地址为所述第一网络设备的第一Sub-BSID,所述第一Sub-BSID包括第一分段列表的标识和段剩余SL,所述第一SRv6 policy包括所述第一分段列表,所述SL指示所述第一网络设备在所述第一分段列表中的位置,所述Sub-BSID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述Sub-BSID映射表包括所述第一Sub-BSID和本地的第一分段标识SID的对应关系,所述第一SID与所述第一出接口对应。In some implementations, the forwarding mapping table is a sub-binding segment identifier Sub-BSID mapping table, the first source IP address is the first Sub-BSID of the first network device, the first Sub-BSID includes an identifier of a first segment list and a segment remaining SL, the first SRv6 policy includes the first segment list, the SL indicates the position of the first network device in the first segment list, the Sub-BSID mapping table is used to guide the processing of service packets transmitted through the forwarding path corresponding to the SRv6 policy on the first network device, the Sub-BSID mapping table includes a correspondence between the first Sub-BSID and a local first segment identifier SID, and the first SID corresponds to the first output interface.

在一些实现方式中,所述装置还包括:接收单元,所述接收单元,用于获得第一消息,所述第一消息携带所述第一SRv6 policy,所述第一SRv6 policy包括第一绑定分段标识BSID,所述第一BSID用于标识所述第一SRv6 policy,所述第一SRv6 policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;那么,所述处理单元,还用于基于所述第一BSID和所述至少一个分段列表,获得所述Sub-BSID映射表。In some implementations, the device also includes: a receiving unit, the receiving unit is used to obtain a first message, the first message carries the first SRv6 policy, the first SRv6 policy includes a first binding segment identifier BSID, the first BSID is used to identify the first SRv6 policy, the first SRv6 policy includes at least one segment list, the at least one segment list includes the first segment list; then, the processing unit is also used to obtain the Sub-BSID mapping table based on the first BSID and the at least one segment list.

在一些实现方式中,所述处理单元,具体用于:从所述Sub-BSID映射表中,确定与所述第一源IP地址中的所述第一Sub-BSID匹配的所述第一SID;从本地SID表中,确定与所述第一SID匹配的所述第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。In some implementations, the processing unit is specifically used to: determine the first SID that matches the first Sub-BSID in the first source IP address from the Sub-BSID mapping table; determine the first output interface that matches the first SID from a local SID table, and the local SID table includes a correspondence between the first SID and the first output interface.

在一些实现方式中,所述处理单元,具体用于:更新所述第一源IP地址中SL字段的值,获得所述第二业务报文,所述第二业务报文中的第二源IP地址中SL字段的值指示所述第二网络设备在所述第一分段列表中的位置,所述第二源IP地址为所述第二网络设备的第二Sub-BSID。In some implementations, the processing unit is specifically used to: update the value of the SL field in the first source IP address to obtain the second service message, the value of the SL field in the second source IP address in the second service message indicates the position of the second network device in the first segment list, and the second source IP address is the second Sub-BSID of the second network device.

在一些实现方式中,所述获得单元,具体用于:接收第三业务报文,所述第三业务报文与所述第一SRv6 policy匹配;在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SRv6 policy中所述第一SID对应的所述第一Sub-BSID,所述第一SID为所述第一分段列表中的第一个SID。In some implementations, the obtaining unit is specifically used to: receive a third service message, the third service message matches the first SRv6 policy; encapsulate the first IPv6 header on the third service message to obtain the first service message, the first source IP address of the first IPv6 header is the first Sub-BSID corresponding to the first SID in the first SRv6 policy, and the first SID is the first SID in the first segment list.

在一些实现方式中,所述获得单元,还用于:获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;所述处理单元,还用于:若确定所述第三IPv6地址中的第三源IP地址与所述Sub-BSID映射表匹配,且所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为所述第一网络设备的第三Sub-BSID,所述第三Sub-BSID包括第二分段列表的标识和SL,所述第二SRv6 policy包括所述第二分段列表,所述SL指示所述第一网络设备在所述第二分段列表中的位置。In some implementations, the obtaining unit is further used to: obtain a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header; the processing unit is further used to: if it is determined that the third source IP address in the third IPv6 address matches the Sub-BSID mapping table, and the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, process the fourth service message according to the third destination IP address in the third IPv6 header, the third source IP address is the third Sub-BSID of the first network device, the third Sub-BSID includes an identifier and SL of a second segment list, the second SRv6 policy includes the second segment list, and the SL indicates the position of the first network device in the second segment list.

在一些实现方式中,所述第一Sub-BSID包括定位符、功能和参数,所述定位符和所述功能与第一BSID一致,所述参数包括所述第一分段列表的标识和SL,所述第一BSID用于标识所述第一SRv6 policy。In some implementations, the first Sub-BSID includes a locator, a function, and a parameter, the locator and the function are consistent with the first BSID, the parameter includes an identifier and a SL of the first segment list, and the first BSID is used to identify the first SRv6 policy.

在一些实现方式中,所述转发映射表为SID映射表,所述第一源IP地址为所述第一网络设备的第一分段标识SID,所述第一SID为所述第一SRv6 policy所包括的第一分段列表中所述第一网络设备的标识,所述SID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括所述第一SID和第二SID的对应关系,所述第二SID为所述第一分段列表中所述第二网络设备的标识。In some implementations, the forwarding mapping table is a SID mapping table, the first source IP address is a first segment identifier SID of the first network device, the first SID is an identifier of the first network device in a first segment list included in the first SRv6 policy, the SID mapping table is used to guide the processing of service packets transmitted through a forwarding path corresponding to the SRv6 policy on the first network device, the SID mapping table includes a correspondence between the first SID and the second SID, and the second SID is an identifier of the second network device in the first segment list.

在一些实现方式中,所述获得单元,还用于:获得第一消息,所述第一消息携带所述第一SRv6 policy,所述第一SRv6 policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;处理单元,还用于:基于所述至少一个分段列表,获得SID映射表。In some implementations, the obtaining unit is further used to: obtain a first message, the first message carries the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list; the processing unit is further used to: obtain a SID mapping table based on the at least one segment list.

在一些实现方式中,所述处理单元,具体用于:从本地SID表中,确定与所述第一源IP地址中的所述第一SID匹配的第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。In some implementations, the processing unit is specifically configured to: determine, from a local SID table, a first outbound interface that matches the first SID in the first source IP address, the local SID table including a correspondence between the first SID and the first outbound interface.

在一些实现方式中,所述处理单元,具体用于:从所述SID映射表中,获得所述第一源IP地址关联的所述第二SID;将所述第一源IP地址中的所述第一SID更新为所述第二SID,获得所述第二业务报文,所述第二业务报文的所述第二源IP地址为所述第二SID。In some implementations, the processing unit is specifically used to: obtain the second SID associated with the first source IP address from the SID mapping table; update the first SID in the first source IP address to the second SID, and obtain the second service message, wherein the second source IP address of the second service message is the second SID.

在一些实现方式中,所述获得单元,具体用于:接收第三业务报文,所述第三业务报文与所述第一SRv6 policy匹配;在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SID,所述第一SID为所述第一分段列表中的第一个SID。In some implementations, the obtaining unit is specifically used to: receive a third business message, the third business message matches the first SRv6 policy; encapsulate the first IPv6 header on the third business message to obtain the first business message, the first source IP address of the first IPv6 header is the first SID, and the first SID is the first SID in the first segment list.

在一些实现方式中,所述获得单元,具体用于:获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;所述处理单元,具体用于:若确定所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为第三SID,所述第三SID为所述第二SRv6 policy所包括的第二分段列表中所述第一网络设备的标识。In some implementations, the obtaining unit is specifically used to: obtain a fourth business message, the fourth business message matches the second SRv6 policy, and the fourth business message includes a third IPv6 header; the processing unit is specifically used to: if it is determined that the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, process the fourth business message according to the third destination IP address in the third IPv6 header, the third source IP address is a third SID, and the third SID is the identifier of the first network device in the second segment list included in the second SRv6 policy.

在一些实现方式中,所述第三IPv6头的所述第三目的IP地址为业务SID,所述处理单元,具体用于:解除所述第四业务报文中与所述第二SRv6 policy相关的封装,获得第五业务报文;基于所述业务SID,处理所述第五业务报文。In some implementations, the third destination IP address of the third IPv6 header is a service SID, and the processing unit is specifically used to: remove the encapsulation related to the second SRv6 policy in the fourth service message to obtain a fifth service message; and process the fifth service message based on the service SID.

在一些实现方式中,所述第一业务报文为ping报文,所述第一业务报文还包括互联网控制信息协议版本六ICMPv6头。In some implementations, the first service message is a ping message, and the first service message also includes an Internet Control Message Protocol version 6 ICMPv6 header.

作为一个示例,所述获得单元,还用于:获得第六业务报文,所述第六业务报文包括所述ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一转发路径的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;发送单元,还用于:按照所述第四IPv6头的目的IP地址转发所述第六业务报文。As an example, the obtaining unit is also used to: obtain a sixth business message, the sixth business message includes the ICMPv6 header and the fourth IPv6 header, the source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header, the destination IP address of the fourth IPv6 header corresponds to the last hop of the first forwarding path, and the sixth business message is a response message to the first business message; the sending unit is also used to: forward the sixth business message according to the destination IP address of the fourth IPv6 header.

在另一些实现方式中,所述第一业务报文和所述第二业务报文均为tracert报文,所述第二业务报文的跳限度比所述第一业务报文中的跳限度小1。In some other implementations, both the first service message and the second service message are tracert messages, and a hop limit of the second service message is 1 less than a hop limit in the first service message.

作为一个示例,所述获得单元,还用于:获得第六业务报文,所述第六业务报文包括ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一业务报文的跳限度指示的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;发送单元,还用于:按照所述第四IPv6头的目的IP地址转发所述第六业务报文。As an example, the obtaining unit is also used to: obtain a sixth business message, the sixth business message includes an ICMPv6 header and a fourth IPv6 header, the source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header, the destination IP address of the fourth IPv6 header corresponds to the last hop indicated by the hop limit of the first business message, and the sixth business message is a response message to the first business message; the sending unit is also used to: forward the sixth business message according to the destination IP address of the fourth IPv6 header.

需要说明的是,本申请提供的装置的具体实现方式以及达到的技术效果,可以参见第一方面提供的方法。It should be noted that the specific implementation method and technical effect achieved by the device provided in this application can refer to the method provided in the first aspect.

第五方面,本申请还提供了一种报文处理装置,应用于第一网络设备,所述装置可以包括:接收单元和处理单元。其中,接收单元,用于接收第一消息,所述第一消息携带基于第六版互联网协议的分段路由策略SRv6 policy,所述SRv6 policy包括至少一个分段列表,所述SRv6 policy与所述第一网络设备的本地定位符匹配;处理单元,用于基于所述至少一个分段列表,获得转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。In a fifth aspect, the present application also provides a message processing device, which is applied to a first network device, and the device may include: a receiving unit and a processing unit. The receiving unit is used to receive a first message, the first message carries a segment routing policy SRv6 policy based on the sixth version of the Internet Protocol, the SRv6 policy includes at least one segment list, and the SRv6 policy matches the local locator of the first network device; the processing unit is used to obtain a forwarding mapping table based on the at least one segment list, and the forwarding mapping table is used to guide the processing of the service message forwarded by the forwarding path corresponding to the SRv6 policy on the first network device.

在一些实现方式中,所述第一消息还包括绑定分段标识BSID,所述BSID用于标识所述SRv6 policy,所述处理单元,具体用于:基于所述BSID和所述至少一个分段列表,获得子绑定分段标识Sub-BSID映射表,所述Sub-BSID映射表包括Sub-BSID和本地分段标识SID的对应关系,所述Sub-BSID与所述本地定位符匹配,所述Sub-BSID包括分段列表的标识和段剩余SL。In some implementations, the first message also includes a binding segment identifier BSID, and the BSID is used to identify the SRv6 policy. The processing unit is specifically used to: obtain a sub-binding segment identifier Sub-BSID mapping table based on the BSID and the at least one segment list, and the Sub-BSID mapping table includes a correspondence between the Sub-BSID and the local segment identifier SID, the Sub-BSID matches the local locator, and the Sub-BSID includes an identifier of the segment list and a segment remainder SL.

在一些实现方式中,所述SRv6 policy与所述第一网络设备的本地定位符匹配包括所述SRv6 policy中的SID与所述本地定位符属于相同网段。In some implementations, the SRv6 policy matches the local locator of the first network device including that the SID in the SRv6 policy and the local locator belong to the same network segment.

作为一个示例,所述BSID与所述本地定位符属于相同网段。那么,所述处理单元,还用于:将所述BSID保存在本地SID表,所述本地SID表包括所述第一网络设备的SID和处理动作的对应关系。As an example, the BSID and the local locator belong to the same network segment. Then, the processing unit is further configured to: store the BSID in a local SID table, wherein the local SID table includes a correspondence between the SID of the first network device and a processing action.

作为另一个示例,所述BSID与所述本地定位符不属于相同网段,但所述至少一个分段列表中的任意一个SID与所述本地定位符属于相同网段。As another example, the BSID and the local locator do not belong to the same network segment, but any one SID in the at least one segment list and the local locator belong to the same network segment.

在一些实现方式中,处理单元,具体用于:基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID;基于所确定的Sub-BSID和每个Sub-BSID对应的本地SID,获得所述Sub-BSID映射表。In some implementations, the processing unit is specifically configured to: determine a Sub-BSID matching the local locator based on the BSID and the at least one segment list; and obtain the Sub-BSID mapping table based on the determined Sub-BSID and a local SID corresponding to each Sub-BSID.

作为一个示例,所述处理单元,具体用于:基于所述BSID计算所述至少一个分段列表中每个分段列表的各SID的Sub-BSID;从计算的所有Sub-BSID中筛选与所述本地定位符属于同一网段的Sub-BSID。As an example, the processing unit is specifically configured to: calculate the Sub-BSID of each SID in each segment list in the at least one segment list based on the BSID; and filter the Sub-BSID belonging to the same network segment as the local locator from all calculated Sub-BSIDs.

作为另一个示例,所述处理单元,具体用于:从所述至少一个分段列表中每个分段列表的各SID中筛选与所述本地定位符属于同一网段的SID;基于所述BSID计算所筛选出的SID对应的Sub-BSID。As another example, the processing unit is specifically configured to: filter SIDs belonging to the same network segment as the local locator from the SIDs in each segment list in the at least one segment list; and calculate the Sub-BSID corresponding to the filtered SID based on the BSID.

在一些实现方式中,所述Sub-BSID包括定位符、功能和参数,所述定位符和所述功能与所述BSID一致,所述参数包括分段列表的标识和SL。In some implementations, the Sub-BSID includes a locator, a function, and parameters, the locator and the function are consistent with the BSID, and the parameters include an identifier of a segment list and a SL.

在另一些实现方式中,所述处理单元,具体用于:基于所述至少一个分段列表,获得SID映射表,所述SID映射表用于指导通过所述转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括第一SID和第二SID的对应关系,所述第一SID为第一分段列表中所述第一网络设备的标识,所述第二SID为所述第一分段列表中第二网络设备的标识,所述第二网络设备为所述第一网络设备在所述转发路径的下一跳设备,所述至少一个分段列表包括所述第一分段列表,所述第一分段列表与所述转发路径对应。In some other implementations, the processing unit is specifically used to: obtain a SID mapping table based on the at least one segment list, the SID mapping table is used to guide the processing of the service message transmitted through the forwarding path on the first network device, the SID mapping table includes a correspondence between a first SID and a second SID, the first SID is an identifier of the first network device in the first segment list, the second SID is an identifier of the second network device in the first segment list, the second network device is a next-hop device of the first network device on the forwarding path, the at least one segment list includes the first segment list, and the first segment list corresponds to the forwarding path.

在一些实现方式中,所述第一消息为边界网关协议BGP SR policy报文。In some implementations, the first message is a Border Gateway Protocol BGP SR policy message.

在一些实现方式中,所述第一消息为路径计算单元协议PCEP报文。In some implementations, the first message is a Path Computation Element Protocol (PCEP) message.

在一些实现方式中,所述装置还包括获得单元和发送单元,所述获得单元,用于获得第一业务报文,所述第一业务报文与所述SRv6 policy匹配,所述第一业务报文包括第一IPv6头;所述处理单元,还用于根据所述第一IPv6头的第一源IP地址确定第一出接口,所述第一出接口为所述第一网络设备在所述转发路径上的出接口;所述处理单元,还用于将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;所述发送单元,用于从所述第一出接口向所述第二网络设备发送所述第二业务报文。In some implementations, the device also includes an obtaining unit and a sending unit, the obtaining unit is used to obtain a first service message, the first service message matches the SRv6 policy, and the first service message includes a first IPv6 header; the processing unit is also used to determine a first output interface based on a first source IP address of the first IPv6 header, the first output interface is the output interface of the first network device on the forwarding path; the processing unit is also used to update the first source IP address in the first service message to a second source IP address to obtain a second service message, the first source IP address indicates the first network device, the second source IP address indicates the second network device, and the second network device is the next hop device of the first network device on the first forwarding path; the sending unit is used to send the second service message from the first output interface to the second network device.

需要说明的是,本申请提供的装置的具体实现方式以及达到的技术效果,可以参见第二方面提供的方法。It should be noted that the specific implementation method and technical effect achieved by the device provided in this application can refer to the method provided in the second aspect.

第六方面,本申请还提供了一种报文处理装置,应用于控制实体,所述装置可以包括:处理单元和发送单元。其中,处理单元,用于确定SRv6 policy,所述SRv6 policy包括至少一个分段列表;发送单元,用于发送第一消息,所述第一消息包括所述SRv6 policy,所述第一消息用于指示本地定位符与所述SRv6 policy匹配的第一网络设备基于所述至少一个分段列表生成转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。In a sixth aspect, the present application also provides a message processing device, which is applied to a control entity, and the device may include: a processing unit and a sending unit. The processing unit is used to determine an SRv6 policy, and the SRv6 policy includes at least one segment list; the sending unit is used to send a first message, and the first message includes the SRv6 policy, and the first message is used to indicate that a first network device whose local locator matches the SRv6 policy generates a forwarding mapping table based on the at least one segment list, and the forwarding mapping table is used to guide the processing of service messages forwarded through the forwarding path corresponding to the SRv6 policy on the first network device.

作为一个示例,发送单元,具体用于:向所述转发路径经过的所述第一网络设备发送所述第一消息,所述转发路径经过的所有第一网络设备与所述控制实体均为边界网关协议BGP邻居。As an example, the sending unit is specifically configured to: send the first message to the first network device through which the forwarding path passes, and all the first network devices through which the forwarding path passes and the control entity are Border Gateway Protocol BGP neighbors.

作为另一个示例,发送单元,具体用于:通过RR向所述转发路径经过的所述第一网络设备发送所述第一消息。As another example, the sending unit is specifically configured to: send the first message to the first network device through which the forwarding path passes through RR.

上述示例中,所述第一消息可以为BGP SR policy报文。In the above example, the first message may be a BGP SR policy message.

在另一些实现方式中,所述第一消息也可以为PCEP报文。In some other implementations, the first message may also be a PCEP message.

其中,所述第一消息还可以包括BSID,所述BSID用于标识所述SRv6 policy。The first message may further include a BSID, where the BSID is used to identify the SRv6 policy.

需要说明的是,本申请提供的装置的具体实现方式以及达到的技术效果,可以参见第三方面提供的方法。It should be noted that the specific implementation method and technical effect achieved by the device provided in this application can refer to the method provided in the third aspect.

第七方面,本申请提供一种网络设备,所述网络设备包括处理器和存储器,存储器用于存储指令或程序代码,处理器用于从存储器中调用并运行所述指令或程序代码,以执行第一方面、第一方面的任意一种可能的实现、第二方面或第二方面的任意一种可能的实现中的所述方法。In a seventh aspect, the present application provides a network device, comprising a processor and a memory, the memory being used to store instructions or program codes, and the processor being used to call and run the instructions or program codes from the memory to execute the method in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.

第八方面,本申请提供一种控制实体,所述控制实体包括处理器和存储器,存储器用于存储指令或程序代码,处理器用于从存储器中调用并运行所述指令或程序代码,以执行第三方面或第三方面的任意一种可能的实现中的所述方法。In an eighth aspect, the present application provides a control entity, comprising a processor and a memory, the memory being used to store instructions or program codes, and the processor being used to call and run the instructions or program codes from the memory to execute the method in the third aspect or any possible implementation of the third aspect.

第九方面,本申请提供一种通信系统,该通信系统可以包括第一网络设备和控制实体;其中,控制实体,用于执行第三方面或第三方面的任意一种可能的实现中所述的方法;第一网络设备,用于执行第一方面、第一方面的任意一种可能的实现、第二方面或第二方面的任意一种可能的实现中的所述方法。其中,所述第一网络设备可以是上述第四方面或第五方面提供的报文处理装置,所述控制实体可以是上述第六方面提供的报文处理装置。或者,第一网络设备可以是上述第七方面提供的网络设备,控制实体可以是上述第八方面提供的控制实体。In a ninth aspect, the present application provides a communication system, which may include a first network device and a control entity; wherein the control entity is used to execute the method described in the third aspect or any possible implementation of the third aspect; the first network device is used to execute the method described in the first aspect, any possible implementation of the first aspect, the second aspect or any possible implementation of the second aspect. The first network device may be the message processing device provided in the fourth aspect or the fifth aspect, and the control entity may be the message processing device provided in the sixth aspect. Alternatively, the first network device may be the network device provided in the seventh aspect, and the control entity may be the control entity provided in the eighth aspect.

第十方面,本申请提供一种计算机可读存储介质,其特征在于,包括指令、程序或代码,当其在计算机上执行时,使得所述计算机执行第一方面、第一方面的任意一种可能的实现中、第二方面、第二方面的任意一种可能的实现中、第三方面、第三方面的任意一种可能的实现中的所述方法。In the tenth aspect, the present application provides a computer-readable storage medium, characterized in that it includes instructions, programs or codes, which, when executed on a computer, enable the computer to execute the method in the first aspect, any possible implementation of the first aspect, the second aspect, any possible implementation of the second aspect, the third aspect, and any possible implementation of the third aspect.

第十一方面,本申请提供一种计算机程序产品,当所述计算机程序产品在网络设备上运行时,使得所述网络设备执行第一方面、第一方面的任意一种可能的实现中、第二方面、第二方面的任意一种可能的实现中、第三方面、第三方面的任意一种可能的实现中的所述方法。In the eleventh aspect, the present application provides a computer program product. When the computer program product runs on a network device, the network device executes the method in the first aspect, any possible implementation of the first aspect, the second aspect, any possible implementation of the second aspect, the third aspect, and any possible implementation of the third aspect.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

图1为本申请实施例中的一种网络场景的示意图;FIG1 is a schematic diagram of a network scenario in an embodiment of the present application;

图2为本申请实施例提供的一种网络设备接收到SRv6 policy后的处理流程示意图;FIG2 is a schematic diagram of a processing flow after a network device receives an SRv6 policy according to an embodiment of the present application;

图3为本申请实施例提供的一种SRv6的传统封装和简化封装的区别示意图;FIG3 is a schematic diagram showing the difference between a traditional encapsulation and a simplified encapsulation of SRv6 provided in an embodiment of the present application;

图4为本申请实施例提供的一种对业务报文的处理流程示意图;FIG4 is a schematic diagram of a process flow for processing a service message provided in an embodiment of the present application;

图5为本申请实施例提供的一种Sub-BSID的结构示意图;FIG5 is a schematic diagram of the structure of a Sub-BSID provided in an embodiment of the present application;

图6为本申请实施例提供的图1所示的场景下一种报文处理方法的流程示意图;FIG6 is a flow chart of a message processing method in the scenario shown in FIG1 according to an embodiment of the present application;

图7为本申请实施例提供的图1所示的场景下另一种报文处理方法的流程示意图;FIG7 is a schematic flow chart of another message processing method in the scenario shown in FIG1 provided in an embodiment of the present application;

图8为本申请实施例提供的一种报文处理方法100的流程示意图;FIG8 is a flow chart of a message processing method 100 provided in an embodiment of the present application;

图9为本申请实施例提供的报文处理方法在ping场景的示意图;FIG9 is a schematic diagram of a message processing method provided in an embodiment of the present application in a ping scenario;

图10为本申请实施例提供的报文处理方法在tracert场景的示意图;FIG10 is a schematic diagram of a message processing method provided in an embodiment of the present application in a tracert scenario;

图11为本申请中一种报文处理装置1100的结构示意图;FIG11 is a schematic structural diagram of a message processing device 1100 in the present application;

图12为本申请中另一种报文处理装置1200的结构示意图;FIG12 is a schematic structural diagram of another message processing device 1200 in the present application;

图13为本申请中又一种报文处理装置1300的结构示意图;FIG13 is a schematic structural diagram of another message processing device 1300 in the present application;

图14为本申请中一种网络设备1400的结构示意图;FIG14 is a schematic diagram of the structure of a network device 1400 in the present application;

图15为本申请中另一种网络设备1500的结构示意图;FIG15 is a schematic diagram of the structure of another network device 1500 in the present application;

图16为本申请中一种通信系统1600的结构示意图。FIG16 is a schematic diagram of the structure of a communication system 1600 in the present application.

具体实施方式DETAILED DESCRIPTION

SRv6是基于源路由理念而设计的在网络上转发互联网协议(Internet Protocol,IP)业务报文的一种协议,SRv6 policy是在SRv6技术基础上发展的一种隧道引流技术。SRv6 policy中可以包括多条候选路径(Candidate Path),每条Candidate Path可以关联多个segment list,每个segment list包括多个Segment,每个Segment即为一个SID。SRv6policy的封装结构例如可以如下:SRv6 is a protocol designed based on source routing to forward Internet Protocol (IP) service packets on the network. SRv6 policy is a tunnel diversion technology developed based on SRv6 technology. SRv6 policy can include multiple candidate paths, each candidate path can be associated with multiple segment lists, each segment list includes multiple segments, and each segment is a SID. The encapsulation structure of SRv6policy can be as follows:

其中,Distinguisher为承载该SRv6 policy的网络层可达信息(Network LayerReachability Information,NLRI)的标识,用于指示该NRLI承载的内容为SRv6 policy。Preference指示Candidate Path的优先权,SRv6 policy中的多条Candidate Path中,以优先权最高的Candidate Path作为该SRv6 policy的工作路径,该SRv6 policy的其他Candidate Path为该工作路径的备用路径。Weight指示Candidate Path中segment list的权重,作为工作路径的Candidate Path的至少一个segment list之间可以基于segmentlist的权重进行负载分担。Among them, Distinguisher is the identifier of the Network Layer Reachability Information (NLRI) carrying the SRv6 policy, which is used to indicate that the content carried by the NRLI is the SRv6 policy. Preference indicates the priority of the Candidate Path. Among the multiple Candidate Paths in the SRv6 policy, the Candidate Path with the highest priority is used as the working path of the SRv6 policy, and the other Candidate Paths of the SRv6 policy are the backup paths of the working path. Weight indicates the weight of the segment list in the Candidate Path. At least one segment list of the Candidate Path as the working path can share load based on the weight of the segmentlist.

目前,SRv6 policy所指示的转发路径的头节点在获得该SRv6 policy后,安装该SRv6 policy所指示的转发路径。在该头节点接收到业务报文时,如果该头节点确定该业务报文的目的地址与该SRv6 policy匹配,那么,在该业务报文中插入SRH,该SRH中包括一个显式的segment list,如此,SRv6 policy所指示的转发路径的中间节点就能够通过所接收的业务报文中的SRH来完成逐跳转发,例如,中间节点通过识别并不断更新所接收的业务报文的目的地址和用于指示segment list中SID的偏移地址(如剩余段(Segment Left,SL)的值)的操作,完成业务报文在SRv6 policy所指示的转发路径中转发。At present, the head node of the forwarding path indicated by the SRv6 policy installs the forwarding path indicated by the SRv6 policy after obtaining the SRv6 policy. When the head node receives a service message, if the head node determines that the destination address of the service message matches the SRv6 policy, then an SRH is inserted into the service message, and the SRH includes an explicit segment list. In this way, the intermediate node of the forwarding path indicated by the SRv6 policy can complete hop-by-hop forwarding through the SRH in the received service message. For example, the intermediate node completes the forwarding of the service message in the forwarding path indicated by the SRv6 policy by identifying and continuously updating the destination address of the received service message and the offset address used to indicate the SID in the segment list (such as the value of the remaining segment (Segment Left, SL)).

可见,业务报文在采用SRv6 policy进行转发时,需要通过SRH携带路径信息,该路径信息即SRH中的segment list,segment list中每个路径节点以一个128比特长度的IPv6地址表示。SRv6 policy所指示的转发路径每增加一个节点,在业务报文封装时就需要增加128比特的封装开销,因此,SRv6 policy所指示的转发路径越长,经过SRv6 policy转发的业务报文需要封装的路径信息就越大,业务报文中的有效载荷占业务报文总长度的比例就越小,业务报文的传输效率就越低,造成网络链路带宽的浪费。It can be seen that when a service message is forwarded using SRv6 policy, it needs to carry path information through SRH. The path information is the segment list in SRH. Each path node in the segment list is represented by a 128-bit IPv6 address. For each additional node in the forwarding path indicated by SRv6 policy, 128 bits of encapsulation overhead needs to be added when encapsulating the service message. Therefore, the longer the forwarding path indicated by SRv6 policy, the larger the path information that needs to be encapsulated in the service message forwarded by SRv6 policy, the smaller the proportion of the effective load in the service message to the total length of the service message, and the lower the transmission efficiency of the service message, resulting in a waste of network link bandwidth.

基于此,本申请实施例提供了一种SRv6 policy的简化封装和转发机制,能够使业务报文在迭代SRv6 policy隧道转发时无需封装SRH也可以能够按照SRv6 policy所指示的转发路径转发,从而解决了业务报文在进行SRv6隧道封装时造成的传输效率较低的问题。具体实现时,本申请实施例提供的报文处理方法中,SRv6 policy所指示的转发路径上的各网络设备,都基于接收到的SRv6 policy建立并维护一张转发映射表,该转发映射表用于指导通过该SRv6 policy对应的转发路径转发的业务报文在该网络设备的处理;对于经过该SRv6 policy所指示的转发路径转发的业务报文,通过IPv6头的源IP地址携带相应的路径信息,网络设备接收到业务报文后,通过转发映射表以及业务报文中IPv6头的源IP地址即可完成对业务报文的处理,使得业务报文能够在SRv6 policy所指示的转发路径中准确的完成传输。这样,不再需要为通过SRv6 policy所指示的转发路径传输的业务报文封装SRH,也不再需要将封装了SRH的业务报文在SRv6 policy所指示的转发路径包括的各网络设备之间传输,提高了SRv6 policy场景下业务报文的传输效率,也节约了业务报文传输过程中对网络链路带宽的消耗。Based on this, the embodiment of the present application provides a simplified encapsulation and forwarding mechanism of SRv6 policy, which enables service messages to be forwarded according to the forwarding path indicated by SRv6 policy without encapsulating SRH when iterating SRv6 policy tunnel forwarding, thereby solving the problem of low transmission efficiency caused by service messages when performing SRv6 tunnel encapsulation. In specific implementation, in the message processing method provided by the embodiment of the present application, each network device on the forwarding path indicated by SRv6 policy establishes and maintains a forwarding mapping table based on the received SRv6 policy, and the forwarding mapping table is used to guide the processing of service messages forwarded through the forwarding path corresponding to the SRv6 policy on the network device; for service messages forwarded through the forwarding path indicated by the SRv6 policy, the corresponding path information is carried by the source IP address of the IPv6 header. After the network device receives the service message, it can complete the processing of the service message through the forwarding mapping table and the source IP address of the IPv6 header in the service message, so that the service message can be accurately transmitted in the forwarding path indicated by the SRv6 policy. In this way, it is no longer necessary to encapsulate SRH for service packets transmitted through the forwarding path indicated by the SRv6 policy, nor is it necessary to transmit the SRH-encapsulated service packets between the network devices included in the forwarding path indicated by the SRv6 policy. This improves the transmission efficiency of service packets in the SRv6 policy scenario and saves the consumption of network link bandwidth during service packet transmission.

作为一个示例,本申请实施例提供的技术方案中,网络设备在获得SRv6 policy后,判断该SRv6 policy与该网络设备的本地定位符(Locator)是否匹配,如果不匹配则该网络设备不对该SRv6 policy进行处理;如果匹配,则,该网络设备确定自己在该SRv6policy所指示的转发路径上,从而,基于该SRv6 policy中包括的至少一个segment list获得转发映射表,该转发映射表用于指导通过该SRv6 policy对应的转发路径转发的业务报文在该网络设备的处理。这样,网络设备通过在接收到SRv6 policy后在控制面配置转发映射表,为该网络设备对需要迭代该SRv6 policy隧道转发的业务报文的处理作好了准备。As an example, in the technical solution provided by the embodiment of the present application, after obtaining the SRv6 policy, the network device determines whether the SRv6 policy matches the local locator (Locator) of the network device. If not, the network device does not process the SRv6 policy; if it matches, the network device determines that it is on the forwarding path indicated by the SRv6 policy, thereby obtaining a forwarding mapping table based on at least one segment list included in the SRv6 policy, and the forwarding mapping table is used to guide the processing of the service message forwarded through the forwarding path corresponding to the SRv6 policy on the network device. In this way, the network device configures the forwarding mapping table on the control plane after receiving the SRv6 policy, so as to prepare for the network device to process the service message that needs to be iterated through the SRv6 policy tunnel forwarding.

在转发面,对于该SRv6 policy对应的转发路径的头节点,获得与该SRv6 policy匹配的业务报文后,在该业务报文上封装IPv6头,该IPv6头的源IP地址填写该SRv6 policy对应的转发路径的第一个SID或该第一个SID对应的子绑定分段标识(Sub Binding SID,Sub-BSID),该IPv6头的目的IP可以填写业务SID;这样,该头节点即可根据封装后的业务报文中IPv6头的源IP地址、转发映射表和本地SID表(也可以称为Local SID表),确定该业务报文的出接口,并更新该业务报文的IPv6头中的源IP地址,使得更新后业务报文的IPv6头中的源IP地址指向该转发路径中头节点的下一跳设备,从而,头节点将该更新后的业务报文从所确定的出接口发送给下一跳设备;对于该SRv6 policy对应的转发路径的中间节点接收到的业务报文,可以基于该IPv6头的源IP地址、转发映射表和本地SID表,确定该业务报文的出接口,并更新该业务报文的IPv6头中的源IP地址,使得更新后业务报文的IPv6头中的源IP地址指向该转发路径中头节点的下一跳设备,从而,中间节点将该更新后的业务报文从所确定的出接口发送给下一跳设备;对于该SRv6 policy对应的转发路径的尾节点接收到的业务报文,可以基于该IPv6头的源IP地址、转发映射表和本地SID表,确定当前网络设备为该SRv6 policy的尾节点,根据该业务报文的IPv6头的目的IP地址和本地SID表确定业务信息,解除该业务报文针对该SRv6 policy的封装后,基于所述业务信息对解封装后的业务信息进行后续转发。这样,SRv6 policy所指示的转发路径中的各网络设备均能够基于所接收的业务报文的IPv6头和本地配置的转发映射表,完成业务报文在该SRv6 policy隧道的处理。On the forwarding plane, for the head node of the forwarding path corresponding to the SRv6 policy, after obtaining the service message matching the SRv6 policy, an IPv6 header is encapsulated on the service message, and the source IP address of the IPv6 header is filled with the first SID of the forwarding path corresponding to the SRv6 policy or the sub-binding segment identifier (Sub Binding SID, Sub-BSID) corresponding to the first SID, and the destination IP of the IPv6 header can be filled with the service SID; in this way, the head node can determine the outbound interface of the service message according to the source IP address of the IPv6 header in the encapsulated service message, the forwarding mapping table and the local SID table (also called the Local SID table), and update the source IP address in the IPv6 header of the service message, so that the source IP address in the IPv6 header of the updated service message points to the next-hop device of the head node in the forwarding path, so that the head node sends the updated service message from the determined outbound interface to the next-hop device; for the SRv6 For a service packet received by an intermediate node of a forwarding path corresponding to the SRv6 policy, the outbound interface of the service packet can be determined based on the source IP address of the IPv6 header, the forwarding mapping table, and the local SID table, and the source IP address in the IPv6 header of the service packet can be updated so that the source IP address in the IPv6 header of the updated service packet points to the next-hop device of the head node in the forwarding path. Thus, the intermediate node sends the updated service packet from the determined outbound interface to the next-hop device. For a service packet received by an end node of a forwarding path corresponding to the SRv6 policy, the current network device can be determined to be the end node of the SRv6 policy based on the source IP address of the IPv6 header, the forwarding mapping table, and the local SID table, and the service information is determined based on the destination IP address of the IPv6 header of the service packet and the local SID table. After decapsulating the service packet for the SRv6 policy, the decapsulated service information is subsequently forwarded based on the service information. In this way, each network device in the forwarding path indicated by the SRv6 policy can complete the processing of the service message in the SRv6 policy tunnel based on the IPv6 header of the received service message and the locally configured forwarding mapping table.

举例来说,本申请实施例可以应用于图1所示的网络中。图1所示的网络可以包括:控制实体10、网络设备21、网络设备22、网络设备23、网络设备24、网络设备25、网络设备26、网络设备27和网络设备28。网络设备21~网络设备28分别配置本地Locator,并根据本地Locator分配节点SID和链路SID,节点SID例如可以是End SID,用于标识该节点;链路SID例如可以是End.X SID,用于标识该节点上用于连接到其他节点的接口,接口确定后即可确定该节点到其他节点的链路,所以该SID称为链路SID。节点SID和链路SID均与本地Locator属于相同网段。例如,网络设备21的Locator为100::/80,网络设备21的节点SID可以是100::10,网络设备21的链路SID包括100::2和100::3,100::2指示网络设备21上连接到网络设备23的接口1,100::3指示网络设备21上连接到网络设备22的接口2。网络设备22的Locator为200::/80,网络设备22的节点SID可以是200::10,网络设备22的链路SID包括200::2和200::3。网络设备23的Locator为300::/80,网络设备23的节点SID可以是300::10,网络设备23的链路SID包括300::1、300::2和300::3。网络设备24的Locator为400::/80,网络设备24的节点SID可以是400::10,网络设备24的链路SID包括400::1、400::2和400::3。网络设备25的Locator为500::/80,网络设备25的节点SID可以是500::10,网络设备25的链路SID包括500::1、500::2和500::3。网络设备26的Locator为600::/80,网络设备26的节点SID可以是600::10,网络设备26的链路SID包括600::1、600::2和600::3。网络设备27的Locator为700::/80,网络设备27的节点SID可以是700::10,网络设备27的链路SID包括700::1和700::3。网络设备28的Locator为800::/80,网络设备28的节点SID可以是800::10,网络设备28的链路SID包括800::1和800::3。此外,由于本申请实施例中以网络设备21到网络设备27的SRv6 policy为例进行说明,所以,网络设备21和网络设备27之间可以建立边界网关协议(Border Gateway Protocol,BGP)邻居,网络设备27将分配的VPN SID 700::100通过BGP消息发送给网络设备21。For example, the embodiment of the present application can be applied to the network shown in Figure 1. The network shown in Figure 1 may include: a control entity 10, a network device 21, a network device 22, a network device 23, a network device 24, a network device 25, a network device 26, a network device 27 and a network device 28. Network devices 21 to 28 are respectively configured with local Locators, and node SIDs and link SIDs are allocated according to the local Locators. The node SID may be, for example, an End SID, which is used to identify the node; the link SID may be, for example, an End.X SID, which is used to identify the interface on the node for connecting to other nodes. Once the interface is determined, the link from the node to other nodes can be determined, so the SID is called a link SID. Both the node SID and the link SID belong to the same network segment as the local Locator. For example, the Locator of network device 21 is 100::/80, the node SID of network device 21 may be 100::10, and the link SID of network device 21 includes 100::2 and 100::3, 100::2 indicates interface 1 on network device 21 connected to network device 23, and 100::3 indicates interface 2 on network device 21 connected to network device 22. The Locator of network device 22 is 200::/80, the node SID of network device 22 may be 200::10, and the link SID of network device 22 includes 200::2 and 200::3. The Locator of network device 23 is 300::/80, the node SID of network device 23 may be 300::10, and the link SID of network device 23 includes 300::1, 300::2, and 300::3. The Locator of network device 24 is 400::/80, the node SID of network device 24 may be 400::10, and the link SIDs of network device 24 include 400::1, 400::2, and 400::3. The Locator of network device 25 is 500::/80, the node SID of network device 25 may be 500::10, and the link SIDs of network device 25 include 500::1, 500::2, and 500::3. The Locator of network device 26 is 600::/80, the node SID of network device 26 may be 600::10, and the link SIDs of network device 26 include 600::1, 600::2, and 600::3. The Locator of network device 27 is 700::/80, the node SID of network device 27 can be 700::10, and the link SID of network device 27 includes 700::1 and 700::3. The Locator of network device 28 is 800::/80, the node SID of network device 28 can be 800::10, and the link SID of network device 28 includes 800::1 and 800::3. In addition, since the SRv6 policy from network device 21 to network device 27 is used as an example in the embodiment of the present application, a Border Gateway Protocol (BGP) neighbor can be established between network device 21 and network device 27, and network device 27 sends the allocated VPN SID 700::100 to network device 21 via a BGP message.

图1所示的网络中,控制实体10用于对该网络中的网络设备进行控制。作为一个示例,控制实体10可以直接与各网络设备建立连接(如建立BGP邻居),那么,控制实体10在完成网络设备21到网络设备27的SRv6 policy的算路后,可以直接将SRv6 policy发送给各网络设备。作为另一个示例,控制实体10可以连接路由反射器(Route Reflector,RR)30,控制实体10可以将算路结果发送给RR 30,RR 30将从控制实体10接收的算路结果反射给各网络设备。In the network shown in FIG1 , the control entity 10 is used to control the network devices in the network. As an example, the control entity 10 can directly establish a connection with each network device (such as establishing a BGP neighbor). Then, after completing the calculation of the SRv6 policy from the network device 21 to the network device 27, the control entity 10 can directly send the SRv6 policy to each network device. As another example, the control entity 10 can be connected to the route reflector (RR) 30, and the control entity 10 can send the calculation result to the RR 30, and the RR 30 reflects the calculation result received from the control entity 10 to each network device.

作为一个示例,控制实体10向全网的网络设备发送SRv6 policy,该SRv6 policy可以为下述SRv6 policy P1:As an example, the control entity 10 sends an SRv6 policy to network devices throughout the network. The SRv6 policy may be the following SRv6 policy P1:

那么,需要对所接收的SRv6 policy P1作出处理的仅为该SRv6 policy P1所指示的转发路径上的各网络设备,其他网络设备不需要对该所接收的SRv6 policy P1进行处理。那么,在接收到控制实体10发送的SRv6 policy P1后,网络设备可以执行图2所示的处理流程。如图2所示,网络设备接收到携带该SRv6 policy P1的消息后,执行的操作可以包括:S11,检查BSID 100::1:0是否与本地Locator在相同的网段,如果在,则,表征自己是该SRv6 policy P1的头节点,执行S12,否则,执行S13;S12,将BSID 100::1:0安装在本地SID表内,并生成转发映射表;S13,检查该SRv6 policy P1内的各SID是否有与本地Locator在相同的网段的,如果有,则,表征该网络设备自己是该SRv6 policy P1所指示的转发路径上的节点,执行S14,否则,表征该网络设备不在该SRv6 policy P1所指示的转发路径上,执行S15;S14,生成转发映射表;S15,忽略携带该SRv6 policy P1的消息,不作任何处理。Then, only the network devices on the forwarding path indicated by the SRv6 policy P1 need to process the received SRv6 policy P1, and other network devices do not need to process the received SRv6 policy P1. Then, after receiving the SRv6 policy P1 sent by the control entity 10, the network device can execute the processing flow shown in FIG. As shown in FIG2 , after the network device receives the message carrying the SRv6 policy P1, the operations performed may include: S11, checking whether BSID 100::1:0 is in the same network segment as the local Locator. If so, it indicates that the network device is the head node of the SRv6 policy P1 and executes S12, otherwise, executes S13; S12, installs BSID 100::1:0 in the local SID table and generates a forwarding mapping table; S13, checks whether each SID in the SRv6 policy P1 is in the same network segment as the local Locator. If so, it indicates that the network device itself is a node on the forwarding path indicated by the SRv6 policy P1 and executes S14, otherwise, it indicates that the network device is not on the forwarding path indicated by the SRv6 policy P1 and executes S15; S14, generates a forwarding mapping table; S15, ignores the message carrying the SRv6 policy P1 and does not perform any processing.

在按照图2所示的流程,SRv6 policy P1所涉及的网络设备完成Sub-BSID的配置后,本申请实施例还定义了一种新的SRv6封装方式,可以称为SRv6的简化封装方式。图3中给出基于传统的SRv6封装方式和本申请实施例提供的SRv6的简化封装方式,对业务报文进行封装的示意图,图3左侧的业务报文为基于传统的SRv6封装方式对报文进行封装获得的,该业务报文包括IPv6头、SRH和有效载荷(payload),该业务报文中SRH中包括:SL字段和segment list,segment list包括了多个128比特的SID;图3右侧的业务报文为基于本申请实施例提供的SRv6的简化封装方式对报文进行封装获得的,该业务报文包括IPv6头和payload,该IPv6头中的源IP地址用于携带该SRv6 policy P1的路径信息,该IPv6地址的目的IP地址用于携带业务SID。可见,本申请实施例提供的SRv6的简化封装方式,能够在确保业务报文有效转发的基础上,大大的提高业务报文的传输效率。After the network equipment involved in SRv6 policy P1 completes the configuration of Sub-BSID according to the process shown in Figure 2, the embodiment of the present application also defines a new SRv6 encapsulation method, which can be called a simplified encapsulation method of SRv6. Figure 3 shows a schematic diagram of encapsulating a service message based on the traditional SRv6 encapsulation method and the simplified encapsulation method of SRv6 provided in the embodiment of the present application. The service message on the left side of Figure 3 is obtained by encapsulating the message based on the traditional SRv6 encapsulation method. The service message includes an IPv6 header, SRH and a payload. The SRH in the service message includes: an SL field and a segment list, and the segment list includes multiple 128-bit SIDs; the service message on the right side of Figure 3 is obtained by encapsulating the message based on the simplified encapsulation method of SRv6 provided in the embodiment of the present application. The service message includes an IPv6 header and a payload. The source IP address in the IPv6 header is used to carry the path information of the SRv6 policy P1, and the destination IP address of the IPv6 address is used to carry the service SID. It can be seen that the simplified encapsulation method of SRv6 provided in the embodiment of the present application can greatly improve the transmission efficiency of business messages while ensuring the effective forwarding of business messages.

本申请实施例中,如果图1所示的网络设备均支持图3右侧的SRv6的简化封装方式,那么,本申请实施例对业务报文的处理过程可以如图4所示,例如可以包括:S21,网络设备接收业务报文;S22,检查该业务报文的源IP地址是否在转发映射表中,如果在,则,执行S23,否则,执行S24;S23,检查该网络设备是否为该业务报文的尾节点,如果是,则执行S24;否则,执行S27;S24,检查该业务报文的目的IP地址是否在本地SID表中,如果在,则执行S25,否则,执行S26;S25,按照本地SID表对应的动作处理该业务报文;S26,按照业务报文的目的IP地址查转发表进行转发;S27,按照源IP地址、转发映射表、本地SID表对该业务报文进行更新和转发。其中,在网络设备接收到业务报文后,执行S22~S23的检查以及在满足条件时执行S27的转发处理,为本申请实施例提供的SRv6 policy转发方法相比传统的SRv6policy转发方法的区别所在。In an embodiment of the present application, if the network devices shown in Figure 1 all support the simplified encapsulation method of SRv6 on the right side of Figure 3, then the processing process of the service message in the embodiment of the present application can be as shown in Figure 4, for example, it can include: S21, the network device receives the service message; S22, checks whether the source IP address of the service message is in the forwarding mapping table, if so, executes S23, otherwise, executes S24; S23, checks whether the network device is the tail node of the service message, if so, executes S24; otherwise, executes S27; S24, checks whether the destination IP address of the service message is in the local SID table, if so, executes S25, otherwise, executes S26; S25, processes the service message according to the action corresponding to the local SID table; S26, searches the forwarding table according to the destination IP address of the service message and forwards it; S27, updates and forwards the service message according to the source IP address, the forwarding mapping table, and the local SID table. Among them, after the network device receives the service message, it performs checks in S22 to S23 and performs forwarding processing in S27 when the conditions are met. This is the difference between the SRv6 policy forwarding method provided in the embodiment of the present application and the traditional SRv6 policy forwarding method.

在第一种可能的实现方式中,转发映射表可以是Sub-BSID映射表。本申请实施例可以定义一种新的BSID,即,Sub-BSID。BSID用于唯一标识该SRv6 policy,SRv6 policy的BSID由一个128bit的IPv6地址表示,如图5所示,SRv6 policy的BSID的最后16比特均为0,将最后16比特设置为参数(Arguments,arg)字段,在16比特的arg字段中设置高8比特携带SRv6 policy中的segment list ID,低8比特携带SL,并对每个segment list内的SID按倒序进行编址,如此,获得128比特的Sub-BSID。需要说明的是,如果128比特的IPv6地址的后16比特的值均为0,则,该IPv6地址可以是SRv6 BSID;如果128比特的IPv6地址的后16比特的值不为0,则,该IPv6地址可以是本申请实施例中新定义的SRv6 Sub-BSID。In the first possible implementation, the forwarding mapping table may be a Sub-BSID mapping table. The embodiment of the present application may define a new BSID, namely, a Sub-BSID. The BSID is used to uniquely identify the SRv6 policy. The BSID of the SRv6 policy is represented by a 128-bit IPv6 address. As shown in FIG5 , the last 16 bits of the BSID of the SRv6 policy are all 0, and the last 16 bits are set to the parameter (Arguments, arg) field. In the 16-bit arg field, the upper 8 bits are set to carry the segment list ID in the SRv6 policy, and the lower 8 bits carry the SL, and the SID in each segment list is addressed in reverse order, so as to obtain a 128-bit Sub-BSID. It should be noted that if the values of the last 16 bits of the 128-bit IPv6 address are all 0, then the IPv6 address may be the SRv6 BSID; if the values of the last 16 bits of the 128-bit IPv6 address are not 0, then the IPv6 address may be the newly defined SRv6 Sub-BSID in the embodiment of the present application.

在S12和S14中网络设备生成转发映射表之前,网络设备可以根据SRv6 policy P1中的BSID和segment list获得与自己相关的Sub-BSID。一种情况下,网络设备可以计算SRv6 policy P1中所有segment list中所有SID对应的Sub-BSID,再从计算获得的Sub-BSID中筛选与本地Locator属于同一网段的SID对应的Sub-BSID,筛选得到的Sub-BSID即所述与自己相关的Sub-BSID。另一种情况下,网络设备也可以先确定与本地Locator属于同一网段的SID,再计算与所筛选的SID对应的Sub-BSID,即为所述与自己相关的Sub-BSID。需要说明的是,全网的网络设备计算Sub-BSID,需要按照相同的算法进行计算,确保该SRv6policy中的每个SID和segment list在不同网络设备上计算得到的Sub-BSID值相同,从而保证本申请实施例提供的方法能够有效的实施。Before the network device generates the forwarding mapping table in S12 and S14, the network device can obtain the Sub-BSID related to itself according to the BSID and segment list in the SRv6 policy P1. In one case, the network device can calculate the Sub-BSID corresponding to all SIDs in all segment lists in the SRv6 policy P1, and then filter the Sub-BSID corresponding to the SID belonging to the same network segment as the local Locator from the calculated Sub-BSID, and the filtered Sub-BSID is the Sub-BSID related to itself. In another case, the network device can also first determine the SID belonging to the same network segment as the local Locator, and then calculate the Sub-BSID corresponding to the filtered SID, which is the Sub-BSID related to itself. It should be noted that the network devices of the entire network need to calculate the Sub-BSID according to the same algorithm to ensure that each SID in the SRv6 policy and the segment list calculated on different network devices have the same Sub-BSID value, thereby ensuring that the method provided in the embodiment of the present application can be effectively implemented.

网络设备接收到SRv6 policy P1后计算与自己相关的Sub-BSID的过程可以包括:Sub-BSID的前112比特与该SRv6 policy P1的BSID保持一致,arg的高8比特按照segmentlist的顺序赋值,segment list 1赋值为1,segment list 2赋值为2,以此类推;arg的低8比特用来代表SL,SL例如可以对每个segment list内的SID按倒序进行编址,例如,segmentlist 1内有6个SID,按照倒序进行编址,则,第一个SID 100::2对应的SL的值为6,第二个SID 300::3对应的SL值为5,以此类推。按照该过程,可以得到代表每个SID和segment list的Sub-BSID值,如,segment list 1内的第一个SID 100::2所对应的Sub-BSID值为100::1:106,segment list 2内的第一个SID 100::2所对应的Sub-BSID值为100::1:204,需要说明的是,当SL的值为0,但segment list ID的值不为0时,则,该Sub-BSID可以指示segmentlist ID的值对应的segment list,如100::1:100指示segment list 1,100::1:200指示segment list 2。如此,SRv6 policy P1计算Sub-BSID可以包括:After receiving the SRv6 policy P1, the process of calculating the Sub-BSID related to the network device may include: the first 112 bits of the Sub-BSID are consistent with the BSID of the SRv6 policy P1, the high 8 bits of arg are assigned values according to the order of the segmentlist, segment list 1 is assigned a value of 1, segment list 2 is assigned a value of 2, and so on; the low 8 bits of arg are used to represent the SL, and the SL can, for example, address the SIDs in each segment list in reverse order. For example, there are 6 SIDs in segmentlist 1, and they are addressed in reverse order. Then, the SL value corresponding to the first SID 100::2 is 6, the SL value corresponding to the second SID 300::3 is 5, and so on. According to this process, the Sub-BSID value representing each SID and segment list can be obtained, such as the Sub-BSID value corresponding to the first SID 100::2 in segment list 1 is 100::1:106, and the Sub-BSID value corresponding to the first SID 100::2 in segment list 2 is 100::1:204. It should be noted that when the SL value is 0, but the segment list ID value is not 0, the Sub-BSID can indicate the segment list corresponding to the segmentlist ID value, such as 100::1:100 indicates segment list 1, and 100::1:200 indicates segment list 2. In this way, the calculation of the Sub-BSID by SRv6 policy P1 may include:

该实现方式中,S12或S14中网络设备生成的转发映射表(即Sub-BSID映射表)例如可以包括Sub-BSID与本地SID之间的对应关系。以segment list 2为例,segment list 2所经过的网络设备21、网络设备23、网络设备25和网络设备27所维护的Sub-BSID映射表以及网络设备的本地SID表如下表1~表8所示:In this implementation, the forwarding mapping table (i.e., Sub-BSID mapping table) generated by the network device in S12 or S14 may include, for example, the correspondence between the Sub-BSID and the local SID. Taking segment list 2 as an example, the Sub-BSID mapping tables maintained by the network devices 21, 23, 25, and 27 through which segment list 2 passes and the local SID tables of the network devices are shown in Tables 1 to 8 below:

表1 网络设备21的本地SID表Table 1 Local SID table of network device 21

本地SIDLocal SID含义meaning100::10100::10网络设备21(本机)Network device 21 (this machine)100::2100::2接口1Interface 1100::3100::3接口2Interface 2100::1:0100::1:0SRv6 policy P1SRv6 policy P1

表2 网络设备21的Sub-BSID映射表Table 2 Sub-BSID mapping table of network device 21

Sub-BSIDSub-BSID本地SIDLocal SID100::1:106100::1:106100::2100::2100::1:204100::1:204100::2100::2100::1:306100::1:306100::3100::3100::1:406100::1:406100::3100::3

表3 网络设备23的本地SID表Table 3 Local SID table of network device 23

本地SIDLocal SID含义meaning300::10300::10网络设备23(本机)Network device 23 (this machine)300::1300::1接口1Interface 1300::2300::2接口2Interface 2300::3300::3接口3Interface 3

表4 网络设备23的Sub-BSID映射表Table 4 Sub-BSID mapping table of network device 23

Sub-BSIDSub-BSID本地SIDLocal SID100::1:105100::1:105300::3300::3100::1:203100::1:203300::2300::2100::1:403100::1:403300::2300::2

表5 网络设备25的本地SID表Table 5 Local SID table of network device 25

本地SIDLocal SID含义meaning500::10500::10网络设备25(本机)Network device 25 (this machine)500::1500::1接口1Interface 1500::2500::2接口2Interface 2500::3500::3接口3Interface 3

表6 网络设备25的Sub-BSID映射表Table 6 Sub-BSID mapping table of network device 25

Sub-BSIDSub-BSID本地SIDLocal SID100::1:202100::1:202500::2500::2100::1:402100::1:402500::2500::2

表7 网络设备27的本地SID表Table 7 Local SID table of network device 27

本地SIDLocal SID含义meaning700::10700::10网络设备27(本机)Network device 27 (this machine)700::1700::1接口1Interface 1700::3700::3接口2Interface 2700::100700::100VPN1VPN1

表8 网络设备27的Sub-BSID映射表Table 8 Sub-BSID mapping table of network device 27

Sub-BSIDSub-BSID本地SIDLocal SID100::1:101100::1:101700::10700::10100::1:201100::1:201700::10700::10100::1:301100::1:301700::10700::10100::1:401100::1:401700::10700::10

该实现方式中,在SRv6 policy P1所涉及的网络设备完成Sub-BSID的配置后,对于需要通过SRv6 policy P1中的segment list 2所指示的转发路径进行传输的业务报文1,如图6所示,图1所示的网络中对业务报文1的处理过程可以包括:S31,网络设备21确定所接收到的业务报文1与SRv6 policy P1匹配,在业务报文1上封装IPv6头1,该IPv6头1的源IP地址1填入segment list 2中第一个SID 100::2对应的Sub-BSID 100::1:204,该IPv6头1的目的IP地址1填入网络设备27发布的VPN SID 700::100,获得业务报文2;S32,网络设备21在表2所示的Sub-BSID映射表中获得与业务报文2的源IP地址1对应的本地SID 100::2,在表1所示的本地SID表中获得与100::2对应的接口1,并且,网络设备21将源IP地址1中的SL减1,获得业务报文3,业务报文3中的IPv6头2的源IP地址2为100::1:203,IPv6头2包括目的IP地址1;S33,网络设备21通过接口1向网络设备23发送业务报文3;S34,网络设备23在表4所示的Sub-BSID映射表中获得与业务报文3的源IP地址2对应的本地SID 300::2,在表3所示的本地SID表中获得与300::2对应的接口2,并且,网络设备23将源IP地址2中的SL减1,获得业务报文4,业务报文4中的IPv6头3的源IP地址3为100::1:202,IPv6头3包括目的IP地址1;S35,网络设备23通过接口2向网络设备25发送业务报文4;S36,网络设备25在表6所示的Sub-BSID映射表中获得与业务报文4的源IP地址3对应的本地SID 500::2,在表5所示的本地SID表中获得与500::2对应的接口2,并且,网络设备25将源IP地址3中的SL减1,获得业务报文5,业务报文5中的IPv6头4的源IP地址4为100::1:201,IPv6头4包括目的IP地址1;S37,网络设备25通过接口2向网络设备27发送业务报文5;S38,网络设备27在表8所示的Sub-BSID映射表中获得与业务报文5的源IP地址4对应的本地SID 700::10,在表7所示的本地SID表中确定700::10为网络设备27自身的节点SID,并且,根据源IP地址4中SL=1确定网络设备27为该SRv6 policy P1的尾节点,从而,对业务报文5解除与该SRv6 policy P1对应的封装,获得业务报文6;S37,网络设备27确定目的IP地址1在表7所示的本地SID表中且指示VPN 1,从而,基于VPN 1查VPN转发表对业务报文6进行转发。In this implementation, after the network device involved in the SRv6 policy P1 completes the configuration of the Sub-BSID, for the service message 1 that needs to be transmitted through the forwarding path indicated by the segment list 2 in the SRv6 policy P1, as shown in Figure 6, the processing process of the service message 1 in the network shown in Figure 1 may include: S31, the network device 21 determines that the received service message 1 matches the SRv6 policy P1, and encapsulates the IPv6 header 1 on the service message 1. The source IP address 1 of the IPv6 header 1 is filled in the Sub-BSID 100::1:204 corresponding to the first SID 100::2 in the segment list 2, and the destination IP address 1 of the IPv6 header 1 is filled in the VPN SID 700::100 issued by the network device 27, and the service message 2 is obtained; S32, the network device 21 obtains the local SID corresponding to the source IP address 1 of the service message 2 in the Sub-BSID mapping table shown in Table 2. 100::2, obtain the interface 1 corresponding to 100::2 in the local SID table shown in Table 1, and the network device 21 subtracts 1 from the SL in the source IP address 1 to obtain the service message 3, the source IP address 2 of the IPv6 header 2 in the service message 3 is 100::1:203, and the IPv6 header 2 includes the destination IP address 1; S33, the network device 21 sends the service message 3 to the network device 23 through the interface 1; S34, the network device 23 obtains the local SID corresponding to the source IP address 2 of the service message 3 in the Sub-BSID mapping table shown in Table 4 300::2, obtain the interface 2 corresponding to 300::2 in the local SID table shown in Table 3, and the network device 23 reduces the SL in the source IP address 2 by 1 to obtain the service message 4, the source IP address 3 of the IPv6 header 3 in the service message 4 is 100::1:202, and the IPv6 header 3 includes the destination IP address 1; S35, the network device 23 sends the service message 4 to the network device 25 through the interface 2; S36, the network device 25 obtains the local SID corresponding to the source IP address 3 of the service message 4 in the Sub-BSID mapping table shown in Table 6 500::2, obtain the interface 2 corresponding to 500::2 in the local SID table shown in Table 5, and the network device 25 reduces the SL in the source IP address 3 by 1 to obtain the service message 5, the source IP address 4 of the IPv6 header 4 in the service message 5 is 100::1:201, and the IPv6 header 4 includes the destination IP address 1; S37, the network device 25 sends the service message 5 to the network device 27 through the interface 2; S38, the network device 27 obtains the local SID 700::10 corresponding to the source IP address 4 of the service message 5 in the Sub-BSID mapping table shown in Table 8, determines that 700::10 is the node SID of the network device 27 itself in the local SID table shown in Table 7, and determines that the network device 27 is the tail node of the SRv6 policy P1 according to SL=1 in the source IP address 4, thereby releasing the service message 5 from the SRv6 policy The encapsulation corresponding to P1 obtains the service message 6; S37, the network device 27 determines that the destination IP address 1 is in the local SID table shown in Table 7 and indicates VPN 1, so the service message 6 is forwarded based on VPN 1 by searching the VPN forwarding table.

在另一些可能的实现方式中,转发映射表可以是SID映射表。该实现方式中无需定义新的SID类型。In some other possible implementations, the forwarding mapping table may be a SID mapping table. In this implementation, there is no need to define a new SID type.

该实现方式中,S12或S14中网络设备生成的转发映射表(即SID映射表)例如可以包括segment list中网络设备自身的SID与下一个SID之间的对应关系。以segment list 2为例,segment list 2所经过的网络设备21、网络设备23和网络设备25所维护的SID映射表可以如下表9~表11所示:In this implementation, the forwarding mapping table (i.e., SID mapping table) generated by the network device in S12 or S14 may include, for example, the correspondence between the SID of the network device itself and the next SID in the segment list. Taking segment list 2 as an example, the SID mapping tables maintained by network devices 21, 23, and 25 that segment list 2 passes through may be as shown in Tables 9 to 11 below:

表9 网络设备21的SID映射表Table 9 SID mapping table of network device 21

自身的SIDIts own SID下一个SIDNext SID100::2100::2300::2300::2

表10 网络设备23的SID映射表Table 10 SID mapping table of network device 23

自身的SIDIts own SID下一个SIDNext SID300::2300::2500::2500::2

表11 网络设备25的SID映射表Table 11 SID mapping table of network device 25

自身的SIDIts own SID下一个SIDNext SID500::2500::2700::10700::10

由于网络设备27为该SRv6 policy P1的尾节点,基于segment list 2分析不存在下一个SID,所以,网络设备27上可以不维护SID映射表。Since network device 27 is the tail node of the SRv6 policy P1, based on the analysis of segment list 2, there is no next SID, so the SID mapping table does not need to be maintained on network device 27.

该第二种可能的实现方式中,在SRv6 policy P1所涉及的网络设备完成SID的配置后,对于需要通过SRv6 policy P1中的segment list 2所指示的转发路径进行传输的业务报文1,如图7所示,图1所示的网络中对业务报文1的处理过程可以包括:S41,网络设备21确定所接收到的业务报文1与SRv6 policy P1匹配,在业务报文1上封装IPv6头1’,该IPv6头1’的源IP地址1’填入segment list 2中第一个SID 100::2,该IPv6头1’的目的IP地址1填入网络设备27发布的VPN SID 700::100,获得业务报文2’;S42,网络设备21在表1所示的本地SID表中获得与100::2对应的接口1,并且,网络设备21在表9所示的SID映射表中获得与业务报文2’的源IP地址1’对应的SID 300::2,将源IP地址1’修改为300::2,获得业务报文3’,业务报文3’中的IPv6头2’的源IP地址2’为300::2,IPv6头2’包括目的IP地址1;S43,网络设备21通过接口1向网络设备23发送业务报文3’;S44,网络设备23在表3所示的本地SID表中获得与300::2对应的接口2,并且,网络设备23在表10所示的SID映射表中获得与业务报文3’的源IP地址2’对应的SID 500::2,将源IP地址2’修改为500::2,获得业务报文4’,业务报文4’中的IPv6头3’的源IP地址3’为500::2,IPv6头3’包括目的IP地址1;S45,网络设备23通过接口2向网络设备25发送业务报文4’;S46,网络设备25在表5所示的本地SID表中获得与500::2对应的接口2,并且,网络设备25在表11所示的SID映射表中获得与业务报文4’的源IP地址3’对应的SID 700::10,将源IP地址3’修改为700::10,获得业务报文5’,业务报文5’中的IPv6头4’的源IP地址4’为700::10,IPv6头4’包括目的IP地址1;S47,网络设备25通过接口2向网络设备27发送业务报文5’;S48,网络设备27在表7所示的本地SID表中确定700::10为网络设备27自身的节点SID,确定网络设备27为该SRv6 policy P1的尾节点,从而,对业务报文5’解除与该SRv6 policy P1对应的封装,获得业务报文6’;S47,网络设备27确定目的IP地址1在表7所示的本地SID表中且指示VPN 1,从而,基于VPN 1查VPN转发表对业务报文6’进行转发。In the second possible implementation, after the network device involved in the SRv6 policy P1 completes the configuration of the SID, for the service message 1 that needs to be transmitted through the forwarding path indicated by the segment list 2 in the SRv6 policy P1, as shown in FIG7 , the processing process of the service message 1 in the network shown in FIG1 may include: S41, the network device 21 determines that the received service message 1 matches the SRv6 policy P1, encapsulates the IPv6 header 1' on the service message 1, fills in the source IP address 1' of the IPv6 header 1' with the first SID 100::2 in the segment list 2, and fills in the destination IP address 1 of the IPv6 header 1' with the VPN SID 700::100 issued by the network device 27, and obtains the service message 2'; S42, the network device 21 obtains the interface 1 corresponding to 100::2 in the local SID table shown in Table 1, and the network device 21 obtains the SID corresponding to the source IP address 1' of the service message 2' in the SID mapping table shown in Table 9 300::2, the source IP address 1' is modified to 300::2, and the service message 3' is obtained. The source IP address 2' of the IPv6 header 2' in the service message 3' is 300::2, and the IPv6 header 2' includes the destination IP address 1; S43, the network device 21 sends the service message 3' to the network device 23 through the interface 1; S44, the network device 23 obtains the interface 2 corresponding to 300::2 in the local SID table shown in Table 3, and the network device 23 obtains the SID corresponding to the source IP address 2' of the service message 3' in the SID mapping table shown in Table 10. 500::2, the source IP address 2' is modified to 500::2, and the service message 4' is obtained. The source IP address 3' of the IPv6 header 3' in the service message 4' is 500::2, and the IPv6 header 3' includes the destination IP address 1; S45, the network device 23 sends the service message 4' to the network device 25 through the interface 2; S46, the network device 25 obtains the interface 2 corresponding to 500::2 in the local SID table shown in Table 5, and the network device 25 obtains the SID corresponding to the source IP address 3' of the service message 4' in the SID mapping table shown in Table 11. 700::10, the source IP address 3' is modified to 700::10, and the service message 5' is obtained. The source IP address 4' of the IPv6 header 4' in the service message 5' is 700::10, and the IPv6 header 4' includes the destination IP address 1; S47, the network device 25 sends the service message 5' to the network device 27 through the interface 2; S48, the network device 27 determines that 700::10 is the node SID of the network device 27 itself in the local SID table shown in Table 7, and determines that the network device 27 is the tail node of the SRv6 policy P1, thereby, the service message 5' is unpacked corresponding to the SRv6 policy P1, and the service message 6' is obtained; S47, the network device 27 determines that the destination IP address 1 is in the local SID table shown in Table 7 and indicates VPN 1, thereby, based on VPN 1, the VPN forwarding table is searched to forward the service message 6'.

需要说明的是,该第二种实现方式,适用于单Candidate Path单segment list的SRv6 policy的情况,即SRv6 policy仅包括一个Candidate Path且该Candidate Path仅包括一个segment list的情况;或者,该第二种实现方式的实施要求同一个网络设备在不同的segment list中对应的SID必须不同,即,每个网络设备需要针对不同的SRv6 policy下不同的Candidate Path的各segment list均分配对应的SID。It should be noted that the second implementation method is applicable to the SRv6 policy of a single Candidate Path and a single segment list, that is, the SRv6 policy includes only one Candidate Path and the Candidate Path includes only one segment list; or, the implementation of the second implementation method requires that the SIDs corresponding to the same network device in different segment lists must be different, that is, each network device needs to allocate corresponding SIDs to each segment list of different Candidate Paths under different SRv6 policies.

需要说明的是,本申请实施例中,SRv6 policy指示的是转发路径,部分位置直接以SRv6 policy指代SRv6 policy所指示的转发路径,出现“SRv6 policy”之处可以理解为“SRv6 policy所指示的转发路径”。It should be noted that in the embodiment of the present application, SRv6 policy indicates a forwarding path. In some locations, SRv6 policy is directly used to refer to the forwarding path indicated by the SRv6 policy. Where "SRv6 policy" appears, it can be understood as "the forwarding path indicated by the SRv6 policy".

需要说明的是,本申请实施例中的网络设备和节点指代相同的含义,可以相互交替理解和使用。网络设备,可以指交换机、路由器、虚拟路由设备或虚拟转发设备等具有报文转发功能的通信设备。例如,图1中网络设备21和网络设备27可以为运营商边缘(Provider Edge,PE)设备,网络设备22、网络设备23、网络设备24、网络设备25、网络设备26和网络设备28可以是运营商(Provider,P)设备。控制实体可以是控制器或其他具有算路功能的实体,例如,控制实体10可以是路径计算单元(Path Calculation Element,PCE),网络设备21~网络设备28上可以包括与PCE可通信的路径计算客户端(Path CalculationClient,PCC)。It should be noted that the network devices and nodes in the embodiments of the present application refer to the same meaning and can be understood and used interchangeably. Network devices may refer to communication devices such as switches, routers, virtual routing devices or virtual forwarding devices that have message forwarding functions. For example, network devices 21 and 27 in Figure 1 may be provider edge (Provider Edge, PE) devices, and network devices 22, 23, 24, 25, 26 and 28 may be provider (Provider, P) devices. The control entity may be a controller or other entity with a path calculation function. For example, the control entity 10 may be a path calculation element (Path Calculation Element, PCE), and network devices 21 to 28 may include a path calculation client (Path Calculation Client, PCC) that can communicate with the PCE.

以上为以场景实施例的形式对本申请实施例的介绍,下面结合附图详细说明本申请实施例的具体实现方式。The above is an introduction to the embodiments of the present application in the form of scenario embodiments. The specific implementation method of the embodiments of the present application is described in detail below with reference to the accompanying drawings.

图8为本申请实施例提供的一种报文处理的方法100的流程示意图。该方法100中,第一网络设备可以对应图1、图6或图7所示的网络中的任意一个网络设备,控制实体可以对应图1所示的网络中的控制实体10。Fig. 8 is a flow chart of a method 100 for message processing provided in an embodiment of the present application. In the method 100, the first network device may correspond to any network device in the network shown in Fig. 1, Fig. 6 or Fig. 7, and the control entity may correspond to the control entity 10 in the network shown in Fig. 1.

如图8所示,该方法100例如可以包括下述S101~S106:As shown in FIG8 , the method 100 may include, for example, the following S101 to S106:

S101,第一网络设备接收控制实体发送的第一消息,第一消息携带第一SRv6policy,第一SRv6 policy包括至少一个分段列表,第一SRv6 policy与第一网络设备的本地定位符匹配。S101: A first network device receives a first message sent by a control entity. The first message carries a first SRv6 policy. The first SRv6 policy includes at least one segment list. The first SRv6 policy matches a local locator of the first network device.

作为一个示例,控制实体可以是独立的实体设备,那么,控制实体在生成第一SRv6policy后,可以向第一网络设备发送所述第一SRv6 policy。例如,控制实体为独立部署的PCE,第一网络设备内包括PCC,且第一网络设备为第一SRv6 policy所指示的转发设备上的任意一个网络设备,那么,S101例如可以是:PCE生成并向第一网络设备的PCC发送第一消息,第一消息中包括第一SRv6 policy,第一网络设备通过接收并解析该第一消息,获得该第一SRv6 policy。As an example, the control entity may be an independent entity device, then, after generating the first SRv6 policy, the control entity may send the first SRv6 policy to the first network device. For example, the control entity is an independently deployed PCE, the first network device includes a PCC, and the first network device is any network device on the forwarding device indicated by the first SRv6 policy, then, S101 may be, for example: the PCE generates and sends a first message to the PCC of the first network device, the first message includes a first SRv6 policy, and the first network device obtains the first SRv6 policy by receiving and parsing the first message.

作为另一个示例,控制实体可以是合设于第一网络设备的一个模块,那么,S101中控制实体向第一网络设备发送第一消息可以理解为第一网络设备内部模块间的数据交互。例如,第一网络设备内部署了PCE和PCC,且第一网络设备为第一SRv6 policy所指示的转发设备上的任意一个网络设备,那么,S101例如可以是:第一网络设备的PCE生成并向PCC发送第一消息,第一消息中包括第一SRv6 policy,第一网络设备中的PCC通过接收并解析该第一消息,获得该第一SRv6 policy。As another example, the control entity may be a module installed in the first network device, and the control entity sending the first message to the first network device in S101 may be understood as data interaction between modules inside the first network device. For example, PCE and PCC are deployed in the first network device, and the first network device is any network device on the forwarding device indicated by the first SRv6 policy, and S101 may be, for example: the PCE of the first network device generates and sends a first message to the PCC, the first message includes the first SRv6 policy, and the PCC in the first network device obtains the first SRv6 policy by receiving and parsing the first message.

下面以控制实体和第一网络设备分设的场景为例进行描述。The following description is made by taking a scenario in which the control entity and the first network device are separately arranged as an example.

可以理解的是,控制实体在算路之前,可以先收集网络中的相关信息,基于收集到的相关信息进行算路。作为一个示例,在S101之前,该方法100还可以包括:S100a,控制实体获得网络信息,所述网络信息例如可以包括网络的拓扑信息和所述网络中各网络设备的SID;S100b,控制实体基于所述网络信息确定第一SRv6 policy。从而,控制实体基于第一SRv6 policy,生成包括第一SRv6 policy的第一消息。对于S100a,例如可以包括:网络中的各网络设备通过边界网关协议(Border Gateway Protocol,BGP)链路状态(Link State,LS)报文上报网络的拓扑信息和自身的SID;控制实体接收到各网络设备的BGP LS报文后,经过解析BGP LS报文获得所述网络信息。It is understandable that before calculating the path, the control entity may first collect relevant information in the network and calculate the path based on the collected relevant information. As an example, before S101, the method 100 may also include: S100a, the control entity obtains network information, and the network information may include, for example, network topology information and the SID of each network device in the network; S100b, the control entity determines a first SRv6 policy based on the network information. Thus, the control entity generates a first message including the first SRv6 policy based on the first SRv6 policy. For S100a, for example, it may include: each network device in the network reports the network topology information and its own SID through a Border Gateway Protocol (Border Gateway Protocol, BGP) Link State (Link State, LS) message; after the control entity receives the BGP LS message from each network device, it obtains the network information by parsing the BGP LS message.

在一些实现方式中,第一消息可以是BGP SR policy报文,该BGP SR policy报文承载第一SRv6 policy。In some implementations, the first message may be a BGP SR policy message that carries the first SRv6 policy.

在另一些实现方式中,第一消息可以是路径计算单元协议(Path CalculationElement Protocol,PCEP)报文,该PCEP报文承载第一SRv6 policy。In some other implementations, the first message may be a Path Calculation Element Protocol (PCEP) message, and the PCEP message carries the first SRv6 policy.

作为一个示例,第一网络设备可以建立与控制实体的直接通信连接,例如,控制实体与第一网络设备建立了BGP邻居,S101可以包括:第一网络设备直接从控制实体接收所述第一消息。As an example, the first network device may establish a direct communication connection with the control entity. For example, the control entity establishes a BGP neighbor relationship with the first network device. S101 may include: the first network device directly receives the first message from the control entity.

作为另一个示例,RR建立与控制实体的通信连接,那么,S101可以包括:第一网络设备可以通过RR接收控制实体发送的所述第一消息。As another example, the RR establishes a communication connection with the control entity, then S101 may include: the first network device may receive the first message sent by the control entity through the RR.

第一SRv6 policy与所述第一网络设备的本地Locator匹配,一种情况下,可以指第一SRv6 policy中至少一个分段列表中的任意一个SID与该第一网络设备的本地Locator属于同一网段;另一种情况下,也可以指用于唯一标识第一SRv6 policy的第一BSID与该第一网络设备的本地Locator属于同一网段。第一SRv6 policy与所述第一网络设备的本地Locator匹配,可以表征该第一网络设备为第一SRv6 policy所指示的转发设备上的任意一个网络设备,也可以理解为该第一网络设备为第一SRv6 policy所涉及的网络设备。The first SRv6 policy matches the local Locator of the first network device. In one case, it may mean that any one of the SIDs in at least one segment list in the first SRv6 policy belongs to the same network segment as the local Locator of the first network device. In another case, it may mean that the first BSID used to uniquely identify the first SRv6 policy belongs to the same network segment as the local Locator of the first network device. The first SRv6 policy matches the local Locator of the first network device, which may indicate that the first network device is any one of the network devices on the forwarding device indicated by the first SRv6 policy, or it may be understood that the first network device is the network device involved in the first SRv6 policy.

需要说明的是,第一网络设备还可以接收第一SRv6 policy的尾节点(后续称为第三网络设备)发送的业务SID,例如,第三网络设备与第一网络设备之间建立BGP邻居,那么,第三网络设备可以向第一网络设备发送第二消息,该第二消息携带该业务SID,该第二消息例如可以是BGP SR policy报文。业务SID用于标识业务报文所属的业务。业务SID可以是VPN SID,也可以是业务链SID。It should be noted that the first network device can also receive the service SID sent by the tail node of the first SRv6 policy (hereinafter referred to as the third network device). For example, a BGP neighbor is established between the third network device and the first network device. Then, the third network device can send a second message to the first network device, and the second message carries the service SID. The second message can be a BGP SR policy message. The service SID is used to identify the service to which the service message belongs. The service SID can be a VPN SID or a service chain SID.

需要说明的是,本申请实施例中提供的报文处理方法中,在IPv6头的目的IP地址中填入业务SID,能够保证该第一SRv6 policy所指示的第一转发路径故障时,网络设备可以通过该业务SID进行查表转发,不会由于故障而无法被有效传输。如果业务SID为二层VPNSID,那么,网络设备在通过VPN SID查表转发时,会从某个出接口按二层转发的方式将业务报文转发出去;如果业务SID为业务链SID,那么,网络设备在通过业务链SID查表转发时,按业务链的安全等要求转发业务报文。It should be noted that in the message processing method provided in the embodiment of the present application, the service SID is filled in the destination IP address of the IPv6 header, which can ensure that when the first forwarding path indicated by the first SRv6 policy fails, the network device can forward the message through the service SID, and will not be unable to be effectively transmitted due to the failure. If the service SID is a layer 2 VPN SID, then when the network device forwards through the VPN SID table lookup, it will forward the service message from a certain output interface in a layer 2 forwarding manner; if the service SID is a service chain SID, then when the network device forwards through the service chain SID table lookup, it will forward the service message according to the security requirements of the service chain.

S102,第一网络设备基于至少一个分段列表,获得转发映射表,转发映射表用于指导通过第一SRv6 policy对应的第一转发路径转发的业务报文在第一网络设备的处理。S102: The first network device obtains a forwarding mapping table based on at least one segment list, where the forwarding mapping table is used to guide processing of a service message forwarded through a first forwarding path corresponding to a first SRv6 policy on the first network device.

在一些实现方式中,所述第一消息还包括第一BSID,该BSID用于标识第一SRv6policy,那么,S102可以包括:基于第一BSID和至少一个分段列表,获得Sub-BSID映射表,所述Sub-BSID映射表包括Sub-BSID和本地SID的对应关系,所述Sub-BSID与所述本地Locator匹配,所述Sub-BSID包括segment list ID和SL。In some implementations, the first message also includes a first BSID, which is used to identify the first SRv6 policy. Then, S102 may include: based on the first BSID and at least one segment list, obtaining a Sub-BSID mapping table, the Sub-BSID mapping table including a correspondence between the Sub-BSID and the local SID, the Sub-BSID matches the local Locator, and the Sub-BSID includes a segment list ID and a SL.

第一SRv6 policy中的SID与第一网络设备的本地Locator属于相同网段。The SID in the first SRv6 policy and the local locator of the first network device belong to the same network segment.

一种情况,该与第一网络设备的本地Locator属于同一网段的SID可以是第一BSID,那么,第一网络设备是该第一SRv6 policy的头节点。那么,该方法还包括:将所述BSID保存在本地SID表,所述本地SID表包括所述第一网络设备的SID和处理动作的对应关系。如此,确保第一SRv6 policy的头节点能够将接收到的业务报文引流到该第一SRv6policy中。In one case, the SID that belongs to the same network segment as the local Locator of the first network device may be the first BSID, then the first network device is the head node of the first SRv6 policy. Then, the method further includes: saving the BSID in a local SID table, wherein the local SID table includes the correspondence between the SID of the first network device and the processing action. In this way, it is ensured that the head node of the first SRv6 policy can direct the received service message to the first SRv6 policy.

另一种情况,该与第一网络设备的本地Locator属于同一网段的SID可以指第一SRv6 policy中所述至少一个分段列表中的任意一个SID,但是该情况下,第一BSID与第一网络设备的本地Locator不属于同一网段。该情况下,第一网络设备是第一SRv6 policy所涉及的、除头节点以外的其他节点。In another case, the SID that belongs to the same network segment as the local Locator of the first network device may refer to any SID in the at least one segment list in the first SRv6 policy, but in this case, the first BSID and the local Locator of the first network device do not belong to the same network segment. In this case, the first network device is a node other than the head node involved in the first SRv6 policy.

该实现方式中,S102,可以包括:S102a,第一网络设备基于所述第一BSID和所述至少一个分段列表,确定与本地Locator匹配的Sub-BSID;S102b,第一网络设备基于所确定的Sub-BSID和每个Sub-BSID对应的本地SID,获得所述Sub-BSID映射表。In this implementation, S102 may include: S102a, the first network device determines the Sub-BSID that matches the local Locator based on the first BSID and the at least one segment list; S102b, the first network device obtains the Sub-BSID mapping table based on the determined Sub-BSID and the local SID corresponding to each Sub-BSID.

作为一个示例,S102a可以包括:第一网络设备基于所述第一BSID计算所述至少一个分段列表中每个分段列表的各SID的Sub-BSID;第一网络设备从计算的所有Sub-BSID中筛选与所述本地Locator属于同一网段的Sub-BSID。As an example, S102a may include: the first network device calculates the Sub-BSID of each SID in each segment list in the at least one segment list based on the first BSID; the first network device filters the Sub-BSID belonging to the same network segment as the local Locator from all calculated Sub-BSIDs.

作为另一个示例,S102a可以包括:第一网络设备从所述至少一个分段列表中每个分段列表的各SID中筛选与所述本地定位符属于同一网段的SID;第一网络设备基于所述第一BSID计算所筛选出的SID对应的Sub-BSID。As another example, S102a may include: the first network device filters SIDs belonging to the same network segment as the local locator from the SIDs in each segment list in the at least one segment list; and the first network device calculates the Sub-BSID corresponding to the filtered SID based on the first BSID.

其中,Sub-BSID可以包括Locator、Function和Arguments,所述Locator和Function与所述第一BSID一致,所述Arguments包括segment list ID和SL。具体结构可以参见图5以及相关说明。The Sub-BSID may include a Locator, a Function and Arguments, wherein the Locator and the Function are consistent with the first BSID, and the Arguments include a segment list ID and a SL. For the specific structure, please refer to FIG. 5 and related descriptions.

需要说明的是,获得Sub-BSID映射表的过程可以上述场景实施例中关于第一种可能的实现方式中的相关说明。It should be noted that the process of obtaining the Sub-BSID mapping table may be the same as the related description about the first possible implementation manner in the above scenario embodiment.

在另一些实现方式中,S102也可以包括:第一网络设备基于所述至少一个分段列表,获得SID映射表,所述SID映射表用于指导通过所述转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括第一SID和第二SID的对应关系,所述第一SID为第一分段列表中所述第一网络设备的标识,所述第二SID为所述第一分段列表中第二网络设备的标识,所述第二网络设备为所述第一网络设备在所述转发路径的下一跳设备,所述至少一个分段列表包括所述第一分段列表,所述第一分段列表与所述第一转发路径对应。In some other implementations, S102 may also include: the first network device obtains a SID mapping table based on the at least one segment list, the SID mapping table is used to guide the processing of the service message transmitted through the forwarding path on the first network device, the SID mapping table includes a correspondence between a first SID and a second SID, the first SID is an identifier of the first network device in the first segment list, the second SID is an identifier of the second network device in the first segment list, the second network device is the next hop device of the first network device in the forwarding path, the at least one segment list includes the first segment list, and the first segment list corresponds to the first forwarding path.

需要说明的是,获得SID映射表的过程可以上述场景实施例中关于第二种可能的实现方式中的相关说明。It should be noted that the process of obtaining the SID mapping table may be the relevant description of the second possible implementation manner in the above scenario embodiment.

通过上述S101~S102,在控制面对第一SRv6 policy所涉及的网络设备完成了配置转发映射表的操作,为后续实施本申请实施例提供的SRv6的简化封装和转发做好了准备,即,S101~S102为后续S103~S106的实施提供了数据基础。Through the above S101~S102, the operation of configuring the forwarding mapping table is completed on the control surface for the network devices involved in the first SRv6 policy, and preparations are made for the subsequent implementation of the simplified encapsulation and forwarding of SRv6 provided in the embodiment of the present application, that is, S101~S102 provide a data basis for the subsequent implementation of S103~S106.

S103,第一网络设备获得第一业务报文,第一业务报文与第一SRv6 policy匹配,第一业务报文包括第一第六版互联网协议IPv6头。S103, the first network device obtains a first service message, the first service message matches the first SRv6 policy, and the first service message includes a first sixth Internet Protocol IPv6 header.

S104,第一网络设备根据第一IPv6头的第一IP地址确定第一出接口,第一出接口为第一网络设备在第一转发路径上的出接口,第一SRv6 policy指示第一转发路径。S104: The first network device determines a first outbound interface according to the first IP address of the first IPv6 header, where the first outbound interface is the outbound interface of the first network device on the first forwarding path, and the first SRv6 policy indicates the first forwarding path.

S105,第一网络设备将第一业务报文中的第一源IP地址更新为第二源IP地址,获得第二业务报文,第一源IP地址指示第一网络设备,第二源IP地址指示第二网络设备,第二网络设备为第一网络设备在第一转发路径的下一跳设备。S105, the first network device updates the first source IP address in the first service message to the second source IP address, and obtains a second service message, wherein the first source IP address indicates the first network device, and the second source IP address indicates the second network device, and the second network device is the next hop device of the first network device in the first forwarding path.

S106,第一网络设备从第一出接口向第二网络设备发送第二业务报文。S106: The first network device sends a second service message from the first output interface to the second network device.

在第一网络设备获得与第一SRv6 policy匹配的第一业务报文之后,对第一业务报文进行处理之前,本申请实施例还可以报文:判断第一业务报文中的第一源IP地址是否与转发映射表匹配,如果匹配,才执行后续S104,按照第一源IP地址指导该第一业务报文的转发;否则,按照该第一业务报文的第一IPv6头的第一目的IP地址指导该第一业务报文的转发。其中,第一网络设备确定第一业务报文中的第一源IP地址与转发映射表不匹配时,按照该第一业务报文的第一IPv6头的第一目的IP地址处理该第一业务报文,例如可以包括:判断该第一目的IP地址是否与本地SID表匹配,如果是,则按照本地SID表中与该第一目的IP地址对应的动作处理该第一业务报文;否则,按照第一目的IP地址查转发表对该第一业务报文进行转发。After the first network device obtains the first service message that matches the first SRv6 policy, before processing the first service message, the embodiment of the present application may also: determine whether the first source IP address in the first service message matches the forwarding mapping table, if it matches, execute the subsequent S104, and guide the forwarding of the first service message according to the first source IP address; otherwise, guide the forwarding of the first service message according to the first destination IP address of the first IPv6 header of the first service message. Wherein, when the first network device determines that the first source IP address in the first service message does not match the forwarding mapping table, the first service message is processed according to the first destination IP address of the first IPv6 header of the first service message, for example, it may include: determine whether the first destination IP address matches the local SID table, if so, process the first service message according to the action corresponding to the first destination IP address in the local SID table; otherwise, forward the first service message according to the first destination IP address query forwarding table.

其中,第一网络设备判断第一业务报文中的第一源IP地址是否与转发映射表匹配,例如可以是:查看转发映射表中是否存在包括第一源IP地址的映射表项,如果存在,则,确定该第一业务报文中的第一源IP地址与转发映射表匹配;否则,确定该第一业务报文中的第一源IP地址与转发映射表不匹配。Among them, the first network device determines whether the first source IP address in the first business message matches the forwarding mapping table. For example, it can be: checking whether there is a mapping table entry including the first source IP address in the forwarding mapping table. If so, it is determined that the first source IP address in the first business message matches the forwarding mapping table; otherwise, it is determined that the first source IP address in the first business message does not match the forwarding mapping table.

转发映射表,例如可以是Sub-BSID映射表或SID映射表。关于Sub-BSID映射表和SID映射表的相关说明可以分别参见上述场景实施例中第一种可能的实现方式和第二种可能的实现方式的相关描述。The forwarding mapping table may be, for example, a Sub-BSID mapping table or a SID mapping table. For relevant descriptions of the Sub-BSID mapping table and the SID mapping table, refer to the relevant descriptions of the first possible implementation manner and the second possible implementation manner in the above scenario embodiment, respectively.

作为一个示例,所述转发映射表为Sub-BSID映射表,所述第一源IP地址为所述第一网络设备的第一Sub-BSID,所述第一Sub-BSID包括第一分段列表的标识和SL,所述第一SRv6 policy包括所述第一分段列表,所述SL指示所述第一网络设备在所述第一分段列表中的位置,所述Sub-BSID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述Sub-BSID映射表包括所述第一Sub-BSID和本地的第一SID的对应关系。需要说明的是,第一网络设备接收的多个与自己相关的SRv6 policy对应的Sub-BSID映射表项,可以在一张Sub-BSID映射表中维护;或者,第一网络设备接收的多个与自己相关的SRv6 policy对应的Sub-BSID映射表项,可以分别使用一张Sub-BSID映射表维护。As an example, the forwarding mapping table is a Sub-BSID mapping table, the first source IP address is the first Sub-BSID of the first network device, the first Sub-BSID includes an identifier and SL of a first segment list, the first SRv6 policy includes the first segment list, the SL indicates the position of the first network device in the first segment list, the Sub-BSID mapping table is used to guide the processing of service packets transmitted through the forwarding path corresponding to the SRv6 policy in the first network device, and the Sub-BSID mapping table includes the correspondence between the first Sub-BSID and the local first SID. It should be noted that the Sub-BSID mapping table entries corresponding to multiple SRv6 policies related to the first network device and received by the first network device can be maintained in one Sub-BSID mapping table; or, the Sub-BSID mapping table entries corresponding to multiple SRv6 policies related to the first network device and received by the first network device can be maintained using one Sub-BSID mapping table respectively.

可见,该示例中通过定义Sub-BSID并维护Sub-BSID映射表的方式,可以使得分配给网络设备的节点SID或链路SID被多个Candidate Path或segment list复用,减少了网络设备分配和维护SID的数量。It can be seen that in this example, by defining the Sub-BSID and maintaining the Sub-BSID mapping table, the node SID or link SID allocated to the network device can be reused by multiple Candidate Paths or segment lists, reducing the number of SIDs allocated and maintained by the network device.

针对转发映射表为Sub-BSID映射表的情况,S104可以包括:第一网络设备从所述Sub-BSID映射表中,确定与所述第一源IP地址中的所述第一Sub-BSID匹配的所述第一SID;从本地SID表中,确定与所述第一SID匹配的所述第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。S105可以包括:第一网络设备更新所述第一源IP地址中SL字段的值,获得所述第二业务报文,所述第二业务报文中的第二源IP地址中SL字段的值指示所述第二网络设备在所述第一分段列表中的位置,所述第二源IP地址为所述第二网络设备的第二Sub-BSID。其中,Sub-BSID中SL可以按照SID在segment list中出现的顺序的倒叙的方式取值,例如,segment list依次包括SID 1、SID 2和SID 3,那么,SID 1对应的Sub-BSID 1的SL可以等于3,SID 2对应的Sub-BSID 2的SL可以等于2,SID 3对应的Sub-BSID 3的SL可以等于1,那么,第一网络设备更新所述第一源IP地址中SL字段的值,例如可以是将SL字段的值减一,作为更新后的SL的值。In the case where the forwarding mapping table is a Sub-BSID mapping table, S104 may include: the first network device determines the first SID that matches the first Sub-BSID in the first source IP address from the Sub-BSID mapping table; and determines the first outbound interface that matches the first SID from a local SID table, wherein the local SID table includes a correspondence between the first SID and the first outbound interface. S105 may include: the first network device updates the value of the SL field in the first source IP address to obtain the second service message, wherein the value of the SL field in the second source IP address in the second service message indicates the position of the second network device in the first segment list, and the second source IP address is the second Sub-BSID of the second network device. Among them, the SL in the Sub-BSID can be taken in reverse order according to the order in which the SID appears in the segment list. For example, the segment list includes SID 1, SID 2 and SID 3 in sequence. Then, the SL of Sub-BSID 1 corresponding to SID 1 can be equal to 3, the SL of Sub-BSID 2 corresponding to SID 2 can be equal to 2, and the SL of Sub-BSID 3 corresponding to SID 3 can be equal to 1. Then, the first network device updates the value of the SL field in the first source IP address, for example, the value of the SL field can be reduced by one as the updated SL value.

上述说明针对第一网络设备为第一SRv6 policy中除了尾节点以外的任何节点均适用。The above description is applicable when the first network device is any node except the tail node in the first SRv6 policy.

针对第一网络设备为第一SRv6 policy的头节点的情况,第一网络设备还基于本申请实施例提供的SRv6的简化封装方式对所接收的、与第一SRv6 policy匹配的业务报文的封装过程。即,S103例如可以包括:第一网络设备接收第三业务报文,所述第三业务报文的目的IP地址与所述第一SRv6 policy匹配;那么,第一网络设备在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SRv6 policy中所述第一SID对应的所述第一Sub-BSID,所述第一SID为所述第一分段列表中的第一个SID。In the case where the first network device is the head node of the first SRv6 policy, the first network device also performs an encapsulation process for the received service message that matches the first SRv6 policy based on the simplified encapsulation method of SRv6 provided in the embodiment of the present application. That is, S103 may include, for example: the first network device receives a third service message, and the destination IP address of the third service message matches the first SRv6 policy; then, the first network device encapsulates the first IPv6 header on the third service message to obtain the first service message, and the first source IP address of the first IPv6 header is the first Sub-BSID corresponding to the first SID in the first SRv6 policy, and the first SID is the first SID in the first segment list.

以第一网络设备为第二SRv6 policy的尾节点为例,对本申请实施例提供的方法中尾节点对报文的处理过程进行介绍。本申请实施例提供的方法还可以包括:第一网络设备获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;若确定所述第三IPv6地址中的第三源IP地址与所述Sub-BSID映射表匹配,且所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为所述第一网络设备的第三Sub-BSID,所述第三Sub-BSID包括第二分段列表的标识和SL,所述第二SRv6 policy包括所述第二分段列表,所述SL指示所述第一网络设备在所述第二分段列表中的位置。其中,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,可以包括:一方面,第一网络设备解除所述第四业务报文中与所述第二SRv6policy相关的封装,获得第五业务报文;另一方面,第一网络设备判断该第三目的IP地址是否与本地SID表匹配,如果是,则按照本地SID表中与该第三目的IP地址对应的动作处理该第五业务报文;否则,按照第三目的IP地址查转发表对该第五业务报文进行转发。其中,第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,例如可以是第三源IP地址的SL=1。Taking the first network device as the tail node of the second SRv6 policy as an example, the processing process of the message by the tail node in the method provided in the embodiment of the present application is introduced. The method provided in the embodiment of the present application may also include: the first network device obtains a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header; if it is determined that the third source IP address in the third IPv6 address matches the Sub-BSID mapping table, and the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, the third source IP address is the third Sub-BSID of the first network device, the third Sub-BSID includes the identifier and SL of the second segment list, the second SRv6 policy includes the second segment list, and the SL indicates the position of the first network device in the second segment list. Wherein, the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, which may include: on the one hand, the first network device removes the encapsulation related to the second SRv6 policy in the fourth service message to obtain the fifth service message; on the other hand, the first network device determines whether the third destination IP address matches the local SID table, and if so, processes the fifth service message according to the action corresponding to the third destination IP address in the local SID table; otherwise, forwards the fifth service message according to the third destination IP address query forwarding table. Wherein, the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, for example, the SL=1 of the third source IP address.

以第一Sub-BSID为例对Sub-BSID的格式进行说明。第一Sub-BSID可以包括Locator、Function和Arguments,所述Locator和Function与第一BSID一致,所述Arguments包括所述第一分段列表的标识和SL,所述第一BSID用于标识所述第一SRv6 policy。The format of the Sub-BSID is described by taking the first Sub-BSID as an example. The first Sub-BSID may include a Locator, a Function, and Arguments, wherein the Locator and the Function are consistent with the first BSID, the Arguments include the identifier of the first segment list and the SL, and the first BSID is used to identify the first SRv6 policy.

作为另一个示例,所述转发映射表为SID映射表,所述第一源IP地址为所述第一网络设备的第一SID,所述SID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括所述第一SID和第二SID的对应关系,第二SID为所述第一转发路径对应的segment list中所述第一SID的下一跳设备的SID。需要说明的是,第一网络设备接收的多个与自己相关的SRv6 policy对应的SID映射表项,可以在一张SID映射表中维护;或者,第一网络设备接收的多个与自己相关的SRv6 policy对应的SID映射表项,可以分别使用一张SID映射表维护。As another example, the forwarding mapping table is a SID mapping table, the first source IP address is the first SID of the first network device, the SID mapping table is used to guide the processing of the service message transmitted through the forwarding path corresponding to the SRv6 policy on the first network device, and the SID mapping table includes the correspondence between the first SID and the second SID, and the second SID is the SID of the next-hop device of the first SID in the segment list corresponding to the first forwarding path. It should be noted that the SID mapping table entries corresponding to multiple SRv6 policies related to the first network device and received by the first network device can be maintained in one SID mapping table; or, the SID mapping table entries corresponding to multiple SRv6 policies related to the first network device and received by the first network device can be maintained using one SID mapping table respectively.

可见,该示例适用于单Candidate Path单segment list的SRv6 policy的情况,即SRv6 policy仅包括一个Candidate Path且该Candidate Path仅包括一个segment list的情况;或者,该示例要求同一个网络设备在不同的segment list中对应的SID必须不同,即,每个网络设备需要针对不同的SRv6 policy下不同的Candidate Path的各segment list均分配对应的SID。It can be seen that this example is applicable to the case of an SRv6 policy with a single Candidate Path and a single segment list, that is, the SRv6 policy includes only one Candidate Path and the Candidate Path includes only one segment list; or, this example requires that the SIDs corresponding to the same network device in different segment lists must be different, that is, each network device needs to be assigned a corresponding SID for each segment list of different Candidate Paths under different SRv6 policies.

针对转发映射表为SID映射表的情况,S104可以包括:第一网络设备从本地SID表中,确定与所述第一源IP地址中的所述第一SID匹配的第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。S105可以包括:第一网络设备从所述SID映射表中,获得所述第一源IP地址关联的所述第二SID;第一网络设备将所述第一源IP地址中的所述第一SID更新为所述第二SID,获得所述第二业务报文,所述第二业务报文的所述第二源IP地址为所述第二SID。In the case where the forwarding mapping table is a SID mapping table, S104 may include: the first network device determines the first outbound interface matching the first SID in the first source IP address from a local SID table, wherein the local SID table includes a correspondence between the first SID and the first outbound interface. S105 may include: the first network device obtains the second SID associated with the first source IP address from the SID mapping table; the first network device updates the first SID in the first source IP address to the second SID, obtains the second service message, and the second source IP address of the second service message is the second SID.

上述说明针对第一网络设备为第一SRv6 policy中除了尾节点以外的任何节点均适用。The above description is applicable when the first network device is any node except the tail node in the first SRv6 policy.

针对第一网络设备为第一SRv6 policy的头节点的情况,第一网络设备还基于本申请实施例提供的SRv6的简化封装方式对所接收的、与第一SRv6 policy匹配的业务报文的封装过程。即,S103例如可以包括:第一网络设备接收第三业务报文,所述第三业务报文与所述第一SRv6 policy匹配;第一网络设备在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SID,所述第一SID为所述第一分段列表中的第一个SID。In the case where the first network device is the head node of the first SRv6 policy, the first network device also performs an encapsulation process for the received service message that matches the first SRv6 policy based on the simplified encapsulation method of SRv6 provided in the embodiment of the present application. That is, S103 may include, for example: the first network device receives a third service message, and the third service message matches the first SRv6 policy; the first network device encapsulates the first IPv6 header on the third service message to obtain the first service message, and the first source IP address of the first IPv6 header is the first SID, and the first SID is the first SID in the first segment list.

以第一网络设备为第二SRv6 policy的尾节点为例,对本申请实施例提供的方法中尾节点对报文的处理过程进行介绍。本申请实施例提供的方法还可以包括:第一网络设备获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;若确定所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为第三SID,所述第三SID为所述第二SRv6 policy所包括的第二分段列表中所述第一网络设备的标识。其中,第一网络设备确定第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,例如可以是:第一网络设备在所述SID映射表中未发现包括第三SID的SID映射表项。其中,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,可以包括:一方面,第一网络设备解除所述第四业务报文中与所述第二SRv6 policy相关的封装,获得第五业务报文;另一方面,第一网络设备判断该第三目的IP地址是否与本地SID表匹配,如果是,则按照本地SID表中与该第三目的IP地址对应的动作处理该第五业务报文;否则,按照第三目的IP地址查转发表对该第五业务报文进行转发。Taking the first network device as the tail node of the second SRv6 policy as an example, the processing process of the message by the tail node in the method provided in the embodiment of the present application is introduced. The method provided in the embodiment of the present application may also include: the first network device obtains a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header; if it is determined that the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, and the third source IP address is the third SID, and the third SID is the identifier of the first network device in the second segment list included in the second SRv6 policy. Among them, the first network device determines that the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, for example, it can be: the first network device does not find the SID mapping table entry including the third SID in the SID mapping table. Among them, the first network device processes the fourth business message according to the third destination IP address in the third IPv6 header, which may include: on the one hand, the first network device removes the encapsulation related to the second SRv6 policy in the fourth business message to obtain the fifth business message; on the other hand, the first network device determines whether the third destination IP address matches the local SID table, and if so, processes the fifth business message according to the action corresponding to the third destination IP address in the local SID table; otherwise, forwards the fifth business message according to the third destination IP address query forwarding table.

无论转发映射表为SID映射表还是Sub-BSID映射表,第四业务报文中的第三IPv6头的第三目的IP地址为业务SID,那么,第一网络设备根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,可以包括:第一网络设备解除所述第四业务报文中与所述第二SRv6 policy相关的封装,获得第五业务报文;第一网络设备基于所述业务SID,转发所述第五业务报文。其中,业务SID例如可以是VPN SID或业务链SID。Regardless of whether the forwarding mapping table is a SID mapping table or a Sub-BSID mapping table, the third destination IP address of the third IPv6 header in the fourth service message is a service SID, then the first network device processes the fourth service message according to the third destination IP address in the third IPv6 header, which may include: the first network device removes the encapsulation related to the second SRv6 policy in the fourth service message to obtain the fifth service message; the first network device forwards the fifth service message based on the service SID. The service SID may be, for example, a VPN SID or a service chain SID.

需要说明的是,本申请实施例提供的方法,也适用于一些操作维护管理(Operation Administration and Maintenance,OAM)场景。It should be noted that the method provided in the embodiment of the present application is also applicable to some operation administration and maintenance (OAM) scenarios.

以网络设备上维护的转发映射表为Sub-BSID映射表的情况为例,对ping和tracert检测SRv6隧道的场景进行描述。ping用于检测SRv6隧道是否连通,tracert用于检测SRv6隧道的故障位置。Taking the case where the forwarding mapping table maintained on the network device is a Sub-BSID mapping table as an example, the scenario of ping and tracert detection of SRv6 tunnels is described. Ping is used to detect whether the SRv6 tunnel is connected, and tracert is used to detect the fault location of the SRv6 tunnel.

对于ping场景,第一业务报文可以是ping报文,所述第一业务报文还包括互联网控制信息协议版本六(Internet Control Message Protocol version 6,ICMPv6)头。ping报文在通过SRv6隧道传输时,可以基于本申请实施例提供的方法进行处理。ping报文到达SRv6隧道的尾节点时,可以将ping报文中IPv6头的源IP地址和目的IP地址互换,获得ping响应报文(也可以称为ICMPv6响应报文),ping响应报文可以基于IPv6头的目的IP地址查转发表转发到该SRv6隧道的头节点。其中,基于IPv6头的目的IP地址查转发表转发ping响应报文,可以是基于ping响应报文中IPv6头的目的IP地址与转发表进行最长匹配,获得与该目的IP地址匹配的转发表项,从而,按照该转发表项中的动作转发该ping响应报文。For the ping scenario, the first service message may be a ping message, which further includes an Internet Control Message Protocol version 6 (ICMPv6) header. When the ping message is transmitted through the SRv6 tunnel, it may be processed based on the method provided in the embodiment of the present application. When the ping message arrives at the tail node of the SRv6 tunnel, the source IP address and the destination IP address of the IPv6 header in the ping message may be interchanged to obtain a ping response message (also referred to as an ICMPv6 response message), and the ping response message may be forwarded to the head node of the SRv6 tunnel by looking up the forwarding table based on the destination IP address of the IPv6 header. Among them, forwarding the ping response message based on the destination IP address of the IPv6 header may be based on the longest match between the destination IP address of the IPv6 header in the ping response message and the forwarding table, obtaining a forwarding table entry that matches the destination IP address, thereby forwarding the ping response message according to the action in the forwarding table entry.

以图1中SRv6 policy P1中的segment list 2所指示的转发路径为例,如图9所示,ping过程可以包括:S51,网络设备21构建ping报文1,该ping报文1包括ICMPv6头1和IPv6头1,IPv6头1的目的IP地址1为网络设备27的SID 700::10,IPv6头1的源IP地址1为网络设备21的Sub-BSID 100::1:204;S52,网络设备21基于本地SID表和Sub-BSID映射表,确定接口1并更新ping报文1为ping报文2,ping报文2包括ICMPv6头1和IPv6头2,IPv6头2包括目的IP地址1和源IP地址2,源IP地址2为Sub-BSID 100::1:203;S53,网络设备21通过接口1将ping报文2发送给网络设备23;S54,网络设备23基于本地SID表和Sub-BSID映射表,确定接口2并更新ping报文2为ping报文3,ping报文3包括ICMPv6头1和IPv6头3,IPv6头3包括目的IP地址1和源IP地址3,源IP地址3为Sub-BSID 100::1:202;S55,网络设备23通过接口2将ping报文3发送给网络设备25;S56,网络设备25基于本地SID表和Sub-BSID映射表,确定接口2并更新ping报文3为ping报文4,ping报文4包括ICMPv6头1和IPv6头4,IPv6头4包括目的IP地址1和源IP地址4,源IP地址4为Sub-BSID 100::1:201;S57,网络设备25通过接口2将ping报文4发送给网络设备27;S58,网络设备27根据ping报文4确定目的IP地址1指示自身且上层协议为ICMPv6,从而,将IPv6头4中的源IP地址和目的IP地址中的值进行互换,获得ping响应报文1,ping响应报文1包括IPv6头5和ICMPv6头1,IPv6头5包括源IP地址5和目的IP地址5,源IP地址5为网络设备27的SID 700::10,目的IP地址5为Sub-BSID100::1:201;S59,网络设备27通过目的IP地址5查转发表,将该ping响应报文1依次经过网络设备25、网络设备23发送到网络设备21;S60,网络设备21接收到ping响应报文1后,进行ping信息显示。其中,显示的ping信息例如可以包括:网络地址、成功以及性能(例如时延),或者,网络地址、失败以及失败原因(例如超时)。ping信息能够表征所检测的SRv6 policy所指示的转发路径的性能。Taking the forwarding path indicated by segment list 2 in SRv6 policy P1 in FIG1 as an example, as shown in FIG9 , the ping process may include: S51, network device 21 constructs ping message 1, the ping message 1 includes ICMPv6 header 1 and IPv6 header 1, the destination IP address 1 of IPv6 header 1 is SID 700::10 of network device 27, and the source IP address 1 of IPv6 header 1 is Sub-BSID 100::1:204 of network device 21; S52, network device 21 determines interface 1 based on the local SID table and Sub-BSID mapping table and updates ping message 1 to ping message 2, ping message 2 includes ICMPv6 header 1 and IPv6 header 2, IPv6 header 2 includes destination IP address 1 and source IP address 2, and source IP address 2 is Sub-BSID 100::1:203; S53, network device 21 sends ping message 2 to network device 23 through interface 1; S54, network device 23 determines interface 2 based on the local SID table and the Sub-BSID mapping table and updates ping message 2 to ping message 3, ping message 3 includes ICMPv6 header 1 and IPv6 header 3, IPv6 header 3 includes destination IP address 1 and source IP address 3, source IP address 3 is Sub-BSID 100::1:202; S55, network device 23 sends ping message 3 to network device 25 through interface 2; S56, network device 25 determines interface 2 based on the local SID table and the Sub-BSID mapping table and updates ping message 3 to ping message 4, ping message 4 includes ICMPv6 header 1 and IPv6 header 4, IPv6 header 4 includes destination IP address 1 and source IP address 4, source IP address 4 is Sub-BSID 100::1:201; S57, network device 25 sends ping message 4 to network device 27 through interface 2; S58, network device 27 determines that destination IP address 1 indicates itself and the upper layer protocol is ICMPv6 according to ping message 4, thereby exchanging the values in the source IP address and the destination IP address in IPv6 header 4 to obtain ping response message 1, ping response message 1 includes IPv6 header 5 and ICMPv6 header 1, IPv6 header 5 includes source IP address 5 and destination IP address 5, source IP address 5 is SID 700::10 of network device 27, and destination IP address 5 is Sub-BSID100::1:201; S59, network device 27 checks the forwarding table through destination IP address 5, and sends the ping response message 1 to network device 21 through network device 25 and network device 23 in sequence; S60, after receiving ping response message 1, network device 21 displays the ping information. The displayed ping information may include, for example, network address, success, and performance (eg, latency), or network address, failure, and failure reason (eg, timeout). The ping information may represent the performance of the forwarding path indicated by the detected SRv6 policy.

对于tracert场景,SRv6 policy的头节点构建tracert用户数据协议(UserDatagram Protocol,UDP)报文(也可以称为tracert报文),该tracert UDP报文在通过SRv6隧道传输时,可以基于本申请实施例提供的方法进行处理。该tracert UDP报文会设置跳限度(Hop Limit,HL)的值,HL的值的大小指示该tracert UDP报文检测的连通性长度,该tracert UDP报文在转发的过程中HL的值逐跳递减,当HL=0时确定所检测的连通性长度范围内路径连通,构造ICMPv6端口不可达报文,该ICMPv6端口不可达报文包括IPv6头和ICMPv6头,IPv6头的目的IP地址为所接收的tracert UDP报文的IPv6头中的源IP地址,ICMPv6端口不可达报文的IPv6头的源IP地址可以为该网络设备上接收tracert UDP报文的接口的地址,或者,ICMPv6端口不可达报文的IPv6头的源IP地址可以为该网络设备的节点SID。ICMPv6端口不可达报文可以基于IPv6头的目的IP地址查转发表转发到该SRv6隧道的头节点。其中,基于IPv6头的目的IP地址查转发表转发ICMPv6端口不可达报文,可以是基于ICMPv6端口不可达报文中IPv6头的目的IP地址与转发表进行最长匹配,获得与该目的IP地址匹配的转发表项,从而,按照该转发表项中的动作转发该ICMPv6端口不可达报文。当SRv6隧道的头节点接收到ICMPv6端口不可达报文,则可以确定该ICMPv6端口不可达报文对应的tracert UDP报文中HL所指示的连通性长度范围内的链路是连通的。For the tracert scenario, the head node of the SRv6 policy constructs a tracert user datagram protocol (UDP) message (also referred to as a tracert message). When the tracert UDP message is transmitted through the SRv6 tunnel, it can be processed based on the method provided in the embodiment of the present application. The tracert UDP message will set the hop limit (Hop Limit, HL) value, the size of the HL value indicates the connectivity length detected by the tracert UDP message, the HL value of the tracert UDP message decreases hop by hop during the forwarding process, when HL = 0, it is determined that the path is connected within the detected connectivity length range, and an ICMPv6 port unreachable message is constructed, the ICMPv6 port unreachable message includes an IPv6 header and an ICMPv6 header, the destination IP address of the IPv6 header is the source IP address in the IPv6 header of the received tracert UDP message, the source IP address of the IPv6 header of the ICMPv6 port unreachable message can be the address of the interface on the network device that receives the tracert UDP message, or the source IP address of the IPv6 header of the ICMPv6 port unreachable message can be the node SID of the network device. The ICMPv6 port unreachable message can be forwarded to the head node of the SRv6 tunnel by looking up the forwarding table based on the destination IP address of the IPv6 header. Among them, forwarding the ICMPv6 port unreachable message based on the destination IP address of the IPv6 header by querying the forwarding table can be based on the longest match between the destination IP address of the IPv6 header in the ICMPv6 port unreachable message and the forwarding table, and obtaining a forwarding table entry that matches the destination IP address, thereby forwarding the ICMPv6 port unreachable message according to the action in the forwarding table entry. When the head node of the SRv6 tunnel receives the ICMPv6 port unreachable message, it can be determined that the link within the connectivity length range indicated by HL in the tracert UDP message corresponding to the ICMPv6 port unreachable message is connected.

作为一个示例,所述第一业务报文和所述第二业务报文可以均为tracert UDP报文,所述第二业务报文的跳限度比所述第一业务报文中的跳限度小1。As an example, the first service message and the second service message may both be tracert UDP messages, and the hop limit of the second service message is 1 less than the hop limit in the first service message.

以图1中SRv6 policy P1中的segment list 2所指示的转发路径为例,如图10所示,tracert过程可以包括:对连通性长度为1、2、……分别进行tracert检测。对连通性长度为1的检测过程包括:S61,网络设备21构建tracert UDP报文1,该tracert UDP报文1包括IPv6头1,IPv6头1的目的IP地址1为网络设备27的SID 700::10,IPv6头1的源IP地址1为网络设备21的Sub-BSID 100::1:204,IPv6头1的HL=1;S62,网络设备21基于本地SID表和Sub-BSID映射表,确定接口1并更新tracert UDP报文1为tracert UDP报文2,tracert UDP报文2包括IPv6头2,IPv6头2包括目的IP地址1和源IP地址2,源IP地址2为Sub-BSID 100::1:203;S63,网络设备21通过接口1将tracert UDP报文2发送给网络设备23;S64,网络设备23将tracert UDP报文2中的HL-1获得tracert UDP报文3;S66,网络设备23确定tracertUDP报文3的HL=0,生成并向网络设备21发送ICMPv6端口不可达报文1,ICMPv6端口不可达报文1包括IPv6头3和ICMPv6头1,IPv6头3中的源IP地址3为网络设备23接收tracert UDP报文2的接口对应的SID 300::1,IPv6头3中的目的IP地址2为tracert UDP报文2的源IP地址2(即Sub-BSID 100::1:203);S67,网络设备21接收到ICMPv6端口不可达报文1后,进行tracert信息1的显示。Taking the forwarding path indicated by segment list 2 in SRv6 policy P1 in FIG. 1 as an example, as shown in FIG. 10 , the tracert process may include: performing tracert detection on connectivity lengths of 1, 2, . . . respectively. The detection process for the connectivity length of 1 includes: S61, the network device 21 constructs a tracert UDP message 1, the tracert UDP message 1 includes an IPv6 header 1, the destination IP address 1 of the IPv6 header 1 is the SID 700::10 of the network device 27, the source IP address 1 of the IPv6 header 1 is the Sub-BSID 100::1:204 of the network device 21, and the HL of the IPv6 header 1 is 1; S62, the network device 21 determines the interface 1 based on the local SID table and the Sub-BSID mapping table and updates the tracert UDP message 1 to the tracert UDP message 2, the tracert UDP message 2 includes the IPv6 header 2, the IPv6 header 2 includes the destination IP address 1 and the source IP address 2, and the source IP address 2 is the Sub-BSID 100::1:203; S63, the network device 21 sends the tracert UDP message 2 to the network device 23 through the interface 1; S64, the network device 23 sends the tracert HL-1 in UDP message 2 obtains tracert UDP message 3; S66, network device 23 determines that HL=0 of tracertUDP message 3, generates and sends ICMPv6 port unreachable message 1 to network device 21, ICMPv6 port unreachable message 1 includes IPv6 header 3 and ICMPv6 header 1, source IP address 3 in IPv6 header 3 is SID 300::1 corresponding to the interface of network device 23 receiving tracert UDP message 2, and destination IP address 2 in IPv6 header 3 is source IP address 2 of tracert UDP message 2 (that is, Sub-BSID 100::1:203); S67, after receiving ICMPv6 port unreachable message 1, network device 21 displays tracert information 1.

接着,对连通性长度为2的检测过程包括:S71,网络设备21构建tracert UDP报文3,该tracert UDP报文3包括IPv6头4,IPv6头4包括目的IP地址1和源IP地址1,IPv6头4的HL=2;S72,网络设备21基于源IP地址1、本地SID表和Sub-BSID映射表,确定接口1并更新tracert UDP报文3为tracert UDP报文4,tracert UDP报文4包括IPv6头5,IPv6头5包括目的IP地址1和源IP地址2;S73,网络设备21通过接口1将tracert UDP报文4发送给网络设备23;S74,网络设备23基于源IP地址2、本地SID表和Sub-BSID映射表,确定接口2,将tracertUDP报文4中的HL-1并更新源IP地址2为源IP地址4,获得tracert UDP报文5,源IP地址4为Sub-BSID 100::1:202;S75,网络设备23从接口2向网络设备25发送tracert UDP报文5;S76,网络设备25将tracert UDP报文5中的HL-1获得将tracert UDP报文6,确定tracertUDP报文6的HL=0,生成并向网络设备21发送ICMPv6端口不可达报文2,ICMPv6端口不可达报文2包括IPv6头8和ICMPv6头1,IPv6头8中的源IP地址5为网络设备25接收tracert UDP报文5的接口对应的SID 500::1,IPv6头8中的目的IP地址3为tracert UDP报文6的源IP地址4(即Sub-BSID 100::1:202);S77,网络设备21接收到ICMPv6端口不可达报文2后,进行tracert信息2的显示。Next, the detection process for the connectivity length of 2 includes: S71, the network device 21 constructs a tracert UDP message 3, the tracert UDP message 3 includes an IPv6 header 4, the IPv6 header 4 includes a destination IP address 1 and a source IP address 1, and the HL of the IPv6 header 4 is 2; S72, the network device 21 determines the interface 1 based on the source IP address 1, the local SID table and the Sub-BSID mapping table, and updates the tracert UDP message 3 to the tracert UDP message 4, the tracert UDP message 4 includes an IPv6 header 5, and the IPv6 header 5 includes the destination IP address 1 and the source IP address 2; S73, the network device 21 sends the tracert UDP message 4 to the network device 23 through the interface 1; S74, the network device 23 determines the interface 2 based on the source IP address 2, the local SID table and the Sub-BSID mapping table, subtracts the HL in the tracert UDP message 4 from 1, updates the source IP address 2 to the source IP address 4, and obtains the tracert UDP message 5, the source IP address 4 is the Sub-BSID 100::1:202; S75, network device 23 sends tracert UDP message 5 to network device 25 from interface 2; S76, network device 25 obtains tracert UDP message 6 by subtracting HL-1 in tracert UDP message 5, determines that HL=0 of tracertUDP message 6, generates and sends ICMPv6 port unreachable message 2 to network device 21, ICMPv6 port unreachable message 2 includes IPv6 header 8 and ICMPv6 header 1, source IP address 5 in IPv6 header 8 is SID 500::1 corresponding to the interface of network device 25 receiving tracert UDP message 5, and destination IP address 3 in IPv6 header 8 is source IP address 4 (i.e. Sub-BSID 100::1:202) of tracert UDP message 6; S77, after receiving ICMPv6 port unreachable message 2, network device 21 displays tracert information 2.

接着,对连通性长度为3的检测过程包括:S81,网络设备21构建tracert UDP报文7,该tracert UDP报文7包括IPv6头9,IPv6头9包括目的IP地址1和源IP地址1,IPv6头9的HL=3;S82,网络设备21基于源IP地址1、本地SID表和Sub-BSID映射表,确定接口1并更新tracert UDP报文7为tracert UDP报文8,tracert UDP报文8包括IPv6头10,IPv6头10包括目的IP地址1和源IP地址2;S83,网络设备21通过接口1将tracert UDP报文8发送给网络设备23;S84,网络设备23基于源IP地址2、本地SID表和Sub-BSID映射表,确定接口2,将tracert UDP报文8中的HL-1并更新源IP地址2为源IP地址4,获得tracert UDP报文9;S85,网络设备23从接口2向网络设备25发送tracert UDP报文9;S86,网络设备25基于源IP地址4、本地SID表和Sub-BSID映射表,确定接口2,将tracert UDP报文9中的HL-1并更新源IP地址4为源IP地址6,获得tracertUDP报文10,源IP地址6为Sub-BSID 100::1:201;S87,网络设备25从接口2向网络设备27发送tracert UDP报文10;S88,网络设备27将tracertUDP报文10中的HL-1获得将tracert UDP报文11,确定tracert UDP报文11的HL=0,生成并向网络设备21发送ICMPv6端口不可达报文3,ICMPv6端口不可达报文3包括IPv6头14和ICMPv6头1,IPv6头14中的源IP地址8为tracert UDP报文10或tracert UDP报文11的目的IP地址1,IPv6头14中的目的IP地址4为tracert UDP报文10或tracert UDP报文11的源IP地址6(即Sub-BSID100::1:201);S89,网络设备21接收到ICMPv6端口不可达报文3后,进行tracert信息3的显示。由于网络设备21接收到的ICMPv6端口不可达报文3中的目的IP地址为该SRv6隧道的尾节点的节点SID,所以,认为对该SRv6隧道的tracert检测完成,不再对HL+1后构建tracertUDP报文进行继续tracert检测。Next, the detection process for the connectivity length of 3 includes: S81, the network device 21 constructs a tracert UDP message 7, the tracert UDP message 7 includes an IPv6 header 9, the IPv6 header 9 includes a destination IP address 1 and a source IP address 1, and the HL of the IPv6 header 9 is 3; S82, the network device 21 determines the interface 1 based on the source IP address 1, the local SID table and the Sub-BSID mapping table, and updates the tracert UDP message 7 to the tracert UDP message 8, the tracert UDP message 8 includes an IPv6 header 10, and the IPv6 header 10 includes the destination IP address 1 and the source IP address 2; S83, the network device 21 sends the tracert UDP message 8 to the network device 23 through the interface 1; S84, the network device 23 determines the interface 2 based on the source IP address 2, the local SID table and the Sub-BSID mapping table, subtracts the HL in the tracert UDP message 8 from 1, and updates the source IP address 2 to the source IP address 4, and obtains the tracert UDP message 9; S85, network device 23 sends tracert UDP message 9 from interface 2 to network device 25; S86, network device 25 determines interface 2 based on source IP address 4, local SID table and Sub-BSID mapping table, updates HL-1 in tracert UDP message 9 to source IP address 6, obtains tracert UDP message 10, source IP address 6 is Sub-BSID 100::1:201; S87, network device 25 sends tracert UDP message 10 from interface 2 to network device 27; S88, network device 27 obtains tracert UDP message 11 from HL-1 in tracert UDP message 10, determines that HL=0 of tracert UDP message 11, generates and sends ICMPv6 port unreachable message 3 to network device 21, ICMPv6 port unreachable message 3 includes IPv6 header 14 and ICMPv6 header 1, source IP address 8 in IPv6 header 14 is tracert The destination IP address 1 of the UDP message 10 or the tracert UDP message 11, and the destination IP address 4 in the IPv6 header 14 are the source IP address 6 of the tracert UDP message 10 or the tracert UDP message 11 (i.e., Sub-BSID100::1:201); S89, after receiving the ICMPv6 port unreachable message 3, the network device 21 displays the tracert information 3. Since the destination IP address in the ICMPv6 port unreachable message 3 received by the network device 21 is the node SID of the tail node of the SRv6 tunnel, it is considered that the tracert detection of the SRv6 tunnel is completed, and no further tracert detection is performed on the tracertUDP message constructed after HL+1.

其中,显示的tracert信息例如可以包括:检测到的链路地址、性能(如时延)。例如,tracert信息1可以包括:300::1和时延1,tracert信息2可以包括:500::1和时延2,tracert信息3可以包括:700::10和时延3。tracert信息能够表征所检测的SRv6 policy所指示的转发路径对应连通性长度的性能。The displayed tracert information may include, for example: the detected link address, performance (such as delay). For example, tracert information 1 may include: 300::1 and delay 1, tracert information 2 may include: 500::1 and delay 2, and tracert information 3 may include: 700::10 and delay 3. The tracert information can characterize the performance of the connectivity length corresponding to the forwarding path indicated by the detected SRv6 policy.

可见,通过本申请实施例提供的方法,SRv6 policy所指示的转发路径上的各网络设备,都基于接收到的SRv6 policy建立并维护一张转发映射表,该转发映射表用于指导通过该SRv6 policy对应的转发路径转发的业务报文在该网络设备的处理;对于经过该SRv6policy所指示的转发路径转发的业务报文,通过IPv6头的源IP地址携带相应的路径信息,网络设备接收到业务报文后,通过转发映射表以及业务报文中IPv6头的源IP地址即可完成对业务报文的处理,使得业务报文能够在SRv6 policy所指示的转发路径中准确的完成传输。这样,基于本申请实施例提出的SRv6 policy的简化封装和转发机制,不再需要为通过SRv6 policy所指示的转发路径传输的业务报文封装SRH,也不再需要将封装了SRH的业务报文在SRv6 policy所指示的转发路径包括的各网络设备之间传输,在业务报文的IPv6头的源IP地址中携带SRv6 policy的路径信息,提高了SRv6 policy场景下业务报文的传输效率,也节约了业务报文传输过程中对网络链路带宽的消耗。It can be seen that through the method provided in the embodiment of the present application, each network device on the forwarding path indicated by the SRv6 policy establishes and maintains a forwarding mapping table based on the received SRv6 policy, and the forwarding mapping table is used to guide the processing of the service packets forwarded through the forwarding path corresponding to the SRv6 policy on the network device; for the service packets forwarded through the forwarding path indicated by the SRv6 policy, the corresponding path information is carried by the source IP address of the IPv6 header. After the network device receives the service packet, it can complete the processing of the service packet through the forwarding mapping table and the source IP address of the IPv6 header in the service packet, so that the service packet can be accurately transmitted in the forwarding path indicated by the SRv6 policy. In this way, based on the simplified encapsulation and forwarding mechanism of SRv6 policy proposed in the embodiment of the present application, it is no longer necessary to encapsulate SRH for the service messages transmitted through the forwarding path indicated by the SRv6 policy, and it is no longer necessary to transmit the service messages encapsulated with SRH between the network devices included in the forwarding path indicated by the SRv6 policy. The path information of the SRv6 policy is carried in the source IP address of the IPv6 header of the service message, which improves the transmission efficiency of the service messages in the SRv6 policy scenario and saves the consumption of network link bandwidth during the transmission of the service messages.

相应的,本申请实施例还提供了一种报文处理装置1100,该装置1100应用于第一网络设备,如图11所示。该装置1100可以包括:获得单元1101、处理单元1102和发送单元1103。其中:Accordingly, the embodiment of the present application further provides a message processing device 1100, which is applied to a first network device, as shown in FIG11. The device 1100 may include: an obtaining unit 1101, a processing unit 1102, and a sending unit 1103. Among them:

获得单元1101,用于获得第一业务报文,所述第一业务报文与第一基于第六版互联网协议的分段路由策略SRv6 policy匹配,所述第一业务报文包括第一第六版互联网协议IPv6头。该获得单元1101可以执行图8所示的S103。The obtaining unit 1101 is configured to obtain a first service message, the first service message matches a first segment routing policy SRv6 policy based on the sixth version of the Internet Protocol, and the first service message includes a first sixth version of the Internet Protocol IPv6 header. The obtaining unit 1101 may execute S103 shown in FIG8 .

处理单元1102,用于根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,所述第一出接口为所述第一网络设备在第一转发路径上的出接口,所述第一SRv6policy指示所述第一转发路径。该处理单元1102可以执行图8所示的S104。The processing unit 1102 is configured to determine a first outgoing interface according to the first source Internet Protocol IP address of the first IPv6 header, wherein the first outgoing interface is an outgoing interface of the first network device on the first forwarding path, and the first SRv6 policy indicates the first forwarding path. The processing unit 1102 may execute S104 shown in FIG8 .

所述处理单元1102,还用于将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备。该处理单元1102可以执行图8所示的S105。The processing unit 1102 is further configured to update the first source IP address in the first service message to a second source IP address to obtain a second service message, wherein the first source IP address indicates the first network device, the second source IP address indicates a second network device, and the second network device is a next hop device of the first network device in the first forwarding path. The processing unit 1102 may execute S105 shown in FIG8 .

发送单元1103,用于从所述第一出接口向所述第二网络设备发送所述第二业务报文。该发送单元1103可以执行图8所示的S106。The sending unit 1103 is configured to send the second service message from the first outbound interface to the second network device. The sending unit 1103 may execute S106 shown in FIG8 .

在一些实现方式中,所述处理单元1102,还用于:在所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口之前,确定所述第一源IP地址与转发映射表匹配。In some implementations, the processing unit 1102 is further configured to: before determining the first outbound interface based on the first source Internet Protocol IP address of the first IPv6 header, determine that the first source IP address matches a forwarding mapping table.

在一些实现方式中,所述处理单元1102,还用于:若确定所述第一源IP地址与所述转发映射表不匹配,则,根据所述第一IPv6头中的第一目的IP地址处理所述第一业务报文。In some implementations, the processing unit 1102 is further configured to: if it is determined that the first source IP address does not match the forwarding mapping table, process the first service message according to the first destination IP address in the first IPv6 header.

在一些实现方式中,所述转发映射表为子绑定分段标识Sub-BSID映射表,所述第一源IP地址为所述第一网络设备的第一Sub-BSID,所述第一Sub-BSID包括第一分段列表的标识和段剩余SL,所述第一SRv6 policy包括所述第一分段列表,所述SL指示所述第一网络设备在所述第一分段列表中的位置,所述Sub-BSID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述Sub-BSID映射表包括所述第一Sub-BSID和本地的第一分段标识SID的对应关系,所述第一SID与所述第一出接口对应。In some implementations, the forwarding mapping table is a sub-binding segment identifier Sub-BSID mapping table, the first source IP address is the first Sub-BSID of the first network device, the first Sub-BSID includes an identifier of a first segment list and a segment remaining SL, the first SRv6 policy includes the first segment list, the SL indicates the position of the first network device in the first segment list, the Sub-BSID mapping table is used to guide the processing of service packets transmitted through the forwarding path corresponding to the SRv6 policy on the first network device, the Sub-BSID mapping table includes a correspondence between the first Sub-BSID and a local first segment identifier SID, and the first SID corresponds to the first output interface.

在一些实现方式中,所述装置1100还包括:接收单元,所述接收单元,用于获得第一消息,所述第一消息携带所述第一SRv6 policy,所述第一SRv6 policy包括第一绑定分段标识BSID,所述第一BSID用于标识所述第一SRv6 policy,所述第一SRv6 policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;那么,所述处理单元1102,还用于基于所述第一BSID和所述至少一个分段列表,获得所述Sub-BSID映射表。In some implementations, the device 1100 also includes: a receiving unit, the receiving unit is used to obtain a first message, the first message carries the first SRv6 policy, the first SRv6 policy includes a first binding segment identifier BSID, the first BSID is used to identify the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list; then, the processing unit 1102 is also used to obtain the Sub-BSID mapping table based on the first BSID and the at least one segment list.

在一些实现方式中,所述处理单元1102,具体用于:从所述Sub-BSID映射表中,确定与所述第一源IP地址中的所述第一Sub-BSID匹配的所述第一SID;从本地SID表中,确定与所述第一SID匹配的所述第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。In some implementations, the processing unit 1102 is specifically used to: determine the first SID that matches the first Sub-BSID in the first source IP address from the Sub-BSID mapping table; determine the first output interface that matches the first SID from a local SID table, and the local SID table includes a correspondence between the first SID and the first output interface.

在一些实现方式中,所述处理单元1102,具体用于:更新所述第一源IP地址中SL字段的值,获得所述第二业务报文,所述第二业务报文中的第二源IP地址中SL字段的值指示所述第二网络设备在所述第一分段列表中的位置,所述第二源IP地址为所述第二网络设备的第二Sub-BSID。In some implementations, the processing unit 1102 is specifically used to: update the value of the SL field in the first source IP address to obtain the second service message, the value of the SL field in the second source IP address in the second service message indicates the position of the second network device in the first segment list, and the second source IP address is the second Sub-BSID of the second network device.

在一些实现方式中,所述获得单元1101,具体用于:接收第三业务报文,所述第三业务报文与所述第一SRv6 policy匹配;在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SRv6 policy中所述第一SID对应的所述第一Sub-BSID,所述第一SID为所述第一分段列表中的第一个SID。In some implementations, the obtaining unit 1101 is specifically used to: receive a third service message, the third service message matches the first SRv6 policy; encapsulate the first IPv6 header on the third service message to obtain the first service message, the first source IP address of the first IPv6 header is the first Sub-BSID corresponding to the first SID in the first SRv6 policy, and the first SID is the first SID in the first segment list.

在一些实现方式中,所述获得单元1101,还用于:获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;所述处理单元1102,还用于:若确定所述第三IPv6地址中的第三源IP地址与所述Sub-BSID映射表匹配,且所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为所述第一网络设备的第三Sub-BSID,所述第三Sub-BSID包括第二分段列表的标识和SL,所述第二SRv6policy包括所述第二分段列表,所述SL指示所述第一网络设备在所述第二分段列表中的位置。In some implementations, the obtaining unit 1101 is further used to: obtain a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header; the processing unit 1102 is further used to: if it is determined that the third source IP address in the third IPv6 address matches the Sub-BSID mapping table, and the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, process the fourth service message according to the third destination IP address in the third IPv6 header, the third source IP address is the third Sub-BSID of the first network device, the third Sub-BSID includes an identifier and SL of a second segment list, the second SRv6 policy includes the second segment list, and the SL indicates the position of the first network device in the second segment list.

在一些实现方式中,所述第一Sub-BSID包括定位符、功能和参数,所述定位符和所述功能与第一BSID一致,所述参数包括所述第一分段列表的标识和SL,所述第一BSID用于标识所述第一SRv6 policy。In some implementations, the first Sub-BSID includes a locator, a function, and a parameter, the locator and the function are consistent with the first BSID, the parameters include an identifier and a SL of the first segment list, and the first BSID is used to identify the first SRv6 policy.

在一些实现方式中,所述转发映射表为SID映射表,所述第一源IP地址为所述第一网络设备的第一分段标识SID,所述第一SID为所述第一SRv6 policy所包括的第一分段列表中所述第一网络设备的标识,所述SID映射表用于指导通过SRv6 policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括所述第一SID和第二SID的对应关系,所述第二SID为所述第一分段列表中所述第二网络设备的标识。In some implementations, the forwarding mapping table is a SID mapping table, the first source IP address is a first segment identifier SID of the first network device, the first SID is an identifier of the first network device in a first segment list included in the first SRv6 policy, the SID mapping table is used to guide the processing of service packets transmitted through a forwarding path corresponding to the SRv6 policy on the first network device, the SID mapping table includes a correspondence between the first SID and the second SID, and the second SID is an identifier of the second network device in the first segment list.

在一些实现方式中,所述获得单元1101,还用于:获得第一消息,所述第一消息携带所述第一SRv6 policy,所述第一SRv6 policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;处理单元1102,还用于:基于所述至少一个分段列表,获得SID映射表。In some implementations, the obtaining unit 1101 is further used to: obtain a first message, the first message carries the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list; the processing unit 1102 is further used to: obtain a SID mapping table based on the at least one segment list.

在一些实现方式中,所述处理单元1102,具体用于:从本地SID表中,确定与所述第一源IP地址中的所述第一SID匹配的第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。In some implementations, the processing unit 1102 is specifically configured to: determine, from a local SID table, a first outbound interface that matches the first SID in the first source IP address, the local SID table including a correspondence between the first SID and the first outbound interface.

在一些实现方式中,所述处理单元1102,具体用于:从所述SID映射表中,获得所述第一源IP地址关联的所述第二SID;将所述第一源IP地址中的所述第一SID更新为所述第二SID,获得所述第二业务报文,所述第二业务报文的所述第二源IP地址为所述第二SID。In some implementations, the processing unit 1102 is specifically used to: obtain the second SID associated with the first source IP address from the SID mapping table; update the first SID in the first source IP address to the second SID, and obtain the second service message, wherein the second source IP address of the second service message is the second SID.

在一些实现方式中,所述获得单元1101,具体用于:接收第三业务报文,所述第三业务报文与所述第一SRv6 policy匹配;在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SID,所述第一SID为所述第一分段列表中的第一个SID。In some implementations, the obtaining unit 1101 is specifically used to: receive a third business message, the third business message matches the first SRv6 policy; encapsulate the first IPv6 header on the third business message to obtain the first business message, the first source IP address of the first IPv6 header is the first SID, and the first SID is the first SID in the first segment list.

在一些实现方式中,所述获得单元1101,具体用于:获得第四业务报文,所述第四业务报文与第二SRv6 policy匹配,所述第四业务报文包括第三IPv6头;所述处理单元1102,具体用于:若确定所述第三源IP地址指示所述第一网络设备为所述第二SRv6 policy的尾节点,根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为第三SID,所述第三SID为所述第二SRv6 policy所包括的第二分段列表中所述第一网络设备的标识。In some implementations, the obtaining unit 1101 is specifically used to: obtain a fourth business message, the fourth business message matches the second SRv6 policy, and the fourth business message includes a third IPv6 header; the processing unit 1102 is specifically used to: if it is determined that the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, process the fourth business message according to the third destination IP address in the third IPv6 header, the third source IP address is a third SID, and the third SID is the identifier of the first network device in the second segment list included in the second SRv6 policy.

在一些实现方式中,所述第三IPv6头的所述第三目的IP地址为业务SID,所述处理单元1102,具体用于:解除所述第四业务报文中与所述第二SRv6 policy相关的封装,获得第五业务报文;基于所述业务SID,处理所述第五业务报文。In some implementations, the third destination IP address of the third IPv6 header is a service SID, and the processing unit 1102 is specifically used to: remove the encapsulation related to the second SRv6 policy in the fourth service message to obtain a fifth service message; and process the fifth service message based on the service SID.

在一些实现方式中,所述第一业务报文为ping报文,所述第一业务报文还包括互联网控制信息协议版本六ICMPv6头。In some implementations, the first service message is a ping message, and the first service message also includes an Internet Control Message Protocol version 6 ICMPv6 header.

作为一个示例,所述获得单元1101,还用于:获得第六业务报文,所述第六业务报文包括所述ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一转发路径的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;发送单元1103,还用于:按照所述第四IPv6头的目的IP地址转发所述第六业务报文。As an example, the obtaining unit 1101 is also used to: obtain a sixth business message, the sixth business message includes the ICMPv6 header and the fourth IPv6 header, the source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header, the destination IP address of the fourth IPv6 header corresponds to the last hop of the first forwarding path, and the sixth business message is a response message to the first business message; the sending unit 1103 is also used to: forward the sixth business message according to the destination IP address of the fourth IPv6 header.

在另一些实现方式中,所述第一业务报文和所述第二业务报文均为tracert报文,所述第二业务报文的跳限度比所述第一业务报文中的跳限度小1。In some other implementations, both the first service message and the second service message are tracert messages, and a hop limit of the second service message is 1 less than a hop limit in the first service message.

作为一个示例,所述获得单元1101,还用于:获得第六业务报文,所述第六业务报文包括ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一业务报文的跳限度指示的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;发送单元1103,还用于:按照所述第四IPv6头的目的IP地址转发所述第六业务报文。As an example, the obtaining unit 1101 is also used to: obtain a sixth business message, the sixth business message includes an ICMPv6 header and a fourth IPv6 header, the source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header, the destination IP address of the fourth IPv6 header corresponds to the last hop indicated by the hop limit of the first business message, and the sixth business message is a response message to the first business message; the sending unit 1103 is also used to: forward the sixth business message according to the destination IP address of the fourth IPv6 header.

需要说明的是,本申请实施例提供的装置1100的具体实现方式以及达到的技术效果,可以参见方法100中第一网络设备的相关操作的说明。It should be noted that the specific implementation method and technical effect achieved by the apparatus 1100 provided in the embodiment of the present application can be found in the description of the relevant operations of the first network device in the method 100.

相应的,本申请实施例还提供了一种报文处理装置1200,该装置1200应用于第一网络设备,如图12所示。该装置1200可以包括:接收单元1201和处理单元1202。其中:Accordingly, the embodiment of the present application further provides a message processing device 1200, which is applied to a first network device, as shown in FIG12. The device 1200 may include: a receiving unit 1201 and a processing unit 1202. Among them:

接收单元1201,用于接收第一消息,所述第一消息携带基于第六版互联网协议的分段路由策略SRv6 policy,所述SRv6 policy包括至少一个分段列表,所述SRv6 policy与所述第一网络设备的本地定位符匹配。该接收单元1201可以执行图8所示的S101。The receiving unit 1201 is configured to receive a first message, wherein the first message carries a segment routing policy SRv6 policy based on the sixth version of the Internet Protocol, wherein the SRv6 policy includes at least one segment list, and the SRv6 policy matches a local locator of the first network device. The receiving unit 1201 may execute S101 shown in FIG8 .

处理单元1202,用于基于所述至少一个分段列表,获得转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。该处理单元1202可以执行图8所示的S102。The processing unit 1202 is configured to obtain a forwarding mapping table based on the at least one segment list, wherein the forwarding mapping table is used to guide the processing of the service message forwarded through the forwarding path corresponding to the SRv6 policy in the first network device. The processing unit 1202 may execute S102 shown in FIG. 8 .

在一些实现方式中,所述第一消息还包括绑定分段标识BSID,所述BSID用于标识所述SRv6 policy,所述处理单元1202,具体用于:基于所述BSID和所述至少一个分段列表,获得子绑定分段标识Sub-BSID映射表,所述Sub-BSID映射表包括Sub-BSID和本地分段标识SID的对应关系,所述Sub-BSID与所述本地定位符匹配,所述Sub-BSID包括分段列表的标识和段剩余SL。In some implementations, the first message also includes a binding segment identifier BSID, and the BSID is used to identify the SRv6 policy. The processing unit 1202 is specifically used to: based on the BSID and the at least one segment list, obtain a sub-binding segment identifier Sub-BSID mapping table, the Sub-BSID mapping table includes a correspondence between the Sub-BSID and the local segment identifier SID, the Sub-BSID matches the local locator, and the Sub-BSID includes an identifier of the segment list and a segment remainder SL.

在一些实现方式中,所述SRv6 policy与所述第一网络设备的本地定位符匹配包括所述SRv6 policy中的SID与所述本地定位符属于相同网段。In some implementations, the SRv6 policy matches the local locator of the first network device including that the SID in the SRv6 policy and the local locator belong to the same network segment.

作为一个示例,所述BSID与所述本地定位符属于相同网段。那么,所述处理单元1202,还用于:将所述BSID保存在本地SID表,所述本地SID表包括所述第一网络设备的SID和处理动作的对应关系。As an example, the BSID and the local locator belong to the same network segment. Then, the processing unit 1202 is further configured to: store the BSID in a local SID table, wherein the local SID table includes a correspondence between the SID of the first network device and a processing action.

作为另一个示例,所述BSID与所述本地定位符不属于相同网段,但所述至少一个分段列表中的任意一个SID与所述本地定位符属于相同网段。As another example, the BSID and the local locator do not belong to the same network segment, but any one SID in the at least one segment list and the local locator belong to the same network segment.

在一些实现方式中,处理单元1202,具体用于:基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID;基于所确定的Sub-BSID和每个Sub-BSID对应的本地SID,获得所述Sub-BSID映射表。In some implementations, the processing unit 1202 is specifically configured to: determine a Sub-BSID matching the local locator based on the BSID and the at least one segment list; and obtain the Sub-BSID mapping table based on the determined Sub-BSID and a local SID corresponding to each Sub-BSID.

作为一个示例,所述处理单元1202,具体用于:基于所述BSID计算所述至少一个分段列表中每个分段列表的各SID的Sub-BSID;从计算的所有Sub-BSID中筛选与所述本地定位符属于同一网段的Sub-BSID。As an example, the processing unit 1202 is specifically configured to: calculate the Sub-BSID of each SID in each segment list in the at least one segment list based on the BSID; and filter the Sub-BSID belonging to the same network segment as the local locator from all calculated Sub-BSIDs.

作为另一个示例,所述处理单元1202,具体用于:从所述至少一个分段列表中每个分段列表的各SID中筛选与所述本地定位符属于同一网段的SID;基于所述BSID计算所筛选出的SID对应的Sub-BSID。As another example, the processing unit 1202 is specifically configured to: filter out SIDs belonging to the same network segment as the local locator from each SID in each segment list of the at least one segment list; and calculate a Sub-BSID corresponding to the filtered SID based on the BSID.

在一些实现方式中,所述Sub-BSID包括定位符、功能和参数,所述定位符和所述功能与所述BSID一致,所述参数包括分段列表的标识和SL。In some implementations, the Sub-BSID includes a locator, a function, and parameters, the locator and the function are consistent with the BSID, and the parameters include an identifier of a segment list and a SL.

在另一些实现方式中,所述处理单元1202,具体用于:基于所述至少一个分段列表,获得SID映射表,所述SID映射表用于指导通过所述转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括第一SID和第二SID的对应关系,所述第一SID为第一分段列表中所述第一网络设备的标识,所述第二SID为所述第一分段列表中第二网络设备的标识,所述第二网络设备为所述第一网络设备在所述转发路径的下一跳设备,所述至少一个分段列表包括所述第一分段列表,所述第一分段列表与所述转发路径对应。In some other implementations, the processing unit 1202 is specifically used to: obtain a SID mapping table based on the at least one segment list, the SID mapping table is used to guide the processing of the service message transmitted through the forwarding path on the first network device, the SID mapping table includes a correspondence between a first SID and a second SID, the first SID is an identifier of the first network device in the first segment list, the second SID is an identifier of the second network device in the first segment list, the second network device is a next-hop device of the first network device on the forwarding path, the at least one segment list includes the first segment list, and the first segment list corresponds to the forwarding path.

在一些实现方式中,所述第一消息为边界网关协议BGP SR policy报文。In some implementations, the first message is a Border Gateway Protocol BGP SR policy message.

在一些实现方式中,所述第一消息为路径计算单元协议PCEP报文。In some implementations, the first message is a Path Computation Element Protocol (PCEP) message.

在一些实现方式中,所述装置1200还包括获得单元和发送单元,所述获得单元,用于获得第一业务报文,所述第一业务报文与所述SRv6 policy匹配,所述第一业务报文包括第一IPv6头;所述处理单元1202,还用于根据所述第一IPv6头的第一源IP地址确定第一出接口,所述第一出接口为所述第一网络设备在所述转发路径上的出接口;所述处理单元1202,还用于将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;所述发送单元,用于从所述第一出接口向所述第二网络设备发送所述第二业务报文。In some implementations, the device 1200 also includes an obtaining unit and a sending unit, the obtaining unit is used to obtain a first service message, the first service message matches the SRv6 policy, and the first service message includes a first IPv6 header; the processing unit 1202 is also used to determine a first output interface based on a first source IP address of the first IPv6 header, the first output interface is the output interface of the first network device on the forwarding path; the processing unit 1202 is also used to update the first source IP address in the first service message to a second source IP address to obtain a second service message, the first source IP address indicates the first network device, the second source IP address indicates the second network device, and the second network device is the next hop device of the first network device on the first forwarding path; the sending unit is used to send the second service message from the first output interface to the second network device.

需要说明的是,本申请实施例提供的装置1100的具体实现方式以及达到的技术效果,可以参见方法100中第一网络设备的相关操作的说明。It should be noted that the specific implementation method and technical effect achieved by the apparatus 1100 provided in the embodiment of the present application can be found in the description of the relevant operations of the first network device in the method 100.

本申请实施例还提供了一种报文处理装置1300,应用于控制实体,如图13所示,所述装置1300可以包括:处理单元1301和发送单元1302。其中:The embodiment of the present application further provides a message processing device 1300, which is applied to a control entity. As shown in FIG13 , the device 1300 may include: a processing unit 1301 and a sending unit 1302. Among them:

处理单元1301,用于确定SRv6 policy,所述SRv6 policy包括至少一个分段列表。The processing unit 1301 is configured to determine an SRv6 policy, where the SRv6 policy includes at least one segment list.

发送单元1302,用于发送第一消息,所述第一消息包括所述SRv6 policy,所述第一消息用于指示本地定位符与所述SRv6 policy匹配的第一网络设备基于所述至少一个分段列表生成转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。A sending unit 1302 is used to send a first message, where the first message includes the SRv6 policy, and the first message is used to instruct a first network device whose local locator matches the SRv6 policy to generate a forwarding mapping table based on the at least one segment list, and the forwarding mapping table is used to guide the processing of service packets forwarded through the forwarding path corresponding to the SRv6 policy on the first network device.

作为一个示例,发送单元1302,具体用于:向所述转发路径经过的所述第一网络设备发送所述第一消息,所述转发路径经过的所有第一网络设备与所述控制实体均为边界网关协议BGP邻居。As an example, the sending unit 1302 is specifically configured to: send the first message to the first network device through which the forwarding path passes, and all the first network devices through which the forwarding path passes and the control entity are Border Gateway Protocol BGP neighbors.

作为另一个示例,发送单元1302,具体用于:通过RR向所述转发路径经过的所述第一网络设备发送所述第一消息。As another example, the sending unit 1302 is specifically configured to: send the first message to the first network device through which the forwarding path passes through RR.

上述示例中,所述第一消息可以为BGP SR policy报文。In the above example, the first message may be a BGP SR policy message.

在另一些实现方式中,所述第一消息也可以为PCEP报文。In some other implementations, the first message may also be a PCEP message.

其中,所述第一消息还可以包括BSID,所述BSID用于标识所述SRv6 policy。The first message may further include a BSID, where the BSID is used to identify the SRv6 policy.

需要说明的是,本申请实施例提供的装置1300的具体实现方式以及达到的技术效果,可以参见本申请实施例提供的方法中关于控制实体的相关操作的说明。It should be noted that the specific implementation method and technical effect achieved by the device 1300 provided in the embodiment of the present application can refer to the description of the relevant operations of the control entity in the method provided in the embodiment of the present application.

参见图14,本申请实施例提供了一种网络设备1400(也可以称为通信设备1400)。该网络设备1400可以是上述任一实施例中的网络设备,例如可以是图1中的各网络设备;又例如也可以是方法100中的第一网络设备。网络设备1400可以实现上述实施例中各种网络设备的功能。或者,该网络设备1400可以是上述任一实施例中的控制实体,例如可以是图1中的控制实体10;又例如也可以是方法100中的控制实体。网络设备1400可以实现上述实施例中各控制实体的功能。该网络设备1400包括至少一个处理器1401,总线系统1402,存储器1403以及至少一个通信接口1404。Referring to Figure 14, an embodiment of the present application provides a network device 1400 (also referred to as a communication device 1400). The network device 1400 may be a network device in any of the above embodiments, for example, it may be each network device in Figure 1; for example, it may also be the first network device in method 100. The network device 1400 may implement the functions of various network devices in the above embodiments. Alternatively, the network device 1400 may be a control entity in any of the above embodiments, for example, it may be the control entity 10 in Figure 1; for example, it may also be the control entity in method 100. The network device 1400 may implement the functions of each control entity in the above embodiments. The network device 1400 includes at least one processor 1401, a bus system 1402, a memory 1403 and at least one communication interface 1404.

该网络设备1400是一种硬件结构的装置,可以用于实现图11所示的报文处理装置1100中的功能模块。例如,本领域技术人员可以想到图11所示的报文处理装置1100中的处理单元1102可以通过该至少一个处理器1401调用存储器1403中的代码来实现。或者,该网络设备1400是一种硬件结构的装置,可以用于实现图12所示的报文处理装置1200中的功能模块。例如,本领域技术人员可以想到图12所示的报文处理装置1200中的处理单元1202可以通过该至少一个处理器1401调用存储器1403中的代码来实现。该网络设备1400是一种硬件结构的装置,可以用于实现图13所示的报文处理装置1300中的功能模块。例如,本领域技术人员可以想到图13所示的报文处理装置1300中的处理单元1301可以通过该至少一个处理器1401调用存储器1403中的代码来实现。The network device 1400 is a device of hardware structure, which can be used to implement the functional modules in the message processing device 1100 shown in FIG. 11. For example, those skilled in the art can imagine that the processing unit 1102 in the message processing device 1100 shown in FIG. 11 can be implemented by the at least one processor 1401 calling the code in the memory 1403. Alternatively, the network device 1400 is a device of hardware structure, which can be used to implement the functional modules in the message processing device 1200 shown in FIG. 12. For example, those skilled in the art can imagine that the processing unit 1202 in the message processing device 1200 shown in FIG. 12 can be implemented by the at least one processor 1401 calling the code in the memory 1403. The network device 1400 is a device of hardware structure, which can be used to implement the functional modules in the message processing device 1300 shown in FIG. 13. For example, those skilled in the art can imagine that the processing unit 1301 in the message processing device 1300 shown in FIG. 13 can be implemented by the at least one processor 1401 calling the code in the memory 1403.

可选的,该网络设备1400还可用于实现上述任一实施例中网络设备的功能。Optionally, the network device 1400 may also be used to implement the functions of the network device in any of the above embodiments.

可选的,上述处理器1401可以是一个通用中央处理器(central processingunit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。Optionally, the processor 1401 may 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 present application.

上述总线系统1402可包括一通路,在上述组件之间传送信息。The bus system 1402 may include a path for transmitting information between the components.

上述通信接口1404,用于与其他设备或通信网络通信。The communication interface 1404 is used to communicate with other devices or communication networks.

上述存储器1403可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compactdisc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The memory 1403 may 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 compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, 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 may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

其中,存储器1403用于存储执行本申请方案的应用程序代码,并由处理器1401来控制执行。处理器1401用于执行存储器1403中存储的应用程序代码,从而实现本申请方法中的功能。The memory 1403 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 1401. The processor 1401 is used to execute the application code stored in the memory 1403, so as to realize the functions in the method of the present application.

在具体实现中,作为一种实施例,处理器1401可以包括一个或多个CPU,例如图14中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 1401 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 14 .

在具体实现中,作为一种实施例,该网络设备1400可以包括多个处理器,例如图10中的处理器1401和处理器1407。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the network device 1400 may include multiple processors, such as the processor 1401 and the processor 1407 in Figure 10. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).

图15是本申请实施例提供的另一种网络设备1500(也可以称为通信设备1500)的结构示意图,网络设备1500可以是上述任一实施例中的第一网络设备或控制实体,可以是图1中的各网络设备或控制实体10;又例如也可以是方法100中的第一网络设备或控制实体。网络设备1500可以实现上述实施例中各种网络设备或控制实体的功能。FIG15 is a schematic diagram of the structure of another network device 1500 (also referred to as communication device 1500) provided in an embodiment of the present application. The network device 1500 may be the first network device or control entity in any of the above embodiments, and may be each network device or control entity 10 in FIG1 ; for example, it may also be the first network device or control entity in method 100. The network device 1500 may implement the functions of various network devices or control entities in the above embodiments.

网络设备1500包括:主控板1510和接口板1530。The network device 1500 includes a main control board 1510 and an interface board 1530 .

主控板1510也称为主处理单元(main processing unit,MPU)或路由处理卡(route processor card),主控板1510对网络设备1500中各个组件的控制和管理,包括路由计算、设备管理、设备维护、协议处理功能。主控板1510包括:中央处理器1511和存储器1512。The main control board 1510 is also called a main processing unit (MPU) or a route processor card. The main control board 1510 controls and manages various components in the network device 1500, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 1510 includes: a central processing unit 1511 and a memory 1512.

接口板1530也称为线路接口单元卡(line processing unit,LPU)、线卡(linecard)或业务板。接口板1530用于提供各种业务接口并实现数据包的转发。业务接口包括而不限于以太网接口、POS(Packet over SONET/SDH)接口等,以太网接口例如是灵活以太网业务接口(Flexible Ethernet Clients,FlexE Clients)。接口板1530包括:中央处理器1531、网络处理器1532、转发表项存储器1534和物理接口卡(ph8sical interface card,PIC)1533。The interface board 1530 is also called a line processing unit (LPU), a line card or a service board. The interface board 1530 is used to provide various service interfaces and realize the forwarding of data packets. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET/SDH) interface, etc., and the Ethernet interface is, for example, a Flexible Ethernet Clients (FlexE Clients) service interface. The interface board 1530 includes: a central processing unit 1531, a network processor 1532, a forwarding table entry memory 1534 and a physical interface card (PIC) 1533.

接口板1530上的中央处理器1531用于对接口板1530进行控制管理并与主控板1510上的中央处理器1511进行通信。The central processor 1531 on the interface board 1530 is used to control and manage the interface board 1530 and communicate with the central processor 1511 on the main control board 1510 .

网络处理器1532用于实现报文的转发处理。网络处理器1532的形态可以是转发芯片。具体而言,上行报文的处理包括:报文入接口的处理,转发表查找;下行报文的处理:转发表查找等等。The network processor 1532 is used to implement message forwarding processing. The network processor 1532 may be in the form of a forwarding chip. Specifically, the processing of uplink messages includes: message inbound interface processing, forwarding table search; the processing of downlink messages: forwarding table search, etc.

物理接口卡1533用于实现物理层的对接功能,原始的流量由此进入接口板1530,以及处理后的报文从该物理接口卡1533发出。物理接口卡1533包括至少一个物理接口,物理接口也称物理口,物理接口卡1533对应于系统架构中的FlexE物理接口。物理接口卡1533也称为子卡,可安装在接口板1530上,负责将光电信号转换为报文并对报文进行合法性检查后转发给网络处理器1532处理。在一些实施例中,接口板1530的中央处理器1531也可执行网络处理器1532的功能,比如基于通用CPU实现软件转发,从而物理接口卡1533中不需要网络处理器1532。The physical interface card 1533 is used to implement the docking function of the physical layer, from which the original traffic enters the interface board 1530, and the processed message is sent from the physical interface card 1533. The physical interface card 1533 includes at least one physical interface, which is also called a physical port. The physical interface card 1533 corresponds to the FlexE physical interface in the system architecture. The physical interface card 1533 is also called a daughter card, which can be installed on the interface board 1530 and is responsible for converting the optical signal into a message and forwarding the message to the network processor 1532 for processing after checking the legitimacy of the message. In some embodiments, the central processor 1531 of the interface board 1530 can also perform the functions of the network processor 1532, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 1532 is not required in the physical interface card 1533.

可选地,网络设备1500包括多个接口板,例如网络设备1500还包括接口板1540,接口板1540包括:中央处理器1541、网络处理器1542、转发表项存储器1544和物理接口卡1543。Optionally, the network device 1500 includes multiple interface boards. For example, the network device 1500 also includes an interface board 1540 . The interface board 1540 includes a central processor 1541 , a network processor 1542 , a forwarding table entry memory 1544 , and a physical interface card 1543 .

可选地,网络设备1500还包括交换网板1520。交换网板1520也可以称为交换网板单元(switch fabric unit,SFU)。在网络设备有多个接口板1530的情况下,交换网板1520用于完成各接口板之间的数据交换。例如,接口板1530和接口板1540之间可以通过交换网板1520通信。Optionally, the network device 1500 further includes a switching fabric board 1520. The switching fabric board 1520 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards 1530, the switching fabric board 1520 is used to complete data exchange between the interface boards. For example, the interface board 1530 and the interface board 1540 may communicate through the switching fabric board 1520.

主控板1510和接口板1530耦合。例如。主控板1510、接口板1530和接口板1540,以及交换网板1520之间通过系统总线与系统背板相连实现互通。在一种可能的实现方式中,主控板1510和接口板1530之间建立进程间通信协议(inter-process communication,IPC)通道,主控板1510和接口板1530之间通过IPC通道进行通信。The main control board 1510 is coupled to the interface board 1530. For example, the main control board 1510, the interface board 1530, the interface board 1540, and the switching network board 1520 are connected to the system backplane through a system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 1510 and the interface board 1530, and the main control board 1510 and the interface board 1530 communicate through the IPC channel.

在逻辑上,网络设备1500包括控制面和转发面,控制面包括主控板1510和中央处理器1531,转发面包括执行转发的各个组件,比如转发表项存储器1534、物理接口卡1533和网络处理器1532。控制面执行路由器、生成转发表、处理信令和协议报文、配置与维护设备的状态等功能,控制面将生成的转发表下发给转发面,在转发面,网络处理器1532基于控制面下发的转发表对物理接口卡1533收到的报文查表转发。控制面下发的转发表可以保存在转发表项存储器1534中。在一些实施例中,控制面和转发面可以完全分离,不在同一设备上。Logically, the network device 1500 includes a control plane and a forwarding plane. The control plane includes a main control board 1510 and a central processor 1531. The forwarding plane includes various components for performing forwarding, such as a forwarding table entry memory 1534, a physical interface card 1533, and a network processor 1532. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 1532 forwards the message received by the physical interface card 1533 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 1534. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same device.

如果网络设备1500被配置为控制实体,中央处理器1511可以确定SRv6 policy,所述SRv6 policy包括至少一个分段列表;网络处理器1532还可以触发物理接口卡1533发送第一消息,所述第一消息包括所述SRv6 policy,所述第一消息用于指示本地定位符与所述SRv6 policy匹配的第一网络设备基于所述至少一个分段列表生成转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。If the network device 1500 is configured as a control entity, the central processor 1511 can determine the SRv6 policy, and the SRv6 policy includes at least one segment list; the network processor 1532 can also trigger the physical interface card 1533 to send a first message, and the first message includes the SRv6 policy. The first message is used to indicate that the first network device whose local locator matches the SRv6 policy generates a forwarding mapping table based on the at least one segment list, and the forwarding mapping table is used to guide the processing of the service message forwarded through the forwarding path corresponding to the SRv6 policy in the first network device.

应理解,报文处理装置1300中的发送单元1302可以相当于网络设备1500中的物理接口卡1533或物理接口卡1543;报文处理装置1300中的处理单元1301可以相当于网络设备1500中的中央处理器1511或中央处理器1531。It should be understood that the sending unit 1302 in the message processing device 1300 can be equivalent to the physical interface card 1533 or the physical interface card 1543 in the network device 1500; the processing unit 1301 in the message processing device 1300 can be equivalent to the central processor 1511 or the central processor 1531 in the network device 1500.

应理解,本申请实施例中接口板1540上的操作与接口板1530的操作一致,为了简洁,不再赘述。应理解,本实施例的网络设备1500可对应于上述各个实施例中的报文处理装置1300,该网络设备1500中的主控板1510、接口板1530和/或接口板1540可以实现上述各个实施例中的报文处理装置1300中所具有的功能和/或所实施的各种步骤,为了简洁,在此不再赘述。It should be understood that the operation on the interface board 1540 in the embodiment of the present application is consistent with the operation of the interface board 1530, and for the sake of brevity, it will not be repeated. It should be understood that the network device 1500 of this embodiment can correspond to the message processing device 1300 in the above-mentioned embodiments, and the main control board 1510, the interface board 1530 and/or the interface board 1540 in the network device 1500 can implement the functions and/or various steps implemented in the message processing device 1300 in the above-mentioned embodiments, and for the sake of brevity, it will not be repeated here.

如果网络设备1500被配置为第一网络设备,中央处理器1511可以获得第一业务报文,所述第一业务报文与第一基于第六版互联网协议的分段路由策略SRv6 policy匹配,所述第一业务报文包括第一第六版互联网协议IPv6头;中央处理器1511还可以根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,所述第一出接口为所述第一网络设备在第一转发路径上的出接口,所述第一SRv6 policy指示所述第一转发路径;中央处理器1511还可以将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;网络处理器1532可以触发物理接口卡1533从所述第一出接口向所述第二网络设备发送所述第二业务报文。If the network device 1500 is configured as a first network device, the central processor 1511 can obtain a first service message, the first service message matches the first segment routing policy SRv6 policy based on the sixth version of the Internet Protocol, and the first service message includes a first sixth version of the Internet Protocol IPv6 header; the central processor 1511 can also determine a first output interface based on a first source Internet Protocol IP address of the first IPv6 header, the first output interface is the output interface of the first network device on the first forwarding path, and the first SRv6 policy indicates the first forwarding path; the central processor 1511 can also update the first source IP address in the first service message to a second source IP address to obtain a second service message, the first source IP address indicates the first network device, the second source IP address indicates the second network device, and the second network device is the next hop device of the first network device on the first forwarding path; the network processor 1532 can trigger the physical interface card 1533 to send the second service message from the first output interface to the second network device.

应理解,报文处理装置1100中的发送单元1103、以及网络设备1400中的通信接口1404可以相当于网络设备1500中的物理接口卡1533或物理接口卡1543;报文处理装置1100中的处理单元1102和获得单元1101、以及网络设备1400中的处理器1401可以相当于网络设备1500中的中央处理器1511或中央处理器1531。It should be understood that the sending unit 1103 in the message processing device 1100 and the communication interface 1404 in the network device 1400 can be equivalent to the physical interface card 1533 or the physical interface card 1543 in the network device 1500; the processing unit 1102 and the obtaining unit 1101 in the message processing device 1100 and the processor 1401 in the network device 1400 can be equivalent to the central processing unit 1511 or the central processing unit 1531 in the network device 1500.

应理解,本申请实施例中接口板1540上的操作与接口板1530的操作一致,为了简洁,不再赘述。应理解,本实施例的网络设备1500可对应于上述各个实施例中的报文处理装置1100或网络设备1400,该网络设备1500中的主控板1510、接口板1530和/或接口板1540可以实现上述各个实施例中的报文处理装置1100或网络设备1400中所具有的功能和/或所实施的各种步骤,为了简洁,在此不再赘述。It should be understood that the operation on the interface board 1540 in the embodiment of the present application is consistent with the operation of the interface board 1530, and for the sake of brevity, it will not be repeated. It should be understood that the network device 1500 of this embodiment can correspond to the message processing device 1100 or the network device 1400 in the above-mentioned embodiments, and the main control board 1510, the interface board 1530 and/or the interface board 1540 in the network device 1500 can implement the functions and/or various steps implemented in the message processing device 1100 or the network device 1400 in the above-mentioned embodiments, and for the sake of brevity, it will not be repeated here.

如果网络设备1500被配置为第一网络设备,网络处理器1532可以触发物理接口卡1533接收第一消息,所述第一消息携带基于第六版互联网协议的分段路由策略SRv6policy,所述SRv6 policy包括至少一个分段列表,所述SRv6 policy与所述第一网络设备的本地定位符匹配;中央处理器1511可以基于所述至少一个分段列表,获得转发映射表,所述转发映射表用于指导通过所述SRv6 policy对应的转发路径转发的业务报文在所述第一网络设备的处理。If the network device 1500 is configured as a first network device, the network processor 1532 can trigger the physical interface card 1533 to receive a first message, wherein the first message carries a segment routing policy SRv6policy based on the sixth version of the Internet Protocol, wherein the SRv6 policy includes at least one segment list, and the SRv6 policy matches the local locator of the first network device; the central processor 1511 can obtain a forwarding mapping table based on the at least one segment list, wherein the forwarding mapping table is used to guide the processing of service packets forwarded through the forwarding path corresponding to the SRv6 policy on the first network device.

应理解,报文处理装置1200中的接收单元1201、以及网络设备1400中的通信接口1404可以相当于网络设备1500中的物理接口卡1533或物理接口卡1543;报文处理装置1200中的处理单元1202、以及网络设备1400中的处理器1401可以相当于网络设备1500中的中央处理器1511或中央处理器1531。It should be understood that the receiving unit 1201 in the message processing device 1200 and the communication interface 1404 in the network device 1400 can be equivalent to the physical interface card 1533 or the physical interface card 1543 in the network device 1500; the processing unit 1202 in the message processing device 1200 and the processor 1401 in the network device 1400 can be equivalent to the central processing unit 1511 or the central processing unit 1531 in the network device 1500.

应理解,本申请实施例中接口板1540上的操作与接口板1530的操作一致,为了简洁,不再赘述。应理解,本实施例的网络设备1500可对应于上述各个实施例中的报文处理装置1200或网络设备1400,该网络设备1500中的主控板1510、接口板1530和/或接口板1540可以实现上述各个实施例中的报文处理装置1200或网络设备1400中所具有的功能和/或所实施的各种步骤,为了简洁,在此不再赘述。It should be understood that the operation on the interface board 1540 in the embodiment of the present application is consistent with the operation of the interface board 1530, and for the sake of brevity, it will not be repeated. It should be understood that the network device 1500 of this embodiment can correspond to the message processing device 1200 or the network device 1400 in the above-mentioned embodiments, and the main control board 1510, the interface board 1530 and/or the interface board 1540 in the network device 1500 can implement the functions and/or various steps implemented in the message processing device 1200 or the network device 1400 in the above-mentioned embodiments, and for the sake of brevity, it will not be repeated here.

应理解,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,网络设备的数据处理能力越强,提供的接口板越多。接口板上的物理接口卡也可以有一块或多块。交换网板可能没有,也可能有一块或多块,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,网络设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,网络设备可以有至少一块交换网板,通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的网络设备的数据接入和处理能力要大于集中式架构的设备。可选地,网络设备的形态也可以是只有一块板卡,即没有交换网板,接口板和主控板的功能集成在该一块板卡上,此时接口板上的中央处理器和主控板上的中央处理器在该一块板卡上可以合并为一个中央处理器,执行两者叠加后的功能,这种形态设备的数据交换和处理能力较低(例如,低端交换机或路由器等网络设备)。具体采用哪种架构,取决于具体的组网部署场景。It should be understood that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability 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 network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly realize load sharing and redundant backup. Under a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for the processing function of the business data of the entire system. Under a distributed forwarding architecture, the network device may have at least one switching network board, and the switching network board is used to realize data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with a distributed architecture are greater than those of devices with a centralized architecture. Optionally, the network device may have only one board, that is, no switching board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two. This type of device has low data exchange and processing capabilities (for example, low-end switches or routers and other network devices). The specific architecture to be adopted depends on the specific networking deployment scenario.

在一些可能的实施例中,上述各网络设备或网络设备可以实现为虚拟化设备。例如,虚拟化设备可以是运行有用于发送报文功能的程序的虚拟机(英文:Virtual Machine,VM),虚拟机部署在硬件设备上(例如,物理服务器)。虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。可以将虚拟机配置为本申请实施例中的各网络设备或控制实体。例如,可以基于通用的物理服务器结合网络功能虚拟化(Network Functions Virtualization,NFV)技术来实现各网络设备或网络设备。各网络设备或网络设备为虚拟主机、虚拟路由器或虚拟交换机。本领域技术人员通过阅读本申请即可结合NFV技术在通用物理服务器上虚拟出具有上述功能的各网络设备或网络设备,此处不再赘述。In some possible embodiments, each of the above-mentioned network devices or network devices can be implemented as a virtualized device. For example, a virtualized device can be a virtual machine (English: Virtual Machine, VM) running a program for sending message functions, 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 or control entity in the embodiments of the present application. For example, each network device or network device can be implemented based on a general physical server in combination 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-mentioned functions on a general physical server in combination with NFV technology by reading this application, which will not be repeated here.

应理解,上述各种产品形态的网络设备,分别具有上述方法实施例中各网络设备或通信设备的任意功能,此处不再赘述。It should be understood that the network devices in the above-mentioned various product forms have any functions of the network devices or communication devices in the above-mentioned method embodiments, which will not be repeated here.

本申请实施例还提供了一种芯片,包括处理器和接口电路,接口电路,用于接收指令并传输至处理器;处理器,例如可以是本申请实施例中报文处理装置的一种具体实现形式,可以用于执行上述路由选路的方法。其中,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述任一方法实施例中的方法。The embodiment of the present application also provides a chip, including a processor and an interface circuit, the interface circuit is used 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 embodiment of the present application, and can be used to execute the above-mentioned routing method. Wherein, the processor is coupled with a memory, and the memory is used to store programs or instructions. When the program or instruction is executed by the processor, the chip system implements the method in any of the above-mentioned method embodiments.

可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请并不限定。示例性的,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be separately provided with the processor, which is not limited in the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be provided on different chips. The present application does not specifically limit the type of memory and the arrangement of the memory and the processor.

示例性的,该芯片系统可以是现场可编程门阵列(field programmable gatearray,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processorunit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

此外,本申请实施例还提供了一种通信系统1600,参见图16。该通信系统1600可以包括:第一网络设备1601和控制实体1602。其中,第一网络设备1601,用于执行以上方法中任意一种可能的实现方式中第一网络设备相应的步骤;控制实体1602,用于执行以上方法中任意一种可能的实现方式中控制实体相应的步骤。In addition, the embodiment of the present application further provides a communication system 1600, see Figure 16. The communication system 1600 may include: a first network device 1601 and a control entity 1602. The first network device 1601 is used to execute the steps corresponding to the first network device in any possible implementation of the above method; the control entity 1602 is used to execute the steps corresponding to the control entity in any possible implementation of the above method.

此外,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有程序代码或指令,当其在计算机上运行时,使得计算机执行以上图8所示实施例中任意一种实现方式下的方法。In addition, an embodiment of the present application further provides a computer-readable storage medium, in which program code or instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes a method in any one of the implementation modes in the embodiment shown in FIG. 8 above.

此外,本申请实施例还提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行前述方法100中任意一种实现方式的方法。In addition, an embodiment of the present application also provides a computer program product, which, when executed on a computer, enables the computer to execute any one of the implementation methods of the aforementioned method 100.

应理解,本申请实施例中提到的“基于根据A确定B”并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that "based on determining B according to A" mentioned in the embodiments of the present application does not mean that B is determined only according to A, but B can also be determined according to A and/or other information.

本申请中提到的“第一SRv6 policy”、“第一业务报文”等名称中的“第一”只是用来做名字标识,并不代表顺序上的第一。该规则同样适用于“第二”等。The "first" in the names of "first SRv6 policy", "first service message" and so on mentioned in this application is only used as a name identifier and does not mean the first in order. The same rule applies to "second" and so on.

通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分步骤可借助软件加通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如只读存储器(英文:read-only memory,ROM)/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如路由器等网络通信设备)执行本申请各个实施例或者实施例的某些部分所述的方法。Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method 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, which can be stored in a storage medium, such as a read-only memory (ROM)/RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例和设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for system embodiments and device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

以上所述仅是本申请的优选实施方式,并非用于限定本申请的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above 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 ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope of the present application.

Claims (39)

Translated fromChinese
1.一种报文处理方法,其特征在于,应用于第一网络设备,所述方法包括:1. A message processing method, characterized in that it is applied to a first network device, and the method includes:获得第一业务报文,所述第一业务报文与第一基于第六版互联网协议的分段路由策略SRv6policy匹配,所述第一业务报文包括第一第六版互联网协议IPv6头;Obtaining a first service message, the first service message matches the first segment routing policy SRv6policy based on the sixth version of the Internet Protocol, and the first service message includes a first sixth version of the Internet Protocol IPv6 header;根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,所述第一出接口为所述第一网络设备在第一转发路径上的出接口,所述第一SRv6policy指示所述第一转发路径;Determine a first outbound interface according to a first source Internet Protocol IP address of the first IPv6 header, where the first outbound interface is an outbound interface of the first network device on a first forwarding path, and the first SRv6policy indicates the first forwarding path;将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;Update the first source IP address in the first service message to a second source IP address to obtain a second service message, where the first source IP address indicates the first network device, and the third source IP address indicates the first network device. The second source IP address indicates a second network device, and the second network device is the next hop device of the first network device on the first forwarding path;从所述第一出接口向所述第二网络设备发送所述第二业务报文。Send the second service message from the first outbound interface to the second network device.2.根据权利要求1所述的方法,其特征在于,在所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口之前,所述方法还包括:2. The method of claim 1, wherein before determining the first outbound interface based on the first source Internet Protocol IP address of the first IPv6 header, the method further includes:确定所述第一源IP地址与转发映射表匹配。It is determined that the first source IP address matches the forwarding mapping table.3.根据权利要求1或2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1 or 2, characterized in that the method further includes:若确定所述第一源IP地址与所述转发映射表不匹配,则,根据所述第一IPv6头中的第一目的IP地址处理所述第一业务报文。If it is determined that the first source IP address does not match the forwarding mapping table, the first service packet is processed according to the first destination IP address in the first IPv6 header.4.根据权利要求2所述的方法,其特征在于,所述转发映射表为子绑定分段标识Sub-BSID映射表,所述第一源IP地址为所述第一网络设备的第一Sub-BSID,所述第一Sub-BSID包括第一分段列表的标识和段剩余SL,所述第一SRv6policy包括所述第一分段列表,所述SL指示所述第一网络设备在所述第一分段列表中的位置,所述Sub-BSID映射表用于指导通过SRv6policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述Sub-BSID映射表包括所述第一Sub-BSID和本地的第一分段标识SID的对应关系,所述第一SID与所述第一出接口对应。4. The method of claim 2, wherein the forwarding mapping table is a Sub-BSID mapping table, and the first source IP address is a first IP address of the first network device. Sub-BSID, the first Sub-BSID includes the identification of the first segment list and the segment remaining SL, the first SRv6policy includes the first segment list, and the SL indicates where the first network device is located. The position in the first segment list, the Sub-BSID mapping table is used to guide the processing of service packets transmitted through the forwarding path corresponding to the SRv6 policy in the first network device, the Sub-BSID mapping table includes the The corresponding relationship between the first Sub-BSID and the local first segment identification SID, and the first SID corresponds to the first outbound interface.5.根据权利要求4所述的方法,其特征在于,所述方法还包括:5. The method according to claim 4, characterized in that, the method further comprises:获得第一消息,所述第一消息携带所述第一SRv6policy,所述第一SRv6policy包括第一绑定分段标识BSID,所述第一BSID用于标识所述第一SRv6policy,所述第一SRv6policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;Obtain a first message, where the first message carries the first SRv6 policy, the first SRv6 policy includes a first binding segment identifier BSID, the first BSID is used to identify the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list;基于所述第一BSID和所述至少一个分段列表,获得所述Sub-BSID映射表。The Sub-BSID mapping table is obtained based on the first BSID and the at least one segment list.6.根据权利要求5所述的方法,其特征在于,所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,包括:6. The method of claim 5, wherein determining the first outbound interface based on the first source Internet Protocol IP address of the first IPv6 header includes:从所述Sub-BSID映射表中,确定与所述第一源IP地址中的所述第一Sub-BSID匹配的所述第一SID;From the Sub-BSID mapping table, determine the first SID that matches the first Sub-BSID in the first source IP address;从本地SID表中,确定与所述第一SID匹配的所述第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。Determine the first outbound interface matching the first SID from a local SID table, where the local SID table includes a correspondence between the first SID and the first outbound interface.7.根据权利要求5或6述的方法,其特征在于,所述将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,包括:7. The method according to claim 5 or 6, characterized in that the updating of the first source IP address in the first service message to a second source IP address to obtain a second service message comprises:更新所述第一源IP地址中SL字段的值,获得所述第二业务报文,所述第二业务报文中的第二源IP地址中SL字段的值指示所述第二网络设备在所述第一分段列表中的位置,所述第二源IP地址为所述第二网络设备的第二Sub-BSID。Update the value of the SL field in the first source IP address to obtain the second service message, wherein the value of the SL field in the second source IP address in the second service message indicates the position of the second network device in the first segment list, and the second source IP address is the second Sub-BSID of the second network device.8.根据权利要求4-7任一项所述的方法,其特征在于,所述获得第一业务报文,包括:8. The method according to any one of claims 4 to 7, characterized in that said obtaining the first service message includes:接收第三业务报文,所述第三业务报文与所述第一SRv6policy匹配;Receive a third service packet, where the third service packet matches the first SRv6 policy;在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SRv6policy中所述第一SID对应的所述第一Sub-BSID,所述第一SID为所述第一分段列表中的第一个SID。The first IPv6 header is encapsulated in the third service message to obtain the first service message, and the first source IP address of the first IPv6 header is the third one in the first SRv6 policy. The first Sub-BSID corresponding to a SID, and the first SID is the first SID in the first segment list.9.根据权利要求4-8任一项所述的方法,其特征在于,所述方法还包括:9. The method according to any one of claims 4-8, characterized in that the method further includes:获得第四业务报文,所述第四业务报文与第二SRv6policy匹配,所述第四业务报文包括第三IPv6头;Obtaining a fourth service message, the fourth service message matches the second SRv6 policy, and the fourth service message includes a third IPv6 header;若确定所述第三IPv6地址中的第三源IP地址与所述Sub-BSID映射表匹配,且所述第三源IP地址指示所述第一网络设备为所述第二SRv6policy的尾节点,根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为所述第一网络设备的第三Sub-BSID,所述第三Sub-BSID包括第二分段列表的标识和SL,所述第二SRv6policy包括所述第二分段列表,所述SL指示所述第一网络设备在所述第二分段列表中的位置。If it is determined that the third source IP address in the third IPv6 address matches the Sub-BSID mapping table, and the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, The fourth service message is processed according to the third destination IP address in the third IPv6 header, the third source IP address is the third Sub-BSID of the first network device, and the third Sub- The BSID includes the identification of the second segment list and the SL, the second SRv6 policy includes the second segment list, and the SL indicates the position of the first network device in the second segment list.10.根据权利要求4-9任一项所述的方法,其特征在于,所述第一Sub-BSID包括定位符、功能和参数,所述定位符和所述功能与第一BSID一致,所述参数包括所述第一分段列表的标识和SL,所述第一BSID用于标识所述第一SRv6policy。10. The method according to any one of claims 4-9 is characterized in that the first Sub-BSID includes a locator, a function and a parameter, the locator and the function are consistent with the first BSID, the parameters include an identifier and SL of the first segment list, and the first BSID is used to identify the first SRv6policy.11.根据权利要求2所述的方法,其特征在于,所述转发映射表为SID映射表,所述第一源IP地址为所述第一网络设备的第一分段标识SID,所述第一SID为所述第一SRv6policy所包括的第一分段列表中所述第一网络设备的标识,所述SID映射表用于指导通过SRv6policy对应的转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括所述第一SID和第二SID的对应关系,所述第二SID为所述第一分段列表中所述第二网络设备的标识。11. The method according to claim 2, wherein the forwarding mapping table is a SID mapping table, the first source IP address is the first segment identifier SID of the first network device, and the third An SID is the identifier of the first network device in the first segment list included in the first SRv6policy, and the SID mapping table is used to guide service packets transmitted through the forwarding path corresponding to the SRv6policy to be processed in the first segment list. Processing of the network device, the SID mapping table includes the corresponding relationship between the first SID and the second SID, where the second SID is the identifier of the second network device in the first segment list.12.根据权利要求11所述的方法,其特征在于,所述方法还包括:12. The method according to claim 11, characterized in that the method further comprises:获得第一消息,所述第一消息携带所述第一SRv6policy,所述第一SRv6policy包括至少一个分段列表,所述至少一个分段列表包括所述第一分段列表;Obtain a first message, the first message carries the first SRv6 policy, the first SRv6 policy includes at least one segment list, and the at least one segment list includes the first segment list;基于所述至少一个分段列表,获得SID映射表。Based on the at least one segment list, a SID mapping table is obtained.13.根据权利要求12所述的方法,其特征在于,所述根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,包括:13. The method of claim 12, wherein determining the first outbound interface based on the first source Internet Protocol IP address of the first IPv6 header includes:从本地SID表中,确定与所述第一源IP地址中的所述第一SID匹配的第一出接口,所述本地SID表包括所述第一SID与所述第一出接口的对应关系。Determine the first outbound interface that matches the first SID in the first source IP address from the local SID table, where the local SID table includes the corresponding relationship between the first SID and the first outbound interface. .14.根据权利要求12或13所述的方法,其特征在于,所述将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,包括:14. The method according to claim 12 or 13, characterized in that the first source IP address in the first service message is updated to a second source IP address to obtain the second service message. ,include:从所述SID映射表中,获得所述第一源IP地址关联的所述第二SID;Obtain the second SID associated with the first source IP address from the SID mapping table;将所述第一源IP地址中的所述第一SID更新为所述第二SID,获得所述第二业务报文,所述第二业务报文的所述第二源IP地址为所述第二SID。Update the first SID in the first source IP address to the second SID to obtain the second service message, and the second source IP address of the second service message is the Second SID.15.根据权利要求11-14任一项所述的方法,其特征在于,所述获得第一业务报文,包括:15. The method according to any one of claims 11 to 14, wherein obtaining the first service message comprises:接收第三业务报文,所述第三业务报文与所述第一SRv6policy匹配;Receive a third service packet, where the third service packet matches the first SRv6 policy;在所述第三业务报文上封装所述第一IPv6头,获得所述第一业务报文,所述第一IPv6头的所述第一源IP地址为所述第一SID,所述第一SID为所述第一分段列表中的第一个SID。The first IPv6 header is encapsulated in the third service message to obtain the first service message, the first source IP address of the first IPv6 header is the first SID, and the third One SID is the first SID in the first segment list.16.根据权利要求11-15任一项所述的方法,其特征在于,所述方法还包括:16. The method according to any one of claims 11 to 15, characterized in that the method further comprises:获得第四业务报文,所述第四业务报文与第二SRv6policy匹配,所述第四业务报文包括第三IPv6头;Obtain a fourth service message, where the fourth service message matches the second SRv6policy, and the fourth service message includes a third IPv6 header;若确定所述第三源IP地址指示所述第一网络设备为所述第二SRv6policy的尾节点,根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,所述第三源IP地址为第三SID,所述第三SID为所述第二SRv6policy所包括的第二分段列表中所述第一网络设备的标识。If it is determined that the third source IP address indicates that the first network device is the tail node of the second SRv6 policy, the fourth service message is processed according to the third destination IP address in the third IPv6 header, so The third source IP address is a third SID, and the third SID is the identifier of the first network device in the second segment list included in the second SRv6 policy.17.根据权利要求9或16所述的方法,其特征在于,所述第三IPv6头的所述第三目的IP地址为业务SID,所述根据所述第三IPv6头中的第三目的IP地址处理所述第四业务报文,包括:17. The method according to claim 9 or 16, characterized in that the third destination IP address in the third IPv6 header is a service SID, and the third destination IP address in the third IPv6 header is a service SID. Address processing of the fourth service message includes:解除所述第四业务报文中与所述第二SRv6policy相关的封装,获得第五业务报文;Unencapsulate the second SRv6 policy in the fourth service message to obtain a fifth service message;基于所述业务SID,转发所述第五业务报文。Based on the service SID, the fifth service message is forwarded.18.根据权利要求1-17任一项所述的方法,其特征在于,所述第一业务报文为ping报文,所述第一业务报文还包括互联网控制信息协议版本六ICMPv6头。18. The method according to any one of claims 1 to 17, characterized in that the first service message is a ping message, and the first service message further includes an Internet Control Information Protocol version six ICMPv6 header.19.根据权利要求18所述的方法,其特征在于,所述方法还包括:19. The method according to claim 18, characterized in that the method further comprises:获得第六业务报文,所述第六业务报文包括所述ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一转发路径的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;Obtain a sixth service message. The sixth service message includes the ICMPv6 header and a fourth IPv6 header. The source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header. The destination IP address of the four IPv6 headers corresponds to the last hop of the first forwarding path, and the sixth service message is a response message of the first service message;按照所述第四IPv6头的目的IP地址转发所述第六业务报文。Forward the sixth service message according to the destination IP address of the fourth IPv6 header.20.根据权利要求1-17任一项所述的方法,其特征在于,所述第一业务报文和所述第二业务报文均为tracert报文,所述第二业务报文的跳限度比所述第一业务报文中的跳限度小1。20. The method according to any one of claims 1-17, characterized in that the first service message and the second service message are both tracert messages, and the hop of the second service message is The limit is 1 smaller than the jump limit in the first service message.21.根据20所述的方法,其特征在于,所述方法还包括:21. The method according to 20, characterized in that the method further includes:获得第六业务报文,所述第六业务报文包括ICMPv6头和第四IPv6头,所述第四IPv6头的源IP地址为所述第一IPv6头的目的IP地址,所述第四IPv6头的目的IP地址与所述第一业务报文的跳限度指示的最后一跳对应,所述第六业务报文为所述第一业务报文的响应报文;Obtain a sixth service message. The sixth service message includes an ICMPv6 header and a fourth IPv6 header. The source IP address of the fourth IPv6 header is the destination IP address of the first IPv6 header. The fourth IPv6 header is The destination IP address of the header corresponds to the last hop indicated by the hop limit of the first service message, and the sixth service message is a response message of the first service message;按照所述第四IPv6头的目的IP地址转发所述第六业务报文。Forward the sixth service message according to the destination IP address of the fourth IPv6 header.22.一种报文处理方法,其特征在于,应用于第一网络设备,所述方法包括:22. A message processing method, characterized in that it is applied to the first network device, and the method includes:接收第一消息,所述第一消息携带基于第六版互联网协议的分段路由策略SRv6policy,所述SRv6policy包括至少一个分段列表,所述SRv6policy与所述第一网络设备的本地定位符匹配;Receive a first message, the first message carries a segment routing policy SRv6policy based on Internet Protocol version 6, the SRv6policy includes at least one segment list, and the SRv6policy matches the local locator of the first network device;基于所述至少一个分段列表,获得转发映射表,所述转发映射表用于指导通过所述SRv6policy对应的转发路径转发的业务报文在所述第一网络设备的处理。Based on the at least one segment list, a forwarding mapping table is obtained, and the forwarding mapping table is used to guide the processing of service packets forwarded through the forwarding path corresponding to the SRv6 policy in the first network device.23.根据权利要求22所述的方法,其特征在于,所述第一消息还包括绑定分段标识BSID,所述BSID用于标识所述SRv6policy,所述基于所述至少一个分段列表,获得转发映射表,包括:23. The method according to claim 22, wherein the first message further includes a binding segment identifier BSID, the BSID is used to identify the SRv6policy, and based on the at least one segment list, Obtain the forwarding mapping table, including:基于所述BSID和所述至少一个分段列表,获得子绑定分段标识Sub-BSID映射表,所述Sub-BSID映射表包括Sub-BSID和本地分段标识SID的对应关系,所述Sub-BSID与所述本地定位符匹配,所述Sub-BSID包括分段列表的标识和段剩余SL。Based on the BSID and the at least one segment list, a sub-binding segment identifier Sub-BSID mapping table is obtained, the Sub-BSID mapping table includes a correspondence between the Sub-BSID and the local segment identifier SID, the Sub-BSID matches the local locator, and the Sub-BSID includes an identifier of the segment list and a segment remainder SL.24.根据权利要求22或23所述的方法,其特征在于,所述SRv6policy与所述第一网络设备的本地定位符匹配包括所述SRv6policy中的SID与所述本地定位符属于相同网段。24. The method according to claim 22 or 23, wherein matching the SRv6policy with the local locator of the first network device includes that the SID in the SRv6policy and the local locator belong to the same network segment.25.根据权利要求24所述的方法,其特征在于,所述BSID与所述本地定位符属于相同网段。25. The method according to claim 24, wherein the BSID and the local locator belong to the same network segment.26.根据权利要求25所述的方法,其特征在于,所述方法还包括:26. The method of claim 25, further comprising:将所述BSID保存在本地SID表,所述本地SID表包括所述第一网络设备的SID和处理动作的对应关系。The BSID is saved in a local SID table, and the local SID table includes a correspondence between the SID of the first network device and the processing action.27.根据权利要求24所述的方法,其特征在于,所述BSID与所述本地定位符不属于相同网段,但所述至少一个分段列表中的任意一个SID与所述本地定位符属于相同网段。27. The method according to claim 24, characterized in that the BSID and the local locator do not belong to the same network segment, but any one SID in the at least one segment list and the local locator belong to the same network segment.28.根据权利要求23-27任一项所述的方法,其特征在于,所述基于所述BSID和所述至少一个分段列表,获得子绑定分段标识Sub-BSID映射表,包括:28. The method according to any one of claims 23 to 27, characterized in that the obtaining of a sub-binding segment identifier Sub-BSID mapping table based on the BSID and the at least one segment list comprises:基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID;determining a Sub-BSID matching a local locator based on the BSID and the at least one segment list;基于所确定的Sub-BSID和每个Sub-BSID对应的本地SID,获得所述Sub-BSID映射表。Based on the determined Sub-BSID and the local SID corresponding to each Sub-BSID, the Sub-BSID mapping table is obtained.29.根据权利要求28所述的方法,其特征在于,所述基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID,包括:29. The method of claim 28, wherein determining, based on the BSID and the at least one segment list, a Sub-BSID matching a local locator includes:基于所述BSID计算所述至少一个分段列表中每个分段列表的各SID的Sub-BSID;Calculate a Sub-BSID for each SID of each segment list in the at least one segment list based on the BSID;从计算的所有Sub-BSID中筛选与所述本地定位符属于同一网段的Sub-BSID。Filter the Sub-BSIDs that belong to the same network segment as the local locator from all calculated Sub-BSIDs.30.根据权利要求28所述的方法,其特征在于,所述基于所述BSID和所述至少一个分段列表,确定与本地定位符匹配的Sub-BSID,包括:30. The method of claim 28, wherein determining a Sub-BSID matching a local locator based on the BSID and the at least one segment list includes:从所述至少一个分段列表中每个分段列表的各SID中筛选与所述本地定位符属于同一网段的SID;Filter SIDs that belong to the same network segment as the local locator from the SIDs of each segment list in the at least one segment list;基于所述BSID计算所筛选出的SID对应的Sub-BSID。The Sub-BSID corresponding to the filtered SID is calculated based on the BSID.31.根据权利要求23-30任一项所述的方法,其特征在于,所述Sub-BSID包括定位符、功能和参数,所述定位符和所述功能与所述BSID一致,所述参数包括分段列表的标识和SL。31. The method according to any one of claims 23 to 30, characterized in that the Sub-BSID includes a locator, a function and a parameter, the locator and the function are consistent with the BSID, and the parameter Includes the ID and SL of the segment list.32.根据权利要求22所述的方法,其特征在于,所述基于所述至少一个分段列表,获得转发映射表,包括:32. The method according to claim 22, wherein obtaining a forwarding mapping table based on the at least one segment list comprises:基于所述至少一个分段列表,获得SID映射表,所述SID映射表用于指导通过所述转发路径传输的业务报文在所述第一网络设备的处理,所述SID映射表包括第一SID和第二SID的对应关系,所述第一SID为第一分段列表中所述第一网络设备的标识,所述第二SID为所述第一分段列表中第二网络设备的标识,所述第二网络设备为所述第一网络设备在所述转发路径的下一跳设备,所述至少一个分段列表包括所述第一分段列表,所述第一分段列表与所述转发路径对应。Based on the at least one segment list, a SID mapping table is obtained. The SID mapping table is used to guide the processing of service packets transmitted through the forwarding path at the first network device. The SID mapping table includes a first The corresponding relationship between the SID and the second SID, the first SID is the identifier of the first network device in the first segment list, and the second SID is the identifier of the second network device in the first segment list , the second network device is the next hop device of the first network device in the forwarding path, the at least one segment list includes the first segment list, and the first segment list is the same as the first segment list. corresponds to the forwarding path described above.33.根据权利要求22-32任一项所述的方法,其特征在于,所述第一消息为边界网关协议BGPSRpolicy报文。33. The method according to any one of claims 22-32, characterized in that the first message is a Border Gateway Protocol BGPSRpolicy message.34.根据权利要求22-32任一项所述的方法,其特征在于,所述第一消息为路径计算单元协议PCEP报文。34. The method according to any one of claims 22 to 32, characterized in that the first message is a path calculation element protocol PCEP message.35.根据权利要求22-34任一项所述的方法,其特征在于,所述方法还包括:35. The method according to any one of claims 22-34, characterized in that the method further comprises:获得第一业务报文,所述第一业务报文与所述SRv6policy匹配,所述第一业务报文包括第一IPv6头;Obtaining a first service message, the first service message matches the SRv6 policy, and the first service message includes a first IPv6 header;根据所述第一IPv6头的第一源IP地址确定第一出接口,所述第一出接口为所述第一网络设备在所述转发路径上的出接口;Determine a first outbound interface based on the first source IP address of the first IPv6 header, where the first outbound interface is the outbound interface of the first network device on the forwarding path;将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;Update the first source IP address in the first service message to a second source IP address to obtain a second service message, where the first source IP address indicates the first network device, and the third source IP address indicates the first network device. The second source IP address indicates a second network device, and the second network device is the next hop device of the first network device in the first forwarding path;从所述第一出接口向所述第二网络设备发送所述第二业务报文。Send the second service message from the first output interface to the second network device.36.一种报文处理装置,其特征在于,应用于第一网络设备,所述装置包括:36. A message processing device, characterized in that it is applied to a first network device, and the device comprises:获得单元,用于获得第一业务报文,所述第一业务报文与第一基于第六版互联网协议的分段路由策略SRv6policy匹配,所述第一业务报文包括第一第六版互联网协议IPv6头;Obtaining unit, configured to obtain a first service message, the first service message matches the first segment routing policy SRv6policy based on the sixth version of the Internet Protocol, and the first service message includes the first sixth version of the Internet protocol Protocol IPv6 header;处理单元,用于根据所述第一IPv6头的第一源互联网协议IP地址确定第一出接口,所述第一出接口为所述第一网络设备在第一转发路径上的出接口,所述第一SRv6policy指示所述第一转发路径;A processing unit configured to determine a first outbound interface based on the first source Internet Protocol IP address of the first IPv6 header, where the first outbound interface is the outbound interface of the first network device on the first forwarding path, so The first SRv6policy indicates the first forwarding path;所述处理单元,还用于将所述第一业务报文中的所述第一源IP地址更新为第二源IP地址,获得第二业务报文,所述第一源IP地址指示所述第一网络设备,所述第二源IP地址指示第二网络设备,所述第二网络设备为所述第一网络设备在所述第一转发路径的下一跳设备;The processing unit is also configured to update the first source IP address in the first service message to a second source IP address to obtain the second service message, where the first source IP address indicates the A first network device, the second source IP address indicates a second network device, and the second network device is the next hop device of the first network device in the first forwarding path;发送单元,用于从所述第一出接口向所述第二网络设备发送所述第二业务报文。A sending unit, configured to send the second service message from the first outbound interface to the second network device.37.一种报文处理装置,其特征在于,应用于第一网络设备,所述装置包括:37. A message processing device, characterized in that it is applied to the first network device, and the device includes:接收单元,用于接收第一消息,所述第一消息携带基于第六版互联网协议的分段路由策略SRv6policy,所述SRv6policy包括至少一个分段列表,所述SRv6policy与所述第一网络设备的本地定位符匹配;A receiving unit configured to receive a first message, the first message carrying a segment routing policy SRv6policy based on the sixth version of the Internet Protocol, the SRv6policy including at least one segment list, the SRv6policy and the first network device local locator matching;处理单元,用于基于所述至少一个分段列表,获得转发映射表,所述转发映射表用于指导通过所述SRv6policy对应的转发路径转发的业务报文在所述第一网络设备的处理。A processing unit configured to obtain a forwarding mapping table based on the at least one segment list, where the forwarding mapping table is used to guide the processing of service packets forwarded through the forwarding path corresponding to the SRv6 policy in the first network device.38.一种网络设备,其特征在于,所述网络设备包括存储器和处理器;38. A network device, characterized in that the network device comprises a memory and a processor;所述存储器,用于存储指令;The memory is used to store instructions;所述处理器,用于执行所述存储器中的所述指令,执行权利要求1-35任意一项所述的方法。The processor is used to execute the instructions in the memory and execute the method described in any one of claims 1-35.39.一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得所述计算机执行以上权利要求1-35任意一项所述的方法。39. A computer-readable storage medium, characterized by comprising instructions that, when run on a computer, cause the computer to perform the method of any one of claims 1-35 above.
CN202211213546.6A2022-09-302022-09-30Message processing method and related equipmentPendingCN117811984A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211213546.6ACN117811984A (en)2022-09-302022-09-30Message processing method and related equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211213546.6ACN117811984A (en)2022-09-302022-09-30Message processing method and related equipment

Publications (1)

Publication NumberPublication Date
CN117811984Atrue CN117811984A (en)2024-04-02

Family

ID=90424218

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211213546.6APendingCN117811984A (en)2022-09-302022-09-30Message processing method and related equipment

Country Status (1)

CountryLink
CN (1)CN117811984A (en)

Similar Documents

PublicationPublication DateTitle
US12309064B2 (en)Method for forwarding packet in SRv6 service function chain, SFF, and SF device
CN115004656B (en) A message sending method, device and system
CN113162849B (en) A message processing method, device and system
US12432139B2 (en)Packet processing method, network device, and network system
WO2022194023A1 (en)Packet processing method, network device, and controller
CN113542111B (en) A message forwarding method and network device
WO2021082575A1 (en)Packet forwarding method, apparatus, storage medium, and system
US20240297844A1 (en)Packet Processing Method and Apparatus, and Device
WO2023274083A1 (en)Route publishing method and apparatus, packet forwarding method and apparatus, device, and storage medium
WO2023213216A1 (en)Packet processing method and related device
WO2022188530A1 (en)Route processing method and network device
WO2024109045A1 (en)Routing updating method and apparatus, device, and storage medium
CN117240769A (en) A message control method and related devices
CN114760244B (en)Method, device and network equipment for transmitting Binding Segment Identification (BSID)
CN116781618A (en) Route generation method, data message forwarding method and device
CN117811984A (en)Message processing method and related equipment
CN117061406A (en)Message processing method and related equipment
JP7703022B2 (en) Packet transmission method and device
EP4443842A1 (en)Routing method and related device
CN116455805A (en) A routing method and related equipment
WO2023169364A1 (en)Routing generation method and apparatus, and data message forwarding method and apparatus
WO2023231438A1 (en)Message sending method, network device and system
WO2024007762A1 (en)Route publishing method, and communication method and apparatus
CN117097656A (en)Message processing method and related equipment
CN116232970A (en)Link state information flooding optimization method, device, equipment and medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp