(Network) Identifying the next node's MAC address.
(Network) Identifying the next node's MAC address.
Hi,
I recently succeeded in re-broadcasting captured packets.
Now I would like to take on a new project, but first I must find a way to get the MAC addresses of nodes only one hop away from my custom machine.
node A <------> MyComp <-----> Node B
basically, in the setup above, i would like MyComp to be able to get the MAC addresses of Node's A and B.
I recently succeeded in re-broadcasting captured packets.
Now I would like to take on a new project, but first I must find a way to get the MAC addresses of nodes only one hop away from my custom machine.
node A <------> MyComp <-----> Node B
basically, in the setup above, i would like MyComp to be able to get the MAC addresses of Node's A and B.
Website: https://joscor.com
-
- Member
- Posts: 134
- Joined: Thu Aug 18, 2005 11:00 pm
- Location: Sol. Earth. Europe. Romania. Bucuresti
- Contact:
Check for "ARP"
Ambition is a lame excuse for the ones not brave enough to be lazy; Solar_OS http://www.oby.ro/os/
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
AFAIK one cannot directly query hosts on a network for their MAC address..
I recommend reading the following Wikipedia articles...
http://en.wikipedia.org/wiki/Address_Re ... n_Protocol
http://en.wikipedia.org/wiki/Internet_Protocol
Have fun..
EDIT: Darn, bontanu posted before me..
I recommend reading the following Wikipedia articles...
http://en.wikipedia.org/wiki/Address_Re ... n_Protocol
http://en.wikipedia.org/wiki/Internet_Protocol
Have fun..
EDIT: Darn, bontanu posted before me..
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
When you use the word hop it tells me the packet passed through a layer three network device and this would prevent you from getting the MAC address the machine, but just in case you are referring to the actual proximity of the computer then like Brynet-Inc and bontanu said a ARP request packet will do this.
I have read up on arp, but I only need to know the addresses of the 2 physically closest daisy-chained nodes. I have a feeling that it isn't going to be possible without knowing the pre-existing IP addresses.
Website: https://joscor.com
Hi,
Modern ethernet uses a "star" configuration (several computers connected to a switch or hub, where the switch or hub is transparent). For example:
Old ethernet (10base2) used a "bus" configuration (one coax cable connecting several computers, with 'T' pieces at each computer). For example:
There used to be something called token ring networks which were "daisy chained" in a circle (and packets went in one direction only). The problem here is lag and fault tolerance - if there's 10 computers in the ring and computer0 wants to send a packet to computer9, then computer0 sends it to computer1, which sends it to computer2, which sends it to computer3, etc; and a single broken cable brings the entire network down. BTW token ring isn't ethernet (it used it's own token ring network adapters) and they're very obsolete now.
For ethernet, typically a computer sends a broadcast packet (that is received by everything on the same hub/switch or bus) and other computers can get it's MAC address from the packet's header (including the DHCP server)....
Cheers,
Brendan
What do you mean by "daisy chained"? Usually this means 2 network cards (or serial ports or whatever) per device, where one network card connects to the previous thing in the chain and the other network card connects to the next thing in the chain. For example:01000101 wrote:I have read up on arp, but I only need to know the addresses of the 2 physically closest daisy-chained nodes. I have a feeling that it isn't going to be possible without knowing the pre-existing IP addresses.
Code: Select all
A----B----C
Code: Select all
HUB---A
| \
| B
C
Code: Select all
+-A
|
+-B
|
+-C
For ethernet, typically a computer sends a broadcast packet (that is received by everything on the same hub/switch or bus) and other computers can get it's MAC address from the packet's header (including the DHCP server)....
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Yes, I am aware of the modern star configuration and the older BNC cards, and believe me, I am not going for a token-style configuration.
I was unaware though, of the broadcast packet containing the MAC address. Although that is helpful, the situation I am in, is that I am trying to create a transparent machine that only communicates to the two devices that it is physically connected to.
and yes, you are correct about the daisy-chaining as the computer I am using is communicating on two NICs. One dedicated to the 'IN' of node B, and the 'OUT' to node A. and vicaversa for the other card.
I only wish to talk to those two machines.
I was unaware though, of the broadcast packet containing the MAC address. Although that is helpful, the situation I am in, is that I am trying to create a transparent machine that only communicates to the two devices that it is physically connected to.
and yes, you are correct about the daisy-chaining as the computer I am using is communicating on two NICs. One dedicated to the 'IN' of node B, and the 'OUT' to node A. and vicaversa for the other card.
I only wish to talk to those two machines.
Website: https://joscor.com
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
I think you are saying you would like to detect the MAC address of these two machines, and this is possible by doing an ARP scan of the IP subnet that these two machines are on. The only other way I know of is to just listen for data coming from one and then store it's MAC address.I was unaware though, of the broadcast packet containing the MAC address. Although that is helpful, the situation I am in, is that I am trying to create a transparent machine that only communicates to the two devices that it is physically connected to.
So it's:
- Do a ARP broadcast scan of the IP subnet.
- Listen for frames from machines on that segment.
Oh. I do forget that there also exists something that may make a network reveal it's MAC address. It has something to do with unicast frames? Might be worth looking into. It is somehow used to detect computers running network sniffers in which the card is placed into promiscuous mode and I think may or some how does work even if the operating system is disabled from using the card while it captures/sniffs.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Most modern operating systems send out an initial ARP packet "announcing" their presence on a subnet..
If you're developing your own OS, You'll want to implement support for ARP.. developing your own standards is not a very good idea..
Good luck & Have fun..
http://wiki.wireshark.org/Gratuitous_ARP
EDIT: Even if you're not going to use IP addresses, at least implement ARP.. It's entirely independent...
If you're developing your own OS, You'll want to implement support for ARP.. developing your own standards is not a very good idea..
Good luck & Have fun..
http://wiki.wireshark.org/Gratuitous_ARP
EDIT: Even if you're not going to use IP addresses, at least implement ARP.. It's entirely independent...
Thanks for the replies.
I believe the verdict is that it is not possible.. or not likely to be able to 'hone-in' on two nodes without more information (either an IP or a MAC addy), so then I shall pose a more attainable question.
How would I go about finding the default gateway of a local subnet?
Does the gateway broadcast to me, or would I have to announce my presence and wait for a response?
I believe the verdict is that it is not possible.. or not likely to be able to 'hone-in' on two nodes without more information (either an IP or a MAC addy), so then I shall pose a more attainable question.
How would I go about finding the default gateway of a local subnet?
Does the gateway broadcast to me, or would I have to announce my presence and wait for a response?
Website: https://joscor.com
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
That is also a problem as a gateway (default or not) is not forced to announce it's presence. Although some use dynamic routing protocols that you can listen for and may even optionally broadcast there services such as (UPNP from a wireless router).
The DHCP is a example of the default gateway being announced, but it does not necessarily mean that the DHCP contains a default gateway valid field or is present as a service in the network. But, to be honest I think DHCP is likely the best bet as this seems to be the standard way on IP networks for client's to locate the gateway or aquire IP addresses.
The DHCP is a example of the default gateway being announced, but it does not necessarily mean that the DHCP contains a default gateway valid field or is present as a service in the network. But, to be honest I think DHCP is likely the best bet as this seems to be the standard way on IP networks for client's to locate the gateway or aquire IP addresses.
well I took the DHCP thing into consideration
and after a hard days work (haha riiight)
I've got handlers for ARP, RARP, IP->UDP, IP->TCP, BOOTP, and DHCP with all successful responses appropriate to their function.
With the DHCP I was able to get the IP of the gateway, whether it be default or not. That is deffinately a step in the right direction.
and after a hard days work (haha riiight)
I've got handlers for ARP, RARP, IP->UDP, IP->TCP, BOOTP, and DHCP with all successful responses appropriate to their function.
With the DHCP I was able to get the IP of the gateway, whether it be default or not. That is deffinately a step in the right direction.
Website: https://joscor.com