EthernetHub

Package: inet.node.ethernet

EthernetHub

simple module

A simple Ethernet hub device that operates at the physical layer. It connects multiple Ethernet devices together in a star topology while creating a single collision domain.

The hub works by broadcasting all incoming signals to all connected ports except the one they arrived on, effectively simulating the shared medium behavior of early Ethernet networks. This includes not only complete frames but also partial transmissions, collisions, and other electrical signals.

Note that this model has limitations in accurately representing frame truncations that occur when links go down or come up during an ongoing transmission.

<b>See also:</b> ~EthernetSwitch, ~EthernetHost

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

SmallLAN compound module

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

VoIPStreamLargeLAN compound module

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

VoIPStreamMediumLAN compound module

Several hosts and an Ethernet hub on a switch

VoIPStreamSmallLAN compound module

Several hosts on an Ethernet hub

Used in

Name Type Description
ARPTest network (no description)
HostsWithHub 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.

Extends

Name Type Description
SimpleModule simple module

Base module for all INET simple modules.

Parameters

Name Type Default value Description
displayStringTextFormat string ""

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

Properties

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

Gates

Name Direction Size Description
ethg [ ] inout

Signals

Name Type Unit Description
packetReceived cMessage

Statistics

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

Source code

//
// A simple Ethernet hub device that operates at the physical layer. It connects
// multiple Ethernet devices together in a star topology while creating a single
// collision domain.
//
// The hub works by broadcasting all incoming signals to all connected ports except
// the one they arrived on, effectively simulating the shared medium behavior of
// early Ethernet networks. This includes not only complete frames but also partial
// transmissions, collisions, and other electrical signals.
//
// Note that this model has limitations in accurately representing frame truncations
// that occur when links go down or come up during an ongoing transmission.
//
// @see ~EthernetSwitch, ~EthernetHost
//
simple EthernetHub extends SimpleModule
{
    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