I want to know how I can send packets through the network with raw data. I need to be able to get the Physical addresses of devices on the LAN so I plan on broadcasting or multicasting ARP packets.
Below would be a correctly constructed ARP packet requesting the IP of a device.
0000 00 1e e5 fb a5 21 00 1a 70 dd e1 f2 08 06 00 01 .....!.. p.......
0010 08 00 06 04 00 01 00 1a 70 dd e1 f2 c0 a8 01 01 ........ p.......
0020 00 00 00 00 00 00 c0 a8 01 90 ........ ..
This is the raw data in Hexadecimal.
If I was to have the data in ASCII instead is it as simple as opening a socket and sending the information with the correct port number? Actually, since this is Level 2 instead of 3, that would mean no TCP and UDP (I think?) so how would I send this out?
raw packet
– Adrian Cornish