AP®︎/College Computer Science Principles
The Internet Protocol (IP) is one of the core protocols in the layers of the Internet, as you might guess from its name. It's used in all Internet communication to handle both addressing and routing.
The protocol describes the use of IP addresses to uniquely identify Internet-connected devices. Just like homes need mailing addresses to receive mail, Internet-connected devices need an IP address to receive messages.
When a computer sends a message to another computer, it must specify the recipient's IP address and also include its own IP address so that the second computer can reply.
Diagram of two servers. Server #1 is labeled with IP 220.127.116.11 and server #2 is labeled with IP 18.104.22.168. Arrow goes from server #1 to server #2 with a box that says "TO: 22.214.171.124 FROM:126.96.36.199" and 4 bits 0 1 0 1.
There are actually two versions of the Internet Protocol in use today:
- IPv4, the first version ever used on the Internet
- IPv6, a backwards-compatible successor
In the IPv4 protocol, IP addresses look like this:
🔍Try visiting that IP in your browser. Where does it go?
Each IP address is split into numbers, and each of those numbers can range from to :
We write those numbers in decimal, but the computer stores them in binary, like so:
Each number can represent values, thanks to the bits. That's also why we often call them "octets."
Overall, that's possible values: possible IPv4 addresses.
That's a lot! But remember, in the beginning, we said there are more than four billion devices connected to the Internet? Well, we're reaching the limit of possible IP addresses. It's time for plan B.
IP v6 addresses
Back when the Internet protocols were first invented, the creators didn't anticipate how popular it would become and that there would eventually be more than devices wanting to connect to the Internet.
When it became obvious in the 1990s that the IPv4 addresses were running out, the IPv6 protocol was proposed with a much longer addressing scheme.
Here's an IPv6 address:
Notice the letters in those numbers, like and in ? Those are hexadecimal numbers, which means that the IPv6 address is much longer than it looks. Let's do some math to see exactly how much longer.
There are hexadecimal numbers, and each number is digits long. The highest value for each number is , since is the highest digit in hexadecimal. Thus, the highest address would look like:
What's in decimal?
Each represents in decimal, so that's : a grand total of .
We can also calculate that based on the binary representation of . Each hexadecimal digit corresponds to in binary, so that results in these bits:
As we discuss in Binary numbers, the highest number that can be represented by binary digits is . That means the binary number above is , which once again equals .
Each 4-digit hexadecimal number can range between and , so each number can represent unique values—and there are of them!
In total, each IP v6 address is represented by bits, so there are possible IP v6 addresses. That's undecillion:
🤔 Imagine a world where we have that many Internet connected devices. What does that look like? How could that much Internet usage make the world better?
🔍 What's your IP address?
One way to find out your computer's IP address is by searching Google for "IP address". Google knows your IP address, since your computer sends a message to the Google computers as soon as it loads
Your IP address might be different tomorrow than it is today. Each ISP has a range of addresses they can assign, and they might give you a different one of those addresses each time they see your computer pop up on the network. That's called a dynamic IP address.
Switching to a different Wi-Fi network will definitely give you a new IP address, since each Wi-Fi provider has its own range of addresses that it can give out.
Computers that act as servers, like the computers that power Google.com, often have static IP addresses. That makes it easier for computers to quickly send search requests to the Google servers. If you tried out the IP address above, you hopefully found yourself on the Google homepage.
Check your understanding
Identify whether each address below is IPv4, IPv6, or invalid:
|IP address||Address type?|
🙋🏽🙋🏻♀️🙋🏿♂️Do you have any questions about this topic? We'd love to answer—just ask in the questions area below!
Want to join the conversation?
- Hey there! I don't think you mentioned before what an ISP is...I'm kinda curious :)(16 votes)
- ISP is an acronym for Internet Service Provider. In other words, the company you buy internet service from.(32 votes)
- if internet is free that means anyone can connect through it i always wonder why we need to pay money in order to access internet(8 votes)
- let's put this in a different analogy:
when you buy a house or a car, you are given the keys, right? without the keys, you don't have the car or house. same with networking, if you don't have the necessary devices to form the bridge between you and the internet, no internet. the product is free, sitting there, your paying for the keys.(25 votes)
- In the "What's Your IP Address section, it says, "Each ISP has a range of addresses they can assign, and they might give you a different one of those addresses each time they see your computer pop up on the network." Does this meant that every time you use the internet your IP address changes or that it changes every time you connect to that Internet? For example, if I am not using my computer, but the wifi is still connected, am I still on the network. Secondly, what's the difference between wifi and internet?(3 votes)
- Most people connect to the internet using a router and so the IP address doesn't change as often, because the router stays connected to the internet and so you keep your IP until the ISP resets the connection (or the router runs a reset).
Wifi is a protocol your computer uses to connect two systems (in your cases probably your computer and your router). Wifi is what you use to connect to the internet.(10 votes)
- In the "What's Your IP Address" section, it says that IP addresses change often. Do Internet Service Providers just cycle through their given range of numbers? Also, is it safe to look up your IP address? If so, how? Are there any possible dangers to doing so? Thanks(2 votes)
- Each ISP has a pool of IP addresses from which it can dynamically assign you one (using the DHPC: dynamic host configuration protocol). Once you stopped using yours, it can be assigned to someone else.
Looking up your IP shouldn't pose any dangers. If you visit a site they can see your IP anyway and in many cases that site will even record it.
There programs that can be used (e.g. ifconfig), but the easiest way to get it is to just write "Whats my IP?" in your search engine of choice.(9 votes)
- I don't really understand how hexadecimal works can you help or share a link?(1 vote)
- I checked my ip address, and it is from IPv4. What does that means? My computer is old?(2 votes)
- It's possible you were also assigned an IPv6 address, but the program you used didn't check for that one. Or it just might be that your ISP just assigned an IPv4 address to you.
It's your ISP that assigns an IP address to you, the age of your computer has nothing to do with that.(6 votes)
- Why is it 2^128? The ipv6 only has 32 bits.(2 votes)
- ipv6 uses 128 bits, whereas ipv4 uses 32 bits. Hence, ipv6 has 2^128 addresses.
Hope this helps!(5 votes)
- How is each IP v6 address represented by 128 bits?(2 votes)
- Howdy msj8464,
An IPv6 address is simply a number which we use to identify a computer. Because we use 128 bits to represent this number in binary notation (0's & 1's), we can represent a total of 2^128 values, or approximately 3.4*10^38 different IPv6 addresses.
Now, what might be confusing you is that we use hexadecimal numbers to represent the IPv6 addresses. This is simply because it is easier to read numbers in their hexadecimal form than with 128 1's and 0's in a row.
Hope this helps.(4 votes)
- IPv4 makes sense: There's 4 numbers. Why is IPv6 made up of 8 numbers? Wouldn't it be easier to skip to v's to make it ore intuitive.(1 vote)
- IPv6 means the 6th version of the IP protocol. The version number has nothing to do with the 8 numbers.
Hope this helps!(3 votes)
- Is there same IP address in world?
I think future will more device that can connect to internet. Now we have wearable devices. Later may be cars, bike and more devices that we can't imagine now. But It may not be over 340 undecillion.(2 votes)