buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28342, Many unnecessary records in ARP...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28342: Many unnecessary records in ARP table

Submitter:  Martin Persich <persich>
Submitted:  Fri 18 Dec 2009 08:05:45 PM UTC
   
 
Category:  ARP Severity:  3 - Normal
Item Group:  Change Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Sun 14 Feb 2010 06:12:38 PM UTC, comment #2: 

You're right, find_entry has been broken so that a new entry always has been created until the table was full. I fixed it the way you suggested, thanks for the input!

I also turned off ETHARP_TRUST_IP_MAC by default since it slows down reception of every packet and other systems don't do it that way, too.

Simon Goldschmidt <goldsimon>
Group administrator
Sun 27 Dec 2009 12:11:17 PM UTC, comment #1: 

I'd be cautious making such a change as the ARP RFC (826) clearly states to add all received broadcasts to the table to prevent too many broadcasts at a later time (if the host that ignored the broadcast before now needs it). If at all this should be an option defaulting to off.

However, the default for ARP is still to prevent broadcasts where possible and costumers buying a device will probably expect it to behave like that if it says it's corresponding to the RFC 826!

Simon Goldschmidt <goldsimon>
Group administrator
Fri 18 Dec 2009 08:05:45 PM UTC, original submission:  

I found full ARP table with 16 items in very short time during my testing of ARP protocol in my project (Atmel AVR32 UC3A0512). I discovered that in this table is many unused IP addresses from my LAN. I found that every incoming IP address in ARP Request Packet from LAN is stored to "arp_table". It is better if in ARP table is only addresses which is necessary for MCU communication, not all from LAN, I think. It is reduce MCU utilization, I think.
I found flag "ETHARP_FIND_ONLY" in file "etharp.c" and I made two small changes:
line #605 in "etharp.c" (Rev 1.153):
old: update_arp_entry(netif, &(iphdr->src), &(ethhdr->src), 0);
new: update_arp_entry(netif, &(iphdr->src), &(ethhdr->src), ETHARP_FIND_ONLY);
line #702:
old: update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), 0);
new: update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), ETHARP_FIND_ONLY);
With this changes ARP works ok - I think ... :-) - and in ARP table are only used IP addresses not all LANs.
And one idea. Is it possible move declaration of "struct etharp_entry" and "enum etharp_state" from "etharp.c" to "etharp.h", remove "static" from arp_table definition and add declaration of "arp_table" in "etharp.h" for diagnostics purpose ? There is not semaphore to this structure, I know ... But for diagnostic it is not necessary, I think.

Martin Persich <persich>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by persich (Submitted the item)
  • -email is unavailable- added by persich
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-02-14 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2009-12-18 persich Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code