Ethernet
Capas IEEE dentro del modelo OSI
Los estándares para Ethernet (IEEE 802.3) especifican -mediante subcapas-
elementos que se encuentran en ubicados en las capas 1 y 2 del modelo OSI
IEEE
Nivel OSI Subcapa de Control de 802.2
ENLACE
Enlace Lógico (LLC)
7 Aplicación
6 Presentación Subcapa de Control de
Ethernet
Acceso al Medio (MAC)
5 Sesión
4 Transporte Subcapas de
FÍSICA
3 Red Señalización física
80
2 Enlace 2
.
Especificaciones
1 Física del medio
3
2
Capas del protocolo IEEE 802
El Comité IEEE 802 ha desarrollado una
arquitectura de protocolos, adoptada por otros.
Modelo de Referencia
Aplicación
IEEE 802
Presentación
Sesión Protocolos Puntos de
Acceso al
Transporte de la capas Servicio LLC
Red superiores (LSAP)
Control de Enlace
Enlace de Lógico-LLC
datos Control de Acceso Normas
al medio-MAC
IEEE802
Físico Físico
Medio de transmisión Medio de transmisión
3
Encapsulamiento del protocolo LAN
Datos de Aplicación
Cabecera
Datos de Aplicación
TCP
Cabecera Cabecera
Datos de Aplicación
IP TCP
Cabecera Cabecera Cabecera
Datos de Aplicación
LLC IP TCP
Cabecera Cabecera Cabecera Cabecera Parte final
Datos de Aplicación
MAC LLC IP TCP de MAC
Cola de
Cabecera de trama Datos de Aplicación
trama
4
Estándares IEEE 802
Comités de la serie IEEE 802
802.1 Interlace de Alto Nivel
802.2 Control de Enlace Lógico
803.3 CSMA / CD
802.4 Token-Passing Bus
802.5 Token-Passing Ring
802.6 Redes de Área Metropolitana
802.7 Grupo de Consejo Técnico de Broadband
802.8 Grupo de Consejo Técnico de Fibra Óptica
802.9 Redes de Voz y Datos Integrados
802.10 Seguridad en Redes
803.11 LAN’s sin cables
5
Estándares de IEEE vs. ISO / OSI
Referencia
Modelo OSI
802.1 Interfax de Alto Nivel
(Internet working) Red
802.2 Control de Enlace Lógico
802.3 802.4 802.5 802.6 Enlace de
Control de Control de Control de Control de Datos
Acceso al Acceso al Acceso al Acceso al
Medio Medio Medio Medio
DQDB
802.3 802.4 802.5 802.6 Física
Física Física Física Física
6
El sistema Ethernet
Elementos básicos
7
Formato de trama genérica
Longitud de los campos en bytes
D
A B C Datos E F
Campo de Dirección
Fin de Trama
Campo de Inicio
de Trama FCS
Campo de tipo Longitud
8
Frame Ethernet
PREAMBLE DEST SRC TYPE DATA FCS
(8) (6) (6) (2) (>46 <1500) (4)
• PREAMBLE: 8 octetos compuestos por 0 y 1 intercalados utilizados para
sincronizar una trama.
• DESTINATION ADDRESS: Dirección Ethernet hacia donde está dirigida la
trama.
• SOURCE ADDRESS: Dirección Ethernet desde donde se origina la trama.
• TYPE: Indica el protocolo del nivel superior. Los códigos están definidos en
estándares.
• DATA: Datos a transmitir. Debe superar los 46 bytes para que la trama no sea
considerada basura.
• FRAME CHECK SEQUENCE (FCS): CRC de 32 bits que controla la
integridad de todos los campos excepto PREAMBLE.
9
El preámbulo es una cadena de 1s y 0s, que finaliza con 11 para indicar el comienzo del campo de dirección de
destino. Los campos que conforman la trama son:
DA (Destination Address - Dirección de destino): contiene 48 bits que representan la dirección MAC del host
destino.
SA (Source Address - Dirección de origen): contiene 48 bits que representan la dirección MAC del host que envía
la trama.
Type (tipo): contiene el número "Ethertype" que indica el protocolo de capa superior que es encapsulado en la
porción de datos de la trama. Ejemplos de números Ethertype son:
Data (datos): contiene la información del protocolo de la capa superior. Si la información es menor a 46 bytes, se
rellena para alcanzar el tamaño mínimo de trama de 64 bytes (encabezado más datos).
FCS (Frame Check Sequence - control de secuencia de trama): contiene los datos del CRC (Cyclic Redundancy
Check) para verificar errores en la recepción de la trama.
El tamaño mínimo de una trama es 64 bytes y el máximo 1518. Cuando se calcula el tamaño de una trama no se
incluye el preámbulo. El formato de la trama Versión 2, sigue las siguientes especificaciones:
El tamaño mínimo de una trama es 6+6+2+46+4 = 64 bytes
El tamaño máximo de una trama es: 6+6+2+1500+4 = 1518 bytes
10
Antes de la especificación IEEE 802.3, Novell necesitaba un formato de trama para su protocolo
IPX que utilizaba su NOS. Novell avanzó con un formato de trama propio que trabaje en redes
CSMA/CD.
Los campos son los siguientes:
Preámbulo: exactamente el mismo que en el formato de trama de Ethernet Versión 2
DA: contiene la dirección MAC del destino
SA: contiene la dirección MAC del origen
Length (tamaño): contiene el tamaño del campo de datos (con valores desde 3 a 1500 bytes)
FCS: contiene la información de CRC
Las tramas Novell son las únicas donde el campo de datos comienza con FFFF en hexadecimal
(representaría el comienzo del encabezado del protocolo IPX).
11
La IEEE desarolló su estandard Ethernet en junio de 1983. Cambiaron el campo type (tipo) por el
campo lenght (tamaño) y agregaron la capa LLC (Logical Link Control - Control de enlace lógico).
La figura muestra el formato de la trama IEEE 802.3.
Los campos de la trama son los siguientes:
Preámbulo: La IEEE lo definió como una cadena de 7 bytes de longitud compuesta por 1s y 0s.
Delimitador de inicio de la trama (SFD - Start Frame Delimiter): 10101011
DA: Dirección MAC destino.
SA: Dirección MAC origen.
Length (tamaño): contiene el tamaño del LLC más el campo de datos. Estos valores están
comprendidos en un rango desde 3 a 1500 bytes.
Data (datos): contiene la información del protocolo de capa superior, como en los otros formatos
de trama.
FCS: contiene el CRC.
12
El problema que se ocasionó cuando la IEEE desarrolló su formato de trama fue que el
protocolo DIX Versión 2 ya se había estado usando por tres años. Para la transición de
un formato de trama a otro, se agregó el campo SNAP a la trama IEEE 802.3. El
campo SNAP incluye la información "Ethertype" usada en DIX Versión 2. La
figura muestra el formato de la trama IEEE 802.3 SNAP.
Todos los campos son similares a los de la trama IEEE 802.3. Adicionalmente se le
agrega el campo SNAP, que contiene dos campos. Los primeros tres bytes del campo
SNAP indentifican la organización (OUI), los dos bytes restantes identifican el protocolo
de capa superior con el campo "Ethertype" tal como lo hace Ethernet Versión 2
13
Operación
Ethernet
Broadcast Ethernet
A B C D
Aplicacion Aplicacion Aplicacion Aplicacion
Presentacion Presentacion Presentacion Presentacion
Sesion Sesion Sesion Sesion
Transporte Transporte Transporte Transporte
Red Red Red Red
Enlace de Datos Enlace de Datos Enlace de Datos Enlace de Datos
Fisica Fisica Fisica Fisica
14
Operación
Ethernet
A B C D
D
Aplicacion
Presentacion
Sesion
Transporte
Red
Enlace de Datos
Fisica
D ByC
Aplicacion Aplicacion
Presentacion Presentacion
Sesion Sesion
Transporte Transporte
Red Red
Enlace de Datos Enlace de Datos
Fisica Fisica 15
Sending and receiving Ethernet frames on a bus
1111 2222 3333 nnnn Abbreviated
MAC
Addresses
3333 1111
• When an Ethernet frame is sent out on the
“bus” all devices on the bus receive it.
• What do they do with it?
16
Sending and receiving Ethernet frames on a bus
Hey, that’s
Nope me! Nope
1111 2222 3333 nnnn Abbreviated
MAC
Addresses
3333 1111
• Each NIC card compares its own MAC address with
the Destination MAC Address.
• If it matches, it copies in the rest of the frame.
• If it does NOT match, it ignores the rest of the frame.
– Unless you are running a Sniffer program 17
Sending and receiving Ethernet frames on a bus
1111 2222 3333 nnnn Abbreviated
MAC
Addresses
• So, what happens when multiple computers try
to transmit at the same time?
18
Sending and receiving Ethernet frames on a bus
1111 2222 3333 nnnn Abbreviated
MAC
Addresses
Collision!
19
Access Methods
Two common types of access methods for LANs include
• Non-Deterministic: Contention methods (Ethernet, IEEE 802.3)
– Only one signal can be on a network segment at one time.
– Collisions are a normal occurrence on an Ethernet/802.3 LAN
• Deterministic: Token Passing (Token Ring)
20
•
CSMA/CD and Collisions
Hey, that’s
Nope me! Nope
1111 2222 3333 nnnn Abbreviated
MAC
Addresses
Notice the
location of
the DA!
3333 1111
21
• Sending and receiving Ethernet frames via a hub
3333 1111
1111
? 2222
• So, what does a
hub do when it
receives
information?
5555
• Remember, a hub
is nothing more
than a multiport
3333 4444
repeater. 22
• Sending and receiving Ethernet frames via a hub
Hub or
23
• Sending and receiving Ethernet frames via a hub
3333 1111
• The hub will flood it out all ports
1111 2222 except for the incoming port.
Nope • Hub is a layer 1 device.
• A hub does NOT look at layer 2
addresses, so it is fast in
transmitting data.
• Disadvantage with hubs: A hub
5555 or series of hubs is a single
Nope collision domain.
• A collision will occur if any two
or more devices transmit at the
same time within the collision
domain.
3333 For me! 4444 Nope 24
• Sending and receiving Ethernet frames via a hub
2222 1111
1111 2222
For me!
• Another disadvantage
with hubs is that is
take up unnecessary
bandwidth on other
links.
5555
Nope
Wasted
bandwidth
3333 Nope 4444 Nope 25
•
Sending and receiving Ethernet frames via a switch
26
• Sending and receiving Ethernet frames via a switch
Source Address Table
Port Source MAC Add. Port Source MAC Add.
3333 1111
• Switches are also known as
switch learning bridges or learning
switches.
• A switch has a source address
table in cache (RAM) where it
stores source MAC address after it
learns about them.
• A switch receives an Ethernet
frame it searches the source
address table for the Destination
1111 3333 MAC address.
• If it finds a match, it filters the
Abbreviated frame by only sending it out that
MAC
addresses port.
2222 4444 • If there is not a match if floods it
out all ports. 27
• No Destination Address in table, Flood
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111
3333 1111
• How does it learn source
switch
MAC addresses?
• First, the switch will see
if the SA (1111) is in it’s
table.
• If it is, it resets the timer
1111 3333 (more in a moment).
Abbreviated • If it is NOT in the table
MAC
addresses it adds it, with the port
2222 4444 number. 28
• Destination Address in table, Filter
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
1111 3333
• Now 3333 sends data back to
switch 1111.
• The switch sees if it has the
SA stored.
• It does NOT so it adds it.
(This will help next time
1111 sends to 3333.)
1111 3333 • Next, it checks the DA and
in our case it can filter the
Abbreviated
MAC frame, by sending it only out
addresses
port 1.
2222 4444
29
• Destination Address in table, Filter
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
3333 1111
switch
1111 3333
• Now, because both MAC addresses
are in the switch’s table, any
information exchanged between 1111
and 3333 can be sent (filtered) out the
appropriate port.
1111 3333
• What happens when two devices
Abbreviated
send to same destination?
MAC • What if this was a hub?
addresses • Where is (are) the collision
2222 4444 domain(s) in this example?
30
• No Collisions in Switch, Buffering
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
3333 1111
9 4444
switch
3333 4444
• Unlike a hub, a collision does
NOT occur, which would cause
the two PCs to have to retransmit
the frames.
• Instead the switch buffers the
1111 3333 frames and sends them out port #6
one at a time.
Abbreviated • The sending PCs have no idea that
MAC
addresses their was another PC wanting to
2222 4444
send to the same destination.
31
• Collision Domains
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
3333 1111
9 4444
Collision Domains
switch
3333 4444
• When there is only one device on a
switch port, the collision domain is
only between the PC and the
switch.
• With a full-duplex PC and switch
1111 3333 port, there will be no collision,
since the devices and the medium
Abbreviated can send and receive at the same
MAC
addresses
time.
2222 4444
32
• Other Information
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
9 4444 • How long are addresses kept in the
Source Address Table?
switch – 5 minutes is common on most
vendor switches.
• How do computers know the
Destination MAC address?
• ARP Caches and ARP Requests
• How many addresses can be kept
in the table?
– Depends on the size of the cache,
1111 3333 but 1,024 addresses is common.
Abbreviated • What about Layer 2 broadcasts?
MAC – Layer 2 broadcasts (DA = all 1’s)
addresses
is flooded out all ports.
2222 4444
33
•
What happens here?
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
1111 3333
1 2222 1 3333
• Notice the
Source
Address Table
has multiple
entries for port
#1.
3333
1111 2222 5555
34
•
What happens here?
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
1111 3333
1 2222 1 5555
• The switch filters the
frame out port #1.
• But the hub is only a
layer 1 device, so it
floods it out all ports.
• Where is the collision
domain?
3333
1111 2222 5555
35
•
What happens here?
Source Address Table
Port Source MAC Add. Port Source MAC Add.
1 1111 6 3333
1111 3333
1 2222 1 5555
Collision Domain
3333
1111 2222 5555
36
Transmisión de frames (otra versión)
Send Frame
Diferir entre (0 y 2k)*512 bit times
donde k=N, k=<10
N := 0 Diferir Seleccione un entero
(R*512 bit times) aleatorio R := (0 y 2k)
¿Carrier Ocupado
Diferir K := N K := 10
“Gap” entre Sense?
frames Desocupado N=<10
Espere 96 bit times N>10
¿N=<10?
Transmitir Incrementa contador
Frame de intentos N<15
N=15
Sí N=?
Transmitir
¿Colisión? N++
JAM de 4 bytes
No
FIN. Demasiados intentos
O.K. 37
Recepción de un frame (10 Mbps y 100 Mbps)
Frame ¿Es para NO No se recibe más el frame
que llega esta
y se desocupa el buffer
estación?
(Si la dirección MAC es igual SÍ
a la propia ó es de broadcast)
¿tiene SÍ SÍ Frame bueno
¿CRC
al menos se pasa al protocolo de
válido?
512 bits? la capa superior
NO NO ¿Termina Error
SÍ
alineado a de
Frame demasiado corto 8 bits? CRC
NO
Frame Error
descartado de
alineamiento
38
Recepción de un frame (otra versión)
Receive Frame
Carrier detectado
¿Comienzo No Espere el byte ...10101011
Longitud >= 64 bytes? de frame?
Longitud =< 1518 bytes?
Número de bytes entero? Sí
CRC = OK? ¿CRC y Error
tamaño Incremente la cuenta
O.K.? de errores
OK
Dirección es la local?
Dirección de broadcast? ¿Es para No
esta
Direción multicast?
estación?
Descartar el frame
Sí
Pasar a la capa superior 39
Confiabilidad
Ethernet
A B C D
Figura 1
A B C D
Figura 2
40
Confiabilidad
Ethernet
A B C D
Colisión
A B C D
JAM JAM JAM JAM JAM JAM
41
Confiabilidad
Ethernet
A B C D
Colisión
A B C D
JAM JAM JAM JAM JAM JAM
•Carrier sense multiple access with collision detection
(CSMA/CD)
42