473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to send an arp "Who has" request?

I am attempting to programmatically determine in VB .Net 4.5 if a specific device is attached to my LAN so I can take actions depending on whether it is On or Off.

Since the LAN uses DHCP for address assignment, there is no guarantee what the IP address will be, thus (using a reverse lookup routine I created) I check the arp cache to see if the device is there. If it is then I open a socket to communicate with it.

But if there is no arp cache entry then I know that the device is either turned off, or an arp cache timeout has occurred for the device. If a timeout has cleared the entry, then I'd like to try to determine that, so I can use the device, by sending a general ARP "WHO HAS" Broadcast and see if I get an answer.

Since I only have its MAC address I want to send an ARP "Who has" broadcast to force a cache refresh, then delay 30 seconds and try the arp lookup again.

So. Long story short, I have two issues . . .

1) The construction of the ARP packet uses the last two fields as Target MAC and Target IP. The broadcasts I have trapped all have the IP field filled in and the MAC field with all 00 bytes. I am hoping I can turn that around and use 00 bytes for the IP and the MAC for the lost target. If that is not possible, then there is no need to answer question 2, unless there is a way to do it not discussed in this question.

2) How can I send a pure raw packet [VB .Net 4.5]? This (I believe) is the complete message I need to send . . .

ff ff ff ff ff ff f4 6d 04 ef e1 06 08 06 00 01 08 00 00 01 f4 6d 04 ef e1 06 c0 a8 01 5a 88 53 95 86 a0 1f 00 00 00 00

I have not been able to find a method to send that packet. Specifically what VB code is required to define,open, and use the socketsend?

Much thanks. The answer to this will make my day. Been at it for two weeks and dozens of forums, without an answer.

:-(
Jul 2 '13 #1
0 1554

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Florent Clairambault | last post by:
Hello, I need a server to send an other some information, like to create an other database. I would like to send something like that : <?xml ?> <insert table="the_table"> <row>...
3
by: ME | last post by:
Hi; I am getting "Unhandled Exception: System.Net.WebException: The remote server returned an erro r: (401) Unauthorized." when I am trying to get a page via post. Code follows...
2
by: Mullin Yu | last post by:
i try to send a big5-encoded xml request to a java servlet by two ways 1. vb6 => success 2. c# => all chinese character becomes ?????? my c# coding is as following: i wonder will it convert...
1
by: Tedmond | last post by:
Dear All, I need to send an URL request to a web server from my Window application. e.g. http:\\serverA\IamAlive.asp Unfortunately, the web server does not provide Web Service. I need to...
2
by: inferno2000 | last post by:
Let's say if I want to send a http "Post" request to a url, and check the http status code later. How should I write the code? I have found example to use WinHttp to send "Get" request and check...
7
by: itay_k | last post by:
Hi, I dont understand why this is so complicated, just to add one line of cookie header on the GET request. This is my unworking code: import time import Cookie import cookielib, urllib2
4
by: ThunderMusic | last post by:
Hi, Is there a way we can send a feature request for Visual Studio? When using 'Refactor-->Encapsulate Field', I'd like to have an option for the references not to be updated anywhere in the...
2
by: Arti | last post by:
Hi, I am trying to access a servlet hosted on Tomcat server using HTTPS Post protocol. I am getting the exception: "The underlying connection was closed: Could not establish trust relationship...
4
by: kj | last post by:
Hi. Sorry for this very clueless question, but how does one write in Python an HTTP client that can send a POST request? The modules I've found (e.g. urllib, urllib2), as far as I can tell, seem...
1
by: BobTheGreat | last post by:
I'm making a lightbox thing for a login so I made a lightbox php script and I dont want to redrect so I have to send a HTTP request using JS. Heres my lightbox code: <?php //add lightbox for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.