off topic completely: How do IP addresses work?

Sorry, guys, I know this is not related to gaming but this is the forum I hang out in so I guess your opinions are the ones I ask…

So my question, looking at an i.p. adress of 999.999.999.999 and a number 999999999999, what is the difference between the number of unique variables these numbers can hold?

According to me, 999 can hold a maximum of 1000 different values.
Thus 999.999.999.999 is equal to 1000x 1000x 1000x 1000 an thus 1,000,000,000,000, although, seeing as how the first set of 1000 all assume the rest to be 0 anways, it seems more like 999x 999x 999x 1000 = 997,002,999,000

But, a single numeric variable of 12 digits in length can hold a maximum of 1,000,000,000,000 different values. So according to me, an ip address is the same or less than the 12 digit numeric counterpart…

Now, according to ‘experts’, all available ip addresses will be used by within the next 3 weeks. Apparently almost all 4 billion ip addresses have been assigned. 4 billion? As in 4,000,000,000 ? As in 3.999.999.999 ?

What am I missing here? 4 billion is far less than 1 trillion. If a single digit can hold 1 trillion values and if my previous statement of an ip address only being able to generate at least 997 billion, why is 4 billion the cutoff?

So my questions:

  1. Why is 4 billion the cutoff for all ip addresses?
  2. What is die difference in the amount of values that can be stored by an ip and a 12 digit number
  3. If the answer to question 2 is not “none”, why so?

http://www.news24.com/SciTech/News/Internet-addresses-to-be-used-up-20101204

p.s. just to clarify, I loosely used COBOL syntax above. To define a variable that can be a maximum of 3 digits in length, you would declare it as a PIC 999. Thus, when I use 999.999.999.999 I meant a series of numbers of which each can be only be 3 digits in length (thus 000 to 999).

Each series of 3 digits is called an octet and is 8 bits. This ranges from 00000000 to 11111111 (max value of 255). The overall IP address is 32bits or ~4 billion possible numbers. 999 is not a valid value.

I forgot to take into account that each number can be broken up into bits…
So to break this down into terms I AM familiar with, this means that an IP address is actually 4 bytes in length, not the 12 I was thinking of?

So when I type in 168.192.10.10 it is converted to 10101000.11000000.00001010.00001010 instead of 000000000000000010101000.000000000000000011000000.000000000000000000001010.000000000000000000001010. Hense 4 billion, instead of 1 trillion…

Gotcha. Thanks for the info.

As above an IP address is simply a 32bit ‘number’. The way you see it written is simply for simplicity.

But this brings to mind another question. Subnet masks. I constantly see them as 255.255.255.0 or 255.255.0.0.
How in the world does one fit the number 255 into 8 bits??? Are subnet masks larger than IP addresses?

128+64+32+16+8+4+2+1 = 255. That’s the maximum decimal value you can get from 8 bits.

–Eric

No, 4 billion as in 2^32 = 4,294,967,296. But there are a few things you should also understand:

  • There’s a difference between assigning and using an ip address.
  • PCs, laptops, and appliances in your home and workplace generally use private ip addresses, not the public ones being discussed.
  • The day the registry runs out of IPv4 addresses, nothing dramatic will happen; the Internet will not stop working, and many ISPs will continue to find ways to more effectively utilize their existing IPv4 address space rather than immediately switching to IPv6.
  • Networking vendors and ISPs have been trying IPv6 for years and aren’t totally unprepared for it.

Oh my good lord!! That is the 2nd time today I made a complete fool of myself (both times on this forum!).
It has been such a long time since I needed binary (only recently started again but not for maths, just on-off indicators). I forgot you could have 256 values between 0 and 255 and thought you could have 255 values between 0 and 254…

Argh… I was so darn tired yesterday that I went to bed at 6pm. Slept for nearly 12 hours and woke up unable to concentrate…
Argh…!

Ostalgar:
I am not worried that the internet will no longer work, I am just curious about the maths behind it. I have never been able to understand IP addresses. All it took was one person to tell me that each number is 1 byte long, not 3 bytes long and now the numbers all makes sense…

