Użytkownik "Ron Natalie" <ro*@sensor.com> napisał w wiadomo¶ci

news:3f*********************@news.newshosting.com. ..

But it doesn't work.

Define: "doesn't work"

I check sum with tcpdump. And it's bad.

It gives the wrong answer for the sum. This isn't surprising because the

algorithm

he uses is just a simple sum, and the IP checksum is defined as the "ones

complement

of a ones complement sum". Specifically after you add 2 16 bit
quantities you need

to take the carry bit (the 17th bit) and add it back to the low end of the

word.

A little googling will for sure point you to an implementation in C.
It's only about ten

lines or so.

I think I've googled the hole internet world :)

And all that I found was about 5-6 codes that implementing this algorithm.

All codes were exactly implementing this algorithm, and all codes were

descripted as working Internet Checksum Alg.

I'll try to calculate the carry for each 16 bit word as you say. (I know

what is "one's complement") But I think that I don't understand this

algorithm.

It's 5th day work on it. I'm exhausted. Maybe You can give me more details.

Maybe you've got exactly the same alg. that is descripted in RFC ?