Message encapsulation and de-encapsulation method and device, storage medium, and electronic device
Provided is a message encapsulation and de-encapsulation method and device, a storage medium, and an electronic device. The message encapsulation method includes: encapsulating a bit indexed explicit replication (BIER) header in an IPv6 extended header of an IPv6 message in combination with a generic fragmentation header (GFH), a generic encapsulating security payload (GESP), or a generic authentication header (GAH). The problem in the related art of how to combine a GFH mechanism with a BIER header encapsulated in an IPv6 extended header can be solved; when the BIER header is encapsulated in the IPv6 extended header, the BIER header can be combined with the GFH/GESP/GAH, thereby simply and efficiently realizing fragmentation, encapsulating security and authentication functions of a BIER multicast message.
1 . A message encapsulation method, performed by a network ingress device, comprising:
encapsulating a Bit Indexed Explicit Replication (BIER) header in an IPv6 extension header of an Internet protocol version 6 (IPv6) message in combination with a generic fragment header (GFH), a generic encapsulating security payload header (GESP) or a generic authentication header (GAH);
wherein, a Next Header field of the IPv6 extension header is set to 59, instructing a network intermediate device to skip processing of the GFH, the GESP, or the GAH in the IPv6 extension header; and a Proto field of the BIER header is set to one of G_TBD_X values, wherein the G_TBD_X values comprise three newly defined values for the Proto field, each corresponding to one of the GFH, the GESP and the GAH, thereby instructing a network egress device to identify and decapsulate the GFH, the GESP, or the GAH based on a value of the Proto field;
wherein the method further comprises: encapsulating the GFH, the GESP or the GAH, wherein a Next Header in the GFH, the GESP or the GAH indicates a message type transmitted by the BIER.
2 . The method according to claim 1 , wherein the IPv6 extension header is a hop-by-hop options header (HBH), a destination options header (DOH), or a routing header (RH).
3 . The method according to claim 1 , wherein the method further comprises:
encapsulating an IPv6 header at an outer layer of the IPv6 extension header, wherein a Next Header field in the IPv6 header indicates that the IPv6 header is followed by the HBH, the DOH, or the RH.
4 . A message decapsulation method, performed by a network egress device, comprising:
decapsulating a bit index explicit replication (BIER) header from an IPv6 extension header of an IPv6 message, wherein the BIER header is combined with a generic fragment header (GFH), a generic encapsulating security payload header (GESP) or a generic authentication header (GAH), and is encapsulated in the IPv6 extension header;
wherein a bit index explicit replication (BIER) header is obtained from an Internet protocol version 6 (IPv6) extension header, wherein the IPv6 extension header is a hop-by-hop options header (HBH), a destination options header (DOH), or a routing header (RH), comprising:
processing the IPv6 extension header and the BIER header in the IPv6 extension header;
performing message processing and forwarding according to the Next Header field of the IPv6 extension header and/or the Proto field in the BIER header;
wherein performing message processing and forwarding according to the Next Header field of the IPv6 extension header and the Proto field in the BIER header comprises:
when the Proto field of the BIER header is a value G_TBD_X for indicating the GFH, the GESP or the GAH, and the Next Header field of the IPv6 extension header is 59, identifying and decapsulating the GFH, the GESP, or the GAH according to a value of the Proto field of the BIER header.