Protocol Emulation¶
Available since v2.0
Tech Preview
Protocol Emulation is in TECH PREVIEW at this time - feature-incomplete and limited testing. Bug reports, feature requests and suggestions are solicited!
Linux-only
This is a Linux-only feature. More specifically, the Ostinato agent (Drone) MUST be running on Linux. The GUI controller or Python script can run on any platform.
Protocol Emulation extends Device Emulation to support the following protocols -
- DHCP Client (IPv4 and IPv6)
- DHCP Server (IPv4 and IPv6)
- IGMP/MLD Host
- OSPFv2
- BGP
Linux containers are used to emulate devices and the following Linux tools are used for the protocols -
- dhcpcd (DHCP client)
- dnsmasq (DHCP server)
- smcroute (IGMP/MLD)
- FRR 8.4.4 (OSPFv2, BGP)
Pre-requisites¶
You need docker on the host running Drone, to use Protocol Emulation.
The Docker container image is not included in the Ostinato install deb/rpm package. You can get it from the Ostinato download portal.
Install the docker image -
$ tar zxvf ostinato-emuldev-<VERSION>.tgz
$ cd ostinato-emuldev-<VERSION>
$ docker load -i docker-ostinato-emuldev-<VERSION>.tgz
Enabling protocol emulation¶
A new Docker based emulation engine has been added. The native emulation is still the default (but does not support protocol emulation).
To enable protocol emulation, you need to modify drone.ini as shown below and restart Drone.
[General]
EmulationEngine=Docker
sudo required
If using the Docker emulation engine, you MUST start Drone with sudo
(or as root
). Assigning capabilities will NOT work.
Protocol Selection and Configuration¶
Use the Ostinato device emulation GUI to select and configure the desired protocols.
DHCP Client¶
No configuration is typically required apart from enabling DHCPv4/DHCPv6.
If you wish the DHCP client to use certain DHCP options or request a specific lease time etc., reach out to support.
DHCP Server¶
No configuration is typically required apart from enabling the DHCP server.
If you want to configure the DHCP server with specific IP ranges for the DHCP pool etc., reach out to support.
IGMP/MLD Host¶
IGMP/MLD host emulation supports sending Join/Leave messages and responds to any queries received.
Both any source multicast (ASM) and source specific multicast (SSM) are supported. You can also force a specific IGMP/MLD version to be used.
The multicast groups are specified as a list of groups with optional sources - one per line. Group and Source IP can be IPv4 or IPv6.
GroupIP[@Source1,Source2,...]
Here's an example
239.1.1.1
225.100.45.10@10.2.19.194,10.2.19.195
OSPFv2¶
Use FRR (Free range routing) config syntax for OSPF.
Here's a minimal OSPFv2 config -
!$area=0
router ospf
redistribute static
The config MUST start with !$area=<area-id>
as the first line. This is the OSPF area for the interface towards the DUT. Area can be specified as a number or dotted IP notation.
network statement not supported
network
statements under router ospf
are NOT supported.
redistribute static
is required to advertise emulated Type 3 or 5 LSAs.
BGP¶
Use FRR (Free range routing) config syntax for BGP.
Here's an example BGP config -
router bgp 65001
bgp router-id 1.1.1.1
neighbor 198.18.2.1 remote-as 65002
address-family ipv4 unicast
redistribute static
no bgp ebgp-requires-policy
redistribute static
is required to advertise emulated routes.
Protocol Information¶
At this time, the device information view does NOT include any information on the protocol emulation state such as peer/neighbor state, learnt routes from the DUT etc.
Please use the DUT to query this information.
If you need to look at the protocol information on the Ostinato emulation side, reach out to support.
Advertising OSPF/BGP routes¶
To advertise emulated routes, we need to include static route configuration as part of the OSPF/BGP config -
ip route 172.16.100.0/24 null0
ip route 172.16.101.0/24 null0
ip route 172.16.102.0/24 null0
ip route 172.16.103.0/24 null0
ip route 172.16.104.0/24 null0
The configured static routes along with redistribute static
will make OSPF/BGP advertise these routes to the peer DUT.
Note
In case of OSPF, static routes will be advertised as Type 5 LSAs.
If you wish to flap routes, please reach out to support.
Traffic Streams¶
Ostinato SMAC/DMAC resolution for traffic streams will work automagically -- just make sure to use a source IP matching one of the emulated routes.
Limitations¶
Protocol emulation has the following limitations currently -
- VLANs are not supported in device group configuration
Manual Clean Up¶
Drone will normally clean up all the running containers and other Linux plumbing created for protocol emulation. However, in case of crashes this clean up may not happen. A subsequent Drone run will check for this and bail out requesting the user to clean up manually.
To clean up any remnants of protocol emulation containers and plumbing, run the following on the host running Drone -
docker ps | grep ostidev-p | cut -d" " -f1 | xargs -r docker rm -f
ip link show | grep obr-p | cut -d: -f2 | xargs -r -n1 sudo ip link delete
ip link show | grep ove-p | cut -d: -f2 | xargs -r -n1 sudo ip link delete
Note - the last 2 commands will prompt you for the sudo
password