VxlanOvsTunnelRecipe

class lnst.Recipes.ENRT.VxlanOvsTunnelRecipe.VxlanOvsTunnelRecipe(**kwargs)

Bases: PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe

This class implements a recipe that configures a simple Vxlan tunnel using OpenVSwitch between two hosts.

                   .--------.
        .----------| switch |-------.
        |          '--------'       |
        |                           |
.-------|----------.        .-------|----------.
|    .--'-.        |        |    .--'-.        |
|    |eth0|        |        |    |eth0|        |
|    '----'        |        |    '----'        |
| .----| |-------. |        | .----| |-------. |
| |    | |   OvS | |        | |    | |   OvS | |
| |    | |       | |        | |    | |       | |
| | ---' '------ | |        | | ---' '------ | |
| | vxlan tunnel | |        | | vxlan tunnel | |
| | ------------ | |        | | ------------ | |
| '--------------' |        | '--------------' |
|                  |        |                  |
|      host1       |        |       host2      |
'------------------'        '------------------'

The actual test machinery is implemented in the BaseEnrtRecipe class.

The test wide configuration is implemented in the BaseTunnelRecipe class.

configure_underlying_network(config: EnrtConfiguration) tuple[RemoteDevice, RemoteDevice]

The underlying network for the tunnel consists of the Ethernet devices on the matched hosts.

create_tunnel(config: EnrtConfiguration, tunnel_endpoints: tuple[RemoteDevice, RemoteDevice]) tuple[RemoteDevice, RemoteDevice]

OvS bridges are created on each of the matched hosts with two ports. One port as an integration port and another port of type VXLAN acting as a tunnel interface connecting tunneled networks.

Integration ports are configured with IPv4 and IPv6 addresses of the tunneled networks.

generate_ping_endpoints(config)

The ping endpoints for this recipe are simply the tunnel endpoints

Returned as:

[PingEndpoints(self.matched.host1.int0, self.matched.host2.int0)]
get_packet_assert_config(ping_config)

The packet assert test configuration contains filter for source and destination addresses matching the carrier network with udp header bits specific to VXLAN tunneling. The grep patterns match the ICMP or ICMP6 echo requests encapsulated by Vxlan.