IUdp

Package: inet.transportlayer.contract

IUdp

module interface

UDP protocol interface.

The UDP protocol header is represented by the class ~UdpHeader.

<b>Communication with clients (applications)</b>

The module can (should) be connected to several applications. For sending a UDP packet, the application should attach an ~UdpCommand object to the payload, and send it to ~Udp. ~Udp will also attach an ~UdpCommand object to any payload message it 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 ~UdpCommand 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 the IPv4 (IPv4/IPv6) layer</b>

The ~Udp model relies on sending and receiving ~L3AddressReq/~L3AddressInd objects attached to packets.

<b>See also:</b> ~Udp, ~UdpHeader, ~UdpCommand, ~UdpCommandCode

Inheritance diagram

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

Implemented by

Name Type Description
ExtLowerUdp simple module

Provides UDP protocol services suitable for emulation. The lower part of the UDP protocol is realized in the real world using real UDP sockets of the host computer which is running the simulation.

Udp simple module

UDP protocol implementation, for IPv4 (~Ipv4) and IPv6 (~Ipv6).

Used in compound modules

Name Type Description
LdpMplsRouter compound module

An LDP-capable router.

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.

Properties

Name Value Description
display i=block/transport

Source code

//
// UDP protocol interface.
//
// The UDP protocol header is represented by the class ~UdpHeader.
//
// <b>Communication with clients (applications)</b>
//
// The module can (should) be connected to several applications.
// For sending a UDP packet, the application should attach an ~UdpCommand
// object to the payload, and send it to ~Udp.
// ~Udp will also attach an ~UdpCommand object to any payload
// message it 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 ~UdpCommand
// 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 the IPv4 (IPv4/IPv6) layer</b>
//
// The ~Udp model relies on sending and receiving ~L3AddressReq/~L3AddressInd
// objects attached to packets.
//
// @see ~Udp, ~UdpHeader, ~UdpCommand, ~UdpCommandCode
//
moduleinterface IUdp
{
    parameters:
        @display("i=block/transport");

    gates:
        input appIn @labels(UdpCommand/down);
        input ipIn @labels(UdpHeader,Ipv4ControlInfo/up,Ipv6ControlInfo/up);
        output appOut @labels(UdpCommand/up);
        output ipOut @labels(UdpHeader,Ipv4ControlInfo/down,Ipv6ControlInfo/down);
}

File: src/inet/transportlayer/contract/IUdp.ned