Re: how to detect MAC address

Discussion in 'Java' started by Jon A. Cruz, Jun 27, 2003.

  1. Jon A. Cruz

    Jon A. Cruz Guest

    Amey Samant wrote:
    > Sudsy <> 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.
     
    Jon A. Cruz, Jun 27, 2003
    #1
    1. Advertising

  2. Jon A. Cruz wrote:
    > Amey Samant wrote:
    >
    >> Sudsy <> 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, Jun 27, 2003
    #2
    1. Advertising

  3. David Zimmerman wrote:
    >
    >
    > Jon A. Cruz wrote:
    >
    >> Amey Samant wrote:
    >>
    >>> Sudsy <> 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.
     
    David Zimmerman, Jun 27, 2003
    #3
  4. Jon A. Cruz

    Jon A. Cruz Guest

    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.
     
    Jon A. Cruz, Jun 27, 2003
    #4
  5. Jon A. Cruz

    Keeger Guest

    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.
     
    Keeger, Jun 28, 2003
    #5
  6. Jon A. Cruz

    Rene Guest

    "Jon A. Cruz" <> 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, Jun 28, 2003
    #6
  7. Jon A. Cruz

    Rene Guest

    "Jon A. Cruz" <> 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
     
    Rene, Jun 28, 2003
    #7
  8. Jon A. Cruz

    Jon A. Cruz Guest

    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.
     
    Jon A. Cruz, Jun 29, 2003
    #8
  9. Jon A. Cruz

    Sudsy Guest

    Rene wrote:
    > "Jon A. Cruz" <> 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.
     
    Sudsy, Jun 30, 2003
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SJ

    MAC Address/Physical Address?

    SJ, Jan 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    530
  2. Rene
    Replies:
    0
    Views:
    8,182
  3. Roedy Green

    Re: how to detect MAC address

    Roedy Green, Jul 1, 2003, in forum: Java
    Replies:
    0
    Views:
    862
    Roedy Green
    Jul 1, 2003
  4. Roedy Green

    Re: how to detect MAC address

    Roedy Green, Jul 1, 2003, in forum: Java
    Replies:
    16
    Views:
    17,591
    Roedy Green
    Jul 5, 2003
  5. Filipe

    Detect Mac OS X Version

    Filipe, Jan 10, 2008, in forum: Ruby
    Replies:
    4
    Views:
    162
    Roger Pack
    Jan 10, 2008
Loading...

Share This Page