VxlanGpeTunnelRecipe
- class lnst.Recipes.ENRT.VxlanGpeTunnelRecipe.VxlanGpeTunnelRecipe(**kwargs)
Bases:
PauseFramesHWConfigMixin
,OffloadSubConfigMixin
,BaseTunnelRecipe
This class implements a recipe that configures a simple Vxlan GPE tunnel between two hosts.
.--------. .------| switch |-----. | '--------' | | | .-------|------. .-------|------. | .--'-. | | .--'-. | | |eth0| | | |eth0| | | '----' | | '----' | | | | | | | | | | ----' '--- | | ----' '--- | | 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.The recipe provides additional parameter:
- param carrier_ipversion:
This parameter specifies whether IPv4 or IPv6 addresses are used for the underlying (carrier) network. The value is either ipv4 or ipv6
- 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 Vxlan tunnel devices are created with external flag specified so that the encapsulation can be defined externally by routes.
The devices are configured to use VXLAN-GPE.
Routes for IPv4 and IPv6 networks to be tunneled through the Vxlan are added.
IPv4 and IPv6 addresses of the tunneled networks are configured on the loopback devices of the matched hosts.
- generate_ping_endpoints(config)
The ping endpoints for this recipe are the loopback devices that are configured with IP addresses of the tunnelled networks.
Returned as:
[PingEndpoints(self.matched.host1.lo, self.matched.host2.lo)]
- 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 with VXLAN-GPE extension.
- generate_perf_endpoints(config: EnrtConfiguration) list[Collection[EndpointPair[IPEndpoint]]]
The perf endpoints for this recipe are the loopback devices that are configured with IP addresses of the tunnelled networks.