Linux ARP and IP stack internals question

This is a discussion on Linux ARP and IP stack internals question within the Linux Networking forums, part of the Linux Forums category; I hope I'm not asking the obvious, but from looking through the Linux kernel source code, I couldn't ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-28-2005
Patrick Klos
 
Posts: n/a
Default Linux ARP and IP stack internals question

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: patrick@timegeeks.com
Klos Technologies, Inc. Web: http://www.timegeeks.com/
==================== http://www.loving-long-island.com/ ====================
Reply With Quote
  #2 (permalink)  
Old 09-28-2005
rahul8143@gmail.com
 
Posts: n/a
Default Re: Linux ARP and IP stack internals question


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: patrick@timegeeks.com
> Klos Technologies, Inc. Web: http://www.timegeeks.com/
> ==================== http://www.loving-long-island.com/ ====================


Reply With Quote
  #3 (permalink)  
Old 09-28-2005
Chris Friesen
 
Posts: n/a
Default Re: Linux ARP and IP stack internals question

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
  #4 (permalink)  
Old 09-29-2005
Patrick Klos
 
Posts: n/a
Default Re: Linux ARP and IP stack internals question

In article <11jlfumgabbl599@corp.supernews.com>,
Chris Friesen <cfriesen@nortel.com> 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 Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0