IpIpTunnelRecipe

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

Bases: MTUHWConfigMixin, PauseFramesHWConfigMixin, BaseTunnelRecipe

This class implements a recipe that configures a simple IpIp tunnel between two hosts.

               .--------.
        .------| switch |-----.
        |      '--------'     |
        |                     |
.-------|------.      .-------|------.
|    .--'-.    |      |    .--'-.    |
|    |eth0|    |      |    |eth0|    |
|    '----'    |      |    '----'    |
|      | |     |      |      | |     |
|  ----' '---  |      |  ----' '---  |
|  ipip tunnel |      |  ipip tunnel |
|  ----------  |      |  ----------  |
|              |      |              |
|    host1     |      |    host2     |
'--------------'      '--------------'

The actual test machinery is implemented in the BaseEnrtRecipe class.

The test wide configuration is implemented in the BaseTunnelRecipe class.

The recipe provides additional parameter:

param tunnel_mode:

this parameter specifies the mode of the IPIP tunnel, can be any of the any, ipip or mplsip

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]

The ipip tunnel devices are configured with IPv4 addresses.

generate_ping_endpoints(config)

The ping endpoints for this recipe are simply the tunnel endpoints

Returned as:

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

The packet assert test configuration contains filter for ip protocol and grep patterns to match the ICMP echo requests encapsulated by IPIP.