Zodiac FX + faucet: tráfico intercambiado entre controlador y switch
Una vez instalado el controlador faucet en la raspberry pi vamos a analizar el tráfico intercambiado entre el controlador y el switch. Puedes instalarlo siguiendo estas instrucciones.
- Paquete OFPT_HELLO
- Paquete OFTP_FEATURES_REQUEST/REPLY
- Paquete OFPT_ECHO_REQUEST/REPLY
- Paquete OFPT_MULTIPART_REQUEST/REPLY
- Tablas Faucet
- Paquete OFPT_FLOW_MOD
- Comando: OFPFC_DELETE
- Comando: OFPFC_ADD
- Paquete OFPT_PACKET_IN
Al arrancar el controlador se ve como se abre una conexión TCP desde el switch 10.0.1.99 hacia el controlador instalado en la raspberry pi (10.0.1.8:6633) y comienza el intercambio de mensajes openflow, véanse paquetes 19, 20 y 22:
Paquete OFPT_HELLO
Inicialmente el switch envía paque OFPT_HELLO:
Y el controlador le contesta con OFPT_HELLO, fijando como número inicial de secuencia al valor Transaction ID: 3420126300
:
Paquete OFPT_FEATURES_REQUEST/REPLY
El controlador envía el switch una solicitud de las características OFPT_FEATURES_REQUEST que tiene el switch, con número de secuencia el siguiente al fijado en el mensaje anterior Transaction ID: 3420126301
:
El switch le envía su información al controlador OFPT_FEATURES_REPLY, en particular su datapath_id: 0x000070b3d56cd74c
que debe coincidir con el que hemos configurado en el fichero faucet.yaml
e indica las características propias que implementa el switch, por ejemplo tiene 10 tablas:
Paquete OFPT_ECHO_REQUEST/REPLY
El switch tiene configura el envío de mensajes echo request OFPT_ECHO_REQUEST cada 3 segundos al controlador, éste respondera con echo reply OFPT_ECHO_REPLY:
Paquete OFPT_MULTIPART_REQUEST/REPLY
Para obtener información de los puertos del switch el controlador envía un mensaje OFPT_MULTIPART_REQUEST solicitando información de los puertos (OFPMP_PORT_DESC):
El switch contesta en el mesnsaje OFPT_MULTIPART_REPLY con la información OFPMP_PORT_DESC de los 3 puertos que tiene y la información de cada uno de ellos:
Tablas en Faucet
Una vez que un paquete entra en un switch viaja a través de una serie de tablas comprobando qué regla aplicar en función de si cumple la condición, en cuyo caso, tendrá que ejecutar la instrucción asociada.
+----------+
+--->-----------------------+ +---> | IPv4_FIB |--->-------+
| | | +----------+ |
+---^--+ +-----+ +---v-----+ | +----v----+ +-------+
+-> | VLAN | ---> | ACL | ---> | ETH_SRC | ---|---------------------> | ETH_DST | ---> | FLOOD |
| +------+ +-----+ +---------+ | +----^----+ +-------+
| | +----------+ |
| +---> | IPv6_FIB |--->-------+
Entrada +----------+
de
paquetes
A continuación el controlador va a gestionar las tablas 0-7 de Faucet:
- Tabla 0: PORT ACL
- Tabla 1: VLAN: entrada de los paquetes al controlador faucet. Descarta paquetes que no deberían ser procesadods por los switches. Contiene entradas para evitar spoofing a través del control de las direcciones MAC. Si es necesario añade etiquetas VLAN y reenvía a la tabla ACL o ETH_SRC.
- Tabla 2: VLAN ACL
- Tabla 3: ETH_SRC: registra las direcciones Ethernet aprendidas.
- Tabla 4/5: IPV4_FIB/IPv6_FIB: añade rutas IPv4/IPv6. Se pueden configurar a través de la configuración VLAN de Faucet o a través de BGP.
- Tabla 6: ETH_DST: si se conoce el destino se envía a través del puerto aprendido. Si no se conoce se realiza inundación. Tiene en cuenta si se ha configurado algún puerto como mirror.
- Tabla 7: FLOOD: realiza la inundación teniendo en cuenta las VLAN y los puertos mirror.
Paquete OFPT_FLOW_MOD
La gestión de las tablas se realiza a través de mensajes OFPT_FLOW_MOD:
Primero envía el mensaje que incluye el comando OFPFC_DELETE, para borrar el contenido de esa tabla. Por ejemplo para la tabla 1:
A continuación se crea un flujo para cada una de las tablas con prioridad 0 sin reglas y sin acciones, a través del comando OFPFC_ADD. Por ejemplo, para la tabla 1:
Se instalan determinadas reglas con el comando OFPFC_ADD, por ejemplo en la tabla 1 se establece que con prioridad 9099 que para el campo ETH_SRC=ff:ff:ff:ff:ff:ff, no se establece ninguna acción, por tanto la acción es descartar:
En la tabla 6 con el comando OFPFC_ADD se instala una regla con prioridad 9000 para reenviar el paquete a la tabla 7.
En la tabla 7 con el comando OFPFC_ADD se instala una regla para los paquetes recibidos por el puerto 2 y etiqueta VLAN=100 se reenvíen sin etiqueta por los puertso 1 y 3.
Después de que el controlador le hay enviado los paquetes de inicialización de flujos, el switch tendrá el siguiente contenido en sus tablas:
La información en las tablas de faucet queda configurada en las tablas de flujos del switch. Por ejemplo, vamos a ver como después de haber arrancado el controlador y éste haya contactado con el switch, ambos tienen información similar:
Tabla 0: PORT ACL
La tabla 0 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 30 | 9099 | 1 | GOTO TABLE 1 | Paquete | Todos los paquetes recibidos en puerto 1 pasan a tabla 1 | |||||
0 | 32 | 9099 | 2 | GOTO TABLE 1 | Paquete | Todos los paquetes recibidos en puerto 2 pasan a tabla 1 | |||||
0 | 34 | 9099 | 3 | GOTO TABLE 1 | Paquete | Todos los paquetes recibidos en puerto 3 pasan a tabla 1 | |||||
0 | 2 | 0 | Nome (DROP) | Paquete | Descartar paquetes |
A continuación se muestra los flujos detallados que proporciona la información del switch:
Flow 30
Match:
In Port: 1
Attributes:
Table ID: 0 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Goto Table: 1
Flow 32
Match:
In Port: 2
Attributes:
Table ID: 0 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Goto Table: 1
Flow 34
Match:
In Port: 3
Attributes:
Table ID: 0 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Goto Table: 1
Flow 2
Match:
Attributes:
Table ID: 0 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 1: VLAN
La tabla 1 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFLow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
1 | 9 | 9099 | ff:ff:ff:ff:ff:ff | None (DROP) | Paquete | Descartar dirección ethernet origen=broadcast | ||||
1 | 11 | 9099 | 01:80:c2:00:00:00 | None (DROP) | Paquete | Descartar STP BPDU | ||||
1 | 12 | 9099 | 01:00:0c:cc:cc:cd | None (DROP) | Paquete | Descartar STP BPDU | ||||
1 | 13 | 9099 | 35020 | None (DROP) | Paquete | Descartar LLDP | ||||
1 | 10 | 9001 | 0e:00:00:00:00:01 | None (DROP) | Paquete | FAUCET_MAC=0e:00:00:00:00:01, descartar spoofing. | ||||
1 | 31 | 9000 | 1 | PUSH VLAN tag=100, Goto Table=3 | Paquete | Añade etiqueta vlan=100 y reenvía a tabla 3. | ||||
1 | 33 | 9000 | 2 | PUSH VLAN tag=100, Goto Table=3 | Paquete | Añade etiqueta vlan=100 y reenvía a tabla 3. | ||||
1 | 35 | 9000 | 3 | PUSH VLAN tag=100, Goto Table=3 | Paquete | Añade etiqueta vlan=100 y reenvía a tabla 3. | ||||
1 | 1 | 0 | None (DROP) | Paquete | Descartar paquetes |
A continuación se muestran los flujos detallados que proporciona la información del switch:
Flow 9
Match:
Source MAC: FF:FF:FF:FF:FF:FF
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Flow 11
Match:
Destination MAC: 01:80:C2:00:00:00
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Flow 12
Match:
Destination MAC: 01:00:0C:CC:CC:CD
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Flow 13
Match:
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9099 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Flow 10
Match:
Source MAC: 0E:00:00:00:00:01
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9001 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Flow 31
Match:
In Port: 1
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Push VLAN tag
Set VLAN ID: 100
Goto Table: 3
Flow 33
Match:
In Port: 2
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Push VLAN tag
Set VLAN ID: 100
Goto Table: 3
Flow 35
Match:
In Port: 3
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Push VLAN tag
Set VLAN ID: 100
Goto Table: 3
Flow 1
Match:
Attributes:
Table ID: 1 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 2: VLAN ACL
La tabla 2 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
2 | 3 | 0 | None (DROP) | Paquete | Descartar paquetes |
A continuación se muestran los flujos detallados que proporciona la información del switch:
Flow 3
Match:
Attributes:
Table ID: 2 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 3: ETH_SRC
La tabla 3 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
3 | 36 | 9000 | CONTROLLER, Goto Table=6 | Paquete | Envía paquete IN_PACKET a controlador y reenvía a la tabla 6 | |||||
3 | 4 | 0 | None (DROP) | Paquete | Descartar paquetes |
La tabla 3 en el switch
Flow 36
Match:
Attributes:
Table ID: 3 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Output: CONTROLLER
Goto Table: 6
Flow 4
Match:
Attributes:
Table ID: 3 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 4: IPv4_FIB
La tabla 4 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFLow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
4 | 5 | 0 | None (DROP) | Paquete | Descartar paquetes |
A continuación se muestran los flujos detallados que proporciona la información del switch:
Flow 5
Match:
Attributes:
Table ID: 4 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 5: IPv6_FIB
La tabla 5 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
5 | 6 | 0 | None (DROP) | Paquete | Descartar paquetes |
A continuación se muestran los flujos detallados que proporciona la información del switch:
Flow 6
Match:
Attributes:
Table ID: 5 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 6: ETH_DST
La tabla 6 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
6 | 14 | 9000 | GOTO_TABLE:7 | Paquete | Ir a la tabla de inundación para destinos no conocidos | |||||
6 | 7 | 0 | None (DROP) | Paquete | Descartar paquetes |
A continuación se muestran los flujos detallados que proporciona la información del switch:
Flow 14
Match:
Attributes:
Table ID: 6 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Goto Table: 7
Flow 7
Match:
Attributes:
Table ID: 6 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Tabla 7: FLOOD
La tabla 7 en el switch contiene la siguiente información:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
7 | 27 | 9008 | ff:ff:ff:ff:ff:ff | 100 | 1 | "POP_VLAN", "OUTPUT:2", "OUTPUT:3" | Paquete | Broadcast, reenviar por puertos 2 y 3 | ||
7 | 28 | 9008 | ff:ff:ff:ff:ff:ff | 100 | 2 | "POP_VLAN", "OUTPUT:1", "OUTPUT:3" | Paquete | Broadcast, reenviar por puertos 1 y 3 | ||
7 | 29 | 9008 | ff:ff:ff:ff:ff:ff | 100 | 3 | "POP_VLAN", "OUTPUT:1", "OUTPUT:2" | Paquete | Broadcast, reenviar por puertos 1 y 2 | ||
7 | 24 | 9006 | 33:33:00:00:00:00/ff:ff:00:00:00:00 | 100 | 1 | "POP_VLAN", "OUTPUT:2", "OUTPUT:3" | Paquete | Multicast IPv6 ND, reenviar por puertos 2 y 3 | ||
7 | 25 | 9006 | 33:33:00:00:00:00/ff:ff:00:00:00:00 | 100 | 2 | "POP_VLAN", "OUTPUT:1", "OUTPUT:3" | Paquete | Multicast IPv6 ND, reenviar por puertos 1 y 3 | ||
7 | 26 | 9006 | 33:33:00:00:00:00/ff:ff:00:00:00:00 | 100 | 3 | "POP_VLAN", "OUTPUT:1", "OUTPUT:2" | Paquete | Multicast IPv6 ND, reenviar por puertos 1 y 2 | ||
7 | 21 | 9004 | 01:00:5e:00:00:00/ ff:ff:ff:00:00:00 | 100 | 1 | "POP_VLAN", "OUTPUT:2", "OUTPUT:3" | Paquete | Cualquier dirección que comience por 01:00:5e:::__ (máscara ff:ff:ff:00:00:00) y con etiqueta VLAN=100 es de IPv4 multicast y se reenvía por tofos los puertos | ||
7 | 22 | 9004 | 01:00:5e:00:00:00/ ff:ff:ff:00:00:00 | 100 | 2 | "POP_VLAN", "OUTPUT:1", "OUTPUT:3" | Paquete | |||
7 | 23 | 9004 | 01:00:5e:00:00:00/ ff:ff:ff:00:00:00 | 100 | 3 | "POP_VLAN", "OUTPUT:1", "OUTPUT:2" | Paquete | |||
7 | 18 | 9002 | 01:80:c2:00:00:00/ ff:ff:ff:00:00:00 | 100 | 1 | "POP_VLAN", "OUTPUT:2", "OUTPUT:3" | Paquete | Cualquier dirección que comience por 01:80:c2:::__ (máscara ff:ff:ff:00:00:00) y con etiqueta VLAN=100 es una dirección de grupo para otros protocolos diferentes de IP se reenvía por tofos los puertos sin etiqueta | ||
7 | 19 | 9002 | 01:80:c2:00:00:00/ ff:ff:ff:00:00:00 | 100 | 2 | "POP_VLAN", "OUTPUT:1", "OUTPUT:3" | Paquete | |||
7 | 20 | 9002 | 01:80:c2:00:00:00/ ff:ff:ff:00:00:00 | 100 | 3 | "POP_VLAN", "OUTPUT:1", "OUTPUT:2" | Paquete | |||
7 | 15 | 9000 | 100 | 1 | "POP_VLAN", "OUTPUT:2", "OUTPUT:3" | Paquete | cualquier paquete con etiqueta VLAN=100 se reenvía por el resto de puertos | |||
7 | 16 | 9000 | 100 | 2 | "POP_VLAN", "OUTPUT:1", "OUTPUT:3" | Paquete | ||||
7 | 17 | 9000 | 100 | 3 | "POP_VLAN", "OUTPUT:1", "OUTPUT:2" | Paquete | ||||
7 | 8 | 0 | None (DROP) | Paquete | Descartar paquetes |
A continuación se muestran los flujos detallados que proporciona la información del switch:
Flow 27
Match:
In Port: 1
Destination MAC: FF:FF:FF:FF:FF:FF
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9008 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 2
Output Port: 3
Flow 28
Match:
In Port: 2
Destination MAC: FF:FF:FF:FF:FF:FF
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9008 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 3
Flow 29
Match:
In Port: 3
Destination MAC: FF:FF:FF:FF:FF:FF
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9008 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 2
Flow 24
Match:
In Port: 1
Destination MAC: 33:33:00:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9006 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 2
Output Port: 3
Flow 25
Match:
In Port: 2
Destination MAC: 33:33:00:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9006 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 3
Flow 26
Match:
In Port: 3
Destination MAC: 33:33:00:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9006 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 2
Flow 21
Match:
In Port: 1
Destination MAC: 01:00:5E:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9004 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 2
Output Port: 3
Flow 22
Match:
In Port: 2
Destination MAC: 01:00:5E:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9004 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 3
Flow 23
Match:
In Port: 3
Destination MAC: 01:00:5E:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9004 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 2
Flow 18
Match:
In Port: 1
Destination MAC: 01:80:C2:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9002 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 2
Output Port: 3
Flow 19
Match:
In Port: 2
Destination MAC: 01:80:C2:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9002 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 3
Flow 20
Match:
In Port: 3
Destination MAC: 01:80:C2:00:00:00
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9002 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 2
Flow 15
Match:
In Port: 1
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 2
Output Port: 3
Flow 16
Match:
In Port: 2
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 3
Flow 17
Match:
In Port: 3
VLAN ID: 100
Attributes:
Table ID: 7 Cookie:0x5adc15c0
Priority: 9000 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Output Port: 2
Flow 8
Match:
Attributes:
Table ID: 4 Cookie:0x5adc15c0
Priority: 0 Duration: 186 secs
Hard Timeout: 0 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:03:06
Instructions:
DROP
Paquete OFPT_PACKET_IN
Cuando el switch recibe un paquete para el que no tiene programada una regla, se lo envía al controlador para pedir instrucciones. Por ejemplo, supongamos que el switch ha recibido a través del puerto 2 una solicitud de ARP de la máquina 3c:07:54:21:5e:70 dirigida al Broadcast Ethernet.
Según se han visto las tablas que hay configuradas, el switch consultaría las siguientes reglas:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
0 | 30 | 9099 | 1 | GOTO TABLE 1 | Paquete | Todos los paquetes recibidos en puerto 1 pasan a tabla 1 | ||||
1 | 31 | 9000 | 1 | PUSH VLAN tag=100, Goto Table=3 | Paquete | Añade etiqueta vlan=100 y reenvía a tabla 3. | ||||
3 | 36 | 9000 | CONTROLLER, Goto Table=6 | Paquete | Envía paquete IN_PACKET a controlador y reenvía a la tabla 6 | |||||
6 | 14 | 9000 | GOTO_TABLE:7 | Paquete | Ir a la tabla de inundación para destinos no conocidos | |||||
7 | 15 | 9000 | 100 | 1 | "POP_VLAN", "OUTPUT:2", "OUTPUT:3" | Paquete |
Como resultado de la regla que hay configurada en la tabla 3, el switch le envía al controlador un paquete OFPT_PACKET_IN:
El controlador instruye al switch con las siguientes reglas de borrado para la tabla 3 (ETH_SRC) y la tabla 6 (ETH_DST), cuya condición incluya la dirección Ethernet origen de la solicitud de ARP 3c:07:54:21:5e:70 y que el paquete se reciba con etiqueta VLAN=100 (por si esta dirección Ethernet se hubiera aprendido en otro puerto diferente).
Y a continuación configura las siguientes entradas en las tablas 3 (ETH_SRC) y 6 (ETH_DST):
- Tabla 3 (ETH_SRC): Con prioridad 9098, cuando se reciba un paquete con la dirección Ethernet origen 3c:07:54:21:5e:70 de la VLAN=100 en el puerto 2, se reenvía a la tabla 6:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
3 | 37 | 9098 | 3C:07:54:21:5E:70 | 100 | 2 | GOTO TABLE 6 | Paquete | Todos los paquetes recibidos en puerto 2, VLAN=100 y ETH_SRC=3C:07:54:21:5E:70, se reenvían a tabla 6 |
Flow 37
Match:
In Port: 2
Source MAC: 3C:07:54:21:5E:70
VLAN ID: 100
Attributes:
Table ID: 3 Cookie:0x5adc15c0
Priority: 9098 Duration: 91 secs
Hard Timeout: 303 secs Idle Timeout: 0 secs
Byte Count: 15419 Packet Count: 111
Last Match: 00:00:01
Instructions:
Goto Table: 6
- Tabla 6 (ETH_DST): Con prioridad 9099, cuando se reciba un paquete con la dirección Ethernet destino 3c:07:54:21:5e:70 de la VLAN=100, se elimina la etiqueta VLAN y se reenvía al puerto 1 (ya se sabe que la máquina está conectada a ese puerto porque es por donde se ha recibido un mensaje con esa dirección Ethernet origen):
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
6 | 38 | 9099 | 3C:07:54:21:5E:70 | 100 | POP VLAN TAG, OUTPUT PORT=2 | Paquete | Todos los paquetes recibidos VLAN=100 y DST_SRC=3C:07:54:21:5E:70, se reenvían sin etiqueta VLAN al puerto 1 |
Flow 38
Match:
Destination MAC: 3C:07:54:21:5E:70
VLAN ID: 100
Attributes:
Table ID: 6 Cookie:0x5adc15c0
Priority: 9099 Duration: 91 secs
Hard Timeout: 0 secs Idle Timeout: 303 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:01:31
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 1
Cuando se recibe la respuesta de ARP:
Se consultan de nuevo las tablas en ese instante, y las reglas que afectan al paquete entrante son:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
0 | 32 | 9099 | 2 | GOTO TABLE 1 | Paquete | Todos los paquetes recibidos en puerto 2 pasan a tabla 1 | ||||
1 | 33 | 9000 | 2 | PUSH VLAN tag=100, Goto Table=3 | Paquete | Añade etiqueta vlan=100 y reenvía a tabla 3. | ||||
3 | 36 | 9000 | CONTROLLER, Goto Table=6 | Paquete | Envía paquete IN_PACKET a controlador y reenvía a la tabla 6 | |||||
6 | 14 | 9000 | GOTO_TABLE:7 | Paquete | Ir a la tabla de inundación para destinos no conocidos | |||||
7 | 16 | 9000 | 100 | 2 | "POP_VLAN", "OUTPUT:1", "OUTPUT:3" | Paquete |
Como resultado de la regla que hay configurada en la tabla 3, el switch le envía al controlador un paquete OFPT_PACKET_IN:
Y a continuación configura las siguientes entradas en las tablas 3 (ETH_SRC) y 6 (ETH_DST):
- Tabla 3 (ETH_SRC): Con prioridad 9098, cuando se reciba un paquete con la dirección Ethernet origen 3c:07:54:21:5e:70 de la VLAN=100 en el puerto 2, se reenvía a la tabla 6:
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
3 | 39 | 9098 | 00:14:5C:97:72:63 | 100 | 2 | GOTO TABLE 6 | Paquete | Todos los paquetes recibidos en puerto 2, VLAN=100 y ETH_SRC=00:14:5C:97:72:63, se reenvían a tabla 6 |
Flow 39
Match:
In Port: 2
Source MAC: 00:14:5C:97:72:63
VLAN ID: 100
Attributes:
Table ID: 3 Cookie:0x5adc15c0
Priority: 9098 Duration: 33 secs
Hard Timeout: 299 secs Idle Timeout: 0 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:00:33
Instructions:
Goto Table: 6
- Tabla 6 (ETH_DST): Con prioridad 9099, cuando se reciba un paquete con la dirección Ethernet destino 00:14:5C:97:72:63 de la VLAN=100 , se elimina la etiqueta VLAN y se reenvía al puerto 2 (ya se sabe que la máquina está conectada a ese puerto porque es por donde se ha recibido un mensaje con esa dirección Ethernet origen):
Table | Flujo en ZodiacFX | Priority | dl_dst | dl_src | dl_vlan | dl_type | in_port | actions | paquete openFlow | meaning |
---|---|---|---|---|---|---|---|---|---|---|
6 | 40 | 9099 | 00:14:5C:97:72:63 | 100 | POP VLAN TAG, OUTPUT PORT=2 | Paquete | Todos los paquetes recibidos VLAN=100 y DST_SRC=00:14:5C:97:72:63, se reenvían sin etiqueta VLAN al puerto 2 |
Flow 40
Match:
Destination MAC: 00:14:5C:97:72:63
VLAN ID: 100
Attributes:
Table ID: 6 Cookie:0x5adc15c0
Priority: 9099 Duration: 33 secs
Hard Timeout: 0 secs Idle Timeout: 299 secs
Byte Count: 0 Packet Count: 0
Last Match: 00:00:33
Instructions:
Apply Actions:
Pop VLAN tag
Output Port: 2