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.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in compound modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

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 %

Properties:

Name Value Description
display i=block/transport

Gates:

Name Direction Size Description
appIn [ ] input

incoming gate from application

network_in input

incoming gate from network

appOut [ ] output

outgoing gate to application

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
{
    parameters:
        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 %
        @display("i=block/transport");

    gates:
        input appIn[];    // incoming gate from application
        input network_in;    // incoming gate from network
        output appOut[];     // outgoing gate to application

}