Download presentation
Presentation is loading. Please wait.
Published byHilary Eaton Modified over 9 years ago
1
Chapter Objectives After completing this chapter you will be able to: Understand remote command execution (Telnet and rlogin) Understand remote file transfer protocol (FTP, TFTP, RPC) Understand protocols for mail transfer (SMTP, POP3, IMAP4) Understand NFS and HTTP protocols
2
Telnet Remote terminal protocol which allows a user at one site to establish a TCP connection to a login server at another Username and password are transferred unsecured (plain text) through the network Defines a network virtual terminal that provides a standard interface to remote systems Includes a mechanism that allows the client and server to negotiate options, and it provides a set of standard options Treats both ends of the connection symmetrically
3
Telnet (Contd) LAN Local Login Remote Login SERVER Remote Telnet Client Local directly attached Client
4
Network Virtual Terminal (NVT) Telnet Client Telnet Server NUL BEL BS HT LF VT FF CR ASCII Control code Decimal value 0 7 8 9 10 11 12 13 Assigned meaning No operation (has no effect on output) Produce audible signal Move left one character position Move right to the next horizontal tab stop Move down (vertically) to the next line Move down to the next vertical tab stop Move to the top of the next page Move to the left margin on the current line TCP Connection NVT format used Server system format used Client system format used
5
Telnet Command Codes SE NOP DM BRK IP AO AYT EC 240 241 242 243 244 245 246 247 End of option sub-negotiation No operation Data mark Break Interrupt process Abort output Are you there Erase character Command Decimal Value Assigned Meaning EL GA SB WILL WONT DO DONT IAC 248 249 250 251 252 253 254 255 Erase line Go ahead Begin sub-negotiation Sender request enabling option Sender rejects enabling option Sender requests other side enabling option Sender rejects other side enabling option Interpret next octet as command
6
Telnet Options Transmit Binary Echo Suppress-GA Status Timing-mark Terminal-type End-of-record Linemode NameCode 0 1 3 5 6 24 25 34 Assigned meaning Change transmission to 8-bit binary Allow one side to echo data it receives Suppress go-ahead signal after data Request for status of a Telnet option from remote site Request timing mark to be inserted in return stream Exchange info.. about the terminal type being used Terminate data sent with EOR code Send complete lines instead of individual characters RFC 856 857 858 859 860 884 885 1116
7
Rlogin Rlogin is a more flexible implementation of Telnet for UNIX Rsh invokes a command interpreter on the remote UNIX machine and passes the command line arguments to the command interpreter The format of a command invocation using rsh is: –rsh –rsh unixserver1 ps Rlogin understands the UNIX notions of standard input, standard output, and standard error, and uses TCP to connect them to the remote machine. – “rsh unixserver1 ps > filename
8
File Transfer Protocol (FTP) FTP is the Internet standard for file transfer. FTP is used to copy a complete file from one system to another system. FTP also offers facilities other than the transfer function itself: –Interactive access –Format specification –Authentication control
9
File Transfer Protocol - (FTP) FTP control (port 21) FTP data (port 20)
10
FTP Commands CommandDescription open disconnect user cd lcd pwd get/mget put/mput binary ascii connect to remote FTP terminate FTP session send new user info when already connected change remote working directory change local working directory print working directory on remote machine receive file/get multiple files send file/send multiple files set binary transfer type set ascii transfer type dir/lslist contents of remote directory helpget help delete terminate ftp session and exitbye delete a file on the remote directory
11
FTP Replies 1yz Positive preliminary reply. The action is being started, but expect another reply, before sending another command. Positive completion reply. A new command can be sent. Positive intermediate reply. The command has been accepted but another command must be sent. Transient negative completion reply.The requested action did not take place, but the error condition is temporary so the command can be reissued later. Permanent negative completion reply. The command was not accepted and should not be retried. 2yz 3yz 4yz 5yz Syntax errors Information Connections; Replies referring to the control or data connections. Authentication and accounting. Replies for the login or accounting commands. Unspecified Filesystem status Reply Description x0zx0z x1zx1z x2zx2z x3zx3z x4zx4z x5zx5z
12
FTP Example > ftp rs.internic.net Connected to rs.internic.net. 220-*****Welcome to the InterNIC Registration Host ***** *****Login with username "anonymous" *****You may change directories to the following: policy - Registration Policies templates - Registration Templates netinfo - NIC Information Files domain - Root Domain Zone Files 220 And more! User (rs.internic.net:(none)): anonymous 331 Guest login ok, send your complete e-mail address as password. Password:xxxxxxxxxxxx 230 Guest login ok, access restrictions apply. ftp> cd rfc 250 CWD command successful. ftp> get rfc1878.txt 200 PORT command successful. 150 Opening ASCII mode data connection for rfc1878.txt (19414 bytes). 226 Transfer complete. ftp: 19865 bytes received in 85.02Seconds 0.23Kbytes/sec.
13
FTP Example (Contd) Client Server USER PASS guest TYPE ASCII STRU FILE MODE STREAM QUIT RETR 230 User logged in, access restrictions apply 200 Command OK 150 Opening data connection for... 226 Transfer complete anonymous 200 Command OK 200 Port Command OK
14
TFTP - Trivial File Transfer Protocol TFTP is an extremely simple protocol to transfer files Communication between a TFTP client and server uses UDP (port 69) not TCP TFTP does not have authorisation TFTP always sends 512-byte blocks of data
15
TFTP Process TFTP ClientTFTP Server (DATA) DATA 512 octets WRQ (WRQ) ACK (ACK) ACK (ACK) (DATA) DATA < 512 octets ACK (ACK)
16
Format of TFTP Messages Read request (1)00FilenameMode Write request (2)00FilenameMode Block numberData (3)Data Block numberAck (4) Error codeError (5)Error message0 2 octets n octets Up to 512 octets 1 octet
17
Remote Procedure Call RPC executes procedures (tasks, subroutines, and sub- procedures) remotely. –The client obtains control and forms a message to the server that contains the arguments for the remote procedure –The server unpacks the arguments, performs the procedure, packs the results of the procedure in a message, and returns it to the client –The client unpacks the message and returns control to the calling program RPC is a session layer protocol than can use either UDP or TCP transport. header contains the transaction ID, the identifier for the direction of transfer, the protocol version number, the program number, the procedure number, and the authorisation.
18
Simple Mail Transfer Protocol (SMTP) SMTP is the Internet standard mail service Uses TCP port 25 SMTP TCP IP Network Interface (data-link & physical)
19
SMTP Process User –interactively creates the message User agent –accepts the message and formats it –builds list of destinations –sends list and message to a queue for the client Client –establishes TCP connection with remote SMTP servers –sends addresses to the relevant servers –sends single copy of message to each server Server –constructs a header (which includes pointer to user’s text) for each address –places header in the queue of the appropriate mailbox
20
SMTP Process (Contd) SMTP Client SMTP Client SMTP Server TCP/IP Internet SMTP Server Port 25 User terminal AUser terminal CUser terminal B SMTP System 1 SMTP System 2
21
SMTP Commands and Replies HELO MAIL RCPT SEND DATA QUIT Terminate connection Initialise connection
22
SMTP Commands HELO –sent by an SMTP agent to initialise a connection and identify the SMTP client. –format: “HELO(SP){domain host name}(CRLF)”. MAIL –identifies the sender –format: “MAIL(SP) (CRLF)”. RCPT –identifies the recipient –format: “RCPT(SP)TO: (CRLF)”.
23
SMTP Commands (Contd) DATA –informs the SMTP server that the phase of sending forward paths is complete – implies the next communication is data. –format: “DATA(CRLF)” SEND –identifies an individual terminal to receive the mail –format: “SEND(SP)TO: (CRLF)”. QUIT –advises the SMTP server that the SMTP client is finished –format: “QUIT(CRLF)”.
24
Reply Codes Reply Code Meaning 211System status 214Human information about how to use SMTP 220 service ready 221 service closing channel 250Requested mail action okay, completed 251User not local, forwarded to forward path 354Start mail input, end with. 421 Service not available 450Requested action aborted; mailbox unavailable 451Requested action aborted; error in processing 452Requested action aborted; insufficient storage 504Command parameter not implemented Reply Code Meaning 500Syntax error, command unrecognised 501Syntax error, in parameters or arguments 550Requested action not taken; mailbox unavailable 551Requested action not taken; error in processing 552User not local; please try 553Action not taken; mailbox name not allowed 503Bad sequence number 502Command not implemented 554Transaction failed
25
SMTP Protocol Example 1Server220 {Server Name B} Mail Transfer Service Ready NumberClient/ServerReply code communication 2 ClientHELO {Host Name A} 3 250 {Service Name B} 4 MAIL FROM: 5 250 OK 6 RCPT TO: 7 250 OK Server Client
26
SMTP Protocol Example (Contd) 8ClientRCPT TO: NumberClient/ServerReply code communication 9Server550 No such user here 10RCPT TO: 11250 OK 12DATA 13354 Start mail input; end with. 14{ASCII character text} Client Server 15 16 17 18. 250 OK QUIT 221 {Host Name B} Service closing channel
27
Post Office Protocol Version 3 (POP3) SMTP Client SMTP Client SMTP Server TCP/IP Internet SMTP Server Port 25 User terminal AUser terminal B SMTP System 1 SMTP System 2 POP 3 Client POP 3 Server Port 110
28
POP3 Basic Operation TCP Connection to port 110 Greeting POP 3 Client POP 3 Server
29
POP3 Basic Operation (Contd) Commands Replies POP 3 Client POP 3 Server 1. Authorisation State 2. Transaction State 3. Update State
30
POP3 Commands Valid in the Authorisation state –USER name –PASS string –QUIT
31
POP3 Commands (Contd) Valid in the Transaction state –STAT –LIST [msg] –RETR msg –DELE msg –NOOP –RSET –QUIT
32
POP3 Commands Example S: +OK mrose's maildrop has 2 messages (320 octets) C: STAT S: +OK 2 320 C: LIST S: +OK 2 messages (320 octets) S: 1 120 S: 2 200 S:. C: RETR 1 S: +OK 120 octets S: S:. C: DELE 1 S: +OK message 1 deleted C: RETR 2 S: +OK 200 octets S: S:. C: DELE 2 S: +OK message 2 deleted C: QUIT S: +OK dewey POP3 server signing off (maildrop empty) C:
33
Internet Message Access Protocol - Version 4 (IMAP4) SMTP Client SMTP Client SMTP Server TCP/IP Internet SMTP Server Port 25 User terminal AUser terminal B SMTP System 1 SMTP System 2 IMAP4 Client IMAP4 Server Port 143 IMAP4 Client IMAP4 Server
34
Network File System NFS provides transparent file access for clients to files and file systems on a server Client Kernel Server kernel Local file access NFS client TCP/UDP IP Local file access TCP/UDP IP NFS server Local disk User process
35
NFS Procedures GETATTR –Return the attributes of a file SETATTR –Set the attributes of a file STAFS –Return the status of a file system LOOKUP –Lookup a file READ –Read from a file WRITE –Write to a file CREATE –Create a file
36
NFS Procedures (Contd) REMOVE –Delete a file RENAME –Rename a file SYMLINK –Creates a symbolic link to a file READLINK –Read a symbolic link MKDIR –Create a directory RMDIR – Delete a directory READDIR –Read a directory
37
NFS Example SUN client Unix1 Sun% cd /nfs/unix1/usr/smith Sun% mkdir Mail Reply ok 96 sun104 getatttr Reply ok 96 104 getattr Reply ok 96 112 lookup “Mail” Reply ok 28 1144 mkdir “Mail” Reply ok 128 Unix1 sun Unix1 sun Unix1 sun Unix1 sun 1 3 4 5 6 7 8 9 10 2 SourceCommand
38
Hypertext Transfer Protocol The standard communication protocol between Web servers and clients is the Hypertext Transfer Protocol (HTTP) The standard language for writing Web documents is Hypertext Markup Language (HTML) Every Web page is assigned a unique URL (Uniform Resource Locator), for example: –http://www.ericsson.com/datacom/solutions
39
HTTP Message Format GET http://server.name/path/file.type commandURL protocol HTTP server domain name path name file name GET http://www.ericsson.com/datacom/solutions
40
HTTP/1.0 Full Request Method(SP)http://server.name/path/file.type(SP)HTTP/1.0(CR)(LF) General-header (CR)(LF) Request-header (CR)(LF) Entity-header (CR)(LF)(CR)(LF) Body
41
Web Operation Example DISK Internet Browser Program HTTP Server HTTP Server HTTP used over this TCP connection Client Server www.w3.org Server xyz.com Hyperlink to www.w3.org Hyperlink to xyz.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.