01-22-2009 11:55 AM
01-22-2009 12:02 PM
James R wrote:
is there a way to make a TCP/IP connection using the mac address instead of the IP?
At first glance I would answer NO but I'll track this thread to find out why not. This is why I say "No".
TCP/IP is a loose abrieviation for TCP/IP over ethernet. (I believe I remeber TCP/IP over Token-Ring from a long time ago)
The mac address is pasrt of the ethernet spec. The ethernet spec describes a set of rules for moving undefined packets from one place to another.
SO there is a situation where you could be talking TCP/IP and there is no mac address at all.
If we assume that the TCP/IP will be limited to only TCP/IP over ethernet then I would have to change my above reply to "maybe".
Standing by to learn something!
Ben
01-22-2009 02:09 PM
I'm not sure I can recommend this approach - it may annoy a network admin - but here's one indirect approach for use on Windows. Use System Exec to send a broadcast ping (usually your broadcast address will be your IP address with 255 in place of the last octet). In most cases all the machines on your local network will respond (some may be configured not to respond to broadcast pings for security reasons). This will cause your machine to cache the MAC addresses of all the machines that respond. Then, use System Exec to execute the command "arp -a" which will return a list of all the IP addresses and associated MAC addresses in your machine's ARP cache. Find the MAC address you want in that list and you'll have its IP address, which you can then use to establish a connection.
This is pretty ugly, though, and not completely reliable. It will only get you machines on your very-local network - you won't be able to get a MAC address for any machine that can only be reached by going through a router. Also, as Ben pointed out, it's possible for connections not to need a MAC address at all - for example the loopback connection, when you connect directly to your own machine as localhost or 127.0.0.1.