You are on page 1of 4

Version Mar 14, 2011

Computer Networks I

application

transport network link physical

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.

But it may be represented as a binary sequence: 10100001.01000011.10001000.10101001


subnet
32 bits
Computer Networks I 4 Computer Networks I 5

host

Special addresses
0.0.0.0 11111111.11111111.11111111.11111111 XX ... XX XX ... XX 00 ... 00 01111111.X.X.X
Computer Networks I

RFC RFC 3330 3330

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

RFC RFC 791 791

This host (any interface)


All hosts: 255.255.255.255

0 10

net id net id net id

host id host id host id

A class B class C class D class E class


7

00 ... 00 11 ... 11 XX ... XX

This network All hosts in this network A host in this network Loopback: 127.0.0.1
6

110 1110 1111

multicast groups reserved for future use


Computer Networks I

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

RFC RFC 1918 1918

A: 231 addresses (50%) B: 230 addresses (25%) C: 229 addresses (12,5%) D: 2 addresses (6,25%) E: 228 addresses (6,25%)
28

1.0.0.0 128.0.0.0 192.0.0.0 224.0.0.0 240.0.0.0 -

127.255.255.255 191.255.255.255 223.255.255.255 239.255.255.255 255.255.255.255

- 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

RFC RFC 3927 3927

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

255 255 255

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:

mask network address

161.67.27.38 /16
Computer Networks I 13

Computer Networks I

12

Subnetting

RFC RFC 950 950

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

n bits -> 2 subnet

RFC RFC 1878 1878

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

Conventional B-class network

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

Subnet: 141.14.0.0/18 X.X.0000 0000.0


141.14.44.12

Subnet: 141.14.64.0/18 X.X.0100 0000.0

141.14.88.9

141.14.198.24 141.14.128.1 141.14.128.2 141.14.191.254 141.14.192.1 141.14.192.2 141.14.255.254

10

net id
sub-net id

host id

Subnet: 141.14.128.0/18 X.X.1000 0000.0

Subnet: 141.14.192.0/18 X.X.1100 0000.0

Mask is
1111 1111 1111 1111 11 00 0000 0000 0000

B-class network divided In 4 subnets

141.14.167.20

Internet

141.14.201.4

Computer Networks I

16

Computer Networks I

17

Subnetting

Variable Length Subnet Mask (VLSM)


If the mask has a fixed size, all the subnets are the same size. This is a big issue because in many situations we need very small blocks. The serial links require only 2 IP address!! VLSM allows to apply subnetting in a nested way VLSM requires specific support from dynamic routing protocols. RIPv1 y GRP does not support VSLM, while RIPv2, OSPF and EIGRP do.

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:

200.10.10.0/25 200.10.10.0/25 200.10.10.128/25 200.10.10.128/25


Subnet 1:

200.10.10.128/26 200.10.10.128/26 200.10.10.192/26 200.10.10.192/26

Subnet 2:

Computer Networks I

18

19

Variable Length Subnet Mask (VLSM) Sample 2


Divide the network 172.16.14.0/24 to get 8 subnet with several sizes.

Supernetting

RFC RFC 1338 1338

172.16.14.0/26 172.16.14.64/26 172.16.14.128/26 172.16.14.192/26

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.224/30 172.16.14.228/30 172.16.14.232/30 172.16.14.236/30 172.16.14.240/30 172.16.14.244/30 172.16.14.248/30 172.16.14.252/30

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

It requires a net mask to make routing possible.


1111 1111 1111 1111 1111 1 000 0000 0000
Supernetting
C-class default mask
- 3 bits

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

1111 1111 1111 1111 1111 1111 0000 0000


Subnetting
+ 3 bits

Sub-net mask

1111 1111 1111 1111 1111 1111 111 0 0000

Computer Networks I

22

Computer Networks I

23

Classless Inter-Domain Routing (CIDR)

1518 a 1518 a 1520 1520

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

B.F. Transmisin de datos y redes de comunicaciones, cuarta edicin 2007.

Chapter 19 Pages 438 - 444 Chapter 5 and Section 6.6

A.S. Redes de computadores. Pearson Educacin, Cuarta edicin, 2003.

Behrouz A. Forouzan. TCP/IP Protocol Suite. McGraw-Hill, 2003.

CISCO Systems. Inc. Gua del primer ao. CCNA 3 y 4.Cisco Press, 2003.

Chapter 2

Cited RFCs.
Computer Networks I 25

You might also like