Outline. Introduction. Computer Networks I. IP addressing

Version Mar 14, 2011 Computer Networks I application transport network link IP addressing physical [email protected] Outline ● ● ● ● ● ● ● ● ...
Author: Vernon Benson
1 downloads 0 Views 334KB Size
Version Mar 14, 2011

Computer Networks I

application

transport network link

IP addressing

physical

[email protected]

Outline ● ● ● ● ● ● ● ●

Introduction Special addresses Classful addressing Private addresses Subneting VLSM Superneting Classless addressing ● CIDR

Computer Networks I

2

Introduction ●

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

3

Introduction ●

The IP address is usually represented as a sequence of 4 decimal numbers (0-255) separated with dots.

161.67.136.169 ●

But it may be represented as a binary sequence: 10100001.01000011.10001000.10101001

Computer Networks I

4

Introduction The IP address has two parts ●



NetID, identifies the network (designed by a global authority) IANA (Internet Assigned Number Authority) HostID, identifies a host inside the network.

subnet

host 32 bits

Computer Networks I

5

Special addresses

RFC RFC 3330 3330

0.0.0.0

This host (any interface)

11111111.11111111.11111111.11111111

All hosts: 255.255.255.255

XX ... XX

00 ... 00

This network

XX ... XX

11 ... 11

All hosts in this network

00 ... 00

XX ... XX

A host in this network

01111111.X.X.X Computer Networks I

Loopback: 127.0.0.1 6

Classful Addressing

RFC RFC 791 791

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

A class

host id

net id

host id

net id

110

net id

host id

B class C class

1110

multicast groups

D class

1111

reserved for future use

E class

Computer Networks I

7

Classful Addressing Classes: ●

A: 231 addresses (50%) 30

1.0.0.0 -

127.255.255.255



B: 2 addresses (25%)

128.0.0.0 -

191.255.255.255



C: 229 addresses (12,5%)





192.0.0.0 -

223.255.255.255

28

224.0.0.0 -

239.255.255.255

28

240.0.0.0 -

255.255.255.255

D: 2 addresses (6,25%) E: 2 addresses (6,25%)

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

Private addresses

RFC RFC 1918 1918

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 ●

- 10.255.255.255/8

(16.777.216 hosts in 1 block)

172.16.0.0 - 172.31.255.255/12 ●

(1.048.576 hosts in 16 blocks)

192.168.0.0 - 192.168.255.255/16 ●

(65.536 hosts in 256 blocks) Computer Networks I

http://xkcd.com/742/ 9

Link-local addresses ●







RFC RFC 3927 3927

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.

Computer Networks I

10

Classful addressing Network address (net id) The network 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

11

Classful addressing Network mask

The mask is a 32-bit integer that determines the net-id. network address = host address AND mask 161

i

It is a B class network

67

38

13

1010 0001 0100 0011 0010 0110 0000 1101

mask

1111 1111 1111 1111 0000 0000 0000 0000

network address

1010 0001 0100 0011 0000 0000 0000 0000

Computer Networks I

12

Classful addressing Network mask

Default masks for the three classes A

255

0

0

0

B

255

255

0

0

C

255

255

255

0



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

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

10

net id

host id

i

RFC RFC 1878 1878

n bits -> 2n subnet

sub-net id



The scheme shows a 4-bit sub-net id. Therefore, there are 16 subnets with 212-2 hosts each. Computer Networks I

14

Subnetting ●

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

Red: 141.14.0.0

Conventional B-class network

141.14.192.2

141.14.255.253

141.14.255.254

141.14.201.4

Internet Computer Networks I

15

Subnetting

sample (cont) 141.14.0.1 141.14.0.2

141.14.63.254

141.14.64.1 141.14.64.2

141.14.127.254

Subnet: 141.14.64.0/18 X.X.0100 0000.0

Subnet: 141.14.0.0/18 X.X.0000 0000.0

141.14.88.9

141.14.44.12 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

Subnet: 141.14.192.0/18 X.X.1100 0000.0

Subnet: 141.14.128.0/18 X.X.1000 0000.0

B-class network divided In 4 subnets

141.14.167.20

Internet

141.14.201.4

Computer Networks I

16

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

10

net id

host id

sub-net id ●

Mask is 1111 1111 1111 1111 11 00 0000 0000 0000

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.

Computer Networks I

18

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

Subnet 1: ● ●



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

Net address: 200.10.10.128 /26

●● ●●

Holds 62 hosts

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

Subnet 2: ●

Net address: 200.10.10.192 /26



Holds 62 hosts Computer Networks I

19

Variable Length Subnet Mask (VLSM) Sample 2 Divide the network 172.16.14.0/24 to get 8 subnet with several sizes. 172.16.14.0/26



172.16.14.64/26



172.16.14.128/26



172.16.14.192/26 ●

172.16.14.192/27



172.16.14.224/27 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.128/26

172.16.14.192/27

172.16.14.224/30

172.16

.14.22 8/3

0

172.16.14.232/30

172.16.14.236/30

172.16.14.0/24 Computer Networks I

172.16.2.0/24



172.16.14.0/26

172.16.1.0/24



20

RFC RFC 1338 1338

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

110

net id

host id

Requirements: ●

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

Supernetting Super-net mask ●

It requires a net mask to make routing possible.

Super-net mask

1111 1111 1111 1111 1111 1 000 0000 0000 Supernetting

C-class default mask

1111 1111 1111 1111 1111 1111 0000 0000 Subnetting

Sub-net mask

- 3 bits

+ 3 bits

1111 1111 1111 1111 1111 1111 111 0 0000

Computer Networks I

22

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.

Computer Networks I

23

RFC RFCss

Classless Inter-Domain Routing (CIDR) ●







1518 1518aa 1520 1520

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

References ●

B.F. Transmisión de datos y redes de comunicaciones, cuarta edición 2007. ●



A.S. Redes de computadores. Pearson Educación, Cuarta edición, 2003. ●



Chapter 5 and Section 6.6

CISCO Systems. Inc. Guía del primer año. CCNA 3 y 4.Cisco Press, 2003. ●



Pages 438 - 444

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



Chapter 19

Chapter 2

Cited RFCs. Computer Networks I

25

Suggest Documents