The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Validation of character separated lines in a file kolesunil UNIX for Dummies Questions & Answers 3 05-27-2008 06:48 AM
CSV file parsing and validation dolo21taf Shell Programming and Scripting 1 03-06-2008 06:15 AM
Need help in file validation by shell script srichakra Shell Programming and Scripting 1 07-19-2007 02:22 PM
validation :file <filename> u263066 Shell Programming and Scripting 2 09-26-2006 03:59 AM
transfer of specific file content to another file mem101 Shell Programming and Scripting 1 10-18-2005 02:01 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-19-2008
iamcollins iamcollins is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 8
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
  #2 (permalink)  
Old 08-21-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
From UDP: the User Datagram Protocol
Quote:
Although UDP provides error checking, it does not do anything to recover from an error. Some implementations of UDP simply discard the damaged segment; others pass the damaged segment to the application with a warning.
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?)
  #3 (permalink)  
Old 08-21-2008
iamcollins iamcollins is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 8
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?
  #4 (permalink)  
Old 08-21-2008
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0