摘要 |
Methods and devices for Generic Routing Encapsulation (GRE) message encapsulation and decapsulation are provided. The encapsulation method includes: performing attribute setting on predetermined bits of a GRE message header according to a preset encapsulation rule during GRE message encapsulation of an original message; and performing GRE message encapsulation on the attribute-set GRE message header and the original message. The decapsulation method includes: performing decapsulation analysis on predetermined bits of a header of a GRE message according to a preset decapsulation rule when the GRE message is received; and performing decapsulation on the received GRE message to obtain an original message in the received GRE message according to an analysis result. Correspondingly, the encapsulation device includes a setting module and an encapsulation module; and the decapsulation device includes an analysis module and a decapsulation module. |