14.11.2014 Views

Direccionamiento IP :: Redes ::

Direccionamiento IP :: Redes ::

Direccionamiento IP :: Redes ::

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Versión 28/02/11<br />

:: <strong>Redes</strong> ::<br />

aplicación<br />

transporte<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

red<br />

enlace<br />

física<br />

<strong>Direccionamiento</strong> <strong>IP</strong><br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 1


Contenidos<br />

<strong>Direccionamiento</strong> con clases<br />

Subnetting<br />

● VLSM<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Supernetting<br />

<strong>Direccionamiento</strong> sin clases<br />

CIDR<br />

Resumen de rutas (Summarizing)<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 2


Dirección <strong>IP</strong><br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

La dirección <strong>IP</strong> es un número de 32 bits e identifica el punto de<br />

conexión (la interfaz) entre un host y una red. El espacio de<br />

direccionamiento es 2 32 = 4.294.967.296<br />

Un host con conexiones a varias redes debe tener (al menos) una<br />

dirección <strong>IP</strong> por cada interfaz.<br />

La dirección <strong>IP</strong> tiene dos partes:<br />

●<br />

●<br />

Un NetID, que identifica una red (designado por una autoridad global),<br />

la IANA (Internet Assigned Number Authority)<br />

Un HostID, que identifica un host dentro de esa red.<br />

subred<br />

32 bits<br />

host<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 3


Direcciones <strong>IP</strong> especiales<br />

00000000.00000000.00000000.00000000<br />

Este host<br />

11111111.11111111.11111111.11111111 Todos los hosts de esta red<br />

XX ... XX<br />

00 ... 00<br />

Esa red<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

XX ... XX<br />

11 ... 11<br />

Todos los host de esa red<br />

00 ... 00 XX ... XX Un host de esta red<br />

01111111.00000000.00000000.00000001 iface loopback<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 4


<strong>Direccionamiento</strong> con clase (classful addressing)<br />

Hay 5 clases, que se reconocen por los bits más significativos:<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 />

Clase A (2 7 -3 redes)<br />

10 net id<br />

host id Clase B (2 14 -16 redes)<br />

110 net id<br />

host id Clase C (2 21 -256 redes)<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

1110 dirección multicast<br />

Clase D<br />

1111 reservado uso futuro<br />

Clase E<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 5


:: <strong>Direccionamiento</strong> ::<br />

<strong>Direccionamiento</strong> con clase (classful addressing)<br />

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

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

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

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

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

RFC<br />

3330<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Rangos para direccionamiento privado. Los paquetes cuyo destino sea una<br />

dirección <strong>IP</strong> privada no pueden atravesar ningún enrutador.<br />

RFC<br />

10.0.0.0 - 10.255.255.255/8 (16.777.216 hosts en 1 bloque)<br />

1918<br />

172.16.0.0 - 172.31.255.255/12 (1.048.576 hosts en 16 bloques)<br />

192.168.0.0 - 192.168.255.255/16 (65.536 hosts en 256 bloques)<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 6


<strong>Direccionamiento</strong> con clase<br />

direcciones de red (net id)<br />

Las direcciones de red tienen varias propiedades:<br />

●<br />

●<br />

●<br />

Es la primera dirección de cada bloque<br />

Identifica a toda una red desde el punto de vista de internet<br />

Dada una dirección de red se puede averiguar la clase a la<br />

que pertenece, el bloque (net id) y el rango de direcciones en<br />

ese bloque<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 7


Una máscara es un número de 32 bits tal que al hacer un<br />

AND con una dirección <strong>IP</strong> dada obtenemos la dirección de<br />

red que le corresponde.<br />

es de clase B<br />

<strong>Direccionamiento</strong> con clase<br />

máscara de red<br />

161 67 38 13<br />

1010 0001<br />

0100 0011 0010 0110 0000 1101<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

máscara 1111 1111 1111 1111 0000 0000 0000 0000<br />

dirección de red 1010 0001 0100 0011 0000 0000 0000 0000<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 8


<strong>Direccionamiento</strong> con clase<br />

máscara de red<br />

Máscaras por defecto para las tres clases<br />

A<br />

B<br />

C<br />

255 0 0 0<br />

255 255 0 0<br />

255 255 255 0<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Si se utiliza estrictamente el esquema de direccionamiento<br />

