Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: (OT) Getting the source hardware address of received UDP packets?

by Anonymous Monk
on Jun 02, 2006 at 06:12 UTC ( [id://553229]=note: print w/replies, xml ) Need Help??


in reply to Re: (OT) Getting the source hardware address of received UDP packets?
in thread (OT) Getting the source hardware address of received UDP packets?

Say a dhcp client without an IP address sends a dhcp request (broadcast).

While a dhcp request/discover payload usually contains the alleged hardware address of the client, it may still be useful to log the hardware address of the frame if things go wrong.

But I don't want the program to see all frames. Only just the relevant packets.

I suppose that's not a good enough reason - so I guess that's why there's no easy way to do that :).

  • Comment on Re^2: (OT) Getting the source hardware address of received UDP packets?

Replies are listed 'Best First'.
Re^3: (OT) Getting the source hardware address of received UDP packets?
by ikegami (Patriarch) on Jun 02, 2006 at 17:32 UTC

    It is possible to make DHCP requests to a server outside of one's LAN*, but only because DHCP allows you to specify your MAC address inside of your request. The DHCP request looks a bit like "My MAC address is 00:00:00:00:00:00. Please give me an IP address." In other words, the client must explicitly place the MAC address in the DHCP request. There's no IP or UDP (or even TCP) solution to your problem.

    You can do the same as DHCP — have the clients send their MAC address along with their request — with your UDP-based protocol if you're still developing the protocol.

    * — That requires the co-operation of the gateway, but only because the machine doesn't have an IP address yet.

Re^3: (OT) Getting the source hardware address of received UDP packets?
by isotope (Deacon) on Jun 02, 2006 at 17:07 UTC
    That really is a good application for Net::Pcap. You dismissed pcap because you didn't want to handle all received frames, but pcap allows you to define a filter so you'd actually be able to select just dhcpc messages if you wanted.


    --isotope

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://553229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found