EthernetHub

Package: inet.node.ethernet

EthernetHub

simple module

An Ethernet hub model.

The model simply broadcasts frames (and transmission updates representing aborted frames, etc.) received on one port on all other ports, mimicking the propagation of electrical signals.

Note that no special attention is made to appropriately model frame truncations that occur when the link breaks, or comes back up while a transmission is underway. If you need to precisely model what happens when the link state changes, you cannot use this module.

Properties

Name Value Description
networkNode
class ::inet::physicallayer::WireJunction
labels node
display i=device/hub;bgb=155,104

Gates

Name Direction Size Description
ethg [ ] inout

Signals

Name Type Unit
packetReceived cMessage

Statistics

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

Called methods (observed)

functioninfocall from
inet::physicallayer::WireJunction::receiveSignalPOST_MODEL_CHANGE-=Network=-, ScenarioManager

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
ethg$i[]EthernetFilledIfgSignal0EthernetCsmaMac
ethg$i[]EthernetJamSignal0EthernetCsmaMac
ethg$i[]EthernetJamSignal0WireJunction
ethg$i[]EthernetSignal0EthernetCsmaMac
ethg$i[]EthernetSignal0WireJunction

Outgoing messages (observed)

gatemsgkindctrldestModuletags
ethg$o[]EthernetFilledIfgSignal0EthernetCsmaMac
ethg$o[]EthernetJamSignal0EthernetCsmaMac
ethg$o[]EthernetJamSignal0WireJunction
ethg$o[]EthernetSignal0EthernetCsmaMac
ethg$o[]EthernetSignal0WireJunction

Source code

//
// An Ethernet hub model.
//
// The model simply broadcasts frames (and transmission updates
// representing aborted frames, etc.) received on one port on all
// other ports, mimicking the propagation of electrical signals.
//
// Note that no special attention is made to appropriately model
// frame truncations that occur when the link breaks, or comes
// back up while a transmission is underway. If you need
// to precisely model what happens when the link state changes,
// you cannot use this module.
//
simple EthernetHub
{
    parameters:
        @networkNode();
        @class(::inet::physicallayer::WireJunction);
        @labels(node,ethernet-node);
        @display("i=device/hub;bgb=155,104");
        @signal[packetReceived](type=cMessage);
        @statistic[packetReceived](title="packets"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        inout ethg[] @labels(EtherFrame-conn);
}

File: src/inet/node/ethernet/EthernetHub.ned