This tutorial assumes the root folder to be
<path/to/veins>/src/vasp
.
- Create your attack class files in the
attack
folder, choose appropriate subfolder structure. - Use the
vasp::attack
namespace. Your namespace should match the folder structure.attack/acceleration/Constant.h
attack is under thevasp::attack::acceleration
namespace. - All attacks inherit from the attack interface (
attack/Interface.h
)Hence all attacks need to implement the
attack()
method - Implement your attack functionality in the
attack()
method. Any variables that need to be updated before running the attack should be either updated via a dedicated constructor of the attack or anupdate()
method.See
attack/acceleration/ConstantOffset.h
andattack/acceleration/ConstantOffset.cc
for example. - Make sure to set the attack type appropriately using the
bsm->setAttackType(<attack_type>)
method inside yourattack()
method. - Add an
enum
for your attack inattack/Type.h
file. Note down the corressponding integer value of your attack's enum. - Call your attack in the
driver/CarApp.cc
class.- Call your attack in the
injectAttack()
method if your attack modifies the attacker's own kinematic information.- Use proper switch-case based on your attack's
enum
. - Assign your attack's constructor to the
attack_
variable.
- Use proper switch-case based on your attack's
- Call your attack in the
injectGhostAttack()
method if your attack creates a ghost vehicle to perform the attack.- Use proper switch-case based on your attack's
enum
. - Assign your attack's constructor to the
ghostAttack_
variable.
- Use proper switch-case based on your attack's
- Call your attack in the
- Assign your attack's
enum
's integer equivalent value to theattackType
variable in thescenario/omnetpp.ini
file. - Run simulation by following the the "Running simulations" instructions in the README
- Once the simulation has ended, open the latest
rxtrace-*.csv
file inscenario/results
folder and observe the data to check for correctness.We recommend Microsoft Excel (or equivalent) program to observe the file and perform rudimentary analyses.