Internet and Intranet Fundamentals
Class 5
Session A
Topics
• Telnet
• FTP
• SMTP
• NNTP
TelnetTopics
• Overview
• History
• Terminology, Model
• Commands
TelnetOverview
• General, bi-directional, byte-oriented communications facility– remote login
• Interfaces terminal devices and terminal-oriented processes– could also be used for process-process or
terminal-terminal communication
• TCP Application
TelnetHistory
• Very early beginning: 1971
• 1983: Standard– RFC 854 (Postel & Reynolds)
• http://info.internet.isi.edu:80/in-notes/rfc/files/rfc854.txt
TelnetTerminology, Model
• NVT = Network Virtual Terminal
• Negotiated Options
• Symmetric Treatment of Terminals and Processes
TelnetTerminology, 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
TelnetTerminology, 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.
TelnetCommands
NAME CODE MEANING
SE 240 End of subnegotiation parameters. NOP 241 No operation. Data Mark 242 The data stream portion of a Synch. This should always be accompanied by a TCP Urgent notification. Break 243 NVT character BRK. Interrupt Process 244 The function IP. Abort output 245 The function AO. Are You There 246 The function AYT. Erase character 247 The function EC. Erase Line 248 The function EL. Go ahead 249 The GA signal. SB 250 Indicates that what follows is subnegotiation of the indicated option.
TelnetCommands
WILL (option code) 251 Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.WON'T (option code) 252 Indicates the refusal to perform, or continue performing, the indicated option.DO (option code) 253 Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option.DON'T (option code) 254 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.IAC 255 Data Byte 255.
FTPFile 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
FTPHistory
• MIT 1971 (NCP)– RFC 114– RFC 141
• 1972 (NCP)– RFC 354
• 1980 (TCP)– RFC 765
FTPTerminology
• 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
ServerDTPFile
SystemFile System
Monitor
Keyboard
UserDTP
UserPI
UserInterface
ServerPI
FTPCommands& Replies
DataConnection
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
FTPModel
• 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
FTPCommands
• 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
FTPCommands
• 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
SMTPCommands
• HELO
• MAIL TO:
• RCPT FROM:
• DATA
• QUIT