# Step 11. Manually modifying an automatically created configuration¶

## Goals¶

Sometimes the configurator’s configuration is just almost right. In such a case it’s possible to dump the configuration into a file, edit it and use the file in place of the original configuration. This step consists of two parts:

• Part A - Dumping the full configuration
• Part B - Using the modified configuration

## Part A - Dumping the full configuration¶

The configurator can be instructed to dump its configuration into a config file, in the XML configuration format. This contains all the assigned addresses, routing table entries and members of wireless links, so they can be easily modified. The modified config file can be used as the XML configuration for subsequent simulation runs.

### Configuration¶

Both parts in this step use the ConfiguratorA network defined in ConfiguratorA.ned:

The configuration for this part in omnetpp.ini is the following:

[Config Step11A]
network = ConfiguratorA
description = "Manually modifying an automatically created configuration - dumping the full configuration"

*.configurator.dumpConfig = "step11a_dump.xml"

*.visualizer.routingTableVisualizer.displayRoutingTables = true
*.visualizer.routingTableVisualizer.destinationFilter = "*"
*.visualizer.routingTableVisualizer.displayRoutesIndividually = false
*.visualizer.routingTableVisualizer.displayLabels = false
*.visualizer.routingTableVisualizer.lineShift = 0


The configurator’s dumpConfig parameter can be used to dump the configuration into a file. The parameter’s value is the name of the config file.

### Results¶

Routes to all nodes are visualized on the following image.

The configuration is dumped into step11a_dump.xml. We will modify this config file in the next part.

## Part B - Using the modified configuration¶

In this part, we edit the config file, and use it as the XML configuration. The goal is that packets should travel counter-clockwise in the triangle of the three routers, i.e. each router should forward packets in the triangle through its interface on the right.

### Configuration¶

The configuration for this part in omnetpp.ini is the following:

[Config Step11B]
network = ConfiguratorA
description = "Manually modifying an automatically created configuration - using the modified configuration"

# Configurator settings
*.configurator.config = xmldoc("step11b.xml")

# Ping settings
*.host1.numApps = 1
*.host1.app[0].typename = "PingApp"

*.host4.numApps = 1
*.host4.app[0].typename = "PingApp"

*.host7.numApps = 1
*.host7.app[0].typename = "PingApp"

# Visualizer settings
*.visualizer.routingTableVisualizer.displayRoutingTables = true
*.visualizer.routingTableVisualizer.destinationFilter = "*"
*.visualizer.routingTableVisualizer.displayRoutesIndividually = false
*.visualizer.routingTableVisualizer.displayLabels = false
*.visualizer.routingTableVisualizer.lineShift = 0


The modified config is used as the XML configuration. Since the configuration specifies all routes, addStaticRoutes needs to be set to false, so the configurator doesn’t add automatic static routes. A host in each LAN pings another host in the adjacent LAN in the counter-clockwise direction.

The routes in all three routers’ routing tables are modified. Routes that would send packets the wrong way (i.e. not counter-clockwise in the triangle) are redirected to the other interface. In essence, all routers send out packets through their interface to the right (expect for packets destined to the connecting LAN.)

The modified XML configuration is in step11b.xml (see step11a_dump.xml for the original.) The differences between the original and the modified config files area displayed below (the original is shown in red).

### Results¶

Routes to all nodes are visualized on the following image. Note that arrows point only counter-clockwise in the triangle.

The ping exchanges highlight the modified routes on the following video:

The packets travel only counter-clockwise in the triangle of the three routers.

## Discussion¶

Use this page in the GitHub issue tracker for commenting on this tutorial.