Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Re: how to detect MAC address (http://www.velocityreviews.com/forums/t123758-re-how-to-detect-mac-address.html)

Jon A. Cruz 06-27-2003 02:58 PM

Re: how to detect MAC address
 
Amey Samant wrote:
> Sudsy <bitbucket44@hotmail.com> wrote in message
> but i dont
> understand if java provides a class NetworkInterface that gives the
> name of the interface card then why did they not make provision for
> mac address ???? if u can reach the card why not exploit it to get
> full details possible....


Ummm....

How do you know that they're even on a card that has a MAC address???

You don't.


I know that when I was using a dial-up connection, my PC would get an IP
address, but definitely had no MAC address.


Since MAC address is not universal to all devices and platforms, it's
not in Java. Just like environment variable access was deprecated around
the time they first ported Java to the Macintosh.


David Zimmerman 06-27-2003 03:03 PM

Re: how to detect MAC address
 


Jon A. Cruz wrote:
> Amey Samant wrote:
>
>> Sudsy <bitbucket44@hotmail.com> wrote in message but i dont
>> understand if java provides a class NetworkInterface that gives the
>> name of the interface card then why did they not make provision for
>> mac address ???? if u can reach the card why not exploit it to get
>> full details possible....

>
>
> Ummm....
>
> How do you know that they're even on a card that has a MAC address???
>
> You don't.
>
>
> I know that when I was using a dial-up connection, my PC would get an IP
> address, but definitely had no MAC address.
>
>
> Since MAC address is not universal to all devices and platforms, it's
> not in Java. Just like environment variable access was deprecated around
> the time they first ported Java to the Macintosh.
>


I thought that MAC addresses were part of the Ethernet standard, so if
you are networking over ethernet, you have a MAC address. Networks that
aren't ethernet are few are very far between (EG IBM tokenring).


David Zimmerman 06-27-2003 03:07 PM

Re: how to detect MAC address
 


David Zimmerman wrote:
>
>
> Jon A. Cruz wrote:
>
>> Amey Samant wrote:
>>
>>> Sudsy <bitbucket44@hotmail.com> wrote in message but i dont
>>> understand if java provides a class NetworkInterface that gives the
>>> name of the interface card then why did they not make provision for
>>> mac address ???? if u can reach the card why not exploit it to get
>>> full details possible....

>>
>>
>>
>> Ummm....
>>
>> How do you know that they're even on a card that has a MAC address???
>>
>> You don't.
>>
>>
>> I know that when I was using a dial-up connection, my PC would get an
>> IP address, but definitely had no MAC address.
>>
>>
>> Since MAC address is not universal to all devices and platforms, it's
>> not in Java. Just like environment variable access was deprecated
>> around the time they first ported Java to the Macintosh.
>>

>
> I thought that MAC addresses were part of the Ethernet standard, so if
> you are networking over ethernet, you have a MAC address. Networks that
> aren't ethernet are few are very far between (EG IBM tokenring).
>


You said "modem"! Of course a modem doesn't have a MAC address, it
isn't ethernet.


Jon A. Cruz 06-27-2003 05:14 PM

Re: how to detect MAC address
 
David Zimmerman wrote:
>
>>

>
> You said "modem"! Of course a modem doesn't have a MAC address, it
> isn't ethernet.
>



Bingo!!!

Exactly.

Java deals with "networking". IIRC, it does not deal at all with
"ethernet" (or at least not 'till recently).

At the time Java was released, I was still dealing with appletalk over
PhoneNet ($30 a piece instead of $130 for ethernet, and no need for a
$200+ hub). And even some PC's with arcnet cards. Microsoft Windows
still had no networking standard (remember Trumpet Winsock?), just about
every online provider had it's own way of communicating, geeks and
researchers were about the only ones on the Internet, and it was just
being opened for commercial ues.


MAC addresses are part of ethernet, not TCP/IP. An IP address is a
32-bit or 128-bit dynamically assignable number that lives in software.
A MAC address is a 48 bit number that lives on ethernet hardware (and is
sometimes changeable, but that's a little rare).



Anyway...

There are many different ways to do networking, and especially so in
devices (remember, Java was 'originally' designed for devices,
appliances, etc.)

Given all this, it's not suprising that Java does not expose the details
of ethernet, but instead only common concepts that are more cross-platform.


Keeger 06-28-2003 01:03 AM

Re: how to detect MAC address
 
Just out of curiosity....have you investigated an alternate
programming language for your needs? Maybe PHP provides the MAC
addy...

Java isn't the only solution for developing software, if it doesn't
have something you need, move on and find what does.

Rene 06-28-2003 07:33 PM

Re: how to detect MAC address
 
"Jon A. Cruz" <jon@joncruz.org> wrote:
> How do you know that they're even on a card that has a MAC address???
>
> You don't.
>
> I know that when I was using a dial-up connection, my PC would get an IP
> address, but definitely had no MAC address.


Right, when doing PPP dialup (Point to Point Protocol), there are no MAC
addresses. Some software emulates or displayes 00:00:00:00:00:00 or some
arbitrary value instead.

MAC addresses is a concept of ethernet. A modem or an ISDN TA don't have
nor need any.

CU

Rene

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB

Rene 06-28-2003 07:39 PM

Re: how to detect MAC address
 
"Jon A. Cruz" <jon@joncruz.org> wrote:
> still had no networking standard (remember Trumpet Winsock?), just about


Argh, the early versions were a nightmare to set up !

> MAC addresses are part of ethernet, not TCP/IP. An IP address is a
> 32-bit or 128-bit dynamically assignable number that lives in software.
> A MAC address is a 48 bit number that lives on ethernet hardware (and is
> sometimes changeable, but that's a little rare).


No its not rare, about every single one allows this. (Not in hardware, but
in software, since it is the OS that puts the data together, not the card)

If you are under linux, just enter (as root)

ifconfig eth0 hw ether 12:23:34:45:56:67 up

and your network card has that mac address.

Under windows, just venture into the "extended" tab on the option dialog of
your network card and you should find the place to enter your value as
"network address" or something like that. If it isn't there, you can always
change it directly by creating the correct registry key.

Then reboot and your NIC has a "new" MAC address.

Its really easy to do, its just that not a lot of people know about it.

> There are many different ways to do networking, and especially so in
> devices (remember, Java was 'originally' designed for devices,
> appliances, etc.)


I doubt cellphones have a MAC either...

> Given all this, it's not suprising that Java does not expose the details
> of ethernet, but instead only common concepts that are more
> cross-platform.


Its very low level anyhow.

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB

Jon A. Cruz 06-29-2003 12:57 AM

Re: how to detect MAC address
 
Rene wrote:
>
> No its not rare, about every single one allows this. (Not in hardware, but
> in software, since it is the OS that puts the data together, not the card)
>
> If you are under linux, just enter (as root)
>
> ifconfig eth0 hw ether 12:23:34:45:56:67 up
>
> and your network card has that mac address.
>


Ahhh.. but then that's something different. That's "lying about your
hardware's assigned identifier". :-)


But I was meaning more that it happens rarely.


Sudsy 06-30-2003 04:50 AM

Re: how to detect MAC address
 
Rene wrote:
> "Jon A. Cruz" <jon@joncruz.org> wrote:
>
>>Rene wrote:
>>
>>>and your network card has that mac address.
>>>

>>
>>Ahhh.. but then that's something different. That's "lying about your
>>hardware's assigned identifier". :-)
>>
>>But I was meaning more that it happens rarely.

>
>
> Well lying is a bit strong :) Its just overriding the default one.
>
> Yeah it is done rarely, but that's because it is needed seldom and because
> few people know it is that easy to do (or even possible)
>
> CU
>
> Rene
>


Why is it lying at all? Are you trying to "force" people to use
their originally-assigned MAC address on their interface card?
It's kind of like suggesting that people are "stealing" satellite
signals beamed directly at them.



All times are GMT. The time now is 12:18 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.