UdpSocketIo

Package: inet.applications.udpapp

UdpSocketIo

simple module

This module provides UDP socket handling for generic applications.

Used in compound modules

Name Type Description
UdpApp compound module

This module generates traffic for a UDP application. The traffic source and traffic sink modules can be built from queueing model elements.

Parameters

Name Type Default value Description
interfaceTableModule string
localAddress string ""
localPort int -1
destAddress string ""
destPort int
timeToLive int -1

if not -1, set the TTL (IPv4) or Hop Limit (IPv6) field of sent packets to this value

dontFragment bool false

if true, asks IP to not fragment the message during routing

dscp int -1

if not -1, set the DSCP (IPv4/IPv6) field of sent packets to this value

tos int -1

if not -1, set the Type Of Service (IPv4) / Traffic Class (IPv6) field of sent packets to this value

multicastInterface string ""

if not empty, set the multicast output interface option on the socket (interface name expected)

multicastAddresses object []

list of multicast addresses that the application socket joins

receiveBroadcast bool false

if true, makes the socket receive broadcast packets

joinLocalMulticastGroups bool false

if true, makes the socket receive packets from all multicast groups set on local interfaces

stopOperationExtraTime double -1s

extra time after lifecycle stop operation finished

stopOperationTimeout double 2s

timeout value for lifecycle stop operation

Properties

Name Value Description
lifecycleSupport
display i=block/socket

Gates

Name Direction Size Description
trafficIn input
trafficOut output
socketIn input
socketOut output

Signals

Name Type Unit
packetReceived inet::Packet
packetSent inet::Packet

Statistics

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

Direct method calls (observed)

call tofunctioninfo
MessageDispatcherinet::MessageDispatcher::arrivedarrived

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
socketInPacket0 (UdpStatusInd::UDP_I_DATA)UdpDscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, NetworkProtocolInd, SocketInd, TosInd, TransportProtocolInd, DirectionTag?, DropEligibleInd?, EncapsulationProtocolInd?, FragmentTag?, MacAddressInd?, PcpInd?, SequenceNumberInd?, StreamInd?, UserPriorityInd?, VlanInd?
trafficInPacket0PacketMultiplexerDirectionTag, PacketProtocolTag
trafficInPacket0FlowMeasurementStarterDirectionTag, PacketProtocolTag
trafficInPacket0PacketTaggerDirectionTag, PacketProtocolTag, VlanReq
trafficInPacket0MarkovSchedulerDirectionTag, PacketProtocolTag
trafficInPacket0ActivePacketSourceDirectionTag, PacketProtocolTag

Outgoing messages (observed)

gatemsgkindctrldestModuletags
socketOutPacket0 (UdpCommandCode::UDP_C_DATA)UdpDirectionTag, DispatchProtocolReq, PacketProtocolTag, SocketReq, VlanReq?
socketOutRequest1 (UdpCommandCode::UDP_C_BIND)UdpBindCommandUdpDispatchProtocolReq, SocketReq
socketOutRequest2 (UdpCommandCode::UDP_C_CONNECT)UdpConnectCommandUdpDispatchProtocolReq, SocketReq
socketOutRequest3 (UdpCommandCode::UDP_C_SETOPTION)UdpJoinMulticastGroupsCommandUdpDispatchProtocolReq, SocketReq
trafficOutPacket0FlowMeasurementRecorderDirectionTag, DscpInd, EcnInd, EncapsulationProtocolInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, MacAddressInd, NetworkProtocolInd, TosInd, TransportProtocolInd
trafficOutPacket0PacketQueueDscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, NetworkProtocolInd, TosInd, TransportProtocolInd
trafficOutPacket0PassivePacketSinkDscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, NetworkProtocolInd, TosInd, TransportProtocolInd, DirectionTag?, DropEligibleInd?, EncapsulationProtocolInd?, FragmentTag?, MacAddressInd?, PcpInd?, SequenceNumberInd?, StreamInd?, UserPriorityInd?, VlanInd?

Shared Tagging operations (observed)

tagTypetagAction
DispatchProtocolReqaddTagIfAbsent
SocketIndfindTag, removeTag
SocketReqaddTagIfAbsent

Tagging operations (observed)

tagTypetagAction
inet::Ipv4InterfaceDatafindTag

Source code

//
// This module provides UDP socket handling for generic applications.
//
simple UdpSocketIo
{
    parameters:
        string interfaceTableModule;
        string localAddress = default("");
        int localPort = default(-1);
        string destAddress = default("");
        int destPort;
        int timeToLive = default(-1); // if not -1, set the TTL (IPv4) or Hop Limit (IPv6) field of sent packets to this value
        bool dontFragment = default(false); // if true, asks IP to not fragment the message during routing
        int dscp = default(-1); // if not -1, set the DSCP (IPv4/IPv6) field of sent packets to this value
        int tos = default(-1); // if not -1, set the Type Of Service (IPv4) / Traffic Class (IPv6) field of sent packets to this value
        string multicastInterface = default("");  // if not empty, set the multicast output interface option on the socket (interface name expected)
        object multicastAddresses = default([]); // list of multicast addresses that the application socket joins
        bool receiveBroadcast = default(false); // if true, makes the socket receive broadcast packets
        bool joinLocalMulticastGroups = default(false); // if true, makes the socket receive packets from all multicast groups set on local interfaces
        double stopOperationExtraTime @unit(s) = default(-1s);    // extra time after lifecycle stop operation finished
        double stopOperationTimeout @unit(s) = default(2s);    // timeout value for lifecycle stop operation
        @lifecycleSupport();
        @display("i=block/socket");
        @signal[packetSent](type=inet::Packet);
        @signal[packetReceived](type=inet::Packet);
        @statistic[packetSent](title="packets sent"; source=packetSent; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[packetReceived](title="packets received"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        input trafficIn;
        output trafficOut;
        input socketIn;
        output socketOut;
}
File: src/inet/applications/udpapp/UdpSocketIo.ned