Applications

PeriodicClient

class PeriodicClient : public Application

Periodic client that generates frames at a fixed rate for remote processing.

PeriodicClient models a device that captures frames at a fixed frame rate and offloads them to an edge server for processing.

Example usage:

Ptr<PeriodicClient> client = CreateObject<PeriodicClient>();
client->SetAttribute("Remote", AddressValue(orchAddress));
client->SetAttribute("FrameRate", DoubleValue(30.0));

Ptr<NormalRandomVariable> frameSize = CreateObject<NormalRandomVariable>();
frameSize->SetAttribute("Mean", DoubleValue(60000));
client->SetAttribute("FrameSize", PointerValue(frameSize));

Ptr<ConstantRandomVariable> compute = CreateObject<ConstantRandomVariable>();
compute->SetAttribute("Constant", DoubleValue(5e9));
client->SetAttribute("ComputeDemand", PointerValue(compute));

node->AddApplication(client);

Public Types

typedef void (*FrameSentTracedCallback)(Ptr<const Task> task)

TracedCallback signature for frame sent events.

Param task:

The task representing the frame.

typedef void (*FrameProcessedTracedCallback)(Ptr<const Task> task, Time latency)

TracedCallback signature for frame processed events.

Param task:

The completed task.

Param latency:

End-to-end latency from submission to response.

typedef void (*FrameRejectedTracedCallback)(Ptr<const Task> task)

TracedCallback signature for frame rejected events.

Param task:

The rejected task.

typedef void (*FrameDroppedTracedCallback)(uint64_t frameNumber)

TracedCallback signature for frame dropped events.

Param frameNumber:

The sequence number of the dropped frame.

Public Functions

void SetRemote(const Address &addr)

Set the remote orchestrator address.

Parameters:

addr – Orchestrator address (InetSocketAddress or Inet6SocketAddress).

Address GetRemote() const

Get the remote orchestrator address.

Returns:

The orchestrator address.

uint64_t GetFramesSent() const

Get the number of frames sent.

Returns:

Number of frames submitted for admission.

uint64_t GetFramesDropped() const

Get the number of frames dropped.

Returns:

Number of frames dropped because the previous frame was still pending.

uint64_t GetResponsesReceived() const

Get the number of responses received.

Returns:

Number of processed frame results received.

uint64_t GetTotalTx() const

Get the total bytes transmitted.

Returns:

Total bytes sent.

uint64_t GetTotalRx() const

Get the total bytes received.

Returns:

Total bytes received.

int64_t AssignStreams(int64_t stream) override

Assign a fixed random variable stream number to the random variables used by this application.

Parameters:

stream – First stream index to use.

Returns:

The number of stream indices assigned.

Public Static Functions

static TypeId GetTypeId()

Get the type ID.

Returns:

The object TypeId.

PeriodicServer

class PeriodicServer : public Application

Periodic backend server that processes frames on an accelerator.

PeriodicServer receives frames from an EdgeOrchestrator, submits them to the Accelerator aggregated on the node and sends processing results back when frames complete.

Example usage:

Ptr<PeriodicServer> server = CreateObject<PeriodicServer>();
server->SetAttribute("Port", UintegerValue(9000));
serverNode->AddApplication(server);
// Requires a GpuAccelerator aggregated on serverNode

Public Types

typedef void (*FrameReceivedTracedCallback)(Ptr<const Task> task)

TracedCallback signature for frame received events.

Param task:

The task representing the received frame.

typedef void (*FrameProcessedTracedCallback)(Ptr<const Task> task, Time duration)

TracedCallback signature for frame processed events.

Param task:

The completed task.

Param duration:

The processing duration on the accelerator.

Public Functions

uint64_t GetFramesReceived() const

Get the number of frames received.

Returns:

Number of frames received.

uint64_t GetFramesProcessed() const

Get the number of frames processed.

Returns:

Number of frames completed and response sent.

uint64_t GetTotalRx() const

Get the total bytes received.

Returns:

Total bytes received.

uint16_t GetPort() const

Get the port number.

Returns:

The listening port.

Public Static Functions

static TypeId GetTypeId()

Get the type ID.

Returns:

The object TypeId.