Main content
Course: AP®︎/College Computer Science Principles > Unit 2
Lesson 3: Addressing the InternetIP address hierarchy
The Internet Protocol (IP) describes the use of IP addresses to identify Internet-connected devices. IP addresses have a hierarchy that makes it easier to route data around the Internet.
Many addressing schemes are hierarchical. Consider a US phone number:
We can break that into parts:
Country code | Area code | Local exchange | Specific phone |
The hierarchy makes it easier for the telephone system to efficiently send calls to the right lines.
IPv4 address hierarchy
Both IPv4 and IPv6 addresses are hierarchical. For simplicity, let's examine the hierarchy of IP v4 addresses.
Consider this IP address:
The first sequence of bits identifies the network and the final bits identify the individual node in the network.
That IP address could break down into these parts:
Comcast network | A home computer |
The first two octets ( bits) identifies a network administered by the Comcast (an Internet Service Provider). The last two octets (the final bits) identifies a home computer on that Comcast network.
If the last two octets were different, then the IP address would point at a different computer on the Comcast network. If the first two octets were different, then the IP address might belong to a completely different network administrator.
The Internet Protocol uses this hierarchical addressing scheme to make it easier to route messages from source to destination. Once a message arrives at the network, a network router can take care of sending it to the individual node. The next lesson on routing dives into more details on how that works.
Subnets
Network administrators can break IP addresses into further subnetworks (subnets) as needed.
Starting with this IP address:
That could break down into 3 parts:
UMich network | Medicine department | Lab computer |
The first two octets identify the entire network for the University of Michigan, the third octet identifies the UMich Medicine department's network, and the fourth octet identifies an individual lab computer in that department's network.
Adding further levels to the address hierarchy can improve the efficiency of routing within the network.
Splitting octets
In actuality, IP addresses are often split in the middle of the octets.
To understand how that works, let's represent the previous IP address in binary instead:
All together, that translates into these 32 bits:
The first bits could route to all of UMich, the next bits could route to a specific UMich department, and the final bits could route to individual computers.
UMich network | Medicine department | Lab computer |
This hierarchy gives UMich the ability to differentiate between ( ) departments and ( ) computers within each department.
Splitting octets might seem confusing at first, but computers store the IP addresses as binary anyways, so it is all the same to them.
As we've just seen, the ability to create hierarchical levels at any point in the IP address allows for greater flexibility in the size of each level of the hierarchy.
🙋🏽🙋🏻♀️🙋🏿♂️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?
- In the last " CHECK YOUR UNDERSTANDING " (Q #02):
If the UMich network uses 5 bits to identify the department networks, then how that leaves only 11 bits to identify individual computers within each network ? As 8 bits are used by UMich Network.
UMich Network(8_bits), Department Network(5_bits), Individual Computers(3_bits)
Waiting For Reply(8 votes)- An IPv4 address is made out of 32 bits.
According to the example in the article the first 16 bits route all to the UMich network. That means you have 16 bits left over to identify different clients in the network itself.
In this case, 5 are used to identify department networks in the UMich network leaving 11 to identify individual computers.(35 votes)
- Why is it called IPv6 if there are 8 groups of 4 numbers?(8 votes)
- IPv6 is the version number so it's Internet Protocol version 6. So the number has nothing to do with the number of bits in the address.
So the question is what happend to IPv5?
IPv5 was assigned to an experimental streaming protocoll, that was never made public. So it was decided to just jump to IPv6.
Today something like that probably wouldn't happen, because the IAAA (the internet assigned numbers authority) has matured a lot and as such experimental protocols probably wouldn't be assigned an actual version number.
That having been said at the moment the version number 0 - 9 and 15 are reserved. So if we would need a new internet protocol tommorrow we'd have to call it the IPv10. But that shouldn't happen because the address space of IPv6 is so large.(24 votes)
- So does my IP address change when I take my laptop to a café or coworking space?(3 votes)
- There are two types of IP addresses. Within a LAN, each NIC can obtain one IP address. Now, when you're connected to the internet through a router, the router's IP address is used publicly. This is why IP bans will hit your whole network. To demonstrate this, go into Command Prompt, and type
ipconfig
. This should show you your IP address as far as your LAN is concerned. Then, go online and check what the internet thinks about your IP address.
Both of these change when you connect to a new network. It's very likely though that your home LAN IP will be maintained once you return home, and the router IP will be maintained unless your ISP gives you a new one.(8 votes)
- This lesson explains the IP address hierarchy regarding IPv4 addresses, but how does it work with the more current and popular IPv6 addresses?(5 votes)
- ipv6 just uses more bits (128) whereas ipv4 uses 32 so they just showed the simpler example.(4 votes)
- Talking about IP Addresses, what are VPNs for?(2 votes)
- A VPN (Virtual Private Network) is an encrypted connection over the Internet from a device to a network. The encrypted connection between your device and the network of interest is known as a "tunnel."
There are a number of VPN use cases. One common use case (I would encourage you to explore other use cases) is remote work. When an employee is working remotely, it is common for the employee to use a VPN to connect to the corporate network. Encrypting communication between the employee's device and the corporate network helps to keep sensitive data secure.(8 votes)
- Does an IP address reveal your location? In other words, is it based on your location?(4 votes)
- Yes, it's based on your location. Using geolocation you can generally track down the general area of the user location (and many sites do that). It's not 100% precise, because IPs get shuffled around a lot, but it's very close.
You can use a tool like
https://iplocation.com/
to see for yourself.(4 votes)
- Why is ir called IPv6 if there are 8 groups of 4 numbers?(3 votes)
- The 6 in IPv6 is the version of the IP address. It doesn't have anything to do with the numbers of the format.(5 votes)
- Who (or which devices) on the internet, store the IP addresses ?(3 votes)
- There is something on the internet called the host, or server. Whenever your computer needs to access another IP address, they request it from the server. The server has every IP address(2 votes)
- Comcost.. what does it mean pls ?(2 votes)
- Comcast is an (or rather the largest) american internet service provider (among other things).(4 votes)
- Under Splitting Octets, it states in one of the examples: "The first 16 bits could route to all of UMich, the next 2 bits could route to a specific UMich department, and the final 14 bits could route to individual computers." Do those bits actually "taper off" as they hit various routers and switches, or do those bits still stay part of the IP packet capsule until it reaches the destination computer? Maybe they were just using that to conceptualize it and I'm overthinking it.(3 votes)