Re: socket data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello

> i have made a module in which im sending data through TCP sockets by
> calling sock_sendmsg
> but tcpdum shows that there is significant delay in sending the
> message to the server.
> i have tried to print jifies values before and after the sock_sendmsg
> call and the difference is zero that means it immediately sends to
> the server but why it shows delay in the tcpdump??

That's because sock_sendmsg just copy the data into the socket buffer, 
move down right into network layer and then it activates the 
net_tx_action(), which is a function running inside NET_TX_SOFTIRQ 
sofirq. 

So you can see here, the actual data sending is done inside the deferred 
function, in this case softirq. This is likely happen (sending is done 
on softirq) when the network card cannot accept new data due to certain 
reason  such as busy transmiting current data sitting on its buffer.

try to google for "harald welte packet journey"....it explains more 
about linux network stack. Also search for articles written by Gianluca 
Involsible (something like that, I forgot) explaining about linux 
network stack on Linux Journal.

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux