28.01.2015 Views

Computer Networks I IP addressing

Computer Networks I IP addressing

Computer Networks I IP addressing

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Version Mar 14, 2011<br />

<strong>Computer</strong> <strong>Networks</strong> I<br />

application<br />

transport<br />

network<br />

<strong>IP</strong> <strong>addressing</strong><br />

link<br />

physical<br />

David.Villa@uclm.es


<strong>Computer</strong> <strong>Networks</strong> I 2<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

Introduction<br />

Special addresses<br />

Classful <strong>addressing</strong><br />

Private addresses<br />

Subneting<br />

VLSM<br />

Superneting<br />

Classless <strong>addressing</strong><br />

●<br />

CIDR<br />

Outline


<strong>Computer</strong> <strong>Networks</strong> I 3<br />

Introduction<br />

●<br />

●<br />

●<br />

The <strong>IP</strong> address is a 32 bit integer.<br />

The address identifies a connection point (a NIC).<br />

<strong>IP</strong> addresses are universally unique.<br />

● The <strong>addressing</strong> space is 2 32 = 4.294.967.296<br />

●<br />

A single host may have several interfaces and it<br />

must have an address per connected interface.


<strong>Computer</strong> <strong>Networks</strong> I 4<br />

Introduction<br />

●<br />

The <strong>IP</strong> address is usually represented as a<br />

sequence of 4 decimal numbers (0-255) separated<br />

with dots.<br />

161.67.136.169<br />

●<br />

But it may be represented as a binary sequence:<br />

10100001.01000011.10001000.10101001


<strong>Computer</strong> <strong>Networks</strong> I 5<br />

Introduction<br />

The <strong>IP</strong> address has two parts<br />

●<br />

●<br />

NetID, identifies the network (designed by a<br />

global authority) IANA (Internet Assigned<br />

Number Authority)<br />

HostID, identifies a host inside the network.<br />

subnet<br />

host<br />

32 bits


<strong>Computer</strong> <strong>Networks</strong> I 6<br />

Special addresses<br />

RFC<br />

3330<br />

0.0.0.0<br />

This host (any interface)<br />

11111111.11111111.11111111.11111111 All hosts: 255.255.255.255<br />

XX ... XX<br />

00 ... 00<br />

This network<br />

XX ... XX<br />

11 ... 11<br />

All hosts in this network<br />

00 ... 00 XX ... XX A host in this network<br />

01111111.X.X.X Loopback: 127.0.0.1


<strong>Computer</strong> <strong>Networks</strong> I 7<br />

Classful Addressing<br />

There are 5 classes, recognized by the MSB bits.<br />

RFC<br />

791<br />

0<br />

0 1 2 3 4 5 6 7 8 9<br />

1<br />

0 1 2 3 4 5 6 7 8 9<br />

2<br />

0 1 2 3 4 5 6 7 8 9<br />

3<br />

0 1<br />

0 net id<br />

host id<br />

A class<br />

10 net id<br />

host id B class<br />

110 net id<br />

host id C class<br />

1110 multicast groups<br />

D class<br />

1111 reserved for future use E class


<strong>Computer</strong> <strong>Networks</strong> I 8<br />

Classful Addressing<br />

Classes:<br />

●<br />

A: 2 31 addresses (50%) 1.0.0.0 - 127.255.255.255<br />

●<br />

B: 2 30 addresses (25%) 128.0.0.0 - 191.255.255.255<br />

●<br />

C: 2 29 addresses (12,5%) 192.0.0.0 - 223.255.255.255<br />

●<br />

D: 2 28 addresses (6,25%) 224.0.0.0 - 239.255.255.255<br />

●<br />

E: 2 28 addresses (6,25%) 240.0.0.0 - 255.255.255.255<br />

The IANA (Internet Assigned Numbers Authority) assignees address<br />

blocks. IANA depends on ICANN (Internet Corporation for Assigned<br />

Names and Numbers).<br />

i<br />

<strong>IP</strong>v4 address block assignments in:<br />

http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml


Private addresses<br />

RFC<br />

1918<br />

Some blocks are reserved for private <strong>addressing</strong> (privately<br />

administered). The packets with a private destination<br />

address must be not forwarded<br />

outside the network.<br />

10.0.0.0 -10.255.255.255/8<br />

●<br />

(16.777.216 hosts in 1 block)<br />

172.16.0.0 - 172.31.255.255/12<br />

●<br />

(1.048.576 hosts in 16 blocks)<br />

192.168.0.0 - 192.168.255.255/16<br />

●<br />

(65.536 hosts in 256 blocks)<br />

http://xkcd.com/742/<br />

<strong>Computer</strong> <strong>Networks</strong> I 9


<strong>Computer</strong> <strong>Networks</strong> I 10<br />

Link-local addresses<br />

RFC<br />

3927<br />

●<br />

It is a method to auto-assign an <strong>IP</strong> address without<br />

DHCP or other external service.<br />

●<br />

The host selects an address in the block<br />

169.254/16 using a pseudo-random number.<br />

●<br />

●<br />

These address are valid only to communicate with<br />

neighbors (same physical or logical link).<br />

These are not routable address.


<strong>Computer</strong> <strong>Networks</strong> I 11<br />

Classful <strong>addressing</strong><br />

Network address (net id)<br />

The network address:<br />

●<br />

●<br />

is the first address of its block.<br />

identifies the whole network from the Internet point<br />

of view.<br />

From any host address it is possible to know its<br />

network address, class and address range of the<br />

block.


<strong>Computer</strong> <strong>Networks</strong> I 12<br />

Classful <strong>addressing</strong><br />

Network mask<br />

The mask is a 32-bit integer that determines the net-id.<br />

network address = host address AND mask<br />

i<br />

It is a B class network<br />

161 67 38 13<br />

1010 0001<br />

0100 0011 0010 0110 0000 1101<br />

mask<br />

1111 1111 1111 1111 0000 0000 0000 0000<br />

network address<br />

1010 0001 0100 0011 0000 0000<br />

0000 0000


<strong>Computer</strong> <strong>Networks</strong> I 13<br />

Classful <strong>addressing</strong><br />

Network mask<br />

Default masks for the three classes<br />

A<br />

B<br />

C<br />

255 0 0 0<br />

255 255 0 0<br />

255 255 255 0<br />

●<br />

●<br />

●<br />

The mask is not required when we use classful <strong>addressing</strong> only.<br />

Other way to indicate mask is “CIDR notation”.<br />

Example: The mask 255.255.0.0 may be indicated like:<br />

● 161.67.27.38 /16


<strong>Computer</strong> <strong>Networks</strong> I 14<br />

Subnetting<br />

RFC<br />

950<br />

●<br />

●<br />

Problem: The A and B class networks are underutilized.<br />

Solution: Divide them in smaller sub-networks. Part of the host id<br />

is used to identify the sub-net.<br />

0<br />

0 1 2 3 4 5 6 7 8 9<br />

10 net id<br />

1<br />

0 1 2 3 4 5 6 7 8 9<br />

2<br />

0 1 2 3 4 5 6 7 8 9<br />

host id<br />

3<br />

0 1<br />

i<br />

RFC<br />

1878<br />

n bits -> 2 n subnet<br />

sub-net id<br />

● The scheme shows a 4-bit sub-net id. Therefore, there are 16<br />

subnets with 2 12 -2 hosts each.


<strong>Computer</strong> <strong>Networks</strong> I 15<br />

Subnetting<br />

●<br />

The number of subnets must be a power of 2.<br />

●<br />

●<br />

●<br />

It may be applied to any not-used block.<br />

That is a local decision, taken by the administrator. It is not perceived from<br />

outside.<br />

Sample: Apply subnetting to the next network to obtain 4 blocks:<br />

141.14.0.1 141.14.0.2 141.14.192.2<br />

141.14.255.253 141.14.255.254<br />

Red: 141.14.0.0<br />

141.14.201.4<br />

Conventional B-class network<br />

Internet


Subnetting<br />

sample (cont)<br />

<strong>Computer</strong> <strong>Networks</strong> I 16<br />

141.14.0.1 141.14.0.2<br />

141.14.63.254 141.14.64.1 141.14.64.2<br />

141.14.127.254<br />

Subnet: 141.14.0.0/18<br />

Subnet: 141.14.64.0/18<br />

X.X.0000 0000.0 X.X.0100 0000.0<br />

141.14.44.12<br />

141.14.88.9<br />

141.14.198.24<br />

141.14.128.1 141.14.128.2<br />

141.14.191.254<br />

141.14.192.1 141.14.192.2<br />

141.14.255.254<br />

Subnet: 141.14.128.0/18<br />

Subnet: 141.14.192.0/18<br />

X.X.1000 0000.0 X.X.1100 0000.0<br />

B-class network divided<br />

In 4 subnets<br />

141.14.167.20<br />

Internet<br />

141.14.201.4


Subnetting<br />

Subnet mask<br />

<strong>Computer</strong> <strong>Networks</strong> I 17<br />

●<br />

With subnetting routing is not possible without a mask that<br />

defines the subnet.<br />

● In the previous sample<br />

host id<br />

0<br />

1<br />

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9<br />

10 net id<br />

2<br />

0 1 2 3 4 5 6 7 8 9<br />

3<br />

0 1<br />

sub-net id<br />

●<br />

Mask is<br />

1111 1111 1111 1111 11 00 0000 0000 0000


Subnetting<br />

Variable Length Subnet Mask (VLSM)<br />

<strong>Computer</strong> <strong>Networks</strong> I 18<br />

●<br />

●<br />

●<br />

●<br />

If the mask has a fixed size, all the subnets are the same size.<br />

This is a big issue because in many situations we need very<br />

small blocks. The serial links require only 2 <strong>IP</strong> address!!<br />

VLSM allows to apply subnetting in a nested way<br />

VLSM requires specific support from dynamic routing<br />

protocols. R<strong>IP</strong>v1 y GRP does not support VSLM, while R<strong>IP</strong>v2,<br />

OSPF and EIGRP do.


Variable Length Subnet Mask (VLSM)<br />

Sample 1<br />

Divide the C-class network 200.10.10.0 in 3 subnets<br />

with 120 and 2x60 hosts.<br />

●<br />

Subnet 0:<br />

200.10.10.0/24:<br />

● Net address: 200.10.10.0 /25<br />

200.10.10.0/24:<br />

● Holds 62 hosts<br />

● Holds 126 hosts<br />

● Subnet 1:<br />

● Net address: 200.10.10.128 /26<br />

● Holds 62 hosts<br />

● Subnet 2:<br />

● Net address: 200.10.10.192 /26<br />

● 200.10.10.0/25<br />

● 200.10.10.128/25<br />

● 200.10.10.128/26<br />

● 200.10.10.192/26<br />

<strong>Computer</strong> <strong>Networks</strong> I 19


Variable Length Subnet Mask (VLSM)<br />

Sample 2<br />

<strong>Computer</strong> <strong>Networks</strong> I 20<br />

172.16.1.0/24 172.16.2.0/24<br />

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

●<br />

172.16.14.0/26<br />

●<br />

172.16.14.64/26<br />

●<br />

172.16.14.128/26<br />

●<br />

172.16.14.192/26<br />

●<br />

172.16.14.192/27<br />

●<br />

172.16.14.224/27<br />

– 172.16.14.224/30<br />

– 172.16.14.228/30<br />

– 172.16.14.232/30<br />

– 172.16.14.236/30<br />

– 172.16.14.240/30<br />

– 172.16.14.244/30<br />

– 172.16.14.248/30<br />

– 172.16.14.252/30<br />

172.16.14.0/26<br />

172.16.14.64/26<br />

172.16.14.128/26<br />

172.16.14.192/27<br />

172.16.14.224/30<br />

172.16.14.228/30<br />

172.16.14.232/30<br />

172.16.14.236/30<br />

172.16.14.0/24


<strong>Computer</strong> <strong>Networks</strong> I 21<br />

Supernetting<br />

RFC<br />

1338<br />

●<br />

●<br />

Problem: C-class network are too small.<br />

Solution: Aggregate small networks to get largest. Part of the net-id<br />

is used to address hosts.<br />

0<br />

0 1 2 3 4 5 6 7 8 9<br />

1<br />

0 1 2 3 4 5 6 7 8 9<br />

2<br />

0 1 2 3 4 5 6 7 8 9<br />

3<br />

0 1<br />

110 net id<br />

host id<br />

Requirements:<br />

● The numbers of blocks must be power of 2.<br />

●<br />

●<br />

The block must have continuous <strong>addressing</strong>.<br />

The third byte of the first address must be divisible by the number of<br />

blocks.


Supernetting<br />

Super-net mask<br />

<strong>Computer</strong> <strong>Networks</strong> I 22<br />

●<br />

It requires a net mask to make routing possible.<br />

Super-net mask<br />

1111 1111 1111 1111 1111 1 000<br />

0000 0000<br />

Supernetting<br />

- 3 bits<br />

C-class default mask<br />

1111 1111 1111 1111 1111 1111 0000 0000<br />

Subnetting<br />

+ 3 bits<br />

Sub-net mask<br />

1111 1111 1111 1111 1111 1111 1110<br />

0000


<strong>Computer</strong> <strong>Networks</strong> I 23<br />

Classless <strong>addressing</strong><br />

●<br />

Classfull address is little flexible.<br />

● Classless allows to define blocks of any size (power of 2).<br />

●<br />

●<br />

●<br />

●<br />

It is a generalization of subnetting. The same<br />

requirements are applied.<br />

The first address and the mask defines the block.<br />

Supernetting has no sense in classless <strong>addressing</strong><br />

It implies routing problems, solved by CIDR.


<strong>Computer</strong> <strong>Networks</strong> I 24<br />

Classless Inter-Domain Routing (CIDR)<br />

RFCs<br />

1518 a<br />

1520<br />

●<br />

●<br />

●<br />

●<br />

CIDR is based in the definition of net-id prefix of<br />

any size.<br />

The first level assignment authority is IANA. There<br />

are 5 RIR (Regional Internet Registry) that spread<br />

<strong>addressing</strong> space among minor entities.<br />

CIDR uses VLSM to define arbitrary size sub-nets.<br />

With CIDR, the routers must change the way the<br />

use their routing tables, all address requires<br />

always a mask.


<strong>Computer</strong> <strong>Networks</strong> I 25<br />

References<br />

●<br />

B.F. Transmisión de datos y redes de comunicaciones, cuarta edición<br />

2007.<br />

●<br />

Chapter 19<br />

●<br />

A.S. Redes de computadores. Pearson Educación, Cuarta edición, 2003.<br />

●<br />

Pages 438 - 444<br />

●<br />

Behrouz A. Forouzan. TCP/<strong>IP</strong> Protocol Suite. McGraw-Hill, 2003.<br />

●<br />

Chapter 5 and Section 6.6<br />

●<br />

CISCO Systems. Inc. Guía del primer año. CCNA 3 y 4.Cisco Press,<br />

2003.<br />

●<br />

Chapter 2<br />

●<br />

Cited RFCs.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!