#Twister Example Applications
Twister applications can be run in three simple steps.
- Create AWS EC2 VMs for Twister
- Install and configure Twister
- Run Twister Application
Create two AWS EC2 VMs "twClient" and "twServer". Twister application can run in single application. Two VMs have been created for ease of demonstration. Please follow this guide for creating AWS EC2 VMs for Twister.
Also ensure to connect one additional NIC for use by Twister Application. The VMs will automatically reboot one time to apply updates required for Twister.
Follow How To Section to clone, install and configure Twister.
Following sample applications have been built using Twister API.
- twiperf
- twping
- twicmpecho
- twarp
- twrarp
twiperf
is an iperf application built using Twister API. It currently supports sending UDP traffic and ethernet traffic (layer 2).
twiperf can be easily tested in following topology.
twServer will listen for any connections. twClient will connect with twServer and send traffic throught tw0
interface. Interfaces bind with Twister are generally named as 'tw0', 'tw1', 'tw2' etc.
Run twiperf (server mode) in 'twServer' VM with udp traffic.
sudo twiperf -u -s
Run twiperf (client mode) 'twClient' VM. Connect with IP address of twiperf server configured in 'twServer' VM.
sudo twiperf -u -c 10.0.2.129
Similarly twiperf can initiate a server with layer 2 traffic as well. Use -e
or --ethernet
flags to generate layer 2 traffic.
sudo twiperf -e -s
For more options checkout twiperf help with -h
flag.
sudo twiperf -h
twping
is a ping application built using Twister API. It works like linux ping
application.
Run twping
application as given below.
sudo twping <IPv4 address>
twicmpecho
application responds back to icmp
(ping
) traffic. Run twicmpecho
application to start icmp server.
sudo twicmpecho
Try sending ping traffic to IP address configured for the port in /etc/twister/config.json
. twicmpecho
application will respond back to the ping traffic.
twarp
application is an ARP
application built using Twister API. twarp
takes an IP address as input and returns its MAC address.
Run twarp
application as given below.
sudo twarp <IP address>
twrarp
application implements the reverse address resolution protocol. It sends the RARP
request and displays the IP resolved from RARP
response.
Run RARP
application with following command.
sudo twrarp