Simple Module SimpleUDP

Package: oversim.underlay.simpleunderlay
File: src/underlay/simpleunderlay/SimpleUDP.ned

C++ definition

UDP protocol implementation, for IPv4 and IPv6.

The UDP protocol header is represented by the class UDPPacket.

Communication with clients (applications)

The module can (should) be connected to several applications. For sending an UDP packet, the application should attach an UDPControlInfo object to the payload, and send it to UDP. UDP will also attach an UDPControlInfo object to any payload message in sends up to the application.

For receiving UDP packets, the connected applications should first "bind" to the given UDP port. This can be done by sending an arbitrary message with message kind UDP_C_BIND and an UDPControlInfo attached with srcPort filled in.

If there is only one app which doesn't bind to any port, it will receive all packets.

Communication with other nodes

The SimpleUDP model sends packets directly to the destination

See also: SimpleUDPPacket, UDPControlInfo, GlobalRoutingHashMap

SimpleUDP

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Extends:

Name Type Description
UDP simple module

UDP protocol implementation, for IPv4 and IPv6.

Used in compound modules:

Name Type Description
SimpleMultiOverlayHost compound module

Host in the simple network that participates in the overlay

SimpleOverlayHost compound module

Host in the simple network that participates in the overlay

Parameters:

Name Type Default value Description
constantDelay double

constant delay between two peers

useCoordinateBasedDelay bool

delay should be calculated from euklidean distance between two peers

delayFaultType string

augment coordinate based delays with a realistic error, according to "Network Coordinates in the Wild", Figure 7 possible values: empty, "live_all", "live_planetlab", "simulation"

jitter double

average amount of jitter in %

enableAccessRouterTxQueue bool

model the tx queue of the access router of an destination node

Properties:

Name Value Description
display i=block/transport
class SimpleUDP

Gates:

Name Direction Size Description
appIn [ ] input
ipIn input
ipv6In input
appOut [ ] output
ipOut output
ipv6Out output

Source code:

//
// UDP protocol implementation, for IPv4 and IPv6.
//
// The \UDP protocol header is represented by the class UDPPacket.
//
// <b>Communication with clients (applications)</b>
//
// The module can (should) be connected to several applications.
// For sending an \UDP packet, the application should attach an UDPControlInfo
// object to the payload, and send it to UDP.
// UDP will also attach an UDPControlInfo object to any payload
// message in sends up to the application.
//
// For receiving \UDP packets, the connected applications should first
// "bind" to the given \UDP port. This can be done by sending an
// arbitrary message with message kind UDP_C_BIND and an UDPControlInfo
// attached with srcPort filled in.
//
// If there is only one app which doesn't bind to any port, it will
// receive all packets.
//
// <b>Communication with other nodes</b>
//
// The SimpleUDP model sends packets directly to the destination
//
// @see SimpleUDPPacket, UDPControlInfo, GlobalRoutingHashMap
//
simple SimpleUDP extends UDP
{
    parameters:
        @class(SimpleUDP);
        double constantDelay @unit(s);  // constant delay between two peers
        bool useCoordinateBasedDelay;   // delay should be calculated from 
                                        // euklidean distance between two peers
        string delayFaultType;          // augment coordinate based delays with a realistic error,
                                        // according to "Network Coordinates in the Wild", Figure 7
                                        // possible values: empty, "live_all", "live_planetlab", "simulation"
        double jitter;                  // average amount of jitter in %
        bool enableAccessRouterTxQueue; // model the tx queue of the access router of an destination node 
        @display("i=block/transport");
    gates:
}