Simple Module EtherHub

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

C++ definition

A generic wiring hub model.

ethg[i] gates represent ports. Messages arriving on a port are broadcast to every other port. 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 hub model in any way, thus the hub model is not specific to Ethernet. Messages may represent anything, from the beginning of a frame transmission to end (or abortion) of transmission.

It is allowed to dynamically unconnect/reconnect ports of the hub, and also to change the size of ethg[] to add/remove ports. However, the model only checks the equivalence of input/output datarates on startup; you are responsible that links added at runtime have have the correct datarate.

EtherHub

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.

IPv4MediumLAN compound module

Several hosts and a router on an Ethernet hub and a switch

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).

MediumLAN compound module

Several hosts and an Ethernet hub on a switch; part of LargeNet(1,2).

OneNetArea compound module (no description)
OspfLan compound module (no description)
SmallLAN compound module

Several hosts on an Ethernet hub; part of LargeNet(1,2).

TestArea compound module (no description)
TwoNetsArea compound module (no description)

Networks:

Name Type Description
Backbone network (no description)
HubLAN network

Sample Ethernet LAN: four hosts connected by a hub.

mIPv6Network network (no description)
MixedLAN network

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

SimpleTest network (no description)
SimpleTest network (no description)

Properties:

Name Value Description
networkNode
labels node
display i=device/hub

Gates:

Name Direction Size Description
ethg [ ] inout

to stations; each one represents a port

Signals:

Name Type Unit
pk cMessage

Statistics:

Name Title Source Record Unit Interpolation Mode
pk packets pk count, sum(packetBytes), vector(packetBytes) none

Source code:

//
// A generic wiring hub model.
//
// ethg[i] gates represent ports. Messages arriving on a port are broadcast
// to every other port. 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 hub model in any way, thus the hub
// model is not specific to Ethernet. Messages may represent anything, from
// the beginning of a frame transmission to end (or abortion) of transmission.
//
// It is allowed to dynamically unconnect/reconnect ports of the hub, and also
// to change the size of ethg[] to add/remove ports. However, the model only
// checks the equivalence of input/output datarates on startup; you are
// responsible that links added at runtime have have the correct datarate.
//
simple EtherHub
{
    parameters:
        @networkNode();
        @labels(node,ethernet-node);
        @display("i=device/hub");
        @signal[pk](type=cMessage);
        @statistic[pk](title="packets"; source=pk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        inout ethg[] @labels(EtherFrame-conn);  // to stations; each one represents a port
}