Now, if someone could just please explain hosting to me in a way that I can understand… that would be fantastic. :stuck_out_tongue: Some have tried but none have illuminated that clearly enough, yet.

Each ISP holds a list of hosts and each www call will send the IP address to your ISP’s name server that checks to see with each of the hosts in it’s databse wether the ip address is in their data base and send you to them if it is or else it will send the IP address to one of the hosts in their database so they can do the same search in their database until finally someone, somewhere finds the ip in a list and then directs you to the host that hosts that IP to finally resolve the IP address and point you to the relevant web space? Wow! No way the internet could be that hit-and-miss!

So does that mean that every IPS has it’s own name server that points to every single name server on the internet and each and every ISP searches the database of each and every name server on the internet for each and every www call? How does it know which server to start searching or does it just search them all sequentually until it finds something?

Or does all name servers keep details of all 4 billion ip addresses? If so, then each isp will know where to direct your www call. Thus, if all IPS know of all IP locations then what exactly does it mean to ‘host’ with this or that company…?

This is off topic for this of topic post so don’t worry about too much about this, but name servers make no sense to me and what it means to host an ip address makes absolutely no sense to me at all. I know an IP address points to somewhere, but how that address is actually translated from one thing to another to finally end up showing me what I am after… that is the mystery!

Subnet masks are the same length as IP addresses. :slight_smile:

Suppose you’re assigned the IP address 10.10.10.8. It’s often useful to divide that into a SUBNET address and a HOST address. The subnet mask tells you exactly how to divvy it up.

Suppose the subnet mask is 255.255.255.0. In bit terms:

00001010 00001010 00001010 00001010 = 10.10.10.10 (ip address)
11111111 11111111 11111111 00000000 = 255.255.255.0 (subnet mask)

The subnet mask tells us the first three octets (10.10.10.x) are the subnet address and the last octet (x.x.x.8) is the host address. Generally, many hosts will be on the same subnet.

IP addresses are hierarchical just like physical addresses. When you give a letter to your mailman destined for 1313 Mockingbird Lane in Alpharetta, GA in the USA… all your postman needs to know is how to send letters to the USA. Someone in the US will finish the job! Similarly, when you send an IP packet to 74.125.224.19 it’s often enough to know how to know that all packets destined for 74.x.x.x go a certain direction.

No way! Your ISPs routers know at most about all the major networks, not hosts. Your workplace’s routers may not even know that much–they may just know “send anything that’s not local to our ISP”.

Name servers convert names like google.com to an ip like 74.125.224.19. They don’t route traffic.

@Eric5h5
Only unsigned… ;OP

@Ostagar
They are less testing IP6 since years, they more hesitate making the switch due to several reasons. Regarding the subnet mask, it depends on your network class.

@MrDude
Did you try wiki? If you really want to grasp it, it’s all a little bit more complex than just one or two aspects…

A simple definition i read many time before is to think of it in terms of country.state.town.house so each IP address points from a larger source to a pin-point accurate location. Fine, using the above example I can see how any ip could be traced to wherever it needs to go, but the ‘hosting’ of an ip is what bothers me.

What does it mean to ‘host’ an ip address. I have a website in Germany but the IP is being hosted in the UK (for example). This means that a UK based company is holding my ip and sending traffic to my web space in Germany. But, if I now sit in Brazil and enter an ip address to the website in Germany, how does my ISP know to go find my ip address in the UK? What exactly does ‘hosting’ an ip mean when all an ip is is merely a redirect service?

If 4 billion ip addresses are being ‘hosted’ on 40 million name servers, does each name server hold a list of all ip addresses or does each isp have to traverse all 40 million systems to find out which one hosts the ip?

