FTP (File Transfer Protocol) Computer
FTP (File Transfer Protocol) Computer
FTP (File Transfer Protocol) is the generic term for a group of computer programs aimed at
facilitating the transfer of files or data from one computer to another. It originated in the
Massachusetts Institute of Technology (MIT) in the early 1970s when mainframes, dumb terminals
and time-sharing were the standard.
Traditionally, when communications speeds were low (ranging from the then-standard 9.8 kbps to the
"fast" 16.8 Kbps unlike today's broadband 1 Mbps standard) FTP was the method of choice for
downloading large files from various websites. Although the FTP programs have been improved and
updated over time, the basic concepts and definitions remain the same and are still in use today.
The key definition to remember is the term " protocol," which means a set of rules or standards that
govern the interactions between computers. It is a key component in many terms that are now taken
for granted: Transmission Control Protocol / Internet Protocol or TCP/ IP, the governing standards
for internet communications; Hyper Text Transfer Protocol or HTTP, which established the
benchmarks for internet addresses and communications between two computers in the internet; and
File Transfer Protocol (FTP) which, as has been said, sets the rules for transferring files between
computers.
The primary
objective in the
formulation of File
Transfer Protocols
was to make file
transfers
uncomplicated
and to relieve the
user of the burden
of learning the
details on how the
transfer is actually
accomplished.
The result of all
these standards
and rules can be
seen in today's
web interactions,
where pointing-and-clicking (with a mouse) initiates a series of actions that the typical internet user
does not see or even remotely understand.
Differences between FTP and HTTP
The major difference between FTP and HTTP is that FTP is a two-way system - it can be used to
copy or move files from a server to a client computer as well as upload or transfer files from a client
to a server. HTTP, on the other hand, is strictly one-way: "transferring" text, pictures and other data
(formulated into a web page) from the "server" to a client computer which uses a web browser to
view the data.
Another point to bear in mind is that File Transfer in FTP means exactly that: files are automatically
copied or moved from a file server to a client computer's hard drive, and vice versa. On the other
hand, files in an HTTP transfer are viewed and can 'disappear' when the browser is turned off unless
the user executes commands to move the data to the computer's memory.
Another major difference between the two systems lies in the manner in which the data is encoded
and transmitted. FTP systems generally encode and transmit their data in binary sets which allow
for faster data transfer; HTTP systems encode their data in MIME format which is larger and more
complex. Note that when attaching files to emails, the size of the file is usually larger than the original
because of the additional encoding involved.
The Transmission Control Protocol (TCP) is one of the central protocols of the Internet Protocol
Suite. TCP is one of the two original components of the entire Internet Protocol Suite, commonly
referred to as TCP/ IP. IP manages the lower-level transmissions from machine to machine and
TCP functions at a higher level, concerned only with the two end computers.
TCP (Transmission Control Protocol) is the major transport protocol utilized in IP networks . The TCP
protocol exists on the Transport Layer of the OSI Model. The TCP protocol is a connection-oriented
protocol which provides end-to-end reliability.
By connection-oriented, we mean
that before two network nodes can
communicate using TCP, they
must first complete a handshaking
protocol to create a connection.
When we say that TCP provides
end-to-end reliability, we mean that
TCP includes mechanisms for
error detection and error correction
between the source and the
destination.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Source Port: It is 16 bit long and is used to identify the sending port.
Destination Port: It is 16 bit long and is used to identify the receiving port.
Sequence Number: It is 32 bit long. If the SYN flag is set then this becomes the first sequence
number. The real sequence number of the first data byte will be this sequence number plus 1. If the
SYN flag is not set, then this becomes the sequence number of the first date byte.
Acknowledgement Number: It is 32 bit long. If the ACK flag is set then this field’s value is the next
sequence number that the receiver is expecting.
Data Offset: It is 4 bit long. It indicates the size of the TCP header in 32-bit words. The least size
header is 5 words and the maximum is 15 words. As the name suggest, it is also the offset from the
start of the TCP segment to the real data.
Reserved: It is 4 bit long. It is basically reserved for future use and must be set to zero.
Flags: They are also known as Control Bits. They shelter 8 1-bit flags for various purposes.
CWR – It stands for Congestion Window Reduced (CWR) flag. It is set by the sending machine to
specify that it received a TCP segment with the ECE flag set.
ECE – It stands for Explicit Congestion Notification. It specifies that the TCP peer is ECN capable during
3-way handshake.
URG - It specifies that the URGent pointer field is important.
ACK – It specifies that the ACKnowledgment field is important.
PSH _ It is used for Push function.
RST – It is used to ReSeT the connection.
SYN – It is used to SYNchronize the sequence numbers.
FIN – It indicates a FINish mark specifying that sender do not have any more data to transfer.
Window – It is 16 bit long. It is basically the size of the receiving window, which indicates the number of
bytes that the receiver can presently accept.
Checksum – It is 16 bit long. It is used for error diagnoses of the header and data.
Urgent pointer - It is 16 bit long. if the URG flag is set, then this field is an offset from the sequence
number specifying the last urgent data byte.
Options - It is a variable length field. The complete length of this field must be a multiple of a 32-bit
word and the data offset field adjusted appropriately.
Data - It is a variable length field. This portion holds the actual data of the TCP segment.
EXTRA:
TCP/IP is a two-layer program. The higher layer, Transmission Control Protocol, manages
the assembling of a message or file into smaller packets that are transmitted over the Internet
and received by a TCP layer that reassembles the packets into the original message. The
lower layer, Internet Protocol, handles the address part of each packet so that it gets to the
right destination. Each gateway computer on the network checks this address to see where to
forward the message. Even though some packets from the same message are routed
differently than others, they'll be reassembled at the destination.
TCP/IP uses the client/server model of communication in which a computer user (a client)
requests and is provided a service (such as sending a Web page) by another computer (a
server) in the network. TCP/IP communication is primarily point-to-point, meaning each
communication is from one point (or host computer) in the network to another point or host
computer. TCP/IP and the higher-level applications that use it are collectively said to be
"stateless" because each client request is considered a new request unrelated to any previous
one (unlike ordinary phone conversations that require a dedicated connection for the call
duration). Being stateless frees network paths so that everyone can use them continuously.
(Note that the TCP layer itself is not stateless as far as any one message is concerned. Its
connection remains in place until all packets in a message have been received.)
Many Internet users are familiar with the even higher layer application protocols that use
TCP/IP to get to the Internet. These include the World Wide Web's Hypertext Transfer
Protocol (HTTP), the File Transfer Protocol (FTP), Telnet (Telnet) which lets you logon to
remote computers, and the Simple Mail Transfer Protocol (SMTP). These and other protocols
are often packaged together with TCP/IP as a "suite."
Personal computer users with an analog phone modem connection to the Internet usually get
to the Internet through the Serial Line Internet Protocol (SLIP) or the Point-to-Point Protocol
(PPP). These protocols encapsulate the IP packets so that they can be sent over the dial-up
phone connection to an access provider's modem.
Protocols related to TCP/IP include the User Datagram Protocol (UDP), which is used instead
of TCP for special purposes. Other protocols are used by network host computers for
exchanging router information. These include the Internet Control Message Protocol (ICMP),
the Interior Gateway Protocol (IGP), the Exterior Gateway Protocol (EGP), and the Border
Gateway Protocol (BGP).
User Datagram Protocol or UDP is part of the Internet Protocol suite, using which, programs
running on different computers on a network can send short messages known as Datagrams to one
another. UDP can be used in networks where TCP is traditionally implemented, but unlike TCP, it
does not guarantee reliability or the correct sequencing of data. Datagrams may go missing without
notice, or arrive in a different order from the one in which they were sent. The protocol was formulated
by David P. Reed in 1980 and officially defined in RFC 768.
UDP makes use of a simple communication model without implicit transmission checks for
guaranteeing reliability, sequencing, or datagram integrity. Though these factors might seem to
suggest that UDP is not a useful protocol, it still finds wide usage in particular areas where speed,
more than reliability, is of utmost importance. UDP considers that error checks and corrections should
be carried out in the communicating application, and not at the network layer. However, if error
checks and corrections are needed at the network layer, the application can make use of
Transmission Control Protocol (TCP) or Stream Control Transmission Protocol (SCTP), which are
specifically formulated for this reason. Since UDP does not have the overhead of checking whether
the data has reached the destination every time it is sent, it makes the protocol that much faster and
more efficient. UDP is often used for time-sensitive applications where missing data is preferred to
late-arriving data.
The Physical Layer consisting of the actual channel for data flow like coaxial, twisted pair or
fiber optic cables
The Data Link Layer implementing Wi-Fi, ISDN, GPRS etc
The Network / Internet Layer
Transport Layer implementing TCP, UDP etc
Application Layer running DNS, FTP, HTTP, POP3, SMTP, Telnet etc
As shown above, UDP belongs to the fourth layer. Although the entire amount of UDP traffic in a
network is a small fraction of the whole, a number of key application in the fifth layer like DNS and
SNMP or simple network management protocol use UDP.
UDP Packet
The UDP header comprises of only four fields. The use of two of those is optional (light red
background in diagram).
Source Port
Source port recognizes the sending port and should be understood to be the port to respond to if
required. If not used, then its value should be zero.
Destination Port
Destination port recognizes the destination port and is mandatory.
Length
A 16-bit length field indicates the length in bytes of the complete datagram: header and data.
Checksum
The 16-bit checksum field is implemented for error-checking of the header and data. The algorithm for
computing the checksum is different for transmission over IPv4 and IPv6.