L2NetworkConfigurator¶
Package: inet.linklayer.configurator.common
simple module L2NetworkConfigurator
Allows configuring network scenarios at layer 2. The Stp and Rstp related parameters such as link cost, port priority and the “is-edge” flag can be configured with XML files.
This module is based on Ipv4NetworkConfigurator. The optional selector
attributes: @hosts, @names, @towards, @among also come with this
configurator and each of them behaves similarly to its Ipv4NetworkConfigurator equivalent.
@ports selector added to configuring per-port parameters in Ieee8021dInterfaceData.
The following example configures port 5 (if it exists) on all switches to cost 19 and priority 32768:
- <config>
<interface hosts=’**’ ports=’5’ cost=’19’ priority=’32768’/>
</config>
When the cost attribute is not given for an interface, the port path cost
defaults to a value derived from the link speed, as recommended by
IEEE 802.1D-2004 (e.g. 200000 for 100 Mb/s, 20000 for 1 Gb/s).
For more information about the usage of the selector attributes see Ipv4NetworkConfigurator.
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
config |
xml |
xml(“<config><interface hosts=’**’ ports=’**’ priority=’128’ edge=’false’/></config>”) |
|
dumpConfiguration |
bool |
false |
Print the computed per-port configuration (link cost, priority, edge flag) to the module output |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
L2NetworkConfigurator |
|
display |
i=block/cogwheel |
Source code¶
//
// Allows configuring network scenarios at layer 2.
// The ~Stp and ~Rstp related parameters such as link cost, port priority
// and the "is-edge" flag can be configured with XML files.
//
// This module is based on ~Ipv4NetworkConfigurator. The optional selector
// attributes: @hosts, @names, @towards, @among also come with this
// configurator and each of them behaves similarly to its ~Ipv4NetworkConfigurator equivalent.
// @ports selector added to configuring per-port parameters in `Ieee8021dInterfaceData`.
//
// The following example configures port 5 (if it exists) on all switches to cost 19 and
// priority 32768:
// <pre>
// <config>
// <interface hosts='**' ports='5' cost='19' priority='32768'/>
// </config>
// <pre>
//
// When the `cost` attribute is not given for an interface, the port path cost
// defaults to a value derived from the link speed, as recommended by
// IEEE 802.1D-2004 (e.g. 200000 for 100 Mb/s, 20000 for 1 Gb/s).
//
// For more information about the usage of the selector attributes see ~Ipv4NetworkConfigurator.
//
simple L2NetworkConfigurator extends SimpleModule
{
parameters:
@class(L2NetworkConfigurator);
@display("i=block/cogwheel");
xml config = default(xml("<config><interface hosts='**' ports='**' priority='128' edge='false'/></config>"));
bool dumpConfiguration = default(false); // Print the computed per-port configuration (link cost, priority, edge flag) to the module output
}
File: src/inet/linklayer/configurator/common/L2NetworkConfigurator.ned