taumel: Yeah, but I don’t speak Greek…

  • An authoritative name server is a name server that gives answers … about names in one or more zones
  • An authoritative-only name server only returns answers … about domain names … specifically configured by the administrator
  • An authoritative name server can either be a master server or a slave server
  • A master server for a zone … stores the definitive versions of all records in that zone
  • A slave server for a zone uses some kind of automatic updating mechanism to maintain an identical copy of the master records
  • The fully qualified domain names of the authoritative name servers for any given zone are listed in the NS records for that zone.

If the server for a zone is not also authoritative for its parent zone, the server for the parent zone must be configured with a delegation for the zone

…anyone know the ip address for the English version of Wikipedia? :stuck_out_tongue:
Check my avatar already :stuck_out_tongue:

C:\Users\Ostagar>nslookup www.wikipedia.com
Server:  xxxxxxxxxxxxx
Address:  a.b.c.d

Non-authoritative answer:
Name:    text.pmtpa.wikimedia.org
Address:  208.80.152.2
Aliases:  www.wikipedia.com
          text.wikimedia.org

My home router only knows that IP packets not destined for 10.x.x.x go to my ISP.

One of my ISP’s routers probably knows that traffic destined for the 208.80.152.x/22 subnet (hierarchy again) should ideally go to a certain carrier. My ISP’s routing table likely has hundreds of thousands (not millions and certainly not billions) of entries, and some of their routers likely know much less than that.

That is an odd term. Googling “hosting an ip address” turns up almost nada.

An IP address is more like a physical address than a redirection service. If you want to be able to switch services freely, you advertise your domain name, not your IP address.

Perhaps ‘hosting my ip address’ and ‘hosting my domain’ are not the same terms?
I used to want to buy a domain name so I can have my own little ip address on the web so to me ip address and domain name = same thing. Perhaps my terminology is what is confusing matters?

So allow me to rephrase that question: “What does hosting a domain actually mean when all it does is redirect to a predefined ip address?”
Granted, when a company hosts your domain they give you access to their mail servers and give you a variety of bonuses etc. For example, if I transfer my domain to Apple’s .me service I would loose my mail forwarding and my multiple mail boxes etc etc etc. Keeping my domain with my current provider allows me to still point the www part of my domain to the ip address of my .me website.

Now the question of what is included with a domain is answered by: “What services does your host provide with the hosted domains”
The question of “How does one computer know where to look to find your domain” remains the same question as before…
If I buy mybadstudios.com then I can configure the www part to forward to sites.me.com/mybadstudios etc etc etc but how does my ISP in Brazil know to go look for mybadstudios in the UK?

I know that certain traffic goes to certain places. For example: My ISP says that all traffic between 100.x.x.x and 200.x.x.x goes to the server in the US and traffic between 201.x.x.x and 300.x.x.x goes to the UK etc etc etc, but if the computer in the UK is the one that knows that mybadstudios.com is actually 200.x.x.1, how will the ISP in Brazil know to go look for my domain in the UK to find out what my ip address is?

That is the part that confuses me. If there are thousands of servers that each convert only a portion of domain names into ip addresses, does that mean that each www call will result in each of those thousands of servers being prodded one after the other to find out which of them contains the translation of my domain name before finally redirecting to the relevant site?

Ahh. They are very different. :slight_smile:

Suppose you pay $15/year to register the domain name MrDude.com. You’re paying for the service that, anytime someone types MrDude.com into their webbrowser, they will go to the IP address of your choice. This month, perhaps you will ask them to point to a webserver in Germany with IP 100.1.1.1. Next month, perhaps you’ll ask them to point to a webserver in the UK with IP 150.1.1.1 that offered you a 40% off special.

When you change service providers, your IP address will change to one of the IP addresses assigned to your new service provider. Your domain name can remain the same, always.

The physical location of IP 100.1.1.1 doesn’t change when you switch web hosting providers. Your ISP in Brazil probably knows 100.x.x.x is goes down a certain cable, and that’s all it needs to know.

DNS = Distributed Hierarchical Database that translates URL’s into IP addresses.

Aye, hierarchy being the key again. In the case of forum.unity3d.com:

