NetBurner 3.5.6
PDF Version
TFTP Server

TFTP Server Application

Overview

This application implements a TFTP (Trivial File Transfer Protocol) Server as a servlet on an embedded device. The server allows clients to transfer files using the TFTP protocol, which is a simplified version of FTP designed for minimal overhead and ease of implementation.

Application Description

The TFTP Server application is built on the NetBurner NNDK (NetBurner Network Development Kit) platform and provides the following functionality:

  • TFTP Server Implementation: Runs as a servlet on the device
  • File Serving: Makes specific files available for TFTP transfer
  • Web Interface: Includes an HTTP web server for device management
  • Network Integration: Full network stack initialization and management

Key Components

Main Application (main.cpp)

The main application file contains:

  • Application Name: "TFTP_Server"
  • TFTP Server Object: MyServer - the main TFTP server instance
  • File Source: file1 - makes test data available as "test.dat"
  • Test Data: References embedded test data array (5500 bytes)

Test Data (data.cpp)

Contains auto-generated test data:

  • Array Name: testdata_array
  • Size: 5500 bytes
  • Content: Formatted hexadecimal test data representing numbered lines
  • Format: Each line contains line numbers and repeating digit patterns

Sample File (filetosend.txt)

Provides a human-readable version of the test data:

  • 50 lines of formatted text
  • Each line prefixed with a 4-digit line number (0000-0059)
  • Contains repeating digit patterns for testing transfer integrity

Functionality

Network Services

  1. TFTP Server:
    • Serves files via TFTP protocol
    • Makes "test.dat" available for download
    • Uses embedded test data array
  2. HTTP Web Server:
    • Starts on default port 80
    • Provides web-based interface
    • Enables system diagnostics
  3. Network Stack:
    • Full network initialization
    • Active network detection with 5-second timeout
    • Continuous operation loop

File Serving

The application demonstrates TFTP file serving by:

  • Creating a TFTP server instance
  • Registering a file source named "test.dat"
  • Mapping the file to the embedded test data array
  • Making the file available for TFTP client downloads

System Requirements

  • NetBurner NNDK platform
  • Network connectivity
  • Sufficient memory for test data (5500+ bytes)

Usage

  1. Startup Sequence:
    • Network stack initialization
    • System diagnostics enablement
    • HTTP server startup
    • Network connection wait (up to 5 seconds)
    • Status reporting
  2. Operation:
    • Continuous operation with 1-second intervals
    • TFTP server runs in background
    • Web server provides management interface
  3. File Access:
    • TFTP clients can connect to the device
    • Request file "test.dat" for download
    • Receive the 5500-byte test data array

Development Notes

  • Built using NetBurner NNDK framework
  • Includes system diagnostics (recommended for development only)
  • Uses standard TFTP protocol implementation
  • Embedded test data for demonstration purposes

File Structure

main.cpp # Main application entry point
data.cpp # Auto-generated test data array
filetosend.txt # Human-readable test data sample
ReadMe.txt # Basic application description

Output Information

Upon startup, the application displays:

  • Application name and version
  • NNDK revision information
  • Network status updates

Protocol Support

  • TFTP: File transfer protocol implementation
  • HTTP: Web server for device management
  • TCP/IP: Full network stack support