LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-03-2009, 11:40 AM   #1
mibo
LQ Newbie
 
Registered: Aug 2009
Posts: 21

Rep: Reputation: 1
UDP packets not seen with wireshark when sending too fast


Hello network experts,

I have problems debugging my 100MBit/s ethernet communication between a dedicated Intel network card an a microcontroller (MC) board. The MC is directly connected to the pc with a 1 meter ethernet cable. Network card and MC have fixed IPs and the UDP communication works in most cases.
Now I want to send 100000 bytes to the MC and do so by sending UDP packets of about 1000 bytes each.
The pc has wireshark running to see all the packets.
My program always successfully sends all the packets with "sendto" (see the function below). But wireshark only sees all the packets when I introduce a "usleep(100)" between the "sendto" commands. Sending the packets without waiting results in that wireshark just sees the first few packets.

Where are the missing packets?
I know that UDP does not guarantee the packets to arrive, but AFAIK they should at least be sent.

Please help,
Michael

Code:
int send_data( char *buffer, int buf_length )
{
  int rc = sendto (sock, buffer, buf_length, 0,
               (struct sockaddr *) &pmi_addr,
               sizeof(pmi_addr));
  if (rc < 0) 
  {
    printf ("could not send data\n");
    close (sock);
    exit (EXIT_FAILURE);
  }
  if (rc != buf_length) 
  {
    printf ("could not send whole data block\n");
    close (sock);
    exit (EXIT_FAILURE);
  }
  return(0);
}

Last edited by mibo; 09-04-2009 at 05:41 AM. Reason: solved the problem
 
Old 09-04-2009, 03:31 AM   #2
mibo
LQ Newbie
 
Registered: Aug 2009
Posts: 21

Original Poster
Rep: Reputation: 1
I rechecked with wireshark.
The used eth1 device is in promiscous mode and the status bar of wireshark shows NO dropped packets - so everything seems to be fine, except that the later packets still don't appear :-(

Any hint?

Edit: I found the reason for the missed packets. There was a computation running in the background. Now, when the quad core pc is idle - wireshark shows all the packets.

BUT - why the hell didn't wireshark report that it was missing packets?

Last edited by mibo; 09-04-2009 at 05:40 AM.
 
  


Reply

Tags
loss, packet, udp, wireshark


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireshark UDP Packets Socket not set robtard Programming 3 10-27-2010 05:45 PM
segmentation fault while sending UDP packets! bizoo Programming 5 07-17-2009 03:33 AM
Udp packets dropped while sending in RHEL4 chinoy Linux - Networking 1 08-21-2008 10:07 PM
UDP: Short Packets: and UDP bad checksum: entries in dmesg minutes2memories Linux - Networking 2 02-26-2006 07:28 PM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM


All times are GMT -5. The time now is 11:51 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration