TCP/IP protocol has several applications, especially related to modifying files. There are 2 mechanisms for transferring files, the first mechanism is sending files from another computer to the local computer, and the other mechanism is using the file system mechanism, where there is a mechanism that allows a user to make changes to files on another computer.
Examples of protocols that use the first mechanism are FTP and TFTP, while those that use the second mechanism are NFS.
Getting to Know File Transfer Protocol (FTP)
Substance:
- File Transfer Protocol (FTP)
- A glance at FTP
- FTP Operations
- FTP Scenario
- FTP Usage Examples
- Anonymous FTP
- Trivial File Transfer Protocol (TFTP)
- TFTP Usage
- Network File System (NFS)
- NFS Concept
- Mount Protocol
- NFS Protocol
- NFS version 4
1. File Transfer Protocol (FTP)
FTP is a standard protocol with STD number 9. It is described in RFC 959 -- File Transfer Protocol (FTP) and updated with RFC 2228 -- FTP security extension.
Duplicating files from one computer to another can be done in 2 directions. The client can send files to the server or can request a file from the server.
To access files on the server, users are required to identify themselves first. And the server will perform the authentication process for the user.
FTP uses a connection-oriented connection, so both sides must have a TCP/IP connection.
2. A brief look at FTP
FTP uses TCP as the transport protocol. FTP server accepts connections on ports 20 and 21. Two connections are required, one for logging in using the TELNET protocol, and the other for file transfer.
On both sides of the network, the FTP application is equipped with a protocol interpreter (PI), data transfer process (DTP), and interface display.
So the working principle of the FTP protocol is, the user interface executes commands through PI and continues to the server side. To perform a file transfer PI gives commands to DTP to send files.
FTP Working Principle
3. FTP Operations
When performing FTP, the user will perform some or all of the existing operations, namely:
a. Connecting to another host
With the Open command and entering the user and password with the User and Pass commands.
b. Sorting directories
With the cd command and pointing to the target directory
c. View list of files
With the dir or ls command
d. Selecting a file transfer method
With bin or ascii commands
e. Transferring files
With the get command to retrieve files, mget to retrieve files with a quantity of more than 1, put to send files, and mput to send files with a quantity of more than 1.
f. Using passive mode
With the passive client command, those behind the firewall can perform FTP as if it came from outside the firewall.
g. Closing the connection
With the quit, bye, or logout command
4. FTP Scenario
A user on a LAN network will send a file using FTP, what will be done is as shown in the image below.
The user will access the server with the name host01, where on the host the user is registered as the username cms01 with the password cmspw. Then the user will sort the directory and select the type of transfer mode to be used. The directory used is 191 and the mode used is FIXrecfm80. Then the user sends a file with the PUT command. The name of the file sent is file01.tst. And finally closes the connection with the QUIT command.
FTP -- FTP Scenarios
5. Example of FTP Usage
An example of using FTP can be seen in the image below,
Example of FTP usage
6. Anonymous FTP
Anonymous FTP is an FTP model that does not use user authentication. So any user can make a transfer, but is usually only allowed to retrieve a file.
7. Trivial File Transfer Protocol (TFTP)
TFTP is a protocol standard with STD number 33. It is described in RFC 1350 -- The TFTP Protocol. And updated in RFC 1785, 2347, 2348, and 2349.
TFTP transfer is a disk-to-disk file transfer, using the SENDFILE API.
TFTP uses the UDP protocol. The TFTP client initializes by sending a read/write request via port 69, then the server and client negotiate about the port to be used to transfer the file.
8. Using TFTP
The TFTP command takes the user to an interactive prompt, where they can continue with subcommands, among others.
TFTP Usage
9. Network File System (NFS)
SUN Microsystems Network File System (NFS) is a protocol that can share resources over a network. NFS is designed to be independent of the type of machine, the type of operating system, and the type of transport protocol used. This is done using RPC.
NFS is described in RFC 1813 -- NFS: NFS Version 3 Protocol and RFC 3010 -- NFS Version 4 Protocol.
10. NFS Concept
NFS allows authorized users to access files on remote hosts as if they were local. Protocols used:
- The mount protocol specifies the remote host and the type of file system to be accessed and places it in a directory.
- The NFS protocol performs I/O on remote file systems.
The mount protocol and NFS protocol work by using RPC and sending with TCP and UDP protocols.
11. Mount Protocol
This protocol is used to create a link by mounting a directory. The command used is mount.
Mount Protocol
To access the user must first run the mount program, for example:
mount //remote/share /mnt
This command is used to access a server with a remote name and has a shared directory with the name share, then mount it in the /mnt directory on the local computer.
After finishing using or modifying a file, the user must unmount it with the umount command, for example:
# umount /mnt
12. NFS Protocol
NFS is an RPC program that provides I/O to a remote host, after a request is made by the mount program.
NFS Protocol
13. NFS version 4
It is an improvement on version 3, with several additional features including:
- Reduces the information transfer required by the mount protocol.
- Security at the RPC layer
- Supports RPCSEC_GSS
- Supports kerberos
- New form of file handle
- Combined lookup and read commands
- Supports 32bit file format
Getting to know FTP (File Transfer Protocol)
TCP/IP protocol has several applications, especially related to modifying files. There are 2 mechanisms for transferring files, the first mechanism is sending files from another computer to the local computer, and the other mechanism is using the file system mechanism, where there is a mechanism that allows a user to make changes to files on another computer.
Examples of protocols that use the first mechanism are FTP and TFTP, while those that use the second mechanism are NFS.
1. File Transfer Protocol (FTP)
FTP is a standard protocol with STD number 9. It is described in RFC 959 -- File Transfer Protocol (FTP) and updated with RFC 2228 -- FTP security extension.
Duplicating files from one computer to another can be done in 2 directions. The client can send files to the server or can request a file from the server.
To access files on the server, users are required to identify themselves first. And the server will perform the authentication process for the user.
FTP uses a connection-oriented connection, so both sides must have a TCP/IP connection.
1.1. A brief overview of FTP
FTP uses TCP as the transport protocol. FTP server accepts connections on ports 20 and 21. Two connections are required, one for logging in using the TELNET protocol, and the other for file transfer.
On both sides of the network, the FTP application is equipped with a protocol interpreter (PI), data transfer process (DTP), and interface display.
So the working principle of the FTP protocol is, the user interface carries out commands through PI and continues to the server side. To transfer files, PI gives commands to DTP to send files. Can be seen in Figure 11.1.
Figure 11.1 FTP – How FTP works
1.2. FTP Operation
When performing FTP, the user will perform some or all of the existing operations, namely:
- Connecting to another host. With the Open command and entering the user and password with the User and Pass commands.
- Sorting directories. With the cd command and pointing to the target directory
- View a list of files. With the dir or ls command.
- Choose how to transfer files. With bin or ascii command
- Transferring files. With the get command to retrieve files, mget to retrieve files with a quantity of more than 1, put¸send files, and mput send files with a quantity of more than 1.
- Using passive mode. With the passive command, clients behind the firewall can perform FTP as if they were coming from outside the firewall.
- Closing the connection. With the quit, bye, or logout command.
1.3. FTP Scenario
A user on a LAN network, will send a file with FTP, what will be done is as shown in Figure 11.2.
The user will access the server with the name host01, where on the host the user is registered as the username cms01 with the password cmspw. Then the user will sort the directory and select the type of transfer mode to be used. The directory used is 191 and the mode used is FIXrecfm80. Then the user sends a file with the PUT command. The name of the file sent is file01.tst. And finally closes the connection with the QUIT command.
Figure 11.2 FTP – FTP Scenario
1.4. Example of FTP Usage
An example of using FTP can be seen in Figure 11.3.
Figure 11.3 FTP – Example of using FTP
1.5. Anonymous FTP
Anonymous FTP is an FTP model that does not use user authentication. So any user can make a transfer, but is usually only allowed to retrieve a file.
2. Trivial File Transfer Protocol (TFTP)
TFTP is a protocol standard with STD number 33. It is described in RFC 1350 -- The TFTP Protocol. And updated in RFC 1785, 2347, 2348, and 2349.
TFTP transfer is a disk-to-disk file transfer, using the SENDFILE API.
TFTP uses the UDP protocol. The TFTP client initializes by sending a read/write request via port 69, then the server and client negotiate about the port to be used to transfer the file.
2.1. Using TFTP
The TFTP <hostname> command takes the user to an interactive prompt, where they can continue with subcommands, including:
Connect <host>
Determining goalsMode <ascii/binary>
Determine the delivery mode.Get <nama file remote> [<nama file Mengambil file lokal>] Put <nama file remote> [<nama file lokal>]
Put the Verbose file.Quit
Exit TFTP.
3. Network File System (NFS)
SUN Microsystems Network File System (NFS) is a protocol that can share resources over a network. NFS is designed to be independent of the type of machine, the type of operating system, and the type of transport protocol used. This is done using RPC.
NFS is described in RFC 1813 -- NFS: NFS Version 3 Protocol and RFC 3010 -- NFS Version 4 Protocol.
3.1. NFS Concept
NFS allows authorized users to access files on remote hosts as if they were local. Protocols used:
- The mount protocol specifies the remote host and the type of file system to be accessed and places it in a directory.
- The NFS protocol performs I/O on remote file systems.
The mount protocol and NFS protocol work by using RPC and sending with TCP and UDP protocols.
3.1.1. Mount Protocol
This protocol is used to create a link by mounting it on a directory.
The command used is mount.
Figure 11.4 Mount Protocol
To access the user must first run the mount program, for example:
# mount //remote/share /mnt
This command is used to access a server with a remote name and has a shared directory with the name share, then mount it in the /mnt directory on the local computer.
After finishing using or modifying a file, the user must unmount it with the umount command, for example:
# umount /mnt
3.1.2. NFS Protocol
NFS is an RPC program that provides I/O to a remote host, after a request is made by the mount program.
Figure 11.5 NFS Protocol
3.2. NFS version 4
It is an improvement on version 3, with several additional features including:
- Reduces the information transfer required by the mount protocol.
- Security at the RPC layer
- Supports RPCSEC_GSS
- Supports kerberos
- New form of file handle
- Combined lookup and read commands
- Supports 32bit file format.