LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-10-2004, 09:09 AM   #1
artematalento
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Rep: Reputation: 0
Question TCP Packet Collisions


I have just installed Fedora Core 2 on my notebook (HP NC6000) and have written a little software in C (GNU / GCC) to communicate with a network device. A TCP/IP device that decodes DVD data.

I noticed that the streaming of my data is not smooth and when I checked the ifconfig eth0, I found that there has been massive amount of collisions.

I am very new to GCC C development and have close to nothing about Linux. My question is
1) How do I go about determining collisions of packet during a send() or write() command.
2) How do I go about checking if my send() buffer has been read by the other end?

** It worked fine when I was using the same code in CYGWIN Windows version.

My questions may should somewhat silly to many, but I do hope the "gurus" out there would excuse a newbie.

Thank you in advance for the help and advice.

ArtemaTalento.
 
Old 11-10-2004, 01:15 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,408

Rep: Reputation: 108Reputation: 108
1. You can't do anything just changing your code. Collisions happen on a lower level than your code. When there are collisions it doesn't mean your data does not arrive to the other end (it may take it more time, through). Making the whole thing very simple collisions happen when there's too much traffic in the network. If such situation happen, there's an automatic retransmission.

2. I'm not 100% sure (should look into the code), but if you're in blocking mode, you have the result as return code.

BTW When it's about media, maybe UDP is a better idea for you than TCP?
 
Old 11-10-2004, 02:02 PM   #3
RHELL
Member
 
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 30
Throw away the hub, buy a switch.
 
Old 11-10-2004, 06:57 PM   #4
artematalento
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for the reply.

I am using TCP mode as my connection mode. I have not set blocking mode as I did not know the usage and functionality of blocking. What it does and it's reason of usage. In fact, the only error trapping I did was to determine if my send() function was working.

if (send(phSocket, szBuffer, 1460,0) <=0) printf("ERROR %d\n", errno);

Is there any site or reference where I can read about blocking mode and how I go about doing it?

Thank you again for the reply and much needed help.
 
Old 11-11-2004, 03:42 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,408

Rep: Reputation: 108Reputation: 108
Your code to find errors was OK. It looks that your send() operations work.

Can't find any good link about blocking and non-blocking sockets. By default the socket is blocking, you make it non-blocking using something like
Code:
fnctl(fd, SETFL, fcntl(fd, GETFL) | O_NONBLOCK)
.
 
Old 11-11-2004, 08:48 PM   #6
artematalento
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you very much for the reply. I am still trying to get things working and is now looking at the possibility of using libpcap (if that can help).

I shall post my findings when I have manage to solve it.

Once again, thank you and regards.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP Packet Size ajkannan83 General 3 11-03-2005 06:46 AM
problem in TCP packet live_dont_exist Programming 3 05-16-2005 06:00 AM
lots of packet collisions causing slow network SirSlappy Linux - Networking 2 12-30-2004 02:57 PM
help with lots of packet collisions! Avatar Linux - Networking 3 07-28-2004 03:39 PM
tcp packet size dellcom1800 Linux - Networking 2 07-28-2004 07:49 AM


All times are GMT -5. The time now is 01:29 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
Open Source Consulting | Domain Registration