Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TFTP File Transfer Application

Overview

The TFTP (Trivial File Transfer Protocol) File Transfer Application is a client-server application developed in C using UDP socket programming. It implements the basic functionality of the TFTP protocol (RFC 1350), enabling reliable file transfer over UDP.

The project demonstrates concepts such as socket programming, network protocol implementation, file handling, and client-server communication in Linux.


Features

  • File Download (GET)
  • File Upload (PUT)
  • Exit Client (EXIT)
  • UDP Socket Communication
  • TFTP Packet Handling (RRQ, WRQ, DATA, ACK, ERROR)
  • File Read/Write Operations
  • Error Detection and Handling
  • Modular Source Code

Technologies Used

  • Language: C
  • Operating System: Linux
  • Protocol: UDP
  • Networking: Socket Programming
  • Build Tool: GCC / Makefile

Project Structure

TFTP_src/
├── client.c
├── server.c
├── tftp.c
├── udp.c
├── file.c
├── tftp.h
├── udp.h
├── file.h
├── makefile
├── text.txt
└── README.md

Build

Compile the project using the Makefile:

make

Or compile manually:

gcc server.c tftp.c udp.c file.c -o server
gcc client.c tftp.c udp.c file.c -o client

Running the Application

Start the Server

./server <port_number>

Example:

./server 3000

Start the Client

./client <server_ip> <port_number>

Example:

./client 127.0.0.1 3000

Supported Modes

Mode Description
GET Downloads a file from the server to the client.
PUT Uploads a file from the client to the server.
EXIT Closes the TFTP client application.

Example Commands

GET

Mode : get
Enter source file      : text.txt
Enter destination file : output.txt

PUT

Mode : put
Enter source file      : sample.txt
Enter destination file : sample.txt

EXIT

Mode : exit
Closing the TFTP client...

TFTP Packet Flow

GET Operation

Client                     Server
  | ------ RRQ -----------> |
  | <----- DATA ----------- |
  | ------ ACK -----------> |
  | <----- DATA ----------- |
  | ------ ACK -----------> |

PUT Operation

Client                     Server
  | ------ WRQ -----------> |
  | <------ ACK ----------- |
  | ------ DATA ----------> |
  | <------ ACK ----------- |
  | ------ DATA ----------> |

Learning Outcomes

This project helped in understanding:

  • UDP Socket Programming
  • Client-Server Communication
  • Linux System Calls
  • File Handling in C
  • TFTP Protocol Implementation
  • Network Packet Handling
  • Error Handling and Debugging
  • Modular Programming

Future Enhancements

  • Timeout and Retransmission Support
  • Concurrent Client Handling
  • IPv6 Support
  • Transfer Progress Indicator
  • Logging Support
  • Improved Error Recovery

Author

Indira Krupa Darshini Midde

  • Electronics and Communication Engineering (ECE)
  • Interests: Embedded Systems, Linux System Programming, Computer Networks, Socket Programming, Embedded C

License

This project is intended for educational and learning purposes.

About

TFTP (Trivial File Transfer Protocol) implementation in C using UDP socket programming for reliable file transfer on Linux.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages