UDP File Transfer Validation and Checksum

Dear All

I have written a client server program for file transmission from one system to other using UDP.

Can i use the cksum number in the udp header to validate if the received packet is corrupted or not? If yes, how can i extract the header and validate it..

Also is there any way that i can call cksum in c program? Except popen("cksum","r")

Any inputs will be of great help

Thanks in advance
Collins

From UDP: the User Datagram Protocol

So getting the checksum is OS and IP-stack implementation-dependent. BTW: How are you dealing with missing packets? (you are tracking sequence numbers, yes?)

Hello

Thanks for the input...

Exactly.. I am tracking the sequence number and if i dont receive it, i request it for again.. Is that the best way?

The page quoted by otheus came from the book "Computer Networking - a top-down approach featuring the Internet" with Kurose as one of the authors (Addison Wesley). Consider getting yourself a copy of that one. It was the textbook for networking course in my university.

Specifically, Section 3.4 "Principles of Reliable Data Transfer" discusses the various approaches of developing reliable data transfer over an unreliable transport. That section should answer your question.