Section: 7.7.7 Invalid Length Information Element
Content: An information element has invalid length when the actual length of the IE is different from the value of the Length field in the IE header. Here, the actual length of the IE means the length of the content field of the received IE. If a GTP message contains more than one information elements and one or more of them have invalid length, the receiving GTP entity can detect which of the IEs have invalid length only in the following cases: - If the Length value in the IE header is greater than the overall length of the message; - If the invalid length IE is the last one in the message. Apart from Echo Request message, if a receiving GTP entity detects information element with invalid length in a Request message, it shall send an appropriate error response with Cause IE value set to "Invalid length" together with the type and instance of the offending IE. Other Length field handling cases are specified below: - If the received value of the Length field and the actual length of the fixed length IE are consistent, but the length is greater than that expected by the fixed number of octets, then the extra octets shall be discarded. - If the received value of the Length field and the actual length of the fixed length IE are consistent, but the length is less than that expected by the fixed number of octets, this shall be considered an error, IE shall be discarded and if the IE was received as a Mandatory IE or a verifiable Conditional IE in a Request message, an appropriate error response with Cause IE value set to "Invalid length" together with the type and instance of the offending IE shall be returned to the sender. - If the received value of the Length field and the actual length of the extendable length IE are consistent, but the length is greater than that expected by the fixed number of octets preceding the extended field(s), then the extra unknown octets shall be discarded. - If the received value of the Length field and the actual length of the extendable length IE are consistent, but the length is less than the number of fixed octets defined for that IE, preceding the extended field(s), this shall be considered an error, IE shall be discarded and if the IE was received as a Mandatory IE or a verifiable Conditional IE in a Request message, an appropriate error response with Cause IE value set to "Invalid length" together with the type and instance of the offending IE shall be returned to the sender. Please refer to Table 8.1-1 for determining the number of fixed octets of an IE.