# Differentiating computers on same network

**URL:** <https://www.ruby-forum.com/t/differentiating-computers-on-same-network/136119>\
**Category:** Rails\
**Created:** [April 29, 2008, 3:38am UTC](https://www.ruby-forum.com/t/differentiating-computers-on-same-network/136119 "2008-04-29T03:38:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 29, 2008, 3:38am UTC](https://www.ruby-forum.com/t/differentiating-computers-on-same-network/136119/1 "2008-04-29T03:38:50Z")

</div>

What would I be looking at to differentiate computers on the same  
network? (using Ruby/Rails code) Also considering computers that are  
assigned a different ip over a wireless office network. Would I be  
looking at extracting the MAC address or is there a better way?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 29, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/differentiating-computers-on-same-network/136119/2 "2008-04-29T16:14:36Z")

</div>

Unsure what you’re trying to do here, but you perhaps want to be  
looking at using session or cookie information to identify unique  
users of a rails app.

If however, you are asking a more generic networking question…then  
IP’s are non-unique. Take for example multiple computers (CPE’s)  
behind a NAT-router. They will all appear as the same IP on the WAN  
side.  
MAC addresses are unique. However, they can be spoofed/modified and as  
such are not a secure way to identify ‘unique-ness’ either. Take the  
same example of the CPE’s behind a NAT-router. They will all appear to  
the WAN side as a single MAC address for their network traffic. (This  
is in-fact how Internet routing works).

So basically MAC addresses will not transit a router in the network as  
they are Layer 2 entities. IP’s are Layer 3+ and will transit routers,  
but not NAT routers (which are very common).  
I’m sure it is possible to get MAC information via a cookie or some  
such inquiry, but that is no guarantee of uniqueness considering that  
MAC’s can be modified.

-Dale