con clases las máscaras no son necesarias.<br />

La máscara 255.255.0.0 se puede indicar también así:<br />

●<br />

161.67.27.38 /16 (Se denomina notación CIDR)<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 9


Subnetting<br />

RFC<br />

950<br />

Problema: Las redes de clase A y B están infrautilizadas.<br />

Solución: Se dividen en “sub-redes” más pequeñas. Se utiliza<br />

parte del sufijo (host id) como identificador de la sub-red.<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 />

RFC<br />

1878<br />

n bits -> 2 n subredes<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

sub-net id<br />

El esquema de la figura utiliza un “sub-net id” de 4 bits, de modo<br />

que se dispone de 16 sub-redes con 2 12 -2 hosts cada una.<br />

El esquema de sub-redes lo decide el administrador de la red.<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 10


Subnetting<br />

El número de sub-redes siempre debe ser una potencia de 2.<br />

Se puede aplicar a cualquier bloque (red o subred) que no se esté<br />

utilizando.<br />

Es una decisión del diseño local, es transparente desde Internet.<br />

Ejemplo: Aplicar subnetting a la siguiente red para conseguir 4 bloques<br />

iguales:<br />

141.14.0.1 141.14.0.2 141.14.192.2<br />

141.14.255.253 141.14.255.254<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Red: 141.14.0.0<br />

Red clase B convencional<br />

141.14.201.4<br />

Internet<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 11


Subnetting :: ejemplo (cont)<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 />

Sub-red: 141.14.0.0/18<br />

Sub-red: 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 />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Sub-red: 141.14.128.0/18<br />

Sub-red: 141.14.192.0/18<br />

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

Red clase B subdividida<br />

en 4 sub-redes<br />

141.14.167.20<br />

Internet<br />

141.14.201.4<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 12


Subnetting<br />

Máscara de la sub-red<br />

Para poder realizar un enrutado efectivo es necesario<br />

definir la máscara de la sub-red.<br />

Para el ejemplo anterior:<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 />

host id<br />

3<br />

0 1<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

●<br />

sub-net id<br />

La máscara es:<br />

1111 1111 1111 1111 11 00 0000 0000 0000<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 13


Cuando se utiliza una máscara de subred de tamaño fijo, todas las<br />

subredes deben tener el mismo tamaño.<br />

Esto supone un gran desperdicio de direcciones cuando se necesitan<br />

bloques pequeños, p.ej. enlaces serie (que sólo necesitan dos<br />

direcciones)<br />

Subnetting<br />

Variable Length Subnet Mask (VLSM)<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

VLSM permite aplicar subnetting de forma anidada.<br />

VLSM requiere soporte de los protocolos de enrutamiento dinámico.<br />

R<strong>IP</strong>v1 y GRP mientras que R<strong>IP</strong>v2, OSPF y EIGRP sí lo soportan<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 14


Variable Length Subnet Mask (VLSM)<br />

(Ejemplo 1)<br />

Supongamos que hay que dividir la red de clase C 200.10.10.0<br />

en tres subredes de 120, 60 y 60 hosts.<br />

Subred 0:<br />

● Dirección: 200.10.10.0 /25<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

200.10.10.0/24:<br />

● Permite 126 hosts<br />

200.10.10.0/24:<br />

● Permite 62 hosts<br />

Subred 1:<br />

● Dirección: 200.10.10.128 /26<br />

● Permite 62 hosts<br />

Subred 2:<br />

● Dirección: 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 />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 15


172.16.1.0/24 172.16.2.0/24<br />

Variable Length Subnet Mask (VLSM)<br />

(Ejemplo 2)<br />

Subdividimos la subred 172.16.14.0/24 para conseguir 8 subredes de<br />

distintos tamaños:<br />

172.16.14.0/26<br />

172.16.14.64/26<br />

172.16.14.128/26<br />

172.16.14.192/26<br />

●<br />

172.16.14.192/27<br />

172.16.14.0/26<br />

172.16.14.224/30<br />

●<br />

172.16.14.224/27<br />

•<br />

172.16.14.224/30<br />

172.16.14.64/26<br />

172.16.14.228/30<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

•<br />

172.16.14.228/30<br />

•<br />

172.16.14.232/30<br />

•<br />

172.16.14.236/30<br />

•<br />

