See this page as a slide show
IP Addresses (IPv4)
Format
An IPv4 (as opposed to the newer IPv6) IP address is
a 32-bit quantity which represents a host on the internet.
It is usually represented as four numbers,
each 0–255, separated by dots. For example:
198.51.100.146
- There are 232 (~4.2 billion) IP addresses.
- This is a ridiculously large number.
- We’re running out.
Grouping
- It is often useful to group IP addresses.
- For example, Hewlett-Packard owns all the 15.whatever IP addresses.
- And all the 16.whatever addresses.
- That’s nearly 1% of all IP addresses! 🐷
- Yeah, well, the DoD owns nearly five percent of all IP addresses!! 🐷🐷🐷🐷🐷
- What notation shall we use, other than “whatever”?
Old-Fashioned Classful Addresses
How address ranges used to be allocated
Class | Pattern | Networks | Hosts/network | Addresses |
A | 0nnnnnnn hhhhhhhh hhhhhhhh hhhhhhhh | 27 | 224 (~16 million) | 0–127.whatever |
B | 10nnnnnn nnnnnnnn hhhhhhhh hhhhhhhh | 214 | 216 (65536) | 128–191.whatever |
C | 110nnnnn nnnnnnnn nnnnnnnn hhhhhhhh | 221 | 28 (256) | 192–223.whatever |
- Class A: IBM (380,000 employees in 2016)
or the U.S. Postal Service (639,789 employees in 2017)
- Class B: CSU (33,198 students in 2016)
- Class C: Jack’s house (20 hosts in 2017)
List of assigned class A networks
Classful no good
- Originally, three classes:
- Problem
- Classes too rigid (C too small, B too big)
- Solution
- Rather than having only three possibilities:
- 8-bit class A network
- 16-bit class B network
- 24-bit class C network
- Have a variable-sized network. 8 bits, 13 bits, 28 bits, whatever.
Masking
- Consider a small business that has been allocated the addresses
198.51.100.0 – 198.51.100.255.
- First 24 bits are the Network ID (the neighborhood)
- Last 8 bits are Host ID (the street address)
- Netmask: FFFFFF0016
(11111111 11111111 11111111 000000002)
- The 1 bits represent the network
- The 0 bits represent the host
- All the 1 bits in the subnet mask are on the left
- What a stupid system!
- Still used by some Linux networking commands
CIDR
- Subnet masks are old-fashioned.
- Use CIDR (Classless Inter-Domain Routing) instead.
- prefix/length
- 198.51.100/24 (omit trailing zero bytes)
- 198.51.100.0/24 (also ok)
- 198.51.100.42/24 (don’t do this)
- Does not have to be on byte boundaries.
- 198.51.100.128/27 is acceptable.
- Represents addresses 198.51.100.128 through 198.51.100.159.
- How many hosts is that?
Special classes of addresses
$ host denver
$ host tuba
Host tuba not found: 3(NXDOMAIN)
There are several special categories of addresses, including:
- Reserved for documentation:
192.0.2/24, 198.51.100/24, 203.0.113/24
- Reserved for CSU: 129.82/16
- Reserved for CSU CS: 129.82.44/23
- Reserved for private use:
10/8, 172.16/12, 192.168/16
- Our CSB 315 lab uses 192.168.110/24, which is a subset of 192.168/16.
- CS Dept. printers use 10/8. Hence, only our subnet can access them!
I’m sorry that CSU addresses begin with 129, which is so similar
to the 192 that begins one form of private networks.
Stupid IP Address Tricks
These all work in my browser:
http://www.cs.colostate.edu
http://%77%77%77%2e%63%73%2e%63%6f%6c%6f%73%74%61%74%65%2e%65%64%75
http://129.82.45.114
http://0x81.0x52.0x2d.0x72
http://0201.0122.055.0162
http://2169646450
http://0x81522d72
http://020124426562