path of packets through network stack

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello

I'm trying to study and understand operations of the Linux tcp/ip stack,  
specifically how 'ping' sends packets down and receives them.
Ping creates raw socket in AF_INET family, therefore I placed printk in  
inet_sendmsg() at net/ipv4/af_inet.c to print out the socket protocol name  
(RAW, UDP etc.) and the address of protocol specific sendmsg function which  
correctly appears to be raw_sendmsg() from net/ipv4/raw.c

Now, I'm sending a single packet and observe that I'm getting printk form  
inet_sendmsg() twice.This puzzles me -- is it normal (has something to do  
with interrupts etc. ?) or there's something broken in the kernel?

Platform - ARM5te, kernel 2.6.31.8

Looking forward to hearing from you !

Mark  



Re: path of packets through network stack

[...]

Quoted text here. Click to load it

Presumably, the phenomenon you observed is 'normal' and it is
certainly not related to 'interrupts'. Interrupts are used for
controlling/ driving devices. This happens 'below' the network
stack. sendmsg is something which happens at the top of the latter.


Re: path of packets through network stack

Quoted text here. Click to load it

I was assuming it may haev something to do with "soft" interrupts.

Mark  



Re: path of packets through network stack
Quoted text here. Click to load it

This doesn't make any more sense.

Re: path of packets through network stack


[skip]
Quoted text here. Click to load it

Could you elaborate on why you believe this phenomenon is normal ?

Mark  



Re: path of packets through network stack
Quoted text here. Click to load it

Considering the following possible explanations:

    - you found an unknown, major kernel error in the interface
          parts of the networking stack which can be triggered in an
          extremely simple way

    - your code doesn't really do what you think it does

        - this is either coincidence or part of the 'normal'
          processing but the exact reason for it is unknown

the first seems the least likely to me. This doesn't mean that I'm
necessarily right but I'm not going to investigate this phenomenon in
the kernels I'm responsible for because I'm afraid that it could be
something serious which could affect other stuff I'm also responsible
for in some negative way.

BTW: You aren't per chance doing this on a system you're acessing over
the network?

Re: path of packets through network stack
On 10.11.12 7:23 , Mark wrote:
Quoted text here. Click to load it


The first sendmsg() may be for name resolution of the target.
Try again with a numeric target address.

--  

Tauno Voipio


Re: path of packets through network stack

Quoted text here. Click to load it

Well, to avoid any name resolution whatsoever, I'm pinging with numeric  
addresses. Also I've checked ping with strace, it's calling send exactly  
once (ping -c1 10.10.10.1), so it's unlikely a bug of busybox's ping.

Mark  



Re: path of packets through network stack
Quoted text here. Click to load it


I'm not certain, but
(Amazon.com product link shortened)
may get into a bit of that.  

rick jones
--  
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline