IP Addressing

When you access the internet through my DSL provider, I know you are assigned a new dynamic IP address each time you connect, but is this how most ISPs work? Doesn’t every AOL user get assigned a new IP address each time they connect, or do they all seem to be the same (or one of aol’s) IP address. Do other ISPs work like my DSL connection in regards to IP addressing?

I’m pretty sure that they are all assigned new ones and users do not get static addresses but my boyfriend’s coworkers think that IP addresses are all unique and I need a definitive resource to quote so if you can point me to one, all the better.

Almost all ISP’s assign you an address dynamically. However, you can get a static IP - with my DSL service, I have the static address 209.196.124.249. It costs me $10 per month extra, and I am the only person in the world with that address.

The reason you’re usually assigned one dynamically is that there are not enough of them to go around. AOL and other ISPs can save addresses by giving you one only when you’re logged on.

In looking at the access log to my web page, I noticed that hits I get from AOL seem to come from the same set of a few IP addresses. This is because when you’re using AOL’s web, their servers act as proxies and get the pages for you, then relay the info back to your computer. Interestingly, they do it in parallel, so that when an AOL user loads my web page, one AOL computer will get the HTML page, and several different AOL computers will each get one of the images on that page.

One more thing, there are four blocks of IP addresses that are reserved for private networks. I have a gateway in my house at my assigned IP address on the public internet, and it assigns addresses to my two computers from one of these private blocks - they are at 192.168.0.xxx. So someone outside my house can’t get to those addresses, but inside my house you can.

Curt explained it pretty well. All IPs in the world (except for the ones reserved for private networks) are unique. Your ISP has a certain range of addresses (probably part of a class B set). When you log on, it gives you one at random. More than likely, they have fewer addresses available than people who use their service.

A bit of a hijack, but I’ve always been kind of curious about this.

For the last few years there’s been dire warnings circulating about that the internet as we know it is “running out of IP addresses”. But considering the current numbering scheme, there should be 256^4 (or 4,294,967,296) possible combinations to make an IP address from…enough so that a good 80% or so of the entire world could have their own personal IP, yet my WAG would say there’s probably no more than 300 million net users worldwide, and that might well be generous.

So what’s the deal? Is this a crock of b.s., or is there some company out there sitting on a hoard of millions and millions of unused IPs? And if so, then why can’t we yank them back into circulation?

The problem IIRC, is not that they are running out of sheer numbers of IP addresses, but that the way IP addresses identify computers makes fewer than all of the possibilities available.

The first thing you have to realize is that an IP address is not a 12-digit number; it is 4 3-digit numbers. The last number identifies a particular computer within a network, but the first 3 numbers identify the network at different levels of organization.

Though I don’t know 'net architecture, I would assume that the numbers are grouped so that a search can be done relatively quickly, which would mean that any business with a network connection would want a block of IP addresses. (Think, for example, of the difficulty involved in data transmission if 123.456.789.101 was an AoL user in Oregon, but 123.456.789.102 was a server in Eastern Europe.)

So there may be blocks of IP addresses that are being “sat upon” by businesses, but it wont help to “force” them back into circulation because they are identified with a certain portion of the internet.

It seems like I would need 4, so that the messages all arrived at the right window.
How does that work?

SIA, the IP address is for your computer, not for the individual browser windows.

Ok, then what does the browser use? Does it add something to the packet header?

I’m not too sure on the exact details, SIA, but I’m sure someone’ll be along in a minute with the right answer!

Also, I’m at work posting, and so is someone else, and a few more, but we always get the same 2 IP addresses. Even though we are on separate computers, running Windows.

In order to understand this you need to understand port numbers. Here it is, grossly oversimplified.

After the IP address (32 bits) there is a 16 bit number called a port number. Any machine running TCP/IP software has the ability to use ports 0 through 65,535. The first 1024 ports are called “priveledged” ports and are standardized for Internet services. HTTP (web) runs on port 80, telnet on port 23, FTP on port 22, SMTP on port 25, etc. On Unix systems, only root-owned processes can open connections on the priveledged port.

OK, so say your IP address is 129.21.113.19. This refers to your network interface and is unique to the world. (Incidentally, IP addresses do NOT refer to computers, they refer to network interfaces. A computer can have more than one network interface, and therefore more than on IP.)

So you open a netscape window and want to go to yahoo. Netscape makes a request to the operating system’s TCP software to make a connection to http://www.yahoo.com. The OS takes care of figuring out http://www.yahoo.com’s IP (a whole other thread). Once this is known, a connection is opened TO port 80 (remember, by default, HTTP runs on port 80) of http://www.yahoo.com FROM an arbitrary port number, say 4356, on 129.21.113.19. This connection is unique because no other thing running on your system can use port 4356 until Netscape is done with it. Say you open ten more browser windows. Netscape will request ten more ports.

In this way, you can have multiple clients and servers running on the same machine. The IP address locates the network interface to talk to, the port number locates the actual software to talk to.

Now you may be wondering how http://www.yahoo.com can deal with having ten bajillion people connecting to port 80 all the time. This is handled with yet another thing called “streams” which works on the OS level.

No, the IP # is for your network interface (most computers, especially personal computers or workstations, have just one network interface), not each individual program that communicates with the Internet, or each instance of a program.

Something like that, yeah. To quote the UNIX System Administration Handbook, Second Edition:

So, when you request a page in a browser window, the program opens up a port on your machine (one above 1024) and sends the request to the server you’re connecting to. When it gets to the server it connects to that machine on port 80 unless you’ve manually specified a different port, as that is the default port for HTTP listeners (web servers). The listener on the server then opens up another port on its end and pushes its data through that port back to you, where you recieve it via the port your browser opened for this specific data transaction. Well, that’s a little simplified but it is basically how the process works.

Since you’re running Windows, you can do the following: start up an MS-DOS prompt in Windows, and at the prompt type in netstat. The resulting outpost should have a few columns including Local Address and Foreign Address, which will consist of some text (either an ip number, a domain name, or an alias such as localhost or your machine name) followed by a colon and then a number. The number after the colon is a port.

By the way, getting back to iberii/schief2’s discussion, there’s no way I’m going to do the math, but if you are, you should be aware of a few things.

Yes and no. There are five Internet address classes: A (1st byte of 1-126, format of N.H.H.H) “Major networks, almost never assigned now”, B (1st byte of 128-191, format of N.N.H.H) “For large sites; usually subnetted, hard to get”, C (1st byte of 192-223, format of N.N.N.H) “Easy to get, often obtained in sets”, D (1st byte of 224-239) “Multicast addressing (still in development)”, and E (1st byte of 240-254) “Experimental addresses”. The quoted material is from the UNIX book I quoted above (it was published in 1995, so I’m not sure if it’s still up to date on the multicasting bit, but other than that I believe it’s accurate). The Ns and Hs are used to represent the part of the IP number that is being used to denote the network and host respectively. So, for an IP number 101.54.167.39 (oh, and I should point out, not only are IP numbers “not a 12-digit number; [they are] 4 3-digit numbers” they are 3-digit numbers that range from 0 to 255, therefore an ip address such as 123.456.789.101 is impossible) only the first byte (101) represents the top-level network, everything after that is their internal responsibility, but for an ip number 222.78.199.234 the first three bytes (222.78.199) represent the network, and only the last byte is assigned locally.

Oh, and if you’re wondering why addresses with a first byte of 0, 127 and 255 aren’t covered, it’s because those bytes have special meanings that I’m not going to go into, and are not used for general IP addresses.

P.S As I preview my post, I see friedo has beaten me to the punch, and in fact done me better, as I claimed that an IP address is for a computer, which technically speaking simply isn’t true. So, now I have to go back and correct that, but I’m still going to make my post after having spent some time on it.

ISP’s like to use DHCP protocol (dynamic IP addressing) to give them more flexibility in enlarging their network and to prevent people from running servers from their home PC’s. (ie if you don’t have a static IP address, you can’t have traffic routed consistantly to your machine)

Incidentally, Yahoo! or any other high traffic site also handles many thousands of connections at a time through clustering. Clustering is the practice of setting up multiple servers that are identical to each other in such a way that network traffic is distributed evenly among them. This not only increases the amount of traffic that can be processed at one time, but allows for redundancy in case one or more of the servers goes offline (the remaining servers will pick up the rest of the traffic).

SIA sez:

  • and it’s very close to the truth.

The IP address is used to route traffic between computers, but you also need to address a specific process inside your computer - perhaps a lot of them, imagine a web-server processing thousands of downloads. To facilitate this, you embed another protocol (TCP, for instance) inside your IP packet. The TCP header has fields to specify which processes are source/destination for this specific TCP packet - better known as port numbers, 16 bits in length. So when a process using IP for communication, is set up, it’s assigned a port number.

This is also used to save IP addresses - by setting up a gateway router that dynamically translates internal IP addresses to a (much) smaller number of registered IP addresses by manipulating port numbers. Among other terms, this is known as “Network Address Translation/Port Address Translation” or “NAT/PAT”. Very useful. The much-announced “impending lack of IP addresses” is cooling off, mainly due to this particular trick.
ibeeri sez:

Mnyah - not exactly. It’s completely true that you split the IP address into a subnet part and a host part, but you can split anywhere you like - classless addressing. You can have the first 8 bits signify a homongous network with up to 16777214 hosts or you can make transfer network with 2 hosts by using 30 bits to signify the network and only 2 to signify hosts.

Did that make anything clearer ? Guess not.

S. Norman

Not only are you people faster, you explain stuff clearer.

S. Norman exits

I thought the xxx.xxx.xxx.xxx format actually represented a four digit hexidecimal?

Nope, hex it ain’t.

The xxx.xxx.xxx.xxx represents 32 bits, broken into 4 bytes for readability. If you were to use hex, you’d need 8 digits to represent 32 bits.

FFFF(hex)=11111111111111111(bin) - that’s only 16 bits, right ?

S. Norman