IP Addressing
IP Addressing
IP Addressing
Computer Networks I
application
IP addressing
David.Villa@uclm.es
Outline
Introduction
Introduction Special addresses Classful addressing Private addresses Subneting VLSM Superneting Classless addressing CIDR
The IP address is a 32 bit integer. The address identifies a connection point (a NIC). IP addresses are universally unique. The addressing space is 232 = 4.294.967.296 A single host may have several interfaces and it must have an address per connected interface.
Computer Networks I
Computer Networks I
Introduction
Introduction
The IP address has two parts
The IP address is usually represented as a sequence of 4 decimal numbers (0-255) separated with dots.
161.67.136.169
NetID, identifies the network (designed by a global authority) IANA (Internet Assigned Number Authority) HostID, identifies a host inside the network.
host
Special addresses
0.0.0.0 11111111.11111111.11111111.11111111 XX ... XX XX ... XX 00 ... 00 01111111.X.X.X
Computer Networks I
Classful Addressing
There are 5 classes, recognized by the MSB bits.
1 2 3 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
0 10
This network All hosts in this network A host in this network Loopback: 127.0.0.1
6
Classful Addressing
Classes:
Private addresses
Some blocks are reserved for private addressing (privately administered). The packets with a private destination address must be not forwarded outside the network.
10.0.0.0
A: 231 addresses (50%) B: 230 addresses (25%) C: 229 addresses (12,5%) D: 2 addresses (6,25%) E: 228 addresses (6,25%)
28
- 10.255.255.255/8
(16.777.216 hosts in 1 block) (1.048.576 hosts in 16 blocks) (65.536 hosts in 256 blocks)
Computer Networks I
The IANA (Internet Assigned Numbers Authority) assignees address blocks. IANA depends on ICANN (Internet Corporation for Assigned Names and Numbers). i
IPv4 address block assignments in: http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml
Computer Networks I 8
172.16.0.0 - 172.31.255.255/12
192.168.0.0 - 192.168.255.255/16
http://xkcd.com/742/
9
Link-local addresses
Classful addressing
Network address (net id) The network address:
It is a method to auto-assign an IP address without DHCP or other external service. The host selects an address in the block 169.254/16 using a pseudo-random number. These address are valid only to communicate with neighbors (same physical or logical link). These are not routable address.
is the first address of its block. identifies the whole network from the Internet point of view.
From any host address it is possible to know its network address, class and address range of the block.
Computer Networks I
10
Computer Networks I
11
Classful addressing
Network mask
The mask is a 32-bit integer that determines the net-id.
network address = host address AND mask
161 67 38 13
Classful addressing
Network mask
Default masks for the three classes
A B C
0 255 255
0 0 255
0 0 0
It is a B class network
1010 0001 0100 0011 0010 0110 0000 1101 1111 1111 1111 1111 0000 0000 0000 0000 1010 0001 0100 0011 0000 0000 0000 0000
The mask is not required when we use classful addressing only. Other way to indicate mask is CIDR notation. Example: The mask 255.255.0.0 may be indicated like:
161.67.27.38 /16
Computer Networks I 13
Computer Networks I
12
Subnetting
Subnetting
Problem: The A and B class networks are underutilized. Solution: Divide them in smaller sub-networks. Part of the host id is used to identify the sub-net.
1 2 3 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
The number of subnets must be a power of 2. It may be applied to any not-used block. That is a local decision, taken by the administrator. It is not perceived from outside. Sample: Apply subnetting to the next network to obtain 4 blocks:
141.14.0.1 141.14.0.2 141.14.192.2 141.14.255.253 141.14.255.254
10
net id
sub-net id
host id
Red: 141.14.0.0
The scheme shows a 4-bit sub-net id. Therefore, there are 16 subnets with 212-2 hosts each.
Computer Networks I 14
141.14.201.4
Internet
Computer Networks I 15
Subnetting
141.14.0.1 141.14.0.2
sample (cont)
141.14.63.254 141.14.64.1 141.14.64.2 141.14.127.254
Subnetting
Subnet mask
With subnetting routing is not possible without a mask that defines the subnet. In the previous sample
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
141.14.88.9
10
net id
sub-net id
host id
Mask is
1111 1111 1111 1111 11 00 0000 0000 0000
141.14.167.20
Internet
141.14.201.4
Computer Networks I
16
Computer Networks I
17
Subnetting
Variable Length Subnet Mask (VLSM) Sample 1 Divide the C-class network 200.10.10.0 in 3 subnets with 120 and 2x60 hosts.
Subnet 0:
Net address: 200.10.10.0 /25 Holds 126 hosts Net address: 200.10.10.128 /26 Holds 62 hosts Net address: 200.10.10.192 /26 Holds 62 hosts
Computer Networks I
200.10.10.0/24: 200.10.10.0/24:
Subnet 1:
Subnet 2:
Computer Networks I
18
19
Supernetting
Problem: C-class network are too small. Solution: Aggregate small networks to get largest. Part of the net-id
is used to address hosts.
1 2 3 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
172.16.1.0/24
172.16.14.192/27 172.16.14.224/27
172.16.14.0/26
172.16.14.224/30
110 Requirements:
net id
host id
172.16.14.64/26
172.16
.14.22 8/
30
172.16.14.128/26
172.16.14.232/30
The numbers of blocks must be power of 2. The block must have continuous addressing. The third byte of the first address must be divisible by the number of blocks.
Computer Networks I 21
172.16.2.0/24
172.16.14.192/27
172.16.14.236/30
172.16.14.0/24
Computer Networks I
20
Supernetting
Super-net mask
Classless addressing
Classfull address is little flexible. Classless allows to define blocks of any size (power of 2). It is a generalization of subnetting. The same requirements are applied. The first address and the mask defines the block. Supernetting has no sense in classless addressing It implies routing problems, solved by CIDR.
Super-net mask
Sub-net mask
Computer Networks I
22
Computer Networks I
23
RFCs RFCs
References
CIDR is based in the definition of net-id prefix of any size. The first level assignment authority is IANA. There are 5 RIR (Regional Internet Registry) that spread addressing space among minor entities. CIDR uses VLSM to define arbitrary size sub-nets. With CIDR, the routers must change the way the use their routing tables, all address requires always a mask.
Computer Networks I 24
CISCO Systems. Inc. Gua del primer ao. CCNA 3 y 4.Cisco Press, 2003.
Chapter 2
Cited RFCs.
Computer Networks I 25