Telnet
•To Understand how TELNET works
•To Understand the role of NVT in a TELNET communication
•To Know how control characters are used
•To Know the TELNET modes of operation
Objectives
TELNET is a general-
purpose
client-server application
program.
NVT CHARACTER SET
NVTusestwosetsofcharacters,onefordataand
oneforcontrol.Bothare8-bitbytes.
The topics discussed in this section include:
Data Characters
Control Characters
Format of data characters
Format of control characters
OPTION NEGOTIATION
Touseanyoftheoptionsfirstrequiresoption
negotiationbetweentheclientandtheserver.Four
controlcharactersareusedforthispurpose.
The topics discussed in this section include:
Enabling an Option
Disabling an Option
Symmetry
NVT character set for option negotiation
Offer to enable an option
Request to enable an option
Offer to disable an option
Request to disable an option
Figure1showsanexampleofoptionnegotiation.Inthis
example,theclientwantstheservertoechoeachcharacter
senttotheserver.Inotherwords,whenacharacteristypedat
theuserkeyboardterminal,itgoestotheserverandissent
backtothescreenoftheuserbeforebeingprocessed.Theecho
optionisenabledbytheserverbecauseitistheserverthat
sendsthecharactersbacktotheuserterminal.Therefore,the
clientshouldrequestfromtheservertheenablingoftheoption
usingDO.Therequestconsistsofthreecharacters:IAC,DO,
andECHO.Theserveracceptstherequestandenablesthe
option.Itinformstheclientbysendingthethreecharacter
approval:IAC,WILL,andECHO.
Example1
See Next Slide
Echo option
CONTROLLING THE SERVER
Controlcharacterscanbeusedtocontroltheremoteserver.
MODE OF OPERATION
MostTELNETimplementationsoperateinoneofthree
modes:
Defaultmode
Charactermode
Linemode
Inthisexample,weusethedefaultmodetoshowthe
conceptanditsdeficiencieseventhoughitisalmostobsolete
today.Theclientandtheservernegotiatetheterminaltypeand
terminalspeedandthentheservercheckstheloginand
passwordoftheuser(seeFigure2).
Example2
See Next Slide
Figure 2
Inthisexample,weshowhowtheclientswitchestothe
charactermode.Thisrequiresthattheclientrequesttheserver
toenabletheSUPPRESSGOAHEADandECHOoptions(see
Figure3).
Example3
See Next Slide
Figure 3
USER INTERFACE
Theoperatingsystem(UNIX,forexample)definesan
interfacetoTELNETwithuser-friendlycommands.The
interfaceisresponsiblefortranslatingtheuser-friendly
commandstotheTELNETcommands.
Examples of interface commands
File Transfer Protocol
WHAT IS FTP?
•FTPworks on the client/server principle. A client
program enables the user to interact with a server in
order to access information and services on the
server computer.
The FTP is a command-Response protocol.
•Files that can be transferred are stored on computers
called FTP servers. To access these files, an FTP
client program is used. This is an interface that
allows the user to locate the file(s) to be transferred
and initiate the transfer process.
•The original specification for the File Transfer
Protocol was written byAbhay Bhushanand
published asRFC 114on 16 April 1971
MODE OF TRANSFER
•There are two modes of transfer in FTP: ascii and
binary.
•ASCII is used only for files saved in ASCII format (this
includes Postcript files)
•Binaryis used for files that are formatted and saved
using a wordprocessing software like WordPerfect (.txt),
spreadsheets (.xls), images (.jpg, .gif), and many
executable programs (.exe) and videos (.avi).
BASIC STEPS TO USE FTP
•Connectto the FTP server
•Navigatethe file structure to find the file you
want
•Transferthe file
•The specifics of each step will vary, depending
on the client program being used and the type
of Internet connection.
Usage of Port
•uses two TCP Ports
–one for control
–one for data transfers
Active Mode FTP
•Client connect from a random unprivileged port (n > 1023) to the
servers command port (21) and sends port command to tell server
to connect to n+1 then listens on the next higher unprivileged port
(n+1) for server responses. The server connects from it’s data port
(20) to the client data port (n+1)
ClientServer
20 21 1026 1027
1
2
3
4
Passive Mode FTP
•Client opens two random unprivileged ports ( n > 1023 and n+1; ex
1026 and 1027) and connects the first port (n) to server command
port 21 and issues a pasv command (server sends port to use for
data); client connects to servers specified data port, server
completes connection.
ClientServer
20 21 1026 1027
1
2
2024
3
4
File Structures
•Operating System store files in different structures
•FTP defined file structures for transporting files
–File F Unstructured, sequence of bytes
–RecordR Series of records
–Page P Series of data blocks (pages)
•Default file structure is File (F)
•File Structure specified using STRU command
Transmission Modes
•Mode is used to specify additional coding or sequencing
performed on data
•independent of data type and file structure
–Stream S stream of bytes, if record structure
EOF sent as record indication;
if file eof indicated by closing
stream
–Block B file sent as sequence of blocks
preceded by header info allows restart
of an interruped transfer
–Compressed C data compressed using run length
encoding
FTP Commands
•USER User name, userid for access control
•PASS Password for access control
•ACCT Account info
•CWD Change working directory
•CDUP Change to parent directory
•SMNT Structure mount, mount a different file
system
•QUIT informs server that client wants out
•REIN restarts session at authentication phase
•PORT Host addr and data port to use
FTP Commands (more)
•PASV Passive; informs server that client will
contact to set up data connections, ask
server to sent port info
•TYPE Data type, type of subsequent transfers
•STRU File structure
•MODE Transfer mode
•RETR Retrieve, download the file from server
•STOR Store, upload the specified to server
•STOU Store unique, same as store but server
picks unique file name
FTP Commands (more)
•APPE Append, upload file to server, if file name
exists, append the upload
•ALLO Allocate, sometimes used to preallocate space
•REST Restart, restart an interrupted transfer
•RNFR Rename file from filename
•RNTO Rename file to
•ABOR Abort, ask server to abort last command
•DELE Delete specified file
•RMD Remove directory
•MKD Make directory
FTP Commands (more)
•PWD Print working directory
•LIST Request directory listing
•NLST Request just a file name list
•SITE Site parameters, allow client to specify
site specific options and parameters
•SYST request server operating system
•STAT Request server to send status of current
xfr
•HELP general and command specific
•NOOP ask server to send a positive reply
FTP TERMINOLOGY
•ASCII-American Standard Code for Information Interchange) --Standard for the
code numbers used by computers to represent all the upper and lower-case Latin
letters, numbers, punctuation, tec. There are 128 standard ASCII codes each of
which can be represented by a 7 digit binary number: 0000000 through 1111111.
•BINARY-Used for files that are formatted and saved using a wordprocessing
software like WordPerfect, spreadsheets, images, and many executable
programs.
•BROWSER-A program which allows a person to read hypertext. The browser
gives some means of viewing the contents of nodes, and of navigating from one
node to another.
•FTP -(File Transfer Protocol)-a client program that enables the user to send files
from one computer to another via the telephone network with the aid of the
internet.
•LOCAL PC -your desktop computer that you will transfer files to.
•HOST-Any computer on a network that is a repository for services available to
other computers on the network..
•LOGIN -The account name used to gain access to a computer system, or the act
of entering into a computer system.
•NAVIGATION-The process of moving from one node or host to another through
the hypertext web. This is normally done by following links.
FTP TERMINOLOGY
•NODE -Any single computer connected to a network.
•PROTOCOLS -sets of communication rules that allow clients and servers
to communicate accurately with each other.
•MAIL ADDRESS -your complete e-mail address.
•SERVER -A computer, or a software package, that provides a specific kind
of service to client software running on other computers.
•INTERNET-The vast collection of inter-connected networks that all use the
TCP/IP protocols and that evolved from the ARPANET of the late 60’s and
70’s.
•TCP/IP -Transmission Control Protocl/Internet Protocol --/tus us te syute if
oriticiks that defines the Internet. To be truly on the Internet, your computer
must have TCP/IP software.
•ANONYMOUS FTP -Allows a user to retrieve documents, files, programs,
and other archived data from anywhere in the Internet without having to
establish a userid and password. By using the special userid of
“anonymous” the network user will bypass local security checks and will
have access to publicly accessible files on the remote system.
FTP TERMINOLOGY
(CONT.)
•VIRUS PROGRAMS -viruses are small, invasive programs that are
designed to create havoc within your computer systems. There is software
to protect your computer from viruses. If you plan to swap disks with others,
the first software program you should install should be a virus protection
program.
•TELNET-The command and program used to login from one Internet site
to another. The telnet command/program gets you to the “login” prompt of
another host.
•CLIENT -A software program that is used to contact and obtain data from a
Server software program on another computer, often across a great
distance. Each Client program is designed to work with one or more
specific kinds of Server programs, and each Server requires a specific kind
of Client.
•VIRUS-A program which replicates itself on computer systems by
incorporating itself into other programs which are shared among computer
systems.
•ARCHIVE SITE -A machine that provides access to a collection of files
across the Internet.
•USER ID -On most host systems, the first time you connect you are asked
to supply a one-word user name. This can be any combination of letters
and numbers. This is usally also your e-mail name.
FTP QUESTIONNAIRE
( & ANSWERS)
•Define FTP
•File Transfer Protocol -the ability to send files from one computer to another via the
telephone network with the aid of the internet.
•What is the command in FTP to change directories?
cd or lcd
•What is the command to list your files?
dir or ls
•What is the difference between ASCII and Binary files?
ASCII is used only for files saved in ASCII format and Binary is used for files that are
formatted and saved using a Word Processing software.
•What type of file is a file with the extension:
.exe?executable
.txt? text
.jpg?picture
.avi?video/movie
.zip?compressed
•What do you enter as your password when logging in as “Anonymous”?
Your total e-mail address
•What safety measures should you take before downloading files from the Internet?
Be sure to have virus detection software loaded on your computer before downloading
files to be sure you don’t infect your computer with a virus.