TFTP
Synopsis
Creates a server that accepts file uploads using the TFTP protocol. Supports IP-based device mapping, multiple workers, and automatic file content processing.
Schema
- id: <numeric>
name: <string>
description: <string>
type: tftp
tags: <string[]>
pipelines: <pipeline[]>
status: <boolean>
properties:
address: <string>
port: <numeric>
reuse: <boolean>
workers: <numeric>
buffer_size: <numeric>
stats_frequency: <numeric>
Configuration
The following are the minimum requirements to define the device.
Device
Field | Required | Default | Description |
---|---|---|---|
id | Y | Unique identifier | |
name | Y | Device name | |
description | N | - | Optional description |
type | Y | Must be tftp | |
tags | N | - | Optional tags |
pipelines | N | - | Optional pre-processor pipelines |
status | N | true | Enable/disable the device |
Server
Field | Required | Default | Description |
---|---|---|---|
address | N | "0.0.0.0" | Listen address |
port | Y | Listen port (typically 69) |
Performance
Field | Required | Default | Description |
---|---|---|---|
reuse | N | false | Enable multi-worker mode |
workers | N | 4 | Number of worker processes when reuse enabled |
buffer_size | N | 9000 | Read buffer size in bytes |
stats_frequency | N | 300 | Statistics collection interval in seconds |
TFTP protocol does not support authentication. Deploy only on trusted networks.
Advanced Features
The following are unique features that Director offers.
IP-Based Device Mapping
The server supports automatic device mapping based on client IP addresses: it maps incoming client IPs to device IDs, and automatically associates uploads with devices. It also supports dynamic device discovery and maintains an IP-to-device mapping cache.
Files
The server processes uploaded files by reading the file contents into memory, recording upload metadata (filename, timestamp, etc.), capturing the client information, and converting the content to consumable format.
Multiple Workers
When reuse
is enabled, the server uses multiple workers which maintain their own TFTP listeners and process files independently so that the files are automatically distributed.
The worker count will be capped at the number of available CPU cores.
Upload
The device upload operations observe the following procedure:
-
The client initiates a TFTP upload:
-
The server accepts the connection:
-
The client transfers the file:
-
Finally, the server maps the client IP to the device, reads the file contents, applies the pipelines, and saves the processed data to a store.
Configure clients to use binary mode for file transfers to avoid data corruption.
Examples
The following are commonly used configuration types.
Basic
A basic server can be created easily:
Creating a simple TFTP server... |
|
Device Mapping
Devices can be automatically captured:
Configuring IP-based device mapping... |
|
Multiple Devices
Uploads from multiple devices can be handled easily:
Configuring server for multiple devices... |
|
Ensure all devices are configured to use the same TFTP server port.
High-Volume
Performance can be enhanced for high file upload volumes:
Optimizing for high volumes... |
|
Pipelines
File contents can be handled according to requirements:
Applying custom processing to uploaded files... |
|
Pipelines are processed sequentially, and can modify or drop content before ingestion.