Networking Forums

Networking Forums > Computer Networking > Linux Networking > Linux ARP and IP stack internals question

Reply
Thread Tools Display Modes

Linux ARP and IP stack internals question

 
 
Patrick Klos
Guest
Posts: n/a

 
      09-28-2005, 12:01 AM
I hope I'm not asking the obvious, but from looking through the Linux
kernel source code, I couldn't readily find the answer.

I know some IP stacks will queue an IP packet while it sends out an
ARP request and awaits the response.

I also know that some IP stacks will basically reuse the outgoing IP
packet buffer (skb?) to send out the ARP request, implying that the original
IP packet is tossed (on the premise that an upper level protocol will
resend/retry if the packet is important).

Can anyone confirm which mechanism the Linux IP stack employs? One way
or the other, I need to confirm what happens to an IP packet when the
target IP address is NOT in the ARP cache?

Thanks for looking!

Patrick
================= GPS based time synchronization solutions =================
Patrick Klos Email: (E-Mail Removed)
Klos Technologies, Inc. Web: http://www.timegeeks.com/
==================== http://www.loving-long-island.com/ ====================
 
Reply With Quote
 
 
 
 
rahul8143@gmail.com
Guest
Posts: n/a

 
      09-28-2005, 01:03 PM

Patrick Klos wrote:
> I hope I'm not asking the obvious, but from looking through the Linux
> kernel source code, I couldn't readily find the answer.
>
> I know some IP stacks will queue an IP packet while it sends out an
> ARP request and awaits the response.
>

No it does not queue packet rather while building packet
after IP header is added it queries for HW/Etherent header to be added
to packet so i would like to say that it does not queue but stops
packet building to check whether destination ip->mac entry exist in arp
table.
> I also know that some IP stacks will basically reuse the outgoing IP
> packet buffer (skb?) to send out the ARP request, implying that the original
> IP packet is tossed (on the premise that an upper level protocol will
> resend/retry if the packet is important).
>
> Can anyone confirm which mechanism the Linux IP stack employs? One way
> or the other, I need to confirm what happens to an IP packet when the
> target IP address is NOT in the ARP cache?

already explain. For more info write back to me with what exactly
you want?
regards,
rahul
>
> Thanks for looking!
>
> Patrick
> ================= GPS based time synchronization solutions =================
> Patrick Klos Email: (E-Mail Removed)
> Klos Technologies, Inc. Web: http://www.timegeeks.com/
> ==================== http://www.loving-long-island.com/ ====================


 
Reply With Quote
 
Chris Friesen
Guest
Posts: n/a

 
      09-28-2005, 04:07 PM
Patrick Klos wrote:
> I hope I'm not asking the obvious, but from looking through the Linux
> kernel source code, I couldn't readily find the answer.
>
> I know some IP stacks will queue an IP packet while it sends out an
> ARP request and awaits the response.


Contrary to what Rahul said, I think it does actually queue the packets.
However, I there is a limit to the number of packets which can be
queued and beyond that they get dropped in FIFO order.

See the code in net/core/neighbor.c, __neigh_event_send(). If the
lookup is incomplete, the packet is queued via

__skb_queue_tail(&neigh->arp_queue, skb);

Chris
 
Reply With Quote
 
Patrick Klos
Guest
Posts: n/a

 
      09-29-2005, 01:22 PM
In article <(E-Mail Removed)>,
Chris Friesen <(E-Mail Removed)> wrote:
>Patrick Klos wrote:
>> I know some IP stacks will queue an IP packet while it sends out an
>> ARP request and awaits the response.

>
>Contrary to what Rahul said, I think it does actually queue the packets.
> However, I there is a limit to the number of packets which can be
>queued and beyond that they get dropped in FIFO order.
>
>See the code in net/core/neighbor.c, __neigh_event_send(). If the
>lookup is incomplete, the packet is queued via
>
>__skb_queue_tail(&neigh->arp_queue, skb);


Followup for anyone interested in the final result:

Chris was absolutely correct - the ARP cache entry has a queue for packets
to send once the ARP response is received. There is a parameter that limits
the number of entries the queue will hold (the default is 3), and it does
maintain the queue in FIFO order (so only the last so many packets will be
kept).

I believe the code should be modified to make sure a public counter is
bumped whenever it throws away a message from the queue, but I haven't
followed the code long enough to know if there's a reason why someone
didn't do that.

To fix the problem we were seeing, we increased the queue length by setting
the unres_qlen value in /proc/sys/net/ipv4/neigh/default to a larger number
(we did so by adding a line to /etc/sysctl.conf).

Thanks for the help Chris and Rahul!

Patrick
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any Documentaion about How Linux Networking IP stack looklike between Linux PC (single NIC card) and Router with multiple Network interfaces (LAN and WAN)? santa19992000@yahoo.com Linux Networking 0 02-11-2007 09:19 PM
ebook for linux networking internals ? vivekian Linux Networking 1 02-01-2006 12:33 PM
How to tell an application to use a custom tcp/ip stack instead of tcp/ip stack from linux? CDP Linux Networking 18 07-06-2005 01:45 PM
Linux internals: tcpdump and ethernet driver Tony Mountifield Linux Networking 4 06-07-2005 12:30 AM
how to remove atcp/ip stack and add a third party stack in linux RajaSekhar.Kavuri Linux Networking 1 03-22-2005 06:30 PM



1 2 3 4 5 6 7 8 9 10 11