Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-03-2005, 08:19 AM
|
#1
|
Member
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223
Rep:
|
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.
|
|
|
02-03-2005, 01:19 PM
|
#2
|
Member
Registered: Dec 2004
Location: Western Pennsylvania, USA
Distribution: Red Hat
Posts: 150
Rep:
|
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.
|
|
|
02-03-2005, 08:10 PM
|
#3
|
Member
Registered: Feb 2004
Location: California
Posts: 99
Rep:
|
Cowanrl's experiment will prove that arp caching works as expected.
Quote:
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?
|
I think the answer is yes. I'm no expert on the code, but you can see in net/ipv4/ip_output.c in ip_finish_output2(), if a cached hardware header is there, hh_output() will be called, which will call hard_start_xmit() via core/dev.c/dev_queue_xmit().
Otherwise (no cached hardware header), core/neighbour.c/neigh_resolve_output() will be invoked, generating arp requests.
|
|
|
02-03-2005, 10:40 PM
|
#4
|
Member
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223
Original Poster
Rep:
|
Hello jaspar,
Quote:
I think the answer is yes. I'm no expert on the code, but you can see in net/ipv4/ip_output.c in ip_finish_output2(), if a cached hardware header is there, hh_output() will be called, which will call hard_start_xmit() via core/dev.c/dev_queue_xmit().
|
As you said i agree but i am not seeing any flow in dev_queue_xmit. I have added debug statements in that functions to print flow info but i got flow debug statements directly from hh_output to hard_start_xmit. Is that workings for packets once their hardware header get cache?
|
|
|
All times are GMT -5. The time now is 12:33 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|