Reputation: 1337
I am working on calculating checksum values for IPV6 packets.
How to calculate the values for destination address and length field for pseudo address in case of extension headers ?
Upvotes: 1
Views: 3513
Reputation: 9978
RFC 2460 section 8.1 specifies all this. Some highlights:
When determining the pseudo-header destination address when extension headers that change the destination address are used you use the destination address that the recipient would see:
If the IPv6 packet contains a Routing header, the Destination Address used in the pseudo-header is that of the final destination. At the originating node, that address will be in the last element of the Routing header; at the recipient(s), that address will be in the Destination Address field of the IPv6 header.
When determining the upper layer packet length you don't count any extension headers, only the final (upper layer) header and its data:
The Upper-Layer Packet Length in the pseudo-header is the length of the upper-layer header and data (e.g., TCP header plus TCP data). Some upper-layer protocols carry their own length information (e.g., the Length field in the UDP header); for such protocols, that is the length used in the pseudo-header. Other protocols (such as TCP) do not carry their own length information, in which case the length used in the pseudo-header is the Payload Length from the IPv6 header, minus the length of any extension headers present between the IPv6 header and the upper-layer header.
Upvotes: 2