Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Digital Literacy How the Web Works The World Wide Web Domain Names and IP Addresses

yaseen kabeer
yaseen kabeer
700 Points

Is IP address unique for every device (computer , tablet , mobile)

i searched on net and found put that IP address can be same if your ISP is same is that really possible

i thought Ip address is something which is internal to every device

like if different computers are sharing the same internet connection , then will they all have same IP address ?

MAC addresses are permanent and truly unique.

IP addresses are assignable, with leasing time. One can request a static IP from an ISP. If they have it, they will charge a fee. So yes, IP address is unique to every device on your local network. But you and your neighbor can have have the same IP address while chatting out side on the lawn. Because you neighbor is connected to his device using something called a local IP address say 192.168.0.10, and you can be also 192.168.0.10. There won't be any conflict because your modems or gateway to the internet have different IP addresses. Just know: Public IP, all the ones being used by websites, and ISP to connect to one another, IP used by government etc... Private IP, used by you and everyone who ever bought a router. Also, cellphones use local IP created by your Cell Co. Private IP cannot see the web, no device on the web would respond directly to a private IP. The are localloop IP, 127.x.x.x will not go to the router, even if directly connect, it is used for diags and other purposes within the computer or device.

http://www.vlsm-calc.net/ipclasses.php

take a look at this video. I used to love it when I was in Cisco's Academy. https://www.youtube.com/watch?v=B0NI5LRNyN4

2 Answers

Hi there!

Every device on a network has to have a unique IP address. That's the same if it's a home network, an office intranet or the internet.

However, we cheat. Think of your home network. Your laptop, computer, phone, tablet, games console.... heck Tv's now all connect to your home network and get addresses like 172.168.0.3 And millions of other devices have that IP address! The point is that they aren't on the same network. Your wifi router, or switch has a publicly facing IP address assigned to it by your ISP whenever it's turned on. That's the only "internet ip" you have - all of your devices are behind that IP, so appear online to have the same IP, whilst all having different IP's on your home network. It's your router/switch/acesspoint that's making that possible via NAT and controlling which data heading to your public IP from the internet goes to which private IP on your home network, public wifi, etc.

And it's not just home networks! If you've set up your first website, you probably went with shared web hosting. Most low cost shared webhosting plans also do not have their own public IP address. instead, the IP address that comes from the DNS lookup goes to your web host, and they know which server on their network hosts that site and they send that site's data back - so many websites can be served from the same IP. Even mobile phone companies do this. Rather than waste an IP address on every single sim card in the world, your mobile network acts like a huge wifi network, with a limited number of public IP's and users divided up into smaller networks over 3/4G that each use one public IP. That might be why you read multiple devices can have the same IP from their ISP? OR mainstream ISP's have now started using NAT to divide up their customers too, which is inevitable if they aren't already.

As for internal to every device, that's the MAC address. Every wifi card, smartphone, router has a unique MAC adddress. IP addresses are assigned to a device by the network and given a lease time. You can pay extra to have a fixed IP - usually used if you're running a server. Otherwise or you have a dynamic address, which is as before assigned when you connect to the network. That means your home IP address could be different every time you turn the router off and on again.