LinuxQuestions.org
Review your favorite Linux distribution.
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 02-06-2012, 01:58 PM   #1
pam_need help
LQ Newbie
 
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
Question how do socket works internally between sendto()/recvfrom()?


I am trying to reduce packets manipulation to its minimum in order to improve efficiency of a specific program i am working on but i am struggling with the time it takes to send through a udp socket using sendto/recvfrom. I am using 2 very basic processes (applications), one is sending, the other one receiving.

I am willing to understand how linux internally works when using these function calls...

Here are my observations: when sending packets at:

•10Kbps, the time it takes for the messages to go from one application to the other is about 28us
•400Kbps, the time it takes for the messages to go from one application to the other is about 25us
•4Mbps, the time it takes for the messages to go from one application to the other is about 20us
•40Mbps, the time it takes for the messages to go from one application to the other is about 18us
When using different CPUs, time is obviously different but consistent with those observations. There must be some sort of setting that enables some queue readings to be done faster depending on the traffic flow on a socket... how can that be controlled?

When using a node as a forwarding node only, going in and out takes about 8us when using 400Kbps flow, i want to converge to this value as much as i can. 25us is not acceptable and deemed to slow (it is obvious that this is way less than the delay between each packet anyway... but the point is to be able to eventually have a greater deal of packets to be processed, hence, this time needs to be shortened!). Is there anything faster than sendto/recvfrom (must use 2 different applications (processes), i know i cannot use a monolitic block, thus i need info to be sent on a socket)?

thanks a lot to all of you guys
 
Old 02-06-2012, 08:43 PM   #2
NEQTAN
Member
 
Registered: Jan 2012
Location: ND USA
Distribution: Linux Mint 12
Posts: 52

Rep: Reputation: 1
understanding linux sockets

Hello Pam_need help,

I could go into some detail, but there are many people that have already put in the effort. There are tutorials that I found that I think will give you the knowledge you seek.

Simply put this in your search engine of choice:

understanding+udp socket+linux

Google returned some great links imo.

I hope this helps.
 
  


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
syslogd: sendto: Socket operation on non-socket PoleStar Other *NIX 1 06-07-2011 11:49 AM
Socket - problem at recvfrom function fneves Programming 2 11-23-2010 09:26 AM
issue while receving data on IPV6 socket using select,recvfrom nagendrar Programming 1 01-19-2010 04:28 AM
Multithread udp socket client fails to sendto data dilin Programming 0 04-06-2007 09:07 AM
sendto error (socket) payal_shah Linux - Networking 0 02-23-2005 12:18 PM


All times are GMT -5. The time now is 01:16 AM.

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