Jump to content

How does every computer have a different IP and MAC address?

Guest

Not sure if Mac addresses have anything to do with networking but how does every pc have a different address? With the amount of computers out there, there seems to have been a possibility of 2 having the same accidentally. Isnt it a finite digit address? 

 

Or were computers made made by really smart cookies; and because of this no one can really say? (Also acceptable when it's a really complex this to answer if you don't want to explain.) 

Link to comment
Share on other sites

Link to post
Share on other sites

mac addresses are unique identifiers and there is only one per device. are you talking about ip address's.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, gkid117 said:

mac addresses are unique identifiers and there is only one per device. are you talking about ip address's.

When you connect to the internet I've been told you send out a ping with a number (like an ip for a website) and it sends until a computernwith that number has it. That number will then send a signal out trying to reach the original sender. That's the number I'm talking about. 

Link to comment
Share on other sites

Link to post
Share on other sites

A mac address is the hardware address of your networking card. They are 48bits long, so yes, it is a fixed size. The manufacturer of your networking card gives it a unique address during manufacturing.

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, roypur said:

A mac address is the hardware address of your networking card. They are 48bits long, so yes, it is a fixed size. The manufacturer of your networking card gives it a unique address during manufacturing.

 

4 minutes ago, gkid117 said:

thats an ip address 

 

How do they make sure that every IP address is different? I'm sure more than one company designs/makes chips and parts. 

Link to comment
Share on other sites

Link to post
Share on other sites

Each and every IP addy (of the form 139.130.221.221 ) is made up of 4 octets each of which can have 257 values so 257X257X257X257 which is around 4000 million, individual addys.  But there is also something known as NAT (Network address Translation)  whereby as far as the ISP is concerned all computers on a network have one IP and every computer on that network is assigned (by the router or... an IP in the range 192.168.???.??? or 10.???.???.???. )  To combat the very thing you are thinking about this system IPv4 is being replaced by IPv6 (coming soon .  It has been coming soon for at least the last ten years) some systems are IPv6 ready and allready have IPv6 addresses but this is not yet in the public consciousness.  This gives someting like 3 X 1038 adresses surely enoung for a planet with 'only' 7 x 109 people.

  Mac addresses are 48 bits long so there is no prospect of us running out of MAC addresses any time soon.

  Obviously this is very simplified but the basic ideas are there.

 Two motoes to live by   "Sometimes there are no shortcuts"

                                           "This too shall pass"

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, fpo said:

 

 

How do they make sure that every IP address is different? I'm sure more than one company designs/makes chips and parts. 

IP address has to do with your location and your ISP... There are no two matching ones except in certain circumstances which aren't applicable to this situation ie spoofing, vpn's... Etc.

 

Edit: To quote the guy above me, there are a shit load of possible combinations to where this is a non issue.

GPU: XFX RX 7900 XTX

CPU: Ryzen 7 7800X3D

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, fpo said:

 

 

How do they make sure that every IP address is different? I'm sure more than one company designs/makes chips and parts. 

The hardware address is MAC not IP. The first 24 bits of the mac address is specific to the company that makes the chip. The first 24 bits are assigned by IEEE.

Link to comment
Share on other sites

Link to post
Share on other sites

55 minutes ago, fpo said:

 

 

How do they make sure that every IP address is different? I'm sure more than one company designs/makes chips and parts. 

I think the thing you are confused about is that IP addresses aren't IN your computer in the way you think they are.

 

An IP is not permanently attached to any particular computer, they rotate around. A computer that is turned off, for example does not have one. every time you connect to a network you are assigned an IP address through a process called DHCP. The next time you connect, you may get a different one.

 

As for MAC addresses, sometimes, people DO end up with the same MAC, that can cause problems if they are on the same network. Luckily you can reset it to something else.

Link to comment
Share on other sites

Link to post
Share on other sites

Welcome to the world of NAT and PAT

 

  • There are 4,294,967,296 IPv4 addresses
  • There are 3,706,452,992 Public IPv4 addresses

 

