Bug 34 - ip checksum calculation is disabled
ip checksum calculation is disabled
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
pre-release
PC Linux
: P1 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-01 09:09 UTC by Mathieu Lacage
Modified: 2008-07-01 13:32 UTC (History)
0 users

See Also:


Attachments
Add ipv4 checksum support. (2.26 KB, patch)
2008-06-04 12:08 UTC, Florian Westphal
Details | Diff
Add ipv4 header checksum support. (2.61 KB, patch)
2008-06-04 19:17 UTC, Florian Westphal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Lacage 2007-06-01 09:09:37 UTC
It was disabled after some changes to the Packet/Buffer API a few months ago. To re-enable it, I think that the right way to go is to add 
uint32_t Buffer::CalculateIpChecksum (Buffer::Iterator start, Buffer::Iterator end);
Comment 1 Florian Westphal 2008-06-04 12:08:39 UTC
Created attachment 146 [details]
Add ipv4 checksum support.

Adds a static Checksum method to the ipv4 header class. Note that it only handles 20 byte ipv4 headers.
Comment 2 Florian Westphal 2008-06-04 19:17:33 UTC
Created attachment 147 [details]
Add ipv4 header checksum support.

Essentially the same as the previous version, but this one will handle an ipv4 header with options, too.

I tried to re-use src/internet-node/ipv4-checksum.cc, but first
moving the header data from Buffer::Iterator to a temporary copy
so it can be fed to the existing code is almost as much code as
doing the checksumming right away.
Comment 3 Mathieu Lacage 2008-06-04 19:52:18 UTC
looks good to me. can commit as-is.
Comment 4 Tom Henderson 2008-06-04 22:33:36 UTC
there's also this line in the header file that needs fixed:
   * \brief Enable checksum calculation for IP (XXX currently has no effect)


also, should this m_calcChecksum value be integrated into the attribute system?
Comment 5 Mathieu Lacage 2008-06-04 23:21:56 UTC
(In reply to comment #4)

> also, should this m_calcChecksum value be integrated into the attribute system?

One way to integrate this in the attribute system would be to move this variable to the Ipv4L3Protocol object and make Ipv4Header::m_calcChecksum a non-static variable and set it based on the Ipv4L3Protocol::m_calcChecksum value.
Comment 6 Mathieu Lacage 2008-06-05 18:56:30 UTC
changeset: aabbcb2cba71