TwoHosts

Package: inet.examples.ethernet.lans

TwoHosts

network

Sample Ethernet LAN: two hosts directly connected to each other via twisted pair.

hostA : EthernetHost

A simplified network device that communicates directly over Ethernet without higher layer protocols...

Source:
hostA: EthernetHost {
    parameters:
        @display("p=100,100");
} hostB : EthernetHost

A simplified network device that communicates directly over Ethernet without higher layer protocols...

Source:
hostB: EthernetHost {
    parameters:
        @display("p=300,100");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Properties

Name Value Description
isNetwork

Unassigned submodule parameters

Name Type Default value Description
hostA.status.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostA.status.initialStatus string "UP"

TODO @signal, @statistic

hostA.interfaceTable.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostA.interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

hostA.cli.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostA.cli.interfaceTableModule string
hostA.cli.destAddress string ""

Destination MAC address, or module path name of destination station; empty means off

hostA.cli.startTime double this.sendInterval

Time of sending the first request

hostA.cli.stopTime double -1s

Time of finishing sending, negative values mean forever

hostA.cli.localSAP int 0xf0

Local service access point

hostA.cli.remoteSAP int 0xf1

Remote service access point

hostA.cli.sendInterval double uniform(0s,1s)

Interval between sending requests

hostA.cli.reqLength int 100B

Length of request packets

hostA.cli.respLength int 1KiB

Length of response packets

hostA.cli.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation finished

hostA.cli.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

hostA.srv.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostA.srv.localSAP int 0xf1
hostA.srv.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation is finished

hostA.srv.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

hostA.dp.displayStringTextFormat string "processed %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostA.dp.interfaceTableModule string

Module path to the ~InterfaceTable module

hostA.dp.forwardServiceRegistration bool true
hostA.dp.forwardProtocolRegistration bool true
hostA.dp.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

hostA.dp.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

hostA.dp.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

hostA.li.displayStringTextFormat string "processed %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostA.li.interfaceTableModule string

Module path to the ~InterfaceTable module

hostA.li.forwardServiceRegistration bool true
hostA.li.forwardProtocolRegistration bool true
hostA.li.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

hostA.li.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

hostA.li.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

hostA.eth.bitrate double
hostB.status.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostB.status.initialStatus string "UP"

TODO @signal, @statistic

hostB.interfaceTable.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostB.interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

hostB.cli.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostB.cli.interfaceTableModule string
hostB.cli.destAddress string ""

Destination MAC address, or module path name of destination station; empty means off

hostB.cli.startTime double this.sendInterval

Time of sending the first request

hostB.cli.stopTime double -1s

Time of finishing sending, negative values mean forever

hostB.cli.localSAP int 0xf0

Local service access point

hostB.cli.remoteSAP int 0xf1

Remote service access point

hostB.cli.sendInterval double uniform(0s,1s)

Interval between sending requests

hostB.cli.reqLength int 100B

Length of request packets

hostB.cli.respLength int 1KiB

Length of response packets

hostB.cli.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation finished

hostB.cli.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

hostB.srv.displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostB.srv.localSAP int 0xf1
hostB.srv.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation is finished

hostB.srv.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

hostB.dp.displayStringTextFormat string "processed %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostB.dp.interfaceTableModule string

Module path to the ~InterfaceTable module

hostB.dp.forwardServiceRegistration bool true
hostB.dp.forwardProtocolRegistration bool true
hostB.dp.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

hostB.dp.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

hostB.dp.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

hostB.li.displayStringTextFormat string "processed %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hostB.li.interfaceTableModule string

Module path to the ~InterfaceTable module

hostB.li.forwardServiceRegistration bool true
hostB.li.forwardProtocolRegistration bool true
hostB.li.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

hostB.li.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

hostB.li.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

hostB.eth.bitrate double

Source code

//
// Sample Ethernet LAN: two hosts directly connected to each other
// via twisted pair.
//
network TwoHosts
{
    submodules:
        hostA: EthernetHost {
            parameters:
                @display("p=100,100");
        }
        hostB: EthernetHost {
            parameters:
                @display("p=300,100");
        }
    connections:
        hostA.ethg <--> {  delay = 0.5us; datarate = 100Mbps; } <--> hostB.ethg;
}


File: examples/ethernet/lans/Networks.ned