a is a flowchart illustrating the process of encapsulating a cascaded packet according to an embodiment of the invention.
b is a flowchart illustrating de-capsulation processing of a cascaded packet.
Embodiments of the invention are hereinafter described in detail with reference to the accompanying drawings.
In an embodiment, a method for Generic Framing Procedure (GFP) encapsulation is provided. As shown in
As shown in
a length field of a PDU for indicating, in byte, the length of the PDU corresponding to the header information of the PDU cascaded; the width of the length field may be an integral multiple of 1 byte, in this embodiment, the width of the length field is set as 2 bytes; in this way, the cascaded packet may not occupy too much overhead even if the length of the cascaded packet reaches 216 bytes;
an ending indicating bit with 1 bit for identifying whether the PDU corresponding to the header information of the PDU cascaded is the last one in the cascaded packet, and the value of 1 indicates the end of the cascaded packet;
a protocol indicating bit with 1 bit for identifying whether the protocol type of the PDU corresponding to the header information of the PDU cascaded is consistent with that of a first PDU with a protocol indicating bit; the value of 1 indicates that the protocol type in the cascaded packet is consistent; the protocol indicating bit of header information of the first PDU cascaded in the cascaded packet may not be set as 1;
a reserved bit for future extention, which is not defined yet;
a protocol type field of the PDU for identifying the protocol type of the PDU corresponding to the header information of the PDU cascaded, which is set as 2 bytes in this embodiment, and there is no such a protocol type field while the value of the protocol indicating bit is 1.
As shown in
filling the length field of the PDU according to length of the PDU;
determining whether the PDU is the first PDU to be cascaded; if yes, setting the protocol indicating bit as 0 and adding the protocol type in the protocol type field of the PDU; if no, determining whether the protocol type of the PDU is consistent with that of the first PDU; if consistent, setting the protocol indicating bit as 1; if not consistent, setting the protocol indicating bit as 0 and adding the protocol type of the PDU in the protocol type field of the PDU;
adding the PDU at the end of the header information of the PDU cascaded corresponding to the PDU, and determining whether the PDU is the last one to be cascaded; if the PDU is not the last one, setting the ending indicating bit as 0, and processing a next PDU to be cascaded according to the processes above; if the PDU is the last one, setting the ending indicating bit as 1 and terminating the process of cascading the PDUs.
As shown in
filling a payload length indicator field of the GFP core header according to the length of the cascaded packet, including the length of all the header information and the length of all PDUs cascaded;
calculating the core Header Error Check (cHEC) field;
filling the PTI, PFI and EXI fields of the GFP payload header according to the GFP recommendation;
filling a UPI field of the GFP payload header different from a non-cascaded packet;
calculating the tHEC;
filling an extension frame header of the GFP frame if the EXI field is non-zero; and
calculating and filling an FCS of the GFP frame if the PFI is 1.
As shown in
checking the cHEC, and determining the starting position of the GFP frame;
determining the ending position of the GFP frame according to the payload length indicator field of the GFP core header;
checking the tHEC;
checking the FCS if the PFI is 1;
removing, according to the GFP recommendation, the PTI, PFI and EXI fields of the GFP payload header and the headers corresponding to the PTI, PFI and EXI fields;
determining the packet type of the PDU according to the User Payload Indicator (UPI) of the GFP payload header, and transferring the PDU to a packet de-cascading module which implements the process of de-cascading if the packet type of the PDU is a cascaded packet, i.e. splits the cascaded packet into a plurality of shorter PDUs.
The process of de-cascading a cascaded packet for splitting the cascaded packet into a plurality of shorter PDUs is shown in
determining the value of the protocol indicating bit in the header information of the PDU cascaded; if the value is 1, taking, from the fourth byte on, bytes corresponding to the length indicated in the length field of the PDU in the header information of the PDU cascaded as the payload of the PDU, and acquiring a protocol type from the header information of the PDU cascaded corresponding to the first PDU, which is then taken as the protocol type of the PDU; if the value is 0, taking, from the sixth byte on, the byte of which the length is indicated by the length field of the PDU in the header information of the PDU cascaded as the payload of the PDU, and acquiring a protocol type from the header information of the PDU cascaded corresponding to the PDU, which is then taken as the protocol type of the PDU;
transferring, according to the protocol type, the PDU to a protocol processing module, which processes the PDU according to a known method;
determining the value of the ending indicating bit in the header information of the packet header; de-cascading a next cascaded PDU if the value is 0, and terminating the process of de-capsulation if the value is 1.
In another embodiment, what differs from the embodiment above is that there is no ending indicating bit in the header information of the PDU cascaded, and other processes are almost the same as those in the embodiment above. As shown in
Then the boundary of the cascaded packet is determined according to the framing mechanism defined in GFP recommendation.
The GFP framing mechanism means that, according to the ITU-T G.7041 definition, and based on the cHEC byte of the GFP core header, if there are 4 sequential bytes meeting the cHEC relation, the GFP state machine determines that the 4 sequential bytes are the beginning of a GFP frame and implements the ECC, and the ending position of the GFP frame can be determined by a 16-bit Payload Length Indicator (PLI) field in the GFP core header.
According to the embodiments of the invention, the bandwidth utilization is increased for the transmission of short PDUs with GFP encapsulation over the transport network. A new formula is:
In the new formula, the header information of the PDU cascaded usually has a length of 3 or 5 bytes, while the length will become more or less depending on the width of the length field of the PDU in the header information of the PDU cascaded.
When five 40-byte packets, for example, are encapsulated in a cascaded packet, the encapsulation efficiency is 84.4% as calculated by the new formula according to the embodiments of the invention versus 76.9% calculated by the formula according to the prior mechanism, that is, the encapsulation efficiency is increased by 7.5%.
An embodiment of the invention also provides a device for GFP encapsulation. As shown in
The cascading module may include:
a module of header information of a PDU cascaded, for filling in header information of the PDU cascaded;
a combination module, for adding the header information of the PDU cascaded from the module of the header information of the PDU cascaded to the beginning of a PDU to be encapsulated; and
a cascading determination module, for determining whether the PDU is the last one to be cascaded, triggering the module of the header information of the PDU cascaded to fill in next header information of a PDU cascaded.
As shown in
a first sub-module, for determining whether the PDU is a first PDU to be cascaded, and whether the protocol type of the PDU is consistent with that of the first PDU;
a second sub-module, for filling in a length field of the PDU, setting the protocol indicating bit according to a determination result from the first sub-module, and filling a protocol type of the PDU in a protocol type field.
Referring to
a third sub-module, for filling a payload length indicator field of the GFP core header according to the length of the cascaded packet from the combination module, and also filling a payload type indicator field, a payload FCS indicator field, an extension header indicator field of the GFP payload header, and filling an extension frame header of the GFP frame if the extension header indicator field is non-zero;
a fourth sub-module, for calculating a cHEC field and a tHEC field, setting a given value in a user payload indicator field of the GFP payload header.
As show in
a GFP de-capsulation module, for checking at least one of the cHEC field and the tHEC field, and the FCS of the GFP frame, determining a starting position and an ending position of the GFP frame, and the protocol type of the PDU, and removing the payload type indicator, payload FCS indicator and extension header indicator fields of the GFP payload header and corresponding header.
The above embodiments illustrate the device cascading and encapsulating the packet and transmitting the encapsulated packet outside when the packet is received. The device may also de-capsulate and decascade the cascaded packet when the cascaded packet is received.
As show in
a packet de-cascading module, for indicating a cascaded packet from the GFP de-capsulation module, obtaining a payload and a protocol type, processing the PDU and de-cascading a next PDU cascaded.
The foregoing are only preferred embodiments of the invention but not for use in limiting the invention, those skilled in the art may make changes and variations on the basis of the invention without departing from the spirit and scope thereof. For example, in the encapsulation process above, the processing sequence of the GFP payload header is subject to appropriate adjustments depending on the actual situations and requirements. For another example, the header information of the PDU cascaded may also be longer or shorter than the prevailing value of 3 or 5 bytes depending on the width of the length field of the PDU in the header information of the PDU cascaded.
Number | Date | Country | Kind |
---|---|---|---|
200610090137.6 | Jun 2006 | CN | national |