TCP/IP Packet sending Resolve ARP
Hello,
In Linux kernel by adding debug statement i observe that if i ping to host 10.0.0.5 with 10 packets then first i know network stack require to resolve hosts IP to its Hardware ID by sending ARP on Ethernet LAN. But then what i get that if i again ping for another 10 packets to 10.0.0.5 then ARP routine is called. Why? Why linux kernel is not caching it. Infact its caching i check it in debug statements then why network stack require to resolve 10.0.0.5 host to send packets to it? Also i want to know once eth_header_cache called then all successive packet to that cache host goes directly from hh->hh_output(skb) to hard_start_xmit? regards, cranium. |
I would imagine that the kernel will always call the arp routine before it transmits a TCP/IP packet. When the arp routine is called, the first thing it would do is check the arp table. If it finds an entry there that satisfies it, it will not broadcast arp packets. If it doesn't find an entry in the arp table, it will broadcast for it.
Have you checked to see if the second time you ping 10.0.0.5 it's actually transmitting the arp packets over the network? The best way to tell is with a packet sniffer such as Ethereal. From my experience, as long as the ip address to MAC address mapping is in the arp table, the TCP/IP stack will not broadcast for it. |
Cowanrl's experiment will prove that arp caching works as expected.
Quote:
Otherwise (no cached hardware header), core/neighbour.c/neigh_resolve_output() will be invoked, generating arp requests. |
Hello jaspar,
Quote:
|
All times are GMT -5. The time now is 02:40 PM. |