[Ns-developers] Checksum patch
Sébastien Vincent
vincent at clarinet.u-strasbg.fr
Wed Jun 25 06:51:05 PDT 2008
Hello,
As Mathieu said in a past mail for a new way of calculating checksum for
IPv4, UDP and TCP.
I quote :
"
Looking at this issue more carefully, a nice way to go forward would be
to:
- move the function Ipv4Header::ChecksumCalculate to the
Buffer::Iterator class as a non-static member method name
CalculateIpChecksum.
- make the Ipv4Header code use this new method
- make the udp and tcp header code use this new method in IsChecksumOk
- re-implement InitializeChecksum in UdpHeader and TcpHeader by
creating a raw temporary instance of a Buffer, call Buffer::Begin (),
and serialize the source, dest, and payload fields, call
Iterator::CalculateIpChecksum
- remove the UdpHeader::m_ipv6 variable (and the UdpHeader::SetIpv6
method, obviously). The same for TcpHeader.
- kill ipv4-checksum.* and ipv6-checksum.*
"
I propose a patch that do this stuff. The code is located at https://svnet.u-strasbg.fr/hg/ns-3-checksum (it is based on last ns-3-dev).
Comments are welcome.
Regards,
--
Sebastien Vincent
Network and Protocol Team, University of Strasbourg, France
More information about the Ns-developers
mailing list