Simple Module SimpleUDP

File: Underlay/SimpleUnderlay/SimpleUDP.ned

C++ definition: click here

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

Usage diagram:

The following diagram shows usage relationships between modules, networks and channels. Unresolved module (and channel) types are missing from the diagram. Click here to see the full picture.

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.

SimpleOverlayHost

Host in the simple network that participates in the overlay

Parameters:

Name Type Description
constantDelay numeric

constant delay between two peers

useCoordinateBasedDelay bool

delay should be calculated from euklidean distance between two peers

Gates:

Name Direction Description
from_app [ ] input
network_in input
to_app [ ] output

Source code:

simple SimpleUDP
    parameters:
	constantDelay : numeric, // constant delay between two peers
	useCoordinateBasedDelay : bool; // delay should be calculated from euklidean distance between two peers
    gates:
        in: from_app[];
        in: network_in;
        out: to_app[];

endsimple