Sunteți pe pagina 1din 3

Experiment No.

Title: - Trivial file transfer protocol (TFTP).


Aim: - To study the TFTP Protocol

Objective: - To install and configure TFTP service and transfer file using TFTP protocol

Relevance:- TFTP is useful for booting computers such as routers which did not have any data
storage devices. It is still used to transfer small files between hosts on a network

Theory:-

Trivial File Transfer Protocol (TFTP) is an Internet software utility for transferring files that is
simpler to use than the File Transfer Protocol (FTP) but less capable. It is used where user
authentication and directory visibility are not required. TFTP uses the User Datagram Protocol
(UDP) rather than the Transmission Control Protocol (TCP).

How TFTP Works

Like FTP, TFTP uses client and server software to make connections between two devices. From
a TFTP client, individual files can be copied (uploaded) to or downloaded from the server. In
other words, the server hosts the files while the client requests or sends them.

Main differences between FTP and TFTP are

 FTP uses TCP port numbers 20 and 21, TFTP uses UDP port number 69.
 FTP is a complete, session-oriented, general purpose file transfer protocol. TFTP is used
as a bare-bones special purpose file transfer protocol.
 FTP can be used interactively. TFTP allows only unidirectional transfer of files.
 FTP depends on TCP, is connection oriented, and provides reliable control. TFTP
depends on UDP, requires less overhead, and provides virtually no control.
 FTP provides user authentication. TFTP does not.

Use of TFTP
 TFTP is mainly used during device bootstrap process for downloading device
OS/firmware and configuration files. It is typically used for copying bootstrap and
configuration files between nodes belonging to the same LAN.
 TFTP is used in situations where all the features of a full file transfer protocol like
FTP are not needed.
 It is used along with boot protocols like BOOTP and DHCP to initialize devices.
Whenever an IP enabled node boots up, it gets its IP address and other device and
network related parameters through BOOTP or DHCP. As part of these parameters,
the client also receives the TFTP server address, bootstrap file and configuration file
details (file name and directory location). The client then uses the TFTP protocol to
download the bootstrap image and configuration files from the TFTP server.

TFTP Message Types:

Installing and setting TFTP server in Ubuntu


1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp


2. Create /etc/xinetd.d/tftp and put this entry:

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}

3. Make /tftpboot directory

$ sudo mkdir /tftpboot


$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot

4. Start tftpd through xinetd

$ sudo /etc/init.d/xinetd stop


$ sudo /etc/init.d/xinetd start

5.. Create a file named test with some content in /tftpboot path of the tftp server

$ cd /tftpboot
/tftpboot $ cat >a.txt
this is file from server to client
press ctrl +c
/tftpboot $ ls

(get the list of files in /tftpboot folder)

Remote Machine: tftp client


install tftp package
$ sudo apt-get install tftp

****** to download **********


6.Now in some other system follow the following steps.

$ tftp <ip of server>

tftp> get a.txt

Sent 159 bytes in 0.0 seconds

tftp> quit

$ ls

(we will get the file in home folder of user which get trasfer from server end to cilent)

****** to up load **********

6.Now in some other system follow the following steps.

$ tftp <ip of server>

tftp> put

S-ar putea să vă placă și