Click to See Complete Forum and Search --> : Write (or edit) ethernet frames
Stuka
08-02-2001, 01:51 PM
<disclaimer>No, I'm not hacking! This is for a legitimate business use.</disclaimer>
Ok, I need to know how I can go about either building (if I have to) or editing (preferred) an existing ethernet frame. What I need to do is set the MAC address of the frame, in order to set a remote embedded device's IP address (learned how this worked just a minute ago). Anybody know how to do this? Or at least point me to some indepth info?
TIA
Stuka
The Kooman
08-02-2001, 11:49 PM
Originally posted by Stuka:
<STRONG>Ok, I need to know how I can go about either building (if I have to) or editing (preferred) an existing ethernet frame.</STRONG>
<disclaimer>
I haven't used it!
</disclaimer>
Check out USI++. I quote the description from its site:
Strong USI++ low-level networklib for FreeBSD, OpenBSD & Linux. Makes you able to send any type of IPv4/ICMP/UDP/TCP packets with arbitary
portnumbers or adresses etc.. You can also easily watch packets on the network,
follow fragmented streams as well as listen to ARP-requests.
You can find it along with some more utilities here (http://www.cs.uni-potsdam.de/homepages/students/linuxer/libs/index.html)
pinoy
08-06-2001, 02:00 AM
You need to be able to write at the link layer. Try libnet also http://www.packetfactory.net/Projects/Libnet/
Are you trying to build a RARP server? What protocol are you trying to implement? BOOTP and DHCP also do the same thing.
Stuka
08-06-2001, 03:33 PM
Thanks for the replies so far - I'm checking it out. LloydM - we've got an embedded device that needs an IP addy assigned. The "trick", as I discovered, involves sending a packet with the desired IP address and the MAC address of the device. Is this what RARP does? I'm not familiar with it, but if so, it may have an answer for me. Well, I'll keep lookin'.
pinoy
08-06-2001, 05:53 PM
RARP is a relatively simple protocol. In the server, you basically set up a table of ip to mac address.
The client (your embedded device) then sends a request, saying "this is my MAC address, what is my IP address?".
RARP is basically reverse-ARP. ARP (address resoultion protocol) is a way of getting the MAC address given an IP address. ie you broadcast an ARP request on the local link. whoever has that ip address will then reply with its MAC address. You can view your arp cache using "arp -a".
DHCP is another protocol, and it's dynamic. ie it tries to allocate the mac address the same ip address, but if it can't, it will pick another from the pool.
Stuka
08-07-2001, 12:12 PM
LloydM-
Thanks for the link - there's even a Win32 port (which I need) for libnet, and it looks like it'll do what I need. And thanks for the RARP description - it's not what I'm doing, but it is related.