Bug 34 - ip checksum calculation is disabled
: ip checksum calculation is disabled
Status: RESOLVED FIXED
: ns-3
simulation core
: pre-release
: PC Linux
: P1 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-06-01 09:09 EDT by
Modified: 2008-07-01 13:32 EDT (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-06-01 09:09:37 EDT
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 From 2008-06-04 12:08:39 EDT -------
Created an attachment (id=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 From 2008-06-04 19:17:33 EDT -------
Created an attachment (id=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 From 2008-06-04 19:52:18 EDT -------
looks good to me. can commit as-is.
------- Comment #4 From 2008-06-04 22:33:36 EDT -------
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 From 2008-06-04 23:21:56 EDT -------
(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 From 2008-06-05 18:56:30 EDT -------
changeset: aabbcb2cba71