Devices in your local network (your PC's, phone, printer etc) live on this private IP range.

  • 192.168.0.0 - 192.168.255.255 (65,536 IP addresses)
  • 172.16.0.0 - 172.31.255.255 (1,048,576 IP addresses)
  • 10.0.0.0 - 10.255.255.255 (16,777,216 IP addresses)

192.168.0.0/16 is a really common range for consumer equipment while 10.0.0.0/8 is quite common in enterprises as it is a bigger range.

 

Everything using IPv4 for an internal network will get one of the above addresses - when it goes out through the router to the outside world, PAT or port address translation occurs. This is where traffic outbound has its internal IPv4 address swapped for an external port number.

 

Eg if I want to go to Facebook.com - my DNS lookup will tell me that facebook.com has an IPv4 address of 31.19.95.36 so my PC will send off packets destined for that address. Part of the packet is both the destination and source IP addresses.

 

The router will then switch my internal IP address for my external address and add a port number to it. This is so that when the packets come back from Facebook, my router will know which device in my network those packets are for.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, SpaceNugget said:

As for MAC addresses, sometimes, people DO end up with the same MAC, that can cause problems if they are on the same network. Luckily you can reset it to something else.

It is generally only a problem if you are running cheap counterfeit network cards, where the counterfeiter are too lazy to serialise the MAC's that they burn in, or in enterprise environemtns where you have VM's and other things that use virtual addresses.  (Or when VMware want to do something stupid like take the hardware address of the ethernet card and binding it to the vmware install, so when you move the install to a new server you suddenly have two machines with the same MAC and waste half your night trying to figure out why you have 50% packet loss on your new server. https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1031111

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, soup said:

snip

How does a mac address get assigned? I understand there are a lot, but couldn't 2 different factories accidentally produce the same one? Someone in a later post said it sometimes happens and you can get a new one through a method.

 

11 hours ago, Orangeator said:

IP address has to do with your location and your ISP... There are no two matching ones except in certain circumstances which aren't applicable to this situation ie spoofing, vpn's... Etc.

 

Edit: To quote the guy above me, there are a shit load of possible combinations to where this is a non issue.

So an IP is sometimes assigned by your house location? For instance 2 houses in England could start with the same IP number but one in Australia would start differently?

 

11 hours ago, roypur said:

The hardware address is MAC not IP. The first 24 bits of the mac address is specific to the company that makes the chip. The first 24 bits are assigned by IEEE.

oh that makes sense;

ieee site for future refernce.

 

10 hours ago, SpaceNugget said:

As for MAC addresses, sometimes, people DO end up with the same MAC, that can cause problems if they are on the same network. Luckily you can reset it to something else.

this is what I was remembering when responding to the first person in this post.

 

10 hours ago, Windspeed36 said:

Welcome to the world of NAT and PAT

 

  • There are 4,294,967,296 IPv4 addresses
  • There are 3,706,452,992 Public IPv4 addresses

 

Devices in your local network (your PC's, phone, printer etc) live on this private IP range.

  • 192.168.0.0 - 192.168.255.255 (65,536 IP addresses)
  • 172.16.0.0 - 172.31.255.255 (1,048,576 IP addresses)
  • 10.0.0.0 - 10.255.255.255 (16,777,216 IP addresses)

192.168.0.0/16 is a really common range for consumer equipment while 10.0.0.0/8 is quite common in enterprises as it is a bigger range.

 

Everything using IPv4 for an internal network will get one of the above addresses - when it goes out through the router to the outside world, PAT or port address translation occurs. This is where traffic outbound has its internal IPv4 address swapped for an external port number.

 

Eg if I want to go to Facebook.com - my DNS lookup will tell me that facebook.com has an IPv4 address of 31.19.95.36 so my PC will send off packets destined for that address. Part of the packet is both the destination and source IP addresses.

 

The router will then switch my internal IP address for my external address and add a port number to it. This is so that when the packets come back from Facebook, my router will know which device in my network those packets are for.

I think I get what you're saying.
There's IP addresses for the internet, IP addresses for Internet providers (Like Comcast or time warner cable), and then there's IP addresses for Local Networks (Like my xbox and laptop at home)

Is this what you're saying in a way with the first part of your post?

 

If so; what prevents 2 ISP from having the same IP? Erkel noted about 50% packet loss if 2 VM have the same Mac address. What stops 2 companies from accidentally having the same IP, or more threatening me from making my own ISP and taking the IP address of a major company? (I will not ask how to do this; no malicious intensions, just interested in how it works.)

 

8 hours ago, Erkel said:

It is generally only a problem if you are running cheap counterfeit network cards, where the counterfeiter are too lazy to serialise the MAC's that they burn in, or in enterprise environemtns where you have VM's and other things that use virtual addresses.  (Or when VMware want to do something stupid like take the hardware address of the ethernet card and binding it to the vmware install, so when you move the install to a new server you suddenly have two machines with the same MAC and waste half your night trying to figure out why you have 50% packet loss on your new server. https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1031111

This is what I was curious about. VMs may do it on purpose, however I wasn't sure what stopped this from happening accidentally.

I may be theorizing impossibilities, but for instance it seems someone could accidentally be sent my log in to an online account.

(The above might be impossible because cookies, and client side workings - but I still wonder.)

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, fpo said:

-- SNIP --

This is what I was curious about. VMs may do it on purpose, however I wasn't sure what stopped this from happening accidentally.

I may be theorizing impossibilities, but for instance it seems someone could accidentally be sent my log in to an online account.

(The above might be impossible because cookies, and client side workings - but I still wonder.)

The amount of topics to cover related to network security to explain how that isn't going to happen is very large. You're not asking the right question to get at that.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, fpo said:

How does a mac address get assigned? I understand there are a lot, but couldn't 2 different factories accidentally produce the same one? Someone in a later post said it sometimes happens and you can get a new one through a method.

What is meant to happen is that a block of addresses is assigned by the IEEE to a manufacturer. MAC addresses were initially meant as a unique identifier but the method to spoof MACs being relatively easy, and manufacturers reusing MACs [1] has meant sometimes machines on the SAME network subnet have  two devices with the same MAC and everything goes to 'a big ball of chalk' (this happens more often than some administrators  like)

 

A MAC address is of the form 10-C3-7B-CF-B2

 

[1] When manufacturers deliberately re use MACs  they try to send the items to a vastly different location so there is a reduced chance of them being on the same network as the previous item with the same MAC

 Two motoes to live by   "Sometimes there are no shortcuts"

                                           "This too shall pass"

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, fpo said:

Not sure if Mac addresses have anything to do with networking but how does every pc have a different address? With the amount of computers out there, there seems to have been a possibility of 2 having the same accidentally. Isnt it a finite digit address? 

 

Or were computers made made by really smart cookies; and because of this no one can really say? (Also acceptable when it's a really complex this to answer if you don't want to explain.) 

Those are two different, yet related questions.

 

First MAC Addresses are in Hexadecimal format. This means they are made up of a series of digits, that can contain any of the following characters:

0-9, A-F

 

A MAC Address is made up of 6 groups of 2-characters, to form a 48-bit address.

 

This is the total possible number of MAC Addresses:

281,474,976,710,656

 

That's 281 Trillion some-odd possible MAC Addresses.

 

Now on to IP Addresses:

IPv4, which is the most common IP type, is made up of 4 groups of 3-digit numbers. A common example of a LAN IP address is 192.168.1.1 (Common Router LAN IP Address) - the xxx.xxx.1.1 at the end would be the same as writing them as xxx.xxx.001.001 - we just truncate the zeroes because there's no need to write them in.

 

IPv4 DOES have a problem with IP Addresses running out. IPv4 is a 32-bit address, and has a total possible combination of 4,294,967,296 addresses.

That's only 4.3 billion IP Addresses. If every person in the world had one Smartphone, each with their own IP Address, we'd already have run out.

 

The easiest way around that is using something called NAT - or Network Address Translation. This is what your Router does, when it translates your WAN (Wide Area Network - generally referring to the Internet as a whole) IP Address (The external IP Address on your Modem) to the various LAN (Local Area Network) IP Addresses your internal devices have.

 

This is how you can have, say, a dozen computers and smartphones at home, but all those devices share a single WAN IP Address. They each have their own internal LAN IP Addresses, and those get translated into the single external WAN IP Address.

 

Some ISP's actually use NAT on a larger scale, and take entire neighbourhoods or cities, and then use NAT to take many IP Addresses and turn those into a single IP Address. This is more common with Fixed Wireless ISP's or less traditional ISP's.

 

The real solution to the IP problem is by adopting IPv6, which is the newer IP Address system.

 

IPv6 is a 128-bit address - and thus has such a ridiculously large combination, as to not be funny:

340,282,366,920,938,463,463,374,607,431,768,211,456

 

Yes, that's right. That's 340 undecillion possible addresses.

http://royal.pingdom.com/2009/05/26/the-number-of-possible-ipv6-addresses-read-out-loud/

Quote

340 undecillion, 282 decillion, 366 nonillion, 920 octillion, 938 septillion, 463 sextillion, 463 quintillion, 374 quadrillion, 607 trillion, 431 billion, 768 million, 211 thousand and 456 possible IPv6 Addresses.

 

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, fpo said:

I think I get what you're saying.
There's IP addresses for the internet, IP addresses for Internet providers (Like Comcast or time warner cable), and then there's IP addresses for Local Networks (Like my xbox and laptop at home)

Is this what you're saying in a way with the first part of your post?

 

If so; what prevents 2 ISP from having the same IP? Erkel noted about 50% packet loss if 2 VM have the same Mac address. What stops 2 companies from accidentally having the same IP, or more threatening me from making my own ISP and taking the IP address of a major company? (I will not ask how to do this; no malicious intensions, just interested in how it works.)

There are global registries which list which carriers own which IP ranges - they then sell them to providers who sell them to end users. Thus it's very rare to have this happen

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Windspeed36 said:

There are global registries which list which carriers own which IP ranges - they then sell them to providers who sell them to end users. Thus it's very rare to have this happen

So when you turn on your computer, it asks the modem to get an IP from the ISP? (If not - something to that effect)

 

1 hour ago, dalekphalm said:

 

Some ISP's actually use NAT on a larger scale, and take entire neighbourhoods or cities, and then use NAT to take many IP Addresses and turn those into a single IP Address. This is more common with Fixed Wireless ISP's or less traditional ISP's.

 

 

Who owns the IP addresses, and what would prevent me from just entering in my own IP address? Is there a type of security measure preventing this?

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, fpo said:

So when you turn on your computer, it asks the modem to get an IP from the ISP? (If not - something to that effect)

 

Who owns the IP addresses, and what would prevent me from just entering in my own IP address? Is there a type of security measure preventing this?

When you turn on your computer, assuming you have DHCP configured (Dynamic Host Control Protocol - this is the default setting, and "asks" for an IP Address), it will send out a broadcast to the rest of your network (Your LOCAL network, not the Internet). Your Router (Or Modem/Router combo device, depending on your setup) will receive this broadcast, and then assign you a LOCAL IP Address (Generally something like 192.168.1.105).

 

Your MODEM (Whether a separate device, or a combo box), when it connects to your ISP's network, will basically do the exact same thing. It will send a broadcast out to the ISP's DHCP server, and then in return, get assigned an IP Address.

 

On your Local network (The LAN), you certainly could assign a Static IP Address to one of your devices. If you assign the same address to more than one computer, you'll have an IP Conflict. Basically, whichever device comes online first, grabs the IP Address, and the second device will be unable to communicate on the network.

 

For your ISP, there's generally an authentication process of some kind happening. This could either be via a Username and Password (Commonly via a method called PPPoE - "Point-to-Point Protocol over Ethernet", which is commonly used on DSL connections), or via a MAC Address list-based system (Example: Cable Internet providers will note the MAC Address of your Modem).

 

When your Modem calls into the ISP to ask for an IP Address via DHCP, your ISP then verifies it's you (via the username or password, or via the MAC Address of the Modem). Once your modem gets verified, the ISP assigns you an IP Address.

 

Now what about typing in your own IP Address - known as a "Static IP"?

 

Well, generally speaking, when your Modem authenticates (eg: via one of the two above methods), your ISP has noted what kind of connection you should have. If your Modem's MAC Address is assigned to a plan that runs on DHCP, and you try to connect with a Static IP Address, it will simply refuse the connection, and probably blacklist/block your Modem while it's at it.

 

Furthermore, you can't just pick any random IP Address - you have to have all the details, including what Gateway to use, what DNS Server (Though there are public DNS Servers, such as Google's 8.8.8.8), what Subnet Mask to use, etc. If you happen to figure out corresponding figures, your ISP will still just block the connection.

 

With all that in mind, this is all very "boiled down" and simplified. Some of what I've said may not even be "technically" correct - I'm not sure, since I'm not an ISP network engineer. But what I've said is the basic "gist" of it, in as close to layman's terms as I can get on this subject.

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to comment
Share on other sites

Link to post
Share on other sites

31 minutes ago, dalekphalm said:

When you turn on your computer, assuming you have DHCP configured (Dynamic Host Control Protocol - this is the default setting, and "asks" for an IP Address), it will send out a broadcast to the rest of your network (Your LOCAL network, not the Internet). Your Router (Or Modem/Router combo device, depending on your setup) will receive this broadcast, and then assign you a LOCAL IP Address (Generally something like 192.168.1.105).

 

Your MODEM (Whether a separate device, or a combo box), when it connects to your ISP's network, will basically do the exact same thing. It will send a broadcast out to the ISP's DHCP server, and then in return, get assigned an IP Address.

 

On your Local network (The LAN), you certainly could assign a Static IP Address to one of your devices. If you assign the same address to more than one computer, you'll have an IP Conflict. Basically, whichever device comes online first, grabs the IP Address, and the second device will be unable to communicate on the network.

 

For your ISP, there's generally an authentication process of some kind happening. This could either be via a Username and Password (Commonly via a method called PPPoE - "Point-to-Point Protocol over Ethernet", which is commonly used on DSL connections), or via a MAC Address list-based system (Example: Cable Internet providers will note the MAC Address of your Modem).

 

When your Modem calls into the ISP to ask for an IP Address via DHCP, your ISP then verifies it's you (via the username or password, or via the MAC Address of the Modem). Once your modem gets verified, the ISP assigns you an IP Address.

 

Now what about typing in your own IP Address - known as a "Static IP"?

 

Well, generally speaking, when your Modem authenticates (eg: via one of the two above methods), your ISP has noted what kind of connection you should have. If your Modem's MAC Address is assigned to a plan that runs on DHCP, and you try to connect with a Static IP Address, it will simply refuse the connection, and probably blacklist/block your Modem while it's at it.

 

Furthermore, you can't just pick any random IP Address - you have to have all the details, including what Gateway to use, what DNS Server (Though there are public DNS Servers, such as Google's 8.8.8.8), what Subnet Mask to use, etc. If you happen to figure out corresponding figures, your ISP will still just block the connection.

 

With all that in mind, this is all very "boiled down" and simplified. Some of what I've said may not even be "technically" correct - I'm not sure, since I'm not an ISP network engineer. But what I've said is the basic "gist" of it, in as close to layman's terms as I can get on this subject.

That makes a lot more sense in how you explained it. It's more than an IP address. There's multiple hoops things have to jump through to be that IP from what I've gathered in your explanation. 

 

I was was wondering if perhaps someone else turned on their computer, and would end up getting logged into a website I typed in accidentally but it seems it really cannot happen that way. 

As well as I cannot try to clone my computer and get the same info as the original on the clone by accident. 

 

When your mind wonders at night hahaha. Thanks to you all. I found this all very interesting and very cool!!! Thanks to everyone for sharing and telling me things. Even if I didn't reply I still loved learning these fun facts! :D

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/2/2017 at 10:43 AM, fpo said:

 

If so; what prevents 2 ISP from having the same IP? Erkel noted about 50% packet loss if 2 VM have the same Mac address. What stops 2 companies from accidentally having the same IP, or more threatening me from making my own ISP and taking the IP address of a major company? (I will not ask how to do this; no malicious intensions, just interested in how it works.)

 

ISPs and routing equipment use BGP routing tables. It's literally an address book of the internet. If someone with the IP address - 105.244.89.104 - sends out a spoofed packet with the address - 103.243.82.101 - The packet is going to get sent back to the spoofed address. 

 

What stops you from making an ISP and getting someone else's IP? ISPs aren't magic, they can't just get any address they want. Basically, small ISPs buy from bigger ISPs, and those ISPs usually buy from backbone providers. Your provider will only give you a certain amount of usable IP addresses. You don't get to choose which ones you want, only the amount you want. Any packet that goes out of the network with an address that shouldn't be coming from there will get dropped (by most providers, at least). 

Link to comment
Share on other sites

Link to post
Share on other sites

I'd like to add that most of the time the only thing stopping an ISP from using another ISP's IP space is a text document called a Letter of Authority or LOA for short (and in some countries even that isn't required). Having had my IPs hijacked before, the only way to prevent another company from hijacking your IPs is to monitor them closely and only announce /24s via BGP (we used to announce /22s, but that changed after the 2nd time a /24 was hijacked).

-KuJoe

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×