技术领域technical field
本发明涉及数据处理领域,特别是涉及一种伪线数据报文的封装、解封装方法和相关装置。The invention relates to the field of data processing, in particular to a method for encapsulating and decapsulating a pseudowire data message and a related device.
背景技术Background technique
伪线(英文:Pseudo Wire,缩写:PW)或伪线端到端仿真(英文:Pseudo Wire Edge-to-Edge Emulation,缩写:PWE3)是一种在互联网协议(英文:Internet Protocol,缩写:IP)/多协议标签交换(英文:Multi-Protocol Label Switching,缩写:MPLS)网络中仿真非IP业务的二层承载技术,通过伪线技术可以实现非IP网络与IP/MPLS网络之间的互连,或者基于融合的IP/MPLS网络承载各种非IP业务,从而实现网络资源的共享,降低网络部署和运维的成本。PW或PWE3可以基于IP或MPLS隧道技术实现,具体的,通过在IP/MPLS隧道封装(英文:IP/MPLS Tunnel Encapsulation)的标签栈中加入PW标签(英文:label),再将非IP的业务净荷(例如Payload)封装到报文中,形成可以实现基于IP/MPLS网络中的非IP业务传输的PW数据报文。如图1所示的PW数据报文的格式,PW label设置在IP/MPLS TunnelEncapsulation和Payload之间。Pseudowire (English: Pseudo Wire, abbreviation: PW) or pseudowire end-to-end emulation (English: Pseudo Wire Edge-to-Edge Emulation, abbreviation: PWE3) is an Internet protocol (English: Internet Protocol, abbreviation: IP )/Multi-Protocol Label Switching (English: Multi-Protocol Label Switching, abbreviation: MPLS) network simulates the two-layer bearer technology of non-IP services, and the interconnection between non-IP networks and IP/MPLS networks can be realized through pseudowire technology , or based on the converged IP/MPLS network to carry various non-IP services, so as to realize the sharing of network resources and reduce the cost of network deployment and operation and maintenance. PW or PWE3 can be implemented based on IP or MPLS tunnel technology. Specifically, by adding a PW label (English: label) to the label stack of IP/MPLS Tunnel Encapsulation (English: IP/MPLS Tunnel Encapsulation), and then adding non-IP services The payload (for example, Payload) is encapsulated into the message to form a PW data message that can implement non-IP service transmission in the IP/MPLS network. In the format of the PW data packet shown in Figure 1, the PW label is set between the IP/MPLS TunnelEncapsulation and the Payload.
由于不同类型的业务有不同的属性和需求,为了能够在IP/MPLS网络尽量模拟不同类型业务的特征,需要对应携带用于处理不同PW类型所需要的一些相关信息。传统方式中一般通过PW控制字(英文:Control Word)来携带上述的相关信息,在PW数据报文中,PW控制字一般放在Payload之前,PW label之后,例如图1所示PW数据报文的格式。Because different types of services have different attributes and requirements, in order to simulate the characteristics of different types of services on the IP/MPLS network as much as possible, it is necessary to carry some relevant information required for processing different PW types. In the traditional way, the above-mentioned relevant information is generally carried by the PW control word (English: Control Word). In the PW data message, the PW control word is generally placed before the Payload and after the PW label, such as the PW data message shown in Figure 1 format.
目前的问题是,不同PW类型的控制字没有统一的格式定义,不同PW类型的控制字中一些字段的定义存在冲突,且控制字自身不能标识PW的类型,使得接收端无法直接通过PW控制字来确定伪线的业务类型和控制字的格式,必须通过预先配置或者发送端与接收端协商指定PW的类型,否则就无法正确解析控制字,这种方式很不灵活,扩展性差,不利于PW技术的继续推广和发展。The current problem is that the control words of different PW types do not have a unified format definition, the definitions of some fields in the control words of different PW types conflict, and the control word itself cannot identify the type of PW, so that the receiving end cannot directly pass the PW control word To determine the service type of the pseudowire and the format of the control word, the type of PW must be specified through pre-configuration or negotiation between the sender and the receiver, otherwise the control word cannot be parsed correctly. This method is very inflexible and has poor scalability, which is not conducive to PW Continued promotion and development of technology.
发明内容Contents of the invention
为了解决上述技术问题,本发明实施例提供了一种伪线数据报文的封装、解封装方法和相关装置,提供了统一、灵活的定义方式设置PW报文头,扩展性强。In order to solve the above technical problems, the embodiments of the present invention provide a method for encapsulating and decapsulating pseudowire data packets and related devices, which provide a unified and flexible definition method for setting PW packet headers, and are highly scalable.
第一方面,本发明实施例提供了一种伪线数据报文的封装方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for encapsulating a pseudowire data message, the method including:
发送设备为PW数据报文设置PW报文头,所述PW报文头包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,所述PW类型字段中的内容用于标识所述PW数据报文所实现的PW业务类型,所述第一PW特有信息字段所占用字节长度固定,用于携带所述PW数据报文所实现PW业务类型的特有信息;The sending device sets a PW header for the PW data message, the PW header includes an identifier field, a PW type-independent information field, a PW type field, and a first PW-specific information field, and the content in the identifier field is used In order to identify the PW data message as a PW data message with a PW message header, the content in the PW type-independent information field includes general information that is not related to the PW service type implemented by the PW data message, so The content in the PW type field is used to identify the PW service type implemented by the PW data message, and the byte length occupied by the first PW specific information field is fixed, and is used to carry the PW service type implemented by the PW data message. Information specific to the type of business;
所述发送设备将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文。The sending device encapsulates the PW packet header in the PW data packet, and sends the encapsulated PW data packet to the receiving device.
可选的,通过封装所述PW数据报文,所述PW报文头所在字段封装在PW标签所在字段和所述业务净荷所在字段之间。Optionally, by encapsulating the PW data packet, the field where the PW packet header is located is encapsulated between the field where the PW label is located and the field where the service payload is located.
可选的,所述PW报文头还包括第二PW特有信息字段,所述第二PW特有信息字段所占用字节长度可变,用于携带所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。Optionally, the PW packet header further includes a second PW-specific information field, the length of bytes occupied by the second PW-specific information field is variable, and is used to carry the PW service type implemented by the PW data packet. A specific part of the unique information, where the specific part is information that cannot be carried by the first PW specific information field.
可选的,所述PW报文头还包括标志位字段,所述标志位字段中的内容用于标识所述PW报文头中是否包括所述第二PW特有信息字段。Optionally, the PW packet header further includes a flag bit field, and the content in the flag bit field is used to identify whether the PW packet header includes the second PW specific information field.
第二方面,本发明实施例提供了一种伪线数据报文的封装装置,所述封装装置包括:In a second aspect, an embodiment of the present invention provides a device for encapsulating a pseudowire data message, the encapsulating device comprising:
设置单元,用于为伪线PW数据报文设置PW报文头,所述PW报文头包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,所述PW类型字段中的内容用于标识所述PW数据报文所实现的PW业务类型,所述第一PW特有信息字段所占用字节长度固定,用于携带所述PW数据报文所实现PW业务类型的特有信息;A setting unit, configured to set a PW header for a pseudowire PW data message, the PW header includes an identifier field, a PW type irrelevant information field, a PW type field, and a first PW specific information field, the identifier The content in the field is used to identify the PW data message as a PW data message with a PW message header, and the content in the PW type-independent information field includes information that is not related to the PW service type implemented by the PW data message. general information, the content in the PW type field is used to identify the PW service type implemented by the PW data message, the first PW specific information field occupies a fixed byte length, and is used to carry the PW data Unique information of the PW service type implemented by the message;
封装及发送单元,用于将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文。An encapsulating and sending unit, configured to encapsulate the PW header in the PW data message, and send the encapsulated PW data message to the receiving device.
可选的,通过所述封装及发送单元封装所述PW数据报文,所述PW报文头所在字段封装在PW标签所在字段和所述业务净荷所在字段之间。Optionally, the PW data packet is encapsulated by the encapsulating and sending unit, and the field where the PW packet header is located is encapsulated between the field where the PW label is located and the field where the service payload is located.
可选的,所述PW报文头还包括第二PW特有信息字段,所述第二PW特有信息字段所占用字节长度可变,用于携带所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。Optionally, the PW packet header further includes a second PW-specific information field, the length of bytes occupied by the second PW-specific information field is variable, and is used to carry the PW service type implemented by the PW data packet. A specific part of the unique information, where the specific part is information that cannot be carried by the first PW specific information field.
可选的,所述PW报文头还包括标志位字段,所述标志位字段中的内容用于标识所述PW报文头中是否包括所述第二PW特有信息字段。Optionally, the PW packet header further includes a flag bit field, and the content in the flag bit field is used to identify whether the PW packet header includes the second PW specific information field.
第三方面,本发明实施例提供了一种伪线数据报文的解封装方法,所述方法包括:In a third aspect, an embodiment of the present invention provides a method for decapsulating a pseudowire data message, the method including:
接收设备获取发送设备发送的数据报文;The receiving device obtains the data packet sent by the sending device;
所述接收设备将所述数据报文解封装,通过识别标识符字段中的内容确定所述数据报文为携带了伪线PW报文头的PW数据报文,所述PW报文头包括所述标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段;The receiving device decapsulates the data message, and determines that the data message is a PW data message carrying a pseudowire PW message header by identifying the content in the identifier field, and the PW message header includes the The identifier field, the PW type irrelevant information field, the PW type field and the first PW specific information field;
所述接收设备根据所述PW报文头的格式解析所述PW报文头,具体包括:The receiving device parses the PW header according to the format of the PW header, specifically including:
所述接收设备通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。The receiving device determines the general information irrelevant to the PW service type implemented by the PW data message by analyzing the content in the PW type-independent information field, and determines the For the PW service type implemented by the PW data message, the specific information of the PW service type implemented by the PW data message is determined by parsing the first PW specific information field.
可选的,所述PW报文头还包括第二PW特有信息字段,所述第二PW特有信息字段所占用字节长度可变,所述接收设备根据所述PW报文头的格式解析所述PW报文头,还包括:Optionally, the PW packet header further includes a second PW-specific information field, the length of bytes occupied by the second PW-specific information field is variable, and the receiving device parses the PW packet header according to the format of the PW packet header. The above PW packet header also includes:
所述接收设备通过解析所述第二PW特有信息字段中的内容,确定出所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。The receiving device determines a specific part of the specific information of the PW service type implemented by the PW data message by analyzing the content in the second PW specific information field, and the specific part cannot be obtained by the first PW Information carried in the PW-specific information field.
可选的,所述PW报文头还包括标志位字段,所述接收设备根据所述PW报文头的格式解析所述PW报文头,还包括:Optionally, the PW header further includes a flag bit field, and the receiving device parses the PW header according to the format of the PW header, and further includes:
所述接收设备通过解析所述标志位字段中的内容,确定出所述PW报文头是否包括所述第二PW特有信息字段。The receiving device determines whether the PW packet header includes the second PW specific information field by analyzing the content in the flag bit field.
第四方面,本发明实施例提供一种伪线数据报文的解封装装置,所述解封装装置包括:In a fourth aspect, an embodiment of the present invention provides a device for decapsulating a pseudowire data message, where the decapsulating device includes:
接收单元,用于获取发送设备发送的数据报文;The receiving unit is used to obtain the data message sent by the sending device;
解封装单元,用于将所述数据报文解封装,通过识别标识符字段中的内容确定所述数据报文为携带了伪线PW报文头的PW数据报文,所述PW报文头包括所述标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段;A decapsulation unit, configured to decapsulate the data message, and determine that the data message is a PW data message carrying a pseudowire PW message header by identifying the content in the identifier field, and the PW message header including the identifier field, the PW type-independent information field, the PW type field, and the first PW-specific information field;
解析单元,用于根据所述PW报文头的格式解析所述PW报文头,具体包括:A parsing unit, configured to parse the PW packet header according to the format of the PW packet header, specifically including:
通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。Determine the general information irrelevant to the PW service type implemented by the PW data message by parsing the content in the PW type-independent information field, and determine the PW data message by parsing the content in the PW type field For the implemented PW service type, the specific information of the PW service type implemented in the PW data message is determined by parsing the first PW specific information field.
可选的,所述PW报文头还包括第二PW特有信息字段,所述第二PW特有信息字段所占用字节长度可变,所述解析单元还用于通过解析所述第二PW特有信息字段中的内容,确定出所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。Optionally, the PW packet header further includes a second PW-specific information field, the length of bytes occupied by the second PW-specific information field is variable, and the parsing unit is further configured to parse the second PW-specific The content in the information field determines a specific part of the specific information of the PW service type implemented by the PW data message, and the specific part is information that cannot be carried by the first PW specific information field.
可选的,所述PW报文头还包括标志位字段,所述解析单元还用于通过解析所述标志位字段中的内容,确定出所述PW报文头是否包括所述第二PW特有信息字段。Optionally, the PW header further includes a flag field, and the parsing unit is further configured to determine whether the PW header includes the second PW-specific information field.
第五方面,本发明实施例提供了一种伪线数据报文的处理系统,所述处理系统包括发送设备和接收设备:In a fifth aspect, an embodiment of the present invention provides a processing system for a pseudowire data message, the processing system includes a sending device and a receiving device:
所述发送设备,用于为伪线PW数据报文设置PW报文头,所述PW报文头包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,所述PW类型字段中的内容用于标识所述PW数据报文所实现的PW业务类型,所述第一PW特有信息字段所占用字节长度固定,用于携带所述PW数据报文所实现PW业务类型的特有信息;将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文;The sending device is configured to set a PW packet header for a pseudowire PW data packet, the PW packet header includes an identifier field, a PW type irrelevant information field, a PW type field, and a first PW specific information field, the The content in the identifier field is used to identify the PW data message as a PW data message with a PW message header, and the content in the PW type-independent information field includes information related to the PW service implemented by the PW data message. Type-independent general information, the content in the PW type field is used to identify the PW service type implemented by the PW data message, the first PW specific information field occupies a fixed byte length, and is used to carry the The specific information of the PW service type implemented by the PW data message; encapsulating the PW message header in the PW data message, and sending the encapsulated PW data message to the receiving device;
所述接收设备,用于获取发送设备发送的数据报文;将所述数据报文解封装,通过识别所述标识符字段中的内容确定所述数据报文为携带了所述PW报文头的所述PW数据报文;根据所述PW报文头的格式解析所述PW报文头,具体包括:通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。The receiving device is configured to obtain the data message sent by the sending device; decapsulate the data message, and determine that the data message carries the PW message header by identifying the content in the identifier field The PW data packet; parsing the PW packet header according to the format of the PW packet header, specifically includes: determining the content related to the PW data packet by parsing the content in the PW type-independent information field Realize general information irrelevant to the PW service type, determine the PW service type implemented by the PW data message by parsing the content in the PW type field, and determine the PW service type implemented by the first PW specific information field by parsing the first PW specific information field Specific information about the PW service type implemented by the PW data packet.
由上述技术方案可以看出,设置的PW报文头中包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,各个字段分别用于携带指定类型的内容,使用所述PW报文头中的这些字段携带用于定义、标识PW数据报文所实现业务类型的各种所需信息,从而可以实现对各种类型PW的报文封装统一、灵活的定义,扩展性强。通过针对发向接收设备的PW数据报文设置所述PW报文头中的内容,发送设备可以在所述PW数据报文中封装所述PW报文头,以便接收设备可以识别所述PW数据报文携带的通用信息和特有信息,并确定所述PW数据报文所实现的PW业务类型。It can be seen from the above technical solution that the set PW message header includes an identifier field, a PW type-independent information field, a PW type field, and a first PW-specific information field, and each field is used to carry a specified type of content. These fields in the PW packet header mentioned above carry all kinds of required information for defining and identifying the service types implemented by the PW data packets, so that the uniform and flexible definition of packet encapsulation of various types of PWs can be realized, and the extensibility powerful. By setting the content in the PW packet header for the PW data packet sent to the receiving device, the sending device can encapsulate the PW packet header in the PW data packet, so that the receiving device can identify the PW data The general information and specific information carried in the message, and determine the PW service type implemented by the PW data message.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1为一种PW数据报文的格式示意图;FIG. 1 is a schematic diagram of the format of a PW data message;
图2为本发明实施例提供的一种PW报文头的格式示意图;FIG. 2 is a schematic diagram of the format of a PW packet header provided by an embodiment of the present invention;
图3为本发明实施例提供的一种伪线数据报文封装方法的方法流程图;Fig. 3 is a method flowchart of a method for encapsulating a pseudowire data packet provided by an embodiment of the present invention;
图4为本发明实施例提供的一种PW数据报文的格式示意图;FIG. 4 is a schematic diagram of the format of a PW data message provided by an embodiment of the present invention;
图5为本发明实施例提供的一种伪线数据报文解封装方法的方法流程图;Fig. 5 is a method flowchart of a method for decapsulating a pseudowire data packet provided by an embodiment of the present invention;
图6为本发明实施例提供的一种伪线数据报文封装装置的装置结构图;FIG. 6 is a device structure diagram of a pseudowire data packet encapsulation device provided by an embodiment of the present invention;
图7为本发明实施例提供的一种伪线数据报文解封装装置的装置结构图;FIG. 7 is a device structure diagram of a device for decapsulating pseudowire data packets provided by an embodiment of the present invention;
图8为本发明实施例提供的一种伪线数据报文的处理系统的系统结构图;FIG. 8 is a system structural diagram of a system for processing pseudowire data packets provided by an embodiment of the present invention;
图9为本发明实施例提供的一种发送设备的硬件结构示意图;FIG. 9 is a schematic diagram of a hardware structure of a sending device provided by an embodiment of the present invention;
图10为本发明实施例提供的一种接收设备的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of a receiving device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
随着IP网络的不断发展,更多类型的业务存在与IP网络互连的需求,或者需要迁移到IP/MPLS网络上,例如通过IP/MPLS网络承载无线前传(英文:Fronthaul)业务,智能电网(英文:Smart Grid)业务或是专业音/视频(英文:Pro-Audio/Video)业务等。可以通过扩展PW技术实现在IP/MPLS网络中承载这些新业务,为此可能需要定义新的PW业务类型,不同的PW业务类型有着不同的属性和处理要求。With the continuous development of IP networks, more types of services need to be interconnected with IP networks, or need to be migrated to IP/MPLS networks, such as carrying wireless fronthaul (English: Fronthaul) services through IP/MPLS networks, smart grid (English: Smart Grid) business or professional audio/video (English: Pro-Audio/Video) business, etc. These new services can be carried on the IP/MPLS network by extending the PW technology. For this purpose, new PW service types may need to be defined. Different PW service types have different attributes and processing requirements.
传统的方式是使用PW控制字来携带用于处理某种PW业务的相关信息,例如可以携带防止乱序的信息,传递控制和告警信息等。The traditional method is to use the PW control word to carry relevant information for processing a certain PW service, for example, it can carry information for preventing disorder, transmit control and alarm information, and so on.
然而,目前的问题是,不同PW类型的控制字没有统一的格式定义,不同PW类型的控制字中一些字段的定义存在冲突,且控制字自身不能标识PW的类型,使得接收端无法直接通过PW控制字来确定伪线的业务类型和控制字的格式,必须通过预先配置或者发送端与接收端协商指定PW的类型,否则就无法正确解析控制字,这种方式很不灵活,扩展性差,不利于PW技术的继续推广和发展。However, the current problem is that there is no unified format definition for the control words of different PW types, and there are conflicts in the definitions of some fields in the control words of different PW types, and the control word itself cannot identify the type of PW, so that the receiving end cannot directly pass the PW To determine the PW service type and the format of the control word, the type of PW must be specified through pre-configuration or negotiation between the sender and the receiver. Otherwise, the control word cannot be parsed correctly. This method is very inflexible and has poor scalability. Conducive to the continued promotion and development of PW technology.
而且发明人发现,传统的PW控制字所占用字节长度固定,仅为4个字节,能够携带的内容有限,扩展性差。对于一些新的功能和新的PW业务来说,缺少足够的空间携带所需要的信息。故即使统一PW控制字携带相关信息的格式定义方式,也难以满足目前越来越多的PW业务类型的处理需求。Moreover, the inventors found that the length of bytes occupied by the traditional PW control word is fixed, only 4 bytes, the content that can be carried is limited, and the expandability is poor. For some new functions and new PW services, there is not enough space to carry the required information. Therefore, even if the format definition method of the relevant information carried by the PW control word is unified, it is still difficult to meet the processing requirements of more and more PW service types.
为此,本发明实施例提供了一种伪线数据报文的封装、解封装方法和相关装置,设置的PW报文头中包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,各个字段分别用于携带指定类型的内容,使用所述PW报文头中的这些字段携带用于定义、标识PW数据报文所实现业务类型的各种所需信息,从而既为各种PW业务类型定义了统一的报文头封装方式,又能够携带特定PW类型的特有信息,且具备很强的扩展性。通过针对发向接收设备的PW数据报文设置所述PW报文头中的内容,发送设备可以在所述PW数据报文中封装所述PW报文头,以便接收设备可以识别所述PW数据报文携带的通用信息和特有信息,并确定所述PW数据报文所实现的PW业务类型。To this end, the embodiment of the present invention provides a method for encapsulating and decapsulating a pseudowire data message and a related device. The set PW message header includes an identifier field, a PW type irrelevant information field, a PW type field and a first PW-specific information fields, each field is used to carry the specified type of content, use these fields in the PW message header to carry various required information for defining and identifying the service type implemented by the PW data message, so that both A unified packet header encapsulation method is defined for various PW service types, and it can carry specific information of a specific PW type, and has strong scalability. By setting the content in the PW packet header for the PW data packet sent to the receiving device, the sending device can encapsulate the PW packet header in the PW data packet, so that the receiving device can identify the PW data The general information and specific information carried in the message, and determine the PW service type implemented by the PW data message.
在本发明实施例中所述的PW报文头(英文:Generic PW header)中,明确定义了分别用于携带指定类型内容的各个字段,以便携带能够涵盖目前出现的以及可能出现的PW业务类型的所需信息,从而达到统一定义PW报文头的效果。In the PW header (English: Generic PW header) described in the embodiment of the present invention, each field used to carry the specified type of content is clearly defined, so as to carry the types of PW services that can cover the current and possible occurrences The required information, so as to achieve the effect of uniformly defining the PW packet header.
在本发明实施例中,所述PW报文头可以包括标识符(英文:First Nibble)字段、PW类型无关信息(英文:PW-Type Independent Information)字段、PW类型(英文:PW-Type)字段和第一PW特有信息(英文:PW-specific Information)字段。In the embodiment of the present invention, the PW header may include an identifier (English: First Nibble) field, a PW type independent information (English: PW-Type Independent Information) field, a PW type (English: PW-Type) field and a first PW-specific information (English: PW-specific Information) field.
其中,所述标识符字段位于所述PW报文头的最前部,该字段又可以称为前半字节或者前4bit,例如图2所示PW报文头格式中最前部的“XXXX”部分。所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,也就是说,当接收设备接收到一个数据报文时,若这个数据报文带有所述标识符字段,那么接收设备通过所述标识符字段的标识功能,可以将这个数据报文与其他IPv4、IPv6报文,带PW控制字的报文等其他数据报文区分开,使得接收设备可以识别出这个数据报文为本发明实施例中提供的这类携带PW报文头的PW数据报文。例如可以将所述标识符字段的取值设置为2或3,用于标识PW数据报文携带了PW报文头。Wherein, the identifier field is located at the front of the PW header, and this field can also be called the first nibble or the first 4 bits, for example, the "XXXX" part at the front of the PW header format shown in FIG. 2 . The content in the identifier field is used to identify the PW data packet as a PW data packet with a PW packet header, that is, when the receiving device receives a data packet, if the data packet With the identifier field, the receiving device can distinguish this data message from other IPv4, IPv6 messages, messages with PW control words and other data messages through the identification function of the identifier field, This enables the receiving device to recognize that the data packet is the PW data packet carrying the PW packet header provided in the embodiment of the present invention. For example, the value of the identifier field may be set to 2 or 3, which is used to identify that the PW data packet carries a PW packet header.
所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,即对各种类型的PW业务都通用的信息。所述PW类型无关信息字段中可以至少包括操作管理维护(英文:Operation Administration and Maintenance,缩写:OAM)字段、服务质量(英文:Quality of Service,缩写:QoS)字段、序列号(英文:SequenceNumber)字段和流标识(英文:Flow Identifier)字段,包括这些字段的所述PW类型无关信息字段可以设置在所述PW报文头格式中的前部,例如图2所示报文头格式中前两行的格式、排列顺序。通过所述OAM字段中携带的内容,可以用于指示对所述PW数据报文进行何种OAM相关的处理,例如报文统计等。通过所述QoS字段中携带的内容,可以用于指示所述PW数据报文所要求的服务质量。通过所述序列号字段中携带的内容,可以用于防止所述PW数据报文中的业务报文乱序。通过所述流标识字段中携带的内容,可以用于标识所述PW数据报文所属的数据流。The content in the PW type-independent information field includes general information irrelevant to the PW service type implemented by the PW data message, that is, information common to all types of PW services. The PW type-independent information field may at least include an operation management and maintenance (English: Operation Administration and Maintenance, abbreviation: OAM) field, a service quality (English: Quality of Service, abbreviation: QoS) field, and a sequence number (English: SequenceNumber) Field and Flow Identifier (English: Flow Identifier) field, the PW type-independent information field including these fields can be set in the front part of the PW message header format, for example, the first two in the message header format shown in Figure 2 The format and order of rows. The content carried in the OAM field may be used to indicate what kind of OAM-related processing is performed on the PW data packet, such as packet statistics. The content carried in the QoS field can be used to indicate the service quality required by the PW data packet. The content carried in the sequence number field can be used to prevent service packets in the PW data packet from being out of sequence. The content carried in the flow identification field can be used to identify the data flow to which the PW data packet belongs.
所述PW类型字段中的内容主要用于标识所述PW数据报文所实现的PW业务类型。The content in the PW type field is mainly used to identify the PW service type implemented by the PW data packet.
需要注意的是,通常不同的PW业务类型还会包括该PW业务类型所特有的信息,例如可以包括控制信息、状态信息、告警信息等。在本发明实施例中,所述PW报文头还可以通过已定义的字段来携带这类信息,其中包括PW特有信息字段。It should be noted that generally different PW service types also include information specific to the PW service type, for example, control information, status information, alarm information, and the like. In the embodiment of the present invention, the PW packet header may also carry such information through defined fields, including PW specific information fields.
所述第一PW特有信息字段中所携带的内容类型和所占字节长度是预先设置好的,用于携带所述PW数据报文所实现PW业务类型的特有信息。所述PW特有信息字段的格式可以是一组带有特定含义的bit标志位,也可以根据特定PW类型定义其他格式。The content type and occupied byte length carried in the first PW specific information field are preset, and are used to carry the specific information of the PW service type implemented by the PW data message. The format of the PW-specific information field may be a group of bits with specific meanings, or other formats may be defined according to a specific PW type.
在本发明实施例中,所述第一PW特有信息字段基本上定义了目前常见的各个PW业务类型特有信息中可能携带的内容。若所述PW数据报文所实现PW业务类型的特有信息中的全部信息已经定义在所述第一PW特有信息字段中,那么就可以由所述第一PW特有信息字段携带PW业务类型的全部特有信息。若某种PW业务类型的特有信息中有一些信息未在所述第一PW特有信息字段中预先定义,那么PW业务类型的特有信息的这部分信息将不能由所述第一PW特有信息字段携带,或者可以理解为,第一PW特有信息字段中没有足够的预留位置来携带该信息。可选的,这部分信息可以由本发明实施例提供的其他字段来携带。在这种情况下,所述第一PW特有信息字段可以仅携带PW业务类型的特有信息的一部分。In the embodiment of the present invention, the first PW specific information field basically defines the content that may be carried in the current common PW service type specific information. If all the information in the specific information of the PW service type implemented by the PW data message has been defined in the first PW specific information field, then the first PW specific information field can carry all the information of the PW service type. proprietary information. If some information in the specific information of a certain PW service type is not predefined in the first PW specific information field, then this part of the specific information of the PW service type cannot be carried by the first PW specific information field , or it can be understood that there is not enough reserved space in the first PW-specific information field to carry the information. Optionally, this part of information may be carried by other fields provided by the embodiment of the present invention. In this case, the first PW specific information field may only carry part of the specific information of the PW service type.
若出现PW业务类型的特有信息中有一些信息未在所述第一PW特有信息字段中预先定义的情况,可选的,所述PW报文头还可以包括第二PW特有信息字段(英文:PW-TypeSpecific Variables),所述第二PW特有信息字段所占用字节长度可变,用于携带所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。If there is some information in the unique information of the PW service type that is not predefined in the first PW specific information field, optionally, the PW header may also include a second PW specific information field (English: PW-TypeSpecific Variables), the length of bytes occupied by the second PW-specific information field is variable, and is used to carry a specific part of the specific information of the PW service type implemented by the PW data message, and the specific part cannot Information carried by the first PW-specific information field.
举例说明,这里所述的特定信息中包括的可以为上述未在所述第一PW特有信息字段中定义的信息。通过所述第二PW特有信息字段,可以实现高扩展性,对可能出现的特定PW业务类型中的新信息做好准备。For example, the specific information described here may include information that is not defined in the first PW specific information field. Through the second PW-specific information field, high scalability can be achieved, and preparations can be made for new information in a specific PW service type that may appear.
为了方便接收设备在解析报文时能够明确所述PW报文头中设置了所述第二PW特有信息字段,可选的,所述PW报文头还可以包括标志位字段,所述标志位字段中的内容用于标识所述PW报文头中是否包括了所述第二PW特有信息字段。例如将所述标志位字段中内容设置为1时标识所述PW报文头包括了所述第二PW特有信息字段,设置为0时标识所述PW报文头未包括所述第二PW特有信息字段。所述标志位字段在所述PW报文头中的位置可以如图2所示,在图2中,所述标志位字段具体为“V”部分。In order to make it easier for the receiving device to clarify that the second PW-specific information field is set in the PW packet header when parsing the packet, optionally, the PW packet header may also include a flag bit field, and the flag bit The content in the field is used to identify whether the PW packet header includes the second PW specific information field. For example, when the content in the flag bit field is set to 1, it indicates that the PW packet header includes the second PW specific information field, and when it is set to 0, it indicates that the PW packet header does not include the second PW specific information field. information field. The position of the flag bit field in the PW packet header may be as shown in FIG. 2 . In FIG. 2 , the flag bit field is specifically a “V” part.
接下来对在PW数据报文中封装、解封装所述PW报文头进行说明。Next, the encapsulation and decapsulation of the PW packet header in the PW data packet will be described.
封装带有PW报文头的PW数据报文的过程如图3所示。The process of encapsulating a PW data packet with a PW packet header is shown in FIG. 3 .
101:发送设备为PW数据报文设置PW报文头。101: The sending device sets a PW packet header for the PW data packet.
举例说明,本发明实施例中所述的发送设备和接收设备可以为网络设备,在IP/MPLS网络中,所述发送设备和接收设备可以为网络侧边缘(英文:Provider Edge,缩写:PE)设备。所述发送设备和接收设备可以通过事先协商等方式确定是否使用PW报文头的封装方式,即是否在PW数据报文中携带PW报文头。For example, the sending device and the receiving device described in the embodiments of the present invention may be network devices, and in the IP/MPLS network, the sending device and the receiving device may be network side edge (English: Provider Edge, abbreviated as: PE) equipment. The sending device and the receiving device can determine whether to use the encapsulation method of the PW packet header through prior negotiation, that is, whether to carry the PW packet header in the PW data packet.
所述PW报文头中的内容与所述PW数据报文所实现的PW业务直接相关。The content in the PW packet header is directly related to the PW service implemented by the PW data packet.
102:所述发送设备将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文。102: The sending device encapsulates the PW packet header into the PW data packet, and sends the encapsulated PW data packet to the receiving device.
封装方式可以是将设置好的所述PW报文头添加在业务净荷字段之前,所述发送设备再添加PW标签和外部的隧道封装。在这种封装方式中,所述PW报文头所在字段可以封装在PW标签所在字段和所述业务净荷所在字段之间,例如封装后的所述PW数据报文的格式可以如图4所示。The encapsulation method may be to add the set PW header before the service payload field, and then add the PW label and external tunnel encapsulation by the sending device. In this encapsulation method, the field where the PW header is located can be encapsulated between the field where the PW label is located and the field where the service payload is located. For example, the format of the encapsulated PW data message can be as shown in Figure 4 Show.
解封装带有PW报文头的PW数据报文的过程如图5所示。The process of decapsulating the PW data packet with the PW packet header is shown in FIG. 5 .
201:接收设备获取发送设备发送的数据报文。201: The receiving device obtains the data packet sent by the sending device.
202:所述接收设备将所述数据报文解封装,通过识别标识符字段中的内容确定所述数据报文为携带了PW报文头的PW数据报文,所述PW报文头包括所述标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段。202: The receiving device decapsulates the data packet, and determines that the data packet is a PW data packet carrying a PW packet header by identifying content in the identifier field, and the PW packet header includes the The above identifier field, PW type irrelevant information field, PW type field and first PW specific information field.
举例说明,所述接收设备通过解封装,去除封装后的所述数据报文外部的隧道封装和PW标签后,可以通过所述标识符的内容确定所述数据报文为一种携带有PW报文头的PW数据报文,根据所述PW数据报文的格式类型,可以依据PW报文头的解析方式对所述PW报文头进行数据解析。For example, after the receiving device decapsulates and removes the tunnel encapsulation and the PW label outside the encapsulated data message, it can determine that the data message is a PW message through the content of the identifier. For the PW data message of the header, according to the format type of the PW data message, the data analysis of the PW message header can be performed according to the analysis mode of the PW message header.
203:所述接收设备根据所述PW报文头的格式解析所述PW报文头,具体包括:203: The receiving device parses the PW packet header according to the format of the PW packet header, specifically including:
所述接收设备通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,以及第一PW特有信息字段的格式。通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。The receiving device determines the general information irrelevant to the PW service type implemented by the PW data message by analyzing the content in the PW type-independent information field, and determines the The PW service type implemented by the PW data message, and the format of the first PW-specific information field. By parsing the first PW specific information field, the specific information of the PW service type implemented by the PW data message is determined.
举例说明,所述接收设备通过解析所述OAM字段中携带的内容,可以明确对所述PW数据报文进行何种OAM相关的处理,例如报文统计等。通过解析所述QoS字段中携带的内容,可以明确所述PW数据报文所要求的服务质量。通过解析所述序列号字段中携带的内容,可以对所述PW数据报文中的乱序的业务报文进行重排。通过解析所述流标识字段中携带的内容,可以明确所述PW数据报文所属的数据流。For example, by analyzing the content carried in the OAM field, the receiving device can specify what kind of OAM-related processing, such as packet statistics, is performed on the PW data packet. By analyzing the content carried in the QoS field, the service quality required by the PW data message can be clarified. By analyzing the content carried in the sequence number field, the out-of-sequence service packets in the PW data packets can be rearranged. By analyzing the content carried in the flow identification field, the data flow to which the PW data message belongs can be specified.
若所述PW报文头还包括占用字节长度可变的第二PW特有信息字段,所述接收设备根据所述PW报文头的格式解析所述PW报文头还可以包括:If the PW header further includes a second PW-specific information field with a variable occupied byte length, parsing the PW header according to the format of the PW header by the receiving device may further include:
所述接收设备通过进一步解析所述第二PW特有信息字段中的内容,确定出所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。The receiving device determines a specific part of the specific information of the PW service type implemented by the PW data packet by further parsing the content in the second PW specific information field, and the specific part cannot be determined by the second PW specific information field. Information carried in a PW-specific information field.
可选的,所述PW报文头还包括标志位字段,所述接收设备根据所述PW报文头的格式解析所述PW报文头,还包括:Optionally, the PW header further includes a flag bit field, and the receiving device parses the PW header according to the format of the PW header, and further includes:
所述接收设备通过解析所述标志位字段中的内容,确定出所述PW报文头是否包括所述第二PW特有信息字段。The receiving device determines whether the PW packet header includes the second PW specific information field by analyzing the content in the flag bit field.
举例说明,通过标志位字段的标识,可以让所述接收设备明确所需解析的字段以及可能携带的内容。提高了所述接收设备对解析携带PW报文头的PW数据报文的准确性和效率。For example, through the identification of the flag field, the receiving device can specify the field to be parsed and the content that may be carried. The accuracy and efficiency of the receiving device in parsing the PW data message carrying the PW message header are improved.
可以看出,设置的PW报文头中包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,各个字段分别用于携带指定类型的内容,使用所述PW报文头中的这些字段携带用于定义、标识PW数据报文所实现业务类型的各种所需信息,从而既为各种PW业务类型定义了统一的报文头封装方式,又能够携带特定PW类型的特有信息,且具备很强的扩展性。通过针对发向接收设备的PW数据报文设置所述PW报文头中的内容,发送设备可以在所述PW数据报文中封装所述PW报文头,以便接收设备可以识别所述PW数据报文携带的通用信息和特有信息,并确定所述PW数据报文所实现的PW业务类型。It can be seen that the set PW message header includes an identifier field, a PW type-independent information field, a PW type field, and a first PW-specific information field, and each field is used to carry content of a specified type. These fields in the header carry various required information for defining and identifying the service type implemented by the PW data message, so that a unified packet header encapsulation method is defined for various PW service types, and a specific PW type can be carried unique information, and has strong scalability. By setting the content in the PW packet header for the PW data packet sent to the receiving device, the sending device can encapsulate the PW packet header in the PW data packet, so that the receiving device can identify the PW data The general information and specific information carried in the message, and determine the PW service type implemented by the PW data message.
接下来说明本发明实施例提供的一种伪线数据报文的封装装置,所述封装装置可以为网络中的用于发送所述PW数据报文的网络设备。请参见图6所示,所述封装装置600可以包括设置单元601和封装及发送单元602:Next, a device for encapsulating a pseudowire data packet provided by an embodiment of the present invention is described. The encapsulating device may be a network device in a network for sending the PW data message. Please refer to FIG. 6, the packaging device 600 may include a setting unit 601 and a packaging and sending unit 602:
所述设置单元601,用于为PW数据报文设置PW报文头,所述PW报文头包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,所述PW类型字段中的内容用于标识所述PW数据报文所实现的PW业务类型,所述第一PW特有信息字段所占用字节长度固定,用于携带所述PW数据报文所实现PW业务类型的特有信息。The setting unit 601 is configured to set a PW packet header for a PW data packet, the PW packet header includes an identifier field, a PW type irrelevant information field, a PW type field, and a first PW specific information field, and the identification The content in the identifier field is used to identify the PW data message as a PW data message with a PW message header, and the content in the PW type-independent information field includes the PW service type implemented by the PW data message Irrelevant general information, the content in the PW type field is used to identify the PW service type implemented by the PW data message, the first PW specific information field occupies a fixed byte length, and is used to carry the PW Specific information about the PW service type implemented by the data packet.
所述封装及发送单元602,用于将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文。The encapsulating and sending unit 602 is configured to encapsulate the PW packet header in the PW data packet, and send the encapsulated PW data packet to a receiving device.
可选的,通过所述封装及发送单元封装所述PW数据报文,所述PW报文头所在字段封装在PW标签所在字段和所述业务净荷所在字段之间。Optionally, the PW data packet is encapsulated by the encapsulating and sending unit, and the field where the PW packet header is located is encapsulated between the field where the PW label is located and the field where the service payload is located.
可选的,所述PW报文头还包括第二PW特有信息字段,所述第二PW特有信息字段所占用字节长度可变,用于携带所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。Optionally, the PW packet header further includes a second PW-specific information field, the length of bytes occupied by the second PW-specific information field is variable, and is used to carry the PW service type implemented by the PW data packet. A specific part of the unique information, where the specific part is information that cannot be carried by the first PW specific information field.
可选的,所述PW报文头还包括标志位字段,所述标志位字段中的内容用于标识所述PW报文头中是否包括所述第二PW特有信息字段。Optionally, the PW packet header further includes a flag bit field, and the content in the flag bit field is used to identify whether the PW packet header includes the second PW specific information field.
接下来说明本发明实施例提供的一种伪线数据报文的解封装装置,所述解封装装置可以为网络中的用于接收所述PW数据报文的网络设备。请参见图7所示,所述解封装装置700可以包括接收单元701、解封装单元702和解析单元703:Next, an apparatus for decapsulating a pseudowire data packet provided by an embodiment of the present invention is described. The decapsulating apparatus may be a network device in a network for receiving the PW data packet. Please refer to FIG. 7, the decapsulation device 700 may include a receiving unit 701, a decapsulation unit 702 and an analysis unit 703:
接收单元701,用于获取发送设备发送的数据报文。The receiving unit 701 is configured to obtain a data message sent by the sending device.
解封装单元702,用于将所述数据报文解封装,通过识别标识符字段中的内容确定所述数据报文为携带了伪线PW报文头的PW数据报文,所述PW报文头包括所述标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段。The decapsulating unit 702 is configured to decapsulate the data message, and determine that the data message is a PW data message carrying a pseudowire PW message header by identifying the content in the identifier field, and the PW message The header includes the identifier field, a PW type-independent information field, a PW type field, and a first PW-specific information field.
解析单元703,用于根据所述PW报文头的格式解析所述PW报文头,具体包括:The parsing unit 703 is configured to parse the PW packet header according to the format of the PW packet header, specifically including:
通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。Determine the general information irrelevant to the PW service type implemented by the PW data message by parsing the content in the PW type-independent information field, and determine the PW data message by parsing the content in the PW type field For the implemented PW service type, the specific information of the PW service type implemented in the PW data message is determined by parsing the first PW specific information field.
可选的,所述PW报文头还包括第二PW特有信息字段,所述第二PW特有信息字段所占用字节长度可变,所述解析单元还用于通过解析所述第二PW特有信息字段中的内容,确定出所述PW数据报文所实现PW业务类型的特有信息中的特定部分,所述特定部分为无法由所述第一PW特有信息字段携带的信息。Optionally, the PW packet header further includes a second PW-specific information field, the length of bytes occupied by the second PW-specific information field is variable, and the parsing unit is further configured to parse the second PW-specific The content in the information field determines a specific part of the specific information of the PW service type implemented by the PW data message, and the specific part is information that cannot be carried by the first PW specific information field.
可选的,所述PW报文头还包括标志位字段,所述解析单元还用于通过解析所述标志位字段中的内容,确定出所述PW报文头是否包括所述第二PW特有信息字段。Optionally, the PW header further includes a flag field, and the parsing unit is further configured to determine whether the PW header includes the second PW-specific information field.
图8为本发明实施例提供的一种伪线数据报文处理系统的系统结构图,所述处理系统800包括发送设备801和接收设备802:FIG. 8 is a system structure diagram of a pseudowire data packet processing system provided by an embodiment of the present invention, the processing system 800 includes a sending device 801 and a receiving device 802:
所述发送设备,用于为伪线PW数据报文设置PW报文头,所述PW报文头包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,所述PW类型字段中的内容用于标识所述PW数据报文所实现的PW业务类型,所述第一PW特有信息字段所占用字节长度固定,用于携带所述PW数据报文所实现PW业务类型的特有信息;将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文;The sending device is configured to set a PW packet header for a pseudowire PW data packet, the PW packet header includes an identifier field, a PW type irrelevant information field, a PW type field, and a first PW specific information field, the The content in the identifier field is used to identify the PW data message as a PW data message with a PW message header, and the content in the PW type-independent information field includes information related to the PW service implemented by the PW data message. Type-independent general information, the content in the PW type field is used to identify the PW service type implemented by the PW data message, the first PW specific information field occupies a fixed byte length, and is used to carry the The specific information of the PW service type implemented by the PW data message; encapsulating the PW message header in the PW data message, and sending the encapsulated PW data message to the receiving device;
所述接收设备,用于获取发送设备发送的数据报文;将所述数据报文解封装,通过识别所述标识符字段中的内容确定所述数据报文为携带了所述PW报文头的所述PW数据报文;根据所述PW报文头的格式解析所述PW报文头,具体包括:通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。The receiving device is configured to obtain the data message sent by the sending device; decapsulate the data message, and determine that the data message carries the PW message header by identifying the content in the identifier field The PW data packet; parsing the PW packet header according to the format of the PW packet header, specifically includes: determining the content related to the PW data packet by parsing the content in the PW type-independent information field Realize general information irrelevant to the PW service type, determine the PW service type implemented by the PW data message by parsing the content in the PW type field, and determine the PW service type implemented by the first PW specific information field by parsing the first PW specific information field Specific information about the PW service type implemented by the PW data packet.
根据上述实施例可以看出,设置的PW报文头中包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,各个字段分别用于携带指定类型的内容,使用所述PW报文头中的这些字段携带用于定义、标识PW数据报文所实现业务类型的各种所需信息,从而可以实现对各种类型PW的报文封装统一、灵活的定义,扩展性强。通过针对发向接收设备的PW数据报文设置所述PW报文头中的内容,发送设备可以在所述PW数据报文中封装所述PW报文头,以便接收设备可以识别所述PW数据报文携带的通用信息和特有信息,并确定所述PW数据报文所实现的PW业务类型。According to the above embodiment, it can be seen that the set PW header includes an identifier field, a PW type-independent information field, a PW type field, and a first PW-specific information field, and each field is used to carry a specified type of content. These fields in the PW packet header mentioned above carry all kinds of required information for defining and identifying the service types implemented by the PW data packets, so that the uniform and flexible definition of packet encapsulation of various types of PWs can be realized, and the extensibility powerful. By setting the content in the PW packet header for the PW data packet sent to the receiving device, the sending device can encapsulate the PW packet header in the PW data packet, so that the receiving device can identify the PW data The general information and specific information carried in the message, and determine the PW service type implemented by the PW data message.
参阅图9,图9为本发明实施例提供的一种发送设备的硬件结构示意图,所述发送设备900包括存储器901和发送器902,以及分别与所述存储器901和所述发送器902连接的处理器903,所述存储器901用于存储一组程序指令,所述处理器903用于调用所述存储器901存储的程序指令执行如下操作:Referring to FIG. 9, FIG. 9 is a schematic diagram of a hardware structure of a sending device provided by an embodiment of the present invention. The sending device 900 includes a memory 901 and a transmitter 902, and devices connected to the memory 901 and the transmitter 902, respectively. A processor 903, the memory 901 is used to store a set of program instructions, and the processor 903 is used to call the program instructions stored in the memory 901 to perform the following operations:
为PW数据报文设置PW报文头,所述PW报文头包括标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段,所述标识符字段中的内容用于标识所述PW数据报文为带有PW报文头的PW数据报文,所述PW类型无关信息字段中的内容包括与所述PW数据报文所实现PW业务类型无关的通用信息,所述PW类型字段中的内容用于标识所述PW数据报文所实现的PW业务类型,所述第一PW特有信息字段所占用字节长度固定,用于携带所述PW数据报文所实现PW业务类型的特有信息;Set the PW header for the PW data message, the PW header includes an identifier field, a PW type irrelevant information field, a PW type field, and a first PW specific information field, and the content in the identifier field is used to identify The PW data message is a PW data message with a PW message header, and the content in the PW type-independent information field includes general information that is irrelevant to the PW service type implemented by the PW data message, and the PW The content in the type field is used to identify the PW service type implemented by the PW data message, and the byte length occupied by the first PW specific information field is fixed, and is used to carry the PW service type implemented by the PW data message unique information;
触发所述发送器902将所述PW报文头封装在所述PW数据报文中,并向接收设备发送封装后的所述PW数据报文。The transmitter 902 is triggered to encapsulate the PW packet header into the PW data packet, and send the encapsulated PW data packet to the receiving device.
可选地,所述处理器903可以为中央处理器(Central Processing Unit,CPU),所述存储器901可以为随机存取存储器(Random Access Memory,RAM)类型的内部存储器和所述发送器902可以包含普通物理接口,所述物理接口可以为以太(Ethernet)接口或异步传输模式(Asynchronous Transfer Mode,ATM)接口。所述处理器903、发送器902和存储器901可以集成为一个或多个独立的电路或硬件,如:专用集成电路(Application SpecificIntegrated Circuit,ASIC)。Optionally, the processor 903 may be a central processing unit (Central Processing Unit, CPU), the memory 901 may be an internal memory of a random access memory (Random Access Memory, RAM) type, and the transmitter 902 may A common physical interface is included, and the physical interface may be an Ethernet (Ethernet) interface or an Asynchronous Transfer Mode (Asynchronous Transfer Mode, ATM) interface. The processor 903, the transmitter 902 and the memory 901 may be integrated into one or more independent circuits or hardware, such as: Application Specific Integrated Circuit (ASIC).
参阅图10,图10为本发明实施例提供的一种接收设备的硬件结构示意图,所述接收设备1000包括存储器1001和接收器1002,以及分别与所述存储器1001和所述接收器1002连接的处理器1003,所述存储器1001用于存储一组程序指令,所述处理器1003用于调用所述存储器1001存储的程序指令执行如下操作:Referring to FIG. 10, FIG. 10 is a schematic diagram of a hardware structure of a receiving device according to an embodiment of the present invention. The receiving device 1000 includes a memory 1001 and a receiver 1002, and devices connected to the memory 1001 and the receiver 1002, respectively. A processor 1003, the memory 1001 is used to store a set of program instructions, and the processor 1003 is used to call the program instructions stored in the memory 1001 to perform the following operations:
触发所述接收器1002获取发送设备发送的数据报文;triggering the receiver 1002 to obtain the data message sent by the sending device;
将所述数据报文解封装,通过识别标识符字段中的内容确定所述数据报文为携带了伪线PW报文头的PW数据报文,所述PW报文头包括所述标识符字段、PW类型无关信息字段、PW类型字段和第一PW特有信息字段;Decapsulating the data message, and determining that the data message is a PW data message carrying a pseudowire PW message header by identifying the content in the identifier field, and the PW message header includes the identifier field , PW type irrelevant information field, PW type field and first PW specific information field;
根据所述PW报文头的格式解析所述PW报文头,具体包括:Parsing the PW header according to the format of the PW header specifically includes:
通过解析所述PW类型无关信息字段中的内容确定出与所述PW数据报文所实现PW业务类型无关的通用信息,通过解析所述PW类型字段中的内容,确定出所述PW数据报文所实现的PW业务类型,通过解析所述第一PW特有信息字段,确定出所述PW数据报文所实现PW业务类型的特有信息。Determine the general information irrelevant to the PW service type implemented by the PW data message by parsing the content in the PW type-independent information field, and determine the PW data message by parsing the content in the PW type field For the implemented PW service type, the specific information of the PW service type implemented in the PW data message is determined by parsing the first PW specific information field.
可选地,所述处理器1003可以为CPU,所述存储器1001可以为RAM类型的内部存储器,所述接收器1002可以包含普通物理接口,所述物理接口可以为Ethernet接口或ATM接口。所述处理器1003、接收器1002和存储器1001可以集成为一个或多个独立的电路或硬件,如:ASIC。Optionally, the processor 1003 may be a CPU, the memory 1001 may be a RAM-type internal memory, and the receiver 1002 may include a common physical interface, and the physical interface may be an Ethernet interface or an ATM interface. The processor 1003, receiver 1002 and memory 1001 may be integrated into one or more independent circuits or hardware, such as ASIC.
本发明实施例中提到的第一PW特有信息字段的“第一”只是用来做名字标识,并不代表顺序上的第一。该规则同样适用于“第二”。The "first" in the first PW-specific information field mentioned in the embodiment of the present invention is only used for name identification, and does not mean the first in order. The same rule applies to "second".
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:只读存储器(英文:read-only memory,缩写:ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps to realize the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the execution includes: The steps of the above-mentioned method embodiments; and the aforementioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviation: ROM), RAM, magnetic disk or optical disk, etc. can store medium for program code.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. place. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of changes or modifications within the technical scope disclosed in the present invention. Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610310741.9ACN107370654B (en) | 2016-05-11 | 2016-05-11 | Encapsulation and decapsulation method and related device for pseudowire data message |
| PCT/CN2017/079348WO2017193732A1 (en) | 2016-05-11 | 2017-04-01 | Method for encapsulating and decapsulating pseudo-wire data message, and relevant apparatus |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610310741.9ACN107370654B (en) | 2016-05-11 | 2016-05-11 | Encapsulation and decapsulation method and related device for pseudowire data message |
| Publication Number | Publication Date |
|---|---|
| CN107370654A CN107370654A (en) | 2017-11-21 |
| CN107370654Btrue CN107370654B (en) | 2019-12-24 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610310741.9AActiveCN107370654B (en) | 2016-05-11 | 2016-05-11 | Encapsulation and decapsulation method and related device for pseudowire data message |
| Country | Link |
|---|---|
| CN (1) | CN107370654B (en) |
| WO (1) | WO2017193732A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109995468A (en)* | 2018-01-03 | 2019-07-09 | 凌群电脑股份有限公司 | High-performance data-length variable information composition method and system |
| CN110611625B (en) | 2018-11-27 | 2020-11-06 | 新华三技术有限公司 | Network equipment and logic device applied to same |
| CN112448918B (en) | 2019-08-29 | 2023-06-09 | 华为技术有限公司 | Message transmission method and device, computer storage medium |
| CN111917735A (en)* | 2020-07-12 | 2020-11-10 | 中信银行股份有限公司 | Communication message generation and processing method and device and electronic equipment |
| CN113542374B (en)* | 2021-06-30 | 2022-04-12 | 北京宇信科技集团股份有限公司 | Message processing method and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101572651A (en)* | 2008-04-30 | 2009-11-04 | 华为技术有限公司 | Method and device for message transfer |
| CN101610263A (en)* | 2009-06-23 | 2009-12-23 | 中兴通讯股份有限公司 | E1 Service Edge-to-Edge Pseudowire Simulation Encapsulation and Decapsulation Method and Device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010088080A (en)* | 2008-10-03 | 2010-04-15 | Fujitsu Ltd | Communication apparatus and communication method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101572651A (en)* | 2008-04-30 | 2009-11-04 | 华为技术有限公司 | Method and device for message transfer |
| CN101610263A (en)* | 2009-06-23 | 2009-12-23 | 中兴通讯股份有限公司 | E1 Service Edge-to-Edge Pseudowire Simulation Encapsulation and Decapsulation Method and Device |
| Title |
|---|
| RFC4447 Pseudowire Setup and Maintenance Using the Label Distribution Protocol (LDP);L. Martini等;《RFC》;20060430;全文* |
| Publication number | Publication date |
|---|---|
| CN107370654A (en) | 2017-11-21 |
| WO2017193732A1 (en) | 2017-11-16 |
| Publication | Publication Date | Title |
|---|---|---|
| EP3958521B1 (en) | Method and apparatus for providing service for service flow | |
| CN108111523B (en) | Data transmission method and device | |
| CN107370654B (en) | Encapsulation and decapsulation method and related device for pseudowire data message | |
| CN101631069B (en) | Method, system and equipment for pseudo wire parameter negotiation | |
| JP2002344476A (en) | Method for use in packet communication and edge switch | |
| WO2017054576A1 (en) | Unicast tunnel building method, apparatus and system | |
| CN111327445B (en) | Message sampling method, message unpacking method, node, system and storage medium | |
| CN106302351B (en) | Method, device and system for collecting access control list | |
| CN101212390A (en) | A data transmission method and device | |
| CN112769738A (en) | DetNet data packet processing method and device | |
| US20230327983A1 (en) | Performance measurement in a segment routing network | |
| WO2021088813A1 (en) | Packet encapsulating method and apparatus, and packet decapsulating method and apparatus | |
| CN109526030A (en) | Processing method, device and the equipment of message | |
| CN111371736B (en) | iOAM information processing method, iOAM information processing device and computer readable storage medium | |
| WO2021254454A1 (en) | Bier oam detection method, and device and system | |
| US8149731B2 (en) | Technique for transferring data over a packet switched network | |
| CN105164973B (en) | Optical fiber to distribution point equipment and communication method thereof | |
| WO2023024755A1 (en) | Mpls packet encapsulation method and apparatus, and storage medium and electronic apparatus | |
| EP1770906B1 (en) | A method for realizing terminals management in the network device | |
| WO2022267875A1 (en) | Packet transmission method and related device | |
| EP3913865B1 (en) | Message decapsulation method and device, message encapsulation method and device, electronic device, and storage medium | |
| CN115766914A (en) | Message transmission method, device and system and electronic equipment | |
| CN115714823A (en) | Message processing method and device, electronic equipment and storage medium | |
| KR100908843B1 (en) | How to Configure a Forwarding Table in a Routing System | |
| CN111835644A (en) | Packet forwarding method and switch |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |