Simple Module EtherBus

Package: inet.linklayer.ethernet
File: src/inet/linklayer/ethernet/EtherBus.ned

C++ definition

Implements the shared coaxial cable for classic Ethernet.

The ethg[i] gates represent taps. Messages arriving on a tap travel on the bus on both directions, and copies of it are sent out on every other tap after delays proportional to their distances.

For the model to work correctly, all connecting links (both incoming and outgoing ones) must have the same datarate.

Messages are not interpreted by the bus model in any way, thus the bus model is not specific to Ethernet.

It is allowed to disconnect/reconnect links at runtime. However, the model does not support changing the tap positions or adding/removing taps at runtime.

EtherBus

Usage diagram:

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

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in compound modules:

Name Type Description
IPv4LargeLAN compound module

Several hosts and an Ethernet hub on a switch. One port of the hub connect to a 10Base2 segment.

LargeLAN compound module

Several hosts and an Ethernet hub on a switch. One port of the hub connect to a 10Base2 segment. Part of LargeNet(1,2).

Networks:

Name Type Description
ARPTest network (no description)
BusLAN network

Sample Ethernet LAN: four hosts on a bus.

MixedLAN network

Sample Ethernet LAN containing eight hosts, a switch and a bus.

Parameters:

Name Type Default value Description
positions string

positions of taps on the cable in meters, as a sequence of numbers separated by spaces. If there are too few values, the distance between the last two positions is repeated, or 5 meters is used.

propagationSpeed double 200000000mps

signal propagation speed on the bus

Properties:

Name Value Description
networkNode
labels node
display b=200,5,,,,1

Gates:

Name Direction Size Description
ethg [ ] inout

to stations; each one represents a tap

Source code:

//
// Implements the shared coaxial cable for classic Ethernet.
//
// The ethg[i] gates represent taps. Messages arriving on a tap
// travel on the bus on both directions, and copies of it are sent out
// on every other tap after delays proportional to their distances.
//
// For the model to work correctly, all connecting links (both incoming
// and outgoing ones) must have the same datarate.
//
// Messages are not interpreted by the bus model in any way, thus the bus
// model is not specific to Ethernet.
//
// It is allowed to disconnect/reconnect links at runtime. However,
// the model does not support changing the tap positions or adding/removing
// taps at runtime.
//
simple EtherBus
{
    parameters:
        @networkNode();
        @labels(node,ethernet-node);
        @display("b=200,5,,,,1");
        string positions;  // positions of taps on the cable in meters, as a sequence
                           // of numbers separated by spaces. If there are too
                           // few values, the distance between the last two positions
                           // is repeated, or 5 meters is used.
        double propagationSpeed @unit("mps") = default(200000000mps); // signal propagation speed on the bus
    gates:
        inout ethg[] @labels(EtherFrame-conn);  // to stations; each one represents a tap
}