Professional Documents
Culture Documents
DEFENCE UNIVERSITY
COLLEDGE OF ENGINEERING AND TECHNOLOGY
IDENTITY NUMBER:01463410
MAY, 202 1
BOSHOFTU,ETHIOPIA
1. Description…………………………………………………………………………………………1
2. Objectives…………………………………………………………………………………………..1
3. How it works………………………………………………………………………………………1
4. Problems…………………………………………………………………………………………….2
5. Advantage………………………………………………………………………………………….3
6. Dis advantage…………………………………………………………………………………….3
7. Limitation…………………………………………………………………………………………..3
8. Sample code……………………………………………………………………………………….3
8.1.Server Side……………………………………………………………………………………3
8.2.Client Side…………………………………………………………………………………….5
9. Practical demo……………………………………………………………………………………7
1. Description
FILE TRANSFER PROTOCOL
FTP (File Transfer Protocol) is a protocol designed for transferring files over the internet . Files stored
on an FTP server can be accessed using an FTP client, such as a web browser ,FTP software program or a
command line interface.
2. Objectives
FTP is a widely used network protocol for transferring files between computers over a TCP/IP-based
network ,such as the internet . FTP lets people and applications exchange and share data with in their
offices and across the internet. FTP was one of the first technologies developed to solve this common
need, and it remains with several generations of enhancements.
3. How it works
FTP works in a client-server model where an FTP server and FTPclient perform the file transfer
operation . a FTP server is conjured in the network , and a specific file storage location (folder/system)
is identified to become the shared storage ,which will host the files to share. The end users will access
this file server via FTP to start copying the files to their local folder/system.
FTP requires a TCP/IP network to function ,and relies on the use of one or more FTP clients. The FTP
client act as the communication agent to interact with the server to download or to upload files . in
other words , the FTP client sends out connections to the FTP server . Up on listening to the request
from the client to either upload or download afile .the FTP server performs the file transfer operation.
FILE TRANSFER PROTOCOL
Figure 1
The above figure shows the basic model of the FTP . The FTP client has three components : the user
interface ,control process and data transfer process. The server has two components :the server control
process and the server data transfer process.
4. Problems
FTP is Not secure
FTP is Unreliable
FTP Lacks Features
FTP is Outdated
FILE TRANSFER PROTOCOL
5. Advantage
FTP is a widely used network protocol for transferring files between computers over a TCP/IP –based
network,such as the internet . FTP lets people and applications exchange and share data with in their
offices and across the internet.
6. Disadvantage
FTP Lacks security
FTP Can be vulnerable to attack
FTP is inhwrently non secure way to transfer data
7. Limitation
FTP does not encrypt traffic that mean passwords and file contents are sent in clear text.Their
force ,FTP may still bbe vulnerable to brute force attack ,packet captures and other hacking attack.
8. Sample Code
8.1. Server Side
import java.net.*;
import java.io.*;
class MyServer {
ServerSocket ss;
Socket clientsocket;
BufferedReader fromclient;
InputStreamReader isr;
PrintWriter toclient;
public MyServer() {
try {
System.out.println("Server Started...");
while(true) {
clientsocket = ss.accept();
System.out.println("Got a client");
String strfile;
String stringdata;
strfile = fromclient.readLine();
System.out.println(strfile);
int notendcharacter;
do {
notendcharacter = fileinputstream.read();
stringdata = String.valueOf(notendcharacter);
toclient.println(stringdata);
FILE TRANSFER PROTOCOL
if (notendcharacter != -1) {
file_still_present = true;
} else {
file_still_present = false;
} while(file_still_present);
fileinputstream.close();
if (str.equals("bye")) {
break;
fromclient.close();
toclient.close();
clientsocket.close();
} catch(Exception ex) {
}
FILE TRANSFER PROTOCOL
import java.net.*;
import java.io.*;
class MyClient {
Socket soc;
PrintWriter toserver;
InputStreamReader isr;
public MyClient() {
String str;
try {
str = fromkeyboard.readLine();
System.out.println(str);
String ddd;
ddd = str;
String strfile;
int notendcharacter;
FILE TRANSFER PROTOCOL
boolean file_validity = false;
strfile = fromkeyboard.readLine();
toserver.println(strfile);
//File OutputStream helps to get write the data from the file ....
do {
str = fromserver.readLine();
notendcharacter = Integer.parseInt(str);
if (notendcharacter != -1) {
file_validity = true;
} else {
System.out.println("Read and Stored all the Data Bytes from the file ..." +
if (file_validity) {
fileOutputStream.write(notendcharacter);
} while(file_validity);
fileOutputStream.close();
toserver.close();
FILE TRANSFER PROTOCOL
fromserver.close();
soc.close();
} catch(Exception ex) {
9.Practical demo
FILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOL
FILE TRANSFER PROTOCOL