Package: inet.common
MessageDispatcher
simple moduleFacilitates the interconnection of applications, protocols, and network interfaces, dispatching messages and packets among them. It supports diverse configurations, ranging from layered architectures with distinct message dispatchers for separate communication layers, to centralized structures where a single dispatcher manages connections to all components.
Keeps track of four different mappings for dispatching messages and packets:
- network interface mapping specifies which gate should be used when dispatching towards a specific network interface
- service mapping specifies which gate should be used when dispatching service data units (SDUs) towards a specific protocol (e.g. IPv4 SDU, Ethernet SDU)
- protocol mapping specifies which gate should be used when dispatching protocol data units (PDUs) towards a specific protocol (e.g. IPv4 PDU, Ethernet PDU)
- socket mapping specifies which gate should be used when dispatching towards a specific socket
To configure the dispatch mechanism:
- protocol modules must register using the registerService() and/or registerProtocol() functions
- network interface modules must register using the registerInterface() function
- sockets must use the ~SocketReq or ~SocketInd tags when sending socket open/close commands
- manual configuration is also possible using the module's mapping parameters
To use the dispatch mechanism, messages and packets must have a specific tag attached that defines the target:
- service or protocol targets can be specified using the ~DispatchProtocolReq tag
- network interface targets can be specified using the ~InterfaceReq tag
- socket targets can be specified using the ~SocketReq or ~SocketInd tags
Automatically learned services, protocols, and network interfaces are shared among connected message dispatchers.
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 |
|---|---|---|
| AccessPoint | compound module |
A wireless access point device that connects wireless stations (like WirelessHost) to a wired network. Supports multiple wireless radios and multiple Ethernet ports. |
| ApplicationLayerNodeBase | compound module |
An extension of the transport layer node base that adds support for applications. Provides the highest level of abstraction for network nodes, completing the full network stack from physical to application layer. |
| BGPRouterEx | compound module |
Example IP router with BGPv4 and OSPFv4 support. |
| BGPRouterSimple | compound module |
Example Ipv4 router with BGPv4 support. |
| DirectionReverserLayer | compound module |
Provides a layer that combines the decision for local delivery with the service of reversing the direction of an incoming packet to outgoing for packet forwarding. |
| EthernetHost | compound module |
A simplified network device that communicates directly over Ethernet without higher layer protocols like IP or TCP. It provides a basic host model for Ethernet-only simulations. |
| EthernetSwitch | compound module |
EthernetSwitch models a Layer 2 Ethernet switch with support for various IEEE 802.1 protocols and features. It provides frame forwarding based on MAC addresses and implements multiple switching technologies. |
| ExtUpperIpv4NetworkLayer | compound module |
Provides a network layer that connects the simulation to a real network on the host computer using a TUN device. Allows simulated applications to send and receive packets through the host's networking stack at the IP layer. Contains standard components like routing table and ARP, and uses ~ExtUpperIpv4 with a TUN device for external connectivity. |
| ForwardingService | compound module | (no description) |
| ForwardingService | compound module | (no description) |
| Ieee8022LlcLayer | compound module | (no description) |
| Interface | compound module | (no description) |
| InterfaceService | compound module | (no description) |
| Ipv4NetworkLayer | compound module | |
| Ipv6NetworkLayer | compound module |
Represents an IPv6 network layer (L3). |
| LdpMplsRouter | compound module |
An LDP-capable router. |
| LinkLayerNodeBase | compound module |
An extension of the basic node infrastructure with link layer functionality. Provides support for various network interfaces and link layer protocols, forming the foundation for network connectivity. |
| NetworkLayerNodeBase | compound module |
An extension of the link layer node base with network layer functionality. Provides support for multiple network protocols, including IPv4 and IPv6. |
| NextHopNetworkLayer | compound module |
Provides a network layer for the next hop forwarding. |
| Node | compound module | (no description) |
| RsvpMplsRouter | compound module |
An RSVP-TE capable router. |
| SimpleNetworkLayer | compound module |
Provides a simple network layer. |
| TcpServerApp | compound module |
A generic, modular TCP server application. It is composed of a listener module that listens on a port to accept TCP connections, and for each incoming TCP connection it dynamically creates a new module in the connection[] submodule vector to handle the connection. |
| TransportLayerNodeBase | compound module |
An extension of the network layer node base with transport layer protocols. Provides support for UDP, TCP, and SCTP, enabling end-to-end communication services for applications. |
| WiseRouteNetworkLayer | compound module |
Provides a simple network layer. |
Extends
| Name | Type | Description |
|---|---|---|
| PacketProcessorBase | simple module |
Base module for various packet processing modules which maintains a few statistics. |
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| forwardServiceRegistration | bool | true | |
| forwardProtocolRegistration | bool | true | |
| interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
Properties
| Name | Value | Description |
|---|---|---|
| class | MessageDispatcher | |
| display | i=-;b=100,5,,,,1; |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| in [ ] | input | ||
| out [ ] | output |
Source code
// // Facilitates the interconnection of applications, protocols, and network interfaces, // dispatching messages and packets among them. It supports diverse configurations, ranging from // layered architectures with distinct message dispatchers for separate communication layers, to // centralized structures where a single dispatcher manages connections to all components. // // Keeps track of four different mappings for dispatching messages and packets: // - network interface mapping specifies which gate should be used when dispatching towards a specific // network interface // - service mapping specifies which gate should be used when dispatching service data units (SDUs) // towards a specific protocol (e.g. IPv4 SDU, Ethernet SDU) // - protocol mapping specifies which gate should be used when dispatching protocol data units (PDUs) // towards a specific protocol (e.g. IPv4 PDU, Ethernet PDU) // - socket mapping specifies which gate should be used when dispatching towards a specific socket // // To configure the dispatch mechanism: // - protocol modules must register using the `registerService()` and/or `registerProtocol()` functions // - network interface modules must register using the `registerInterface()` function // - sockets must use the ~SocketReq or ~SocketInd tags when sending socket open/close commands // - manual configuration is also possible using the module's mapping parameters // // To use the dispatch mechanism, messages and packets must have a specific tag attached that defines the target: // - service or protocol targets can be specified using the ~DispatchProtocolReq tag // - network interface targets can be specified using the ~InterfaceReq tag // - socket targets can be specified using the ~SocketReq or ~SocketInd tags // // Automatically learned services, protocols, and network interfaces are shared among connected message dispatchers. // simple MessageDispatcher extends PacketProcessorBase { parameters: string interfaceTableModule; // Module path to the ~InterfaceTable module bool forwardServiceRegistration = default(true); bool forwardProtocolRegistration = default(true); object interfaceMapping = default({}); // Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default object serviceMapping = default({}); // Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default object protocolMapping = default({}); // Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default @class(MessageDispatcher); @display("i=-;b=100,5,,,,1;"); gates: input in[]; output out[]; }File: src/inet/common/MessageDispatcher.ned