172.16.14.240/30<br />

•<br />

172.16.14.244/30<br />

•<br />

172.16.14.248/30<br />

•<br />

172.16.14.252/30<br />

172.16.14.128/26<br />

172.16.14.232/30<br />

172.16.14.192/27<br />

172.16.14.236/30<br />

172.16.14.0/24<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 16


Supernetting<br />

RFC<br />

1338<br />

Problema: Nadie quiere las redes de clase C porque son demasiado<br />

pequeñas.<br />

Solución: Se agregan para formar “super-redes” más grandes. Se<br />

utiliza parte del prefijo (net id) para direccionar 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 />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Requisitos:<br />

● El número de bloques agregados debe ser potencia de 2.<br />

●<br />

●<br />

Los bloques deben tener direccionamiento contiguo.<br />

El tercer byte de la primera dirección debe ser divisible por el nº de<br />

bloques.<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 17


Supernetting :: Máscara de la super-red<br />

En este caso también es obligatorio disponer de la máscara<br />

para saber a que rango de bloques afecta la super-red<br />

Máscara de super-red<br />

1111 1111 1111 1111 1111 1 000<br />

0000 0000<br />

Supernetting<br />

- 3 bits<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

Máscara por defecto<br />

para una red clase C<br />

Máscara de sub-red<br />

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

Subnetting<br />

1111 1111 1111 1111 1111 1111 1110<br />

0000<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 18<br />

+ 3 bits


<strong>Direccionamiento</strong> sin clases (classless addressing)<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

El direccionamiento con clases (classfull) es poco flexible.<br />

Classless permite definir bloques de direcciones de cualquier tamaño (que<br />

sea potencia de 2).<br />

La primera dirección debe ser divisible por el número de direcciones en el<br />

bloque.<br />

La primera dirección y la máscara definen cada bloque.<br />

Una organización puede hacer subnetting dentro de su bloque. Sin<br />

embargo no tiene sentido aplicar supernetting con classless addressing.<br />

El direccionamiento sin clases plantea problemas de rutado, que<br />

soluciona el CIDR.<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 19


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

RFCs<br />

1518 a<br />

1520<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

CIDR se basa en la definición de prefijos de cualquier tamaño que se<br />

van asignando de forma arbórea, por distintas entidades.<br />

La entidad “asignadora” de primer nivel es IANA. en el segundo nivel<br />

hay 5 RIR (Regional Internet Registry) que a su vez reparten el<br />

espacio de direccionamiento entre otras entidades menores.<br />

CIDR utiliza VLSM para definir subredes de forma arbitraria.<br />

Las subredes se pueden agregar con las reglas habituales para<br />

formar “super-redes”.<br />

Con CIDR, los enrutadores deben cambiar la forma en la que<br />

manejan sus tablas de rutas, puesto que las direcciones destino de<br />

los paquetes no son “auto-contenidas”, como sí ocurría en classfull.<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 20


CIDR :: Resumen de rutas<br />

El resumen (o agregación) de rutas permite a los encaminadores CIDR<br />

simplificar sus tablas de rutas.<br />

target mask next hop iface<br />

200.10.8.0 22 200.10.0.2 S1<br />

...<br />

200.10.8.0/24<br />

S1: 200.10.10.1/30<br />

E0<br />

E1<br />

200.10.9.0/24<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

S1: 200.10.10.2/30<br />

target mask next hop iface<br />

200.10.8.0 24 - E0<br />

200.10.9.0 24 - E1<br />

200.10.10. 24 - E2<br />

200.10.11. 0 24 - E3<br />

... 0<br />

200.10.11.0/24<br />

200.10.10.0/24<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 21<br />

E3<br />

E2


Referencias<br />

Se recomienda repasar y profundizar el contenido de este tema utilizando (al<br />

menos) la siguiente bibliografía básica:<br />

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

● Sección 19.1<br />

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

● Pág 438 - 444<br />

<strong>Redes</strong> : : <strong>Direccionamiento</strong> <strong>IP</strong><br />

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

● Capítulo 5 y Sección 6.6<br />

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

● Capítulo 2<br />

RFCs citadas a lo largo del tema.<br />

David Villa :: http://www.inf-cr.uclm.es/www/dvilla/ 22

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

Saved successfully!

Ooh no, something went wrong!