IP Addressing¶
Slides: http://www.cs.put.poznan.pl/ksiek/naps/ip/
A short and inaccurate history of the Internet¶

- Prehistory
- the telegraph
- processor linking
- time-sharing terminals
- telephone exchange
- dedicated networks
Interface Message Processor (IMP) subnets
- packet switching
- Advanced Research Projects Agency Network (ARPANET), 1967
- National Physics Laboratory (NPL), 1970
- Internetworking, intercompatibility
- CYCLADES, 1973
Internet Assigned Number Authority (IANA), 1972
Transmission Control Protocol (TCP), 1974, (DARPA)
Dynamic Name Server (DNS), 1984
USENET, 1984
World Wide Web (WWW), 1991
The need for standarization:
For each of these three terminals, I had three different sets of user commands. So if I was talking online with someone at S.D.C. and I wanted to talk to someone I knew at Berkeley or M.I.T. about this, I had to get up from the S.D.C. terminal, go over and log into the other terminal and get in touch with them...
I said, oh man, it’s obvious what to do: If you have these three terminals, there ought to be one terminal that goes anywhere you want to go where you have interactive computing. That idea is the ARPAnet.
Robert Taylor. An Internet Pioneer Ponders the Next Revolution. The New York Times. 20 XII 1999.
Internet Protocol addressing¶
What is a protocol?
The problem:
- How to send data to a device in a network.
- How to send data to a specific device in a network.
IP address¶
- A sequence of 32 bits (4 bytes)
- Example:
11000000 01110000 01001100 00000011
Dotted decimal representation¶
The binary notation is unwieldy, so the dotted decimal representation is usually used:
- 4 single-byte dot-separated segments, and
- each byte is represented as a single decimal number in the domain.
What is the range of values in each segment?
What is the dotted decimal representation of the example 11000000 01110000 01001100 00000011
?
(sub)Network addresses¶

The anatomy of an IP address¶
A sequence of 32 bits (4 bytes)
- Hirearchical—has two parts:
- network part—the address of a network in which the computer is located (the leading part)
- computer part—the address of the computer within the network (the final part)
Example:
11000000 01110000 01001100 00000011
- network part:
11000000 01110000
(2B) - computer part:
01001100 00000011
(2B)
- network part:
Special addresses: network address¶
A network address is a special IP address whose computer part is zeroed (consists only of zeroes). This is the address that represents the network, without reference to any computers in the network.
Examples:
assuming 2B network part, 2B computer part:
150.254.0.0 → 1001011011111110000000000000000
assuming 3B network part, 1B computer part:
192.168.1.0 → 11000000101010000000000100000000
assuming 30b network part, 2b computer part:
10.0.1.12 → 0000101000000000000000100001100
Special addresses: broadcast address¶
A broadcast address* is a special IP address whose computer part consists only of ones. This address represents all the computers in the network. For instance, a message sent to a broadcast address will be received by all the computers in the network.
Examples:
assuming 2B network part, 2B computer part:
150.254.255.255 → 10010110111111101111111111111111
assuming 3B network part, 1B computer part:
192.168.1.255 → 11000000101010000000000111111111
assuming 30b network part, 2b computer part:
10.0.1.15 → 0000101000000000000000100001111
IP address masking¶
The information about where the division lies between the network part and the computer part can be denoted as. A functional IP address should always contain this information.
- 150.254.255.255/16
- 192.168.1.255/24
- 10.0.1.15/30
/n indicates that the network part is n-bits long.
This represents a mask.
150.254.255.255/16
→10010110111111101111111111111111
11111111111111110000000000000000
→150.254.255.255 255.255.0.0
Calculating a network address¶
The mask can “hide” the computer address in an IP address and derive the network address. This is done by AND
-ing the IP address with its mask.
For example:
Computer address:
150.150.10.10/16
Mask (from
/16
):255.255.0.0
Binary representation:
10010110100101100000101000001010
11111111111111110000000000000000
Network address:
10010110100101100000101000001010
AND
11111111111111110000000000000000
=10010110100101100000000000000000
Dotted decimal represenation of the network address:
150.150.0.0/16
Calculating the addressing range¶
How many computers can there be in a network?
Remember that the broadcast address and the network address are “taken.”
Example:
Sieć:
150.150.0.0/16
10010110 10010110 00000000 00000000
150.150.0.0
network address 10010110 10010110 00000000 00000001
150.150.0.1
address of computer no 1 10010110 10010110 00000000 00000010
150.150.0.2
address of computer no 2 ... ... 10010110 10010110 11111111 11111110
150.150.255.254
address of last computer in the network 10010110 10010110 11111111 11111111
150.150.255.255
broadcast address address range:
150.150.0.1
–150.150.255.254
the number of computers that can be addressed in this network: \(2^{16} - 2\)
Public address registration¶
Addressing in the Internet needs to meet two requirements:
unique network address – public address registration: regional institutions controlled by IANA regulate assigning IP networks:
- ICANN / IANA
- RIPE, etc.
unique computer address within network – job of the network administrator
RIR service regions¶

Classful allocation (largely obsolete)¶
Initially the only mask possible was 16. This was inefficient and dropped fast.
Classful addressing divided address space into classes:
- A class - big networks, most significant bit
0
, min. mask /8
- B class - medium, most significant bits
10
, min.mask/16
- C class - small, most significant bits
110
, min. mask/24
- D class - multicast,
1110
- E class - reserved (now given away)
- A class - big networks, most significant bit
Since its discontinuation, remnants of classful network concepts remain in practice only in limited scope in the default configuration parameters of some network software and hardware components (e.g., default subnet mask).
- Reserved addresses:
127.0.0.0/8
– loopback192.0.2.0/24
– example (TEST-NET)
Private addresses¶
Motivation:
- Not all addresses need to be unique
- Small allocation space of IPv4
- Network Address Translation (NAT)
Private address: no registration, not routable in the Internet.
10.0.0.0/8
(old class A)172.16.0.0/12
(old class B)192.168.0.0/16
(old class C)
Exercises¶
- Display your IP address (Linux
ip address
, Windowsipconfig
). - Calculate number of ones in the mask and the network address.
- Give a formula for the number of computers in a network with a known mask length (
n
). - Calculate computer range and broadcast address for
150.150.64.0 255.255.192.0
- Display your computer’s IP address and mask (
ipconfig``on Windows, ``ip addr
on Linux). What is:- the address of your computer
- the network mask
- the network address of the network the computer is in
- the broadcast address of the network the computer is in
- Is your computer inside a private network?
- Let
/n
be the network mask of some network. Provide a general formula to count the number of computers that can have addresses within that network. - What is the range of addresses and the broadcast address of a network with the address:
150.150.64.0
and mask255.255.192.0
. - How many computers can have addresses within class A, B, and C?