Link to home
Start Free TrialLog in
Avatar of yogibearaz
yogibearazFlag for United States of America

asked on

RARP in .net

Not picky about c# or, but does anyone know how to resolve a MAC addy to an IP using .Net. I cannot find any solutions on the net. I found one solution using ARP but i need RARP.

Avatar of graye
Flag of United States of America image

Since the ISO networking model doesn't require any end-to-end mapping of MAC addresses, RARP was designed to work only within the same subnet.   There are RARP "relay servers" that can be installed to perform this function, but you certainly couldn't count on them being there.

On a LAN environment, where you have access to the remote PC, you can use WMI to directly query the network adapter to get it's MAC address.

Tell us more about what you're trying to do.

Avatar of yogibearaz


Ok here is a little more detail on what i am trying to achieve. basically using RARP i want to dump in a list of known MAC addy's and retrieve the IP's of each address. The reason for is a center that i work with recently did a mass change of motherboards and doesnt have a listing of who and where. With this i can put in the old address and track which stations i do not get a reply from thus weeding out the changed machines on the network. Now i have never programmed for network detection and have been told that i should be able to code an app in .net that uses RARP to take the entire list of MAC addy's and will export out the IP correlations. Although i have searched all over and have been unable to get much information on where to start here. I hope this makes sense.
I'm still struggling a wee bit with the question, but let's see if we can figure out a way to solve the problem...  

Let's try this simple test before we get to a programatic solution...  if all of the PCs are in the same subnet (not separated by a bridge or router), then you could ping their IP address and then use "arp -a" to look at the ARP cache for the corresponding MAC addresses.  If this scenario works, then we can proceed with doing it via code.

Let's also talk about alternative ways to accomplish what you want.   As I've mentioned, you can use Windows Management Instrumentation (WMI) to gather information about the PCs in the LAN.  Using this technique you can build a table of all of the existing IP and MAC addresses.  You can then match up your list of old MAC addresses with the list of new MAC addresses.

You might also want to consider a "complete solution" for gathering and maintaining hardware and software "inventory" for the LAN.  Take a look at the following article to see what I'm talking about.   Sure, it's a bit of overkill if you're just interested in IP and MAC addresss, but on the other hand, you might "get hooked" and find you need more and more information about the PCs on the LAN.

Your second suggestion is closer to what i need, but there are limitations here that prohibit me from using WMI. First the company wide has over 15K plus machines and this would be a gaudy list to try and match up against. Not to mention the Net Admins might go crazy. But I think you got it for what i am looking for. I have the MAC addy's, i do not have the IP's.
Yeah, I've run across a few folks where WMI is blocked due to security concerns.   But after they see what's on their PCs (by temporarily turning on WMI), they *very quickly* realize that WMI is their friend!.

I look at it the other way around... If I had 15k+ PCs, I'd never attempt to manage them *without* some sort of automatically updating inventory database.

The whole idea of the "complete solution" is to put all of the infromation in a database.  That way, it'd be a trival task to write an SQL query to match up MAC addresses, etc.
Well, you answered my question on whether or not they are all on the same subnet...  obviously NOT!

So, that means a simple probing of IP address and ARP cache isn't gonna work.
I completely agree they probably should have some sort of inventory database, but this company is very locked down and impossible to get any information out of. Yes we are not all on the same subnet.

So any ideas? anyone? kind of complicated huh.
Well, there are other ways...

1) Most managed hubs have method of reporting the attached MAC address
2) You can get a listing from the DHCP server
3) Or you could use an extremely low-tech method to get the MAC/IP addresses would be to put something in the Startup/Login batch file that recorded the MAC/IP in a file on a network share.

The first two methods are complely "unobtrusive" and wouldn't require anything other than Admin permissions on the hub or DHCP server
Rather than go around and around, let me restate the problem I need a solution to:

I have a list of MAC addresses.  I need sample code or a reference to a component (free or purchase) that can send RARP requests so I can determine whether or not these mac addresses are still on the local network.

I do not have access to the routers or domain infrastructure (this is a large company and getting those IT departments involved would take time and money).  I cannot add any software to the machines.

I want to send a RARP packet for each MAC address on the list and determine if that machine is still on the network.

Avatar of graye
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the honesty, for that was what i needed to know. Wasnt frustration, just felt we were losing focus. :)
is a grade c and closed for no solution available. thanks for assistance.