The ANDL is a domain specific language (DSL) that aims to simplify the generation of simulation configuration files for the frameworks CoRE4INET, FiCo4OMNeT and SignalsAndGateways. As a plugin for the Eclipse IDE there are benefits like autocompletion, syntax highlighting, validation, autoformatting, renaming and scoping. Currently the ANDL Supports:
Minimum Java Version: 11 In omnetpp-<VERSION>/ide/omnetpp.ini
Java can be specifed.
For example on Windows:
--launcher.appendVmargs
...
-vm
C:/Program Files/Java/jdk-11.0.2/bin/javaw
-vmargs
...
The ANDL is an OMNeT++ Plugin. Install the Plugin in your OMNeT++ IDE:
Create a new Project (File->New->Project). Choose a name.
Right click on the src folder and select new->other->General->File. The filename must end with ``.andl’’. When Eclipse asks to add the Xtext Nature to the project select yes.
The network configuration takes place in the empty andl file. Autocompletion (Ctrl+Space) is a great tool to support the process. It shows all possibilities that can be placed the current context in the editing area.
If the Process did not start automatically after saving the build process must be started (Ctrl+B) (right click on .andl file->Generate Network). After the build process is finished the simulation files can be found in the simulations folder of the project.
To initate the Autoformatting press Ctrl+Shift+F.
The language contains three main sections. These are types, settings, and network. The first two are optional. The last one is the mandatory network description.
Major elements of the network can instantiate a type to reduce the parameter redundancy in the network description part. This major elements are ethernetLink, canLink, node, switch, gateway and message.
types std {
ethernetLink ETH_100MBIT {
bandwidth 100Mb/s;
}
canLink CANBUS_500KBIT {
bandwidth 500Kb/s;
}
switch ETH_SWITCH {
hardwareDelay 8us;
}
message MAX_CANMSG {
payload 8B;
}
}
types sntypes{
message MSG extends std.MAX_CANMSG{
sender canNode1;
receivers canNode2;
}
}
The optional settings part configures simulation file generation related parameters. For example the behavior of the automatic time-triggered scheduler. The following code shows how to deactivate the scheduling of time-triggered messages for the simulation configuration.
settings{
tteScheduling false;
}
This is the mandatory part of the ANDL. It contains of 3 mandatory subsections. They are devices, connections and communication. The first one is used to describe the network participants. The second one sets the connection between them. In the last section all messages are defined that should traverse the network. The next example shows the start of the network component. The network name in this example is specified as smallNetwork.
network smallNetwork {
Network participants are configured in the devices section. The syntax is similar to the types component. A device can extend a device type. In the following example there are two canLink (canbus1, canbus2), one ethernetLink (ethcable1), one switch (switch1), two gateways (gateway1, gateway2) and two nodes (canNode1, canNode2) defined. The semicolons can be replaced with an !’’{}!’’ block for the definition of additional parameters.
devices {
canLink canbus1 extends std.CANBUS_500KBIT;
canLink canbus2 extends std.CANBUS_500KBIT;
switch switch1 extends std.ETH_SWITCH;
gateway gateway1;
gateway gateway2;
node canNode1;
node canNode2;
}
The elements in the devices section can be used now to build the network infrastructure. Each connection is a member of a segment. Segments are later used to define the different message representations. For Ethernet connections there are two network participants connected via one ethernetLink. For CAN connections each participant is plugged to a bus using a canLink. The connections example shows two segments (backbone and canbus) for the individual connections. A special feature for ethernetLink is the !’‘new!’’ keyword. It enables the possibility to instance a new ethernetLink with a defined type. This reduces the configuration effort instead of defining each cable in the devices section.
connections{
segment backbone {
gateway1 <--> {new std.ETH_100MBIT} <--> switch1;
gateway2 <--> {new std.ETH_100MBIT} <--> switch1;
}
segment canbus {
gateway1 <--> canbus1;
canNode1 <--> canbus1;
gateway2 <--> canbus2;
canNode2 <--> canbus2;
}
}
Communication is defined using messages. Each message can extend a message type and has parameters such as sender, receivers or messages size. Additionaly a message has a mapping section. In this section the representation in different parts of the networks is defined. There is no necessary order of the mapping entires. At the moment mappings can be made for segments and gateways. In the following example there are three messages (canmsg1, canmsg2 and canmsg3). All have a period and extend a parameterized message type. For canmsg1 the mapping says that the message is represented through the CAN id 1 in the canbus segment. In the backbone segment the message is represented by a best-effort Ethernet frame. Additionally the involved gateways are gateway1 and gateway2.
communication{
message canmsg1 extends sntypes.MSG{
period 10ms;
mapping {
canbus : can{id 1;};
gateway1;
backbone : be;
gateway2;
}
}
message canmsg2 extends sntypes.MSG{
period 15ms;
mapping {
canbus : can{id 2;};
gateway1;
backbone : be;
gateway2;
}
}
message canmsg3 extends sntypes.MSG{
period 20ms;
mapping {
canbus : can{id 3;};
gateway1;
backbone : be;
gateway2;
}
}
}
At last the network section must be closed. Now the andl file is ready for the generation process
}