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.

EthernetHub

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

SmallLAN compound module

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

Used in

Name Type Description
ARPTest network (no description)
HubLAN network

Sample Ethernet LAN: four hosts connected by a hub.

MixedLAN network

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

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

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