com
|-------------->unity3d
|--------------------------------------->forum

Caching is often implemented so common lookups are actually serviced very quickly.

; <<>> DiG 9.3.2 <<>> @localhost forum.unity3d.com A +trace
 ; (2 servers found)
 ;; global options:  printcmd
 .			334063	IN	NS	j.root-servers.net.
 .			334063	IN	NS	k.root-servers.net.
 .			334063	IN	NS	l.root-servers.net.
 .			334063	IN	NS	m.root-servers.net.
 .			334063	IN	NS	a.root-servers.net.
 .			334063	IN	NS	b.root-servers.net.
 .			334063	IN	NS	c.root-servers.net.
 .			334063	IN	NS	d.root-servers.net.
 .			334063	IN	NS	e.root-servers.net.
 .			334063	IN	NS	f.root-servers.net.
 .			334063	IN	NS	g.root-servers.net.
 .			334063	IN	NS	h.root-servers.net.
 .			334063	IN	NS	i.root-servers.net.
 ;; Received 228 bytes from 127.0.0.1#53(127.0.0.1) in 0 ms
 
 com.			172800	IN	NS	c.gtld-servers.net.
 com.			172800	IN	NS	j.gtld-servers.net.
 com.			172800	IN	NS	e.gtld-servers.net.
 com.			172800	IN	NS	g.gtld-servers.net.
 com.			172800	IN	NS	h.gtld-servers.net.
 com.			172800	IN	NS	i.gtld-servers.net.
 com.			172800	IN	NS	a.gtld-servers.net.
 com.			172800	IN	NS	l.gtld-servers.net.
 com.			172800	IN	NS	d.gtld-servers.net.
 com.			172800	IN	NS	m.gtld-servers.net.
 com.			172800	IN	NS	b.gtld-servers.net.
 com.			172800	IN	NS	k.gtld-servers.net.
 com.			172800	IN	NS	f.gtld-servers.net.
 ;; Received 507 bytes from 192.58.128.30#53(j.root-servers.net) in 10 ms
 
 unity3d.com.		172800	IN	NS	ns1.gratisdns.dk.
 unity3d.com.		172800	IN	NS	ns2.gratisdns.dk.
 unity3d.com.		172800	IN	NS	ns3.gratisdns.dk.
 unity3d.com.		172800	IN	NS	ns4.gratisdns.dk.
 unity3d.com.		172800	IN	NS	ns1-8.akam.net.
 unity3d.com.		172800	IN	NS	ns5.gratisdns.dk.
 ;; Received 181 bytes from 192.26.92.30#53(c.gtld-servers.net) in 113 ms
 
 forum.unity3d.com.	7200	IN	CNAME	liquid5.unity3d.com.
 liquid5.unity3d.com.	7200	IN	A	67.225.180.246
 unity3d.com.		7200	IN	NS	eur2.akam.net.
 unity3d.com.		7200	IN	NS	ns1-8.akam.net.
 unity3d.com.		7200	IN	NS	use4.akam.net.
 unity3d.com.		7200	IN	NS	ns2.gratisdns.dk.
 unity3d.com.		7200	IN	NS	ns4.gratisdns.dk.
 unity3d.com.		7200	IN	NS	ns3.gratisdns.dk.
 unity3d.com.		7200	IN	NS	ns1-105.akam.net.
 unity3d.com.		7200	IN	NS	asia3.akam.net.
 unity3d.com.		7200	IN	NS	usw4.akam.net.
 unity3d.com.		7200	IN	NS	ns5.gratisdns.dk.
 unity3d.com.		7200	IN	NS	ns1.gratisdns.dk.
 unity3d.com.		7200	IN	NS	eur5.akam.net.
 unity3d.com.		7200	IN	NS	usc4.akam.net.
 ;; Received 340 bytes from 109.238.48.13#53(ns1.gratisdns.dk) in 29 ms

Sorta techie, but you can see how it’s looking up com, then unity3d.com, then finally forum.unity3d.com.