LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2005, 07:19 AM   #1
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Rep: Reputation: 30
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.
 
Old 02-03-2005, 12:19 PM   #2
cowanrl
Member
 
Registered: Dec 2004
Location: Western Pennsylvania, USA
Distribution: Red Hat
Posts: 150

Rep: Reputation: 15
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.
 
Old 02-03-2005, 07:10 PM   #3
jspaar
Member
 
Registered: Feb 2004
Location: California
Posts: 99

Rep: Reputation: 15
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.
 
Old 02-03-2005, 09:40 PM   #4
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Original Poster
Rep: Reputation: 30
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sending an arp request jagman Programming 2 02-27-2006 02:59 PM
TCP Packet Size ajkannan83 General 3 11-03-2005 06:46 AM
[help - emergency] linux sending arp flood princenux Linux - Security 2 12-10-2004 01:36 PM
TCP Packet Collisions artematalento Linux - Networking 5 11-11-2004 08:48 PM
tcp packet size dellcom1800 Linux - Networking 2 07-28-2004 07:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration