How to query a DHCP server for the arp table

HI,

I have to retrieve the ARP table from a DHCP SERVER.

How can I query the DHCP server to obtain such table?

Do I have to prepare a formatted packet or something similar? Do I have to use socket?

I have to do this is JAVA, so the command line solution is not applicable.

Any hint is appreciated.

Thanks!!

ProgDario

Reply to
ProgDario
Loading thread data ...

I had responded to you a few threads back about this. Apparently, you haven't found your solution. I would like to reinforce the idea that getting the arp table from the server is (in my opinion) the wrong approach. You haven't mentioned what type of server this is. But, I would be willing to guess that the arp table is difficult to get through SNMP, and it has a short life, which means that you probably won't find the address you are looking for in it.

My idea was that you use SNMP to query the network equipment that the device will most likely be talking to the most (ie Gateway). SNMP is fairly simple to understand as a protocol, but it takes time to understand how the mibs (information objects on the equipment being queried) work. You'll need to check to see if the device you want to query offers the appropriate mibs for displaying the arp table. I can tell you that Cisco devices do. Personally, I would not try to construct that packet myself. I use components that do all that work for me. With a quick search, I located an API for Java, which may work for you:

formatting link
That said, it appears there is a rather large learning curve for you on this project. You may want to consider just using HTTP to query the phone itself and parsing the data. Also, that is the only place you can be sure that the mac address to ip cross reference is available.

Jim

Reply to
Scooby

why is the arp table from a server of any interesest ? The table will timeout within 6 min or so.

If you what to track users/hosts Ciscoworks can do this for you, given that your LAN is Cisco. The approach (which is the same for any device) is to get the CAM (Mac address forwarding table) tables from your switches in the LAN, this will tell you on exactly which port a given user is on. /HTH Martin

"ProgDario" skrev i en meddelelse news: snipped-for-privacy@f14g2000cwb.googlegroups.com...

Reply to
Martin Bilgrav

In article , ProgDario wrote: :I have to retrieve the ARP table from a DHCP SERVER.

;How can I query the DHCP server to obtain such table?

As I explained to you before, chances are that you cannot do so -- not unless your DHCP server is constrained to be a more specific kind of device (such as a Cisco router) that happens to offer a query mechanism.

:Do I have to prepare a formatted packet or something similar? Do I have :to use socket?

I posted the exact SNMP MIB you need for Cisco routers and the algorithm you have to go through to extract the data you want. You didn't reply at all.

The interaction so far has been fairly one-sided, and that discourages people from assisting you further. We're [generally] willing to guide you as long as you show that you are reasonably learning as you go -- but we aren't likely to post the exact code you need -- you are the developer, the one being paid to develop the code. [And besides, I'd have to learn Java in order to write the necessary code.]

Reply to
Walter Roberson

Reply to
Steven Kalcevich

I think Jim is right on this. I have created some fairly simple webcrawlers using excel webquery and marcos that will allow you to sweep a phone subnet and gather all kinds of information from the phone including ip addr.

Mike

Reply to
miskaone

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.