Transcript Session 5A

Internet and Intranet
Fundamentals
Class 5
Session A
Topics
•
•
•
•
Telnet
FTP
SMTP
NNTP
Telnet
Topics
•
•
•
•
Overview
History
Terminology, Model
Commands
Telnet
Overview
• General, bi-directional, byte-oriented
communications facility
– remote login
• Interfaces terminal devices and terminaloriented processes
– could also be used for process-process or
terminal-terminal communication
• TCP Application
Telnet
History
• Very early beginning: 1971
• 1983: Standard
– RFC 854 (Postel & Reynolds)
• http://info.internet.isi.edu:80/in-notes/rfc/files/rfc854.txt
Telnet
Terminology, Model
• NVT = Network Virtual Terminal
• Negotiated Options
• Symmetric Treatment of Terminals and
Processes
Telnet
Terminology, Model
• NVT
– Network Virtual Terminal
– standard, intermediate representation of
canonical terminal
– each end assumed to originate and terminate
– user host is host with physical terminal
• but could just be the host that initiated the
communication
Telnet
Terminology, Model
• Principle of Negotiated Options
– DO, DONT, WILL, WONT
– allows user and server to agree on set of
conventions for the Telnet session
• conventions such as character set, echoing, etc.
– either party can initiate a request that some
option take effect
– other party can accept or reject
• may refuse to enable; must never refuse to disable
Telnet
Terminology, Model
• Two-Byte or Three-Byte Command
Structure
– IAC = interpret as command
– followed by command code
– followed optionally by argument / option
• Examples:
– AYT, AO, GA, WILL, WONT, etc.
Telnet
Commands
NAME
CODE
SE
NOP
Data Mark
240
241
242
Break
Interrupt Process
Abort output
Are You There
Erase character
Erase Line
Go ahead
SB
243
244
245
246
247
248
249
250
MEANING
End of subnegotiation parameters.
No operation.
The data stream portion of a Synch.
This should always be accompanied
by a TCP Urgent notification.
NVT character BRK.
The function IP.
The function AO.
The function AYT.
The function EC.
The function EL.
The GA signal.
Indicates that what follows is
subnegotiation of the indicated
option.
Telnet
Commands
WILL (option code)
251
WON'T (option code)
252
DO (option code)
253
DON'T (option code)
254
IAC
255
Indicates the desire to begin
performing, or confirmation that
you are now performing, the
indicated option.
Indicates the refusal to perform,
or continue performing, the
indicated option.
Indicates the request that the
other party perform, or
confirmation that you are expecting
the other party to perform, the
indicated option.
Indicates the demand that the
other party stop performing,
or confirmation that you are no
longer expecting the other party
to perform, the indicated option.
Data Byte 255.
FTP
File Transfer Protocol
•
•
•
•
•
•
Objectives
History
Terminology, Model
Commands
Process
Relation to Other Application Protocols
Objectives of FTP
• Promote … file sharing
• Encourage … indirect / implicit use of
remote computers
• Shield … user from file system variations
• Facilitate … reliable and efficient data
transfer
Objectives of FTP
“FTP, though usable directly by a user
at a terminal, is designed mainly for use by programs.”
-- Postel, Reynolds, RFC 959, October 1985
FTP
History
• MIT 1971 (NCP)
– RFC 114
– RFC 141
• 1972 (NCP)
– RFC 354
• 1980 (TCP)
– RFC 765
FTP
Terminology
• data connection
– A simplex connection over which data is
transferred, in a specified mode and type.
• DTP
– data transfer process
server-DTP, user-DTP
– active and passive states
• PI
– protocol interpreter
server-PI, user-PI
FTP Model
Monitor
User
Interface
File
System
Server
PI
FTP
Commands
& Replies
User
PI
Server
DTP
Data
Connection
User
DTP
Keyboard
File System
FTP
Model
• Connections
– do not need to exist all of the time
– bi-directional
• User-PI initiates TELNET connection
• FTP commands sent to server via TELNET
– control the data connection
• Replies sent from server-PI to user-PI via
TELNET
FTP
Model
• User-DTP listens (like a server) on data port
• Data port does not need to be on same host
as sender of FTP commands
• Can transfer data between two remote hosts
FTP
Commands
• Access Control Commands
– user
– password
– quit
• Transfer Parameter Commands
– PORT h1,h2,h3,h4,p1,p2
• data port = p1 * 256 + p2
– PASV (passive)
• order server-DTP to listen
• ordinarily, server-DTP initiates a connection request
FTP
Commands
•
•
•
•
•
•
RETR
STOR
APPE
DELE
CWD
LIST
SMTP
• Simple Mail Transport Protocol
• Model
– at user request, two-way comm channel set up
between sender-SMTP and receiver-SMTP
– receiver may be ultimate or intermediate
– commands are send and replies are received
– use Telnet to port 25
• try help to see commands
SMTP
• Receiver-SMTP writes (appends) to file
– typically a mailbox file
• Receiver-SMTP sends replies back to
sender-SMTP
SMTP
Commands
•
•
•
•
•
HELO
MAIL TO:
RCPT FROM:
DATA
QUIT