Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming ARP/IP problem

Status
Not open for further replies.

Futterama

Programmer
Aug 14, 2003
1
DK
Hello forum,

I'm note sure this is the best forum for this question, so If you know a better forum, please drop a link.

I'm writing my own code for the ARP protocol on a PIC18F2620 mircocontroller and ENC28J60 ethernet controller. I am not using any code from the Microchip Stack.

My question requires a little explanation.

1. When a computer with IP protocol connects to a ethernet netvork, it will broadcast an ARP request 3 times, to make sure no one is responding. This is the method to make sure no other computer on the network shares the same IP address. The same mechanism is used when a computer changes to a new IP address. Lets assume that the computer wants to have IP address 10.0.0.2. The broadcasted ARP packet will have a sender IP of 10.0.0.2 and a target IP of 10.0.0.2.

2. When a computer receives any ARP packet, it assumes that if another computer wants to know my MAC address, he will talk to me, and I'll probably need to talk back. So when receiving an ARP request, the senders MAC and IP address will be added to the ARP cache.

3. When a computer "A" with IP 10.0.0.2 then receives a broadcast ARP packet from computer "B" who wants to know if IP address 10.0.0.2 is unused, computer "A" will then put the ARP senders MAC and IP in the ARP cache. But the senders information will have the same IP as computer "A" and then computer "A" will have an ARP cache entry with its own IP address, but with a foreign MAC address.

Somehow Windows manages to get rid of this invalid ARP cache entry (I have tested this). My question is, what mechanism is used to do that and how? Is Windows checking ARP entries before they are written to the ARP cache, or is the IP protocol checking the new ARP entries, and removes the invalid entry?

A reference to a RFC document would be nice.

You must understand that my project is for my education, and the teachers would be most impressed if I follow the RFC documents. That's why I don't just do an IP check in my Add-new-ARP-entry code - because RFC 826 regarding Address Resolution Protocol, does not mention this (probably because it's the IP protocol that initiated the 3 ARP requests in the first place).

Any help would be appreciated.

Regards,
Futterama
 
...so techy..

it seems to me it just falls under *Request For Comments: 826*
RFC 826 specifies the ARP packet format and other details.


...doesnt seem to have its *on* rfc for the mechanism that throws away the arp cache..
...and i cant believe i just read rfc 826 b.s.

..good luck!...let us know how that paper came out

CCNP,CCSP,MCSE,Sec+,Net+,A+...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top