chapter 26 remote logging, electronic mail, and file ...plw/dccn/presentation/ch26.pdf · figure...
TRANSCRIPT
Chapter 26
Remote Logging, Electronic Mail,
and File Transferand File Transfer
26.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
2626--1 REMOTE LOGGING1 REMOTE LOGGING
ItIt wouldwould bebe impossibleimpossible toto writewrite aa specificspecific client/serverclient/serverItIt wouldwould bebe impossibleimpossible toto writewrite aa specificspecific client/serverclient/serverprogramprogram forfor eacheach demanddemand.. TheThe betterbetter solutionsolution isis aageneralgeneral--purposepurpose client/serverclient/server programprogram thatthat letslets aa userusergeneralgeneral purposepurpose client/serverclient/server programprogram thatthat letslets aa useruseraccessaccess anyany applicationapplication programprogram onon aa remoteremote computercomputer..
TELNETTopics discussed in this section:Topics discussed in this section:
26.2
Note
TELNET is a general-purpose li t/ li ticlient/server application program.
26.3
Figure 26.1 Local and remote log-in
26.4
Figure 26.2 Concept of NVT
26.5
Table 26.1 Some NVT control characters
26.6
Figure 26.3 An example of embedding
26.7
Table 26.2 Options
26.8
T bl 26 3 h f i i iTable 26.3 NVT character set for option negotiation
26.9
Example 26.1
Figure 26.4 shows an example of option negotiation. Inthis example the client wants the server to echo eachthis example, the client wants the server to echo eachcharacter sent to the server. The echo option is enabled bythe server because it is the server that sends thethe server because it is the server that sends thecharacters back to the user terminal. Therefore, the clientshould request from the server the enabling of the optionshould request from the server the enabling of the optionusing DO. The request consists of three characters: IAC,DO and ECHO The server accepts the request andDO, and ECHO. The server accepts the request andenables the option. It informs the client by sending thethree-character approval: IAC WILL and ECHOthree-character approval: IAC, WILL, and ECHO.
26.10
Figure 26.4 Example 26.1: Echo option
26.11
Table 26.4 Character set for suboptions
26.12
Example 26.2
Figure 26.5 shows an example of suboption negotiation.In this example, the client wants to negotiate the typeof the terminal.
26.13
Figure 26.5 Example of suboption negotiation
26.14
2626--2 2 ELECTRONIC MAILELECTRONIC MAIL
OneOne ofof thethe mostmost popularpopular InternetInternet servicesservices isis electronicelectronicOneOne ofof thethe mostmost popularpopular InternetInternet servicesservices isis electronicelectronicmailmail (e(e--mail)mail).. TheThe designersdesigners ofof thethe InternetInternet probablyprobablynevernever imaginedimagined thethe popularitypopularity ofof thisthis applicationapplicationnevernever imaginedimagined thethe popularitypopularity ofof thisthis applicationapplicationprogramprogram.. ItsIts architecturearchitecture consistsconsists ofof severalseveralcomponentscomponents thatthat wewe discussdiscuss inin thisthis chapterchaptercomponentscomponents thatthat wewe discussdiscuss inin thisthis chapterchapter..
Topics discussed in this section:Topics discussed in this section:ArchitectureUser Agent
Topics discussed in this section:Topics discussed in this section:
User AgentMessage Transfer Agent: SMTPMessage Access Agent: POP and IMAP
26.15
Web-Based Mail
Figure 26.6 First scenario in electronic mail
26.16
Note
When the sender and the receiver of an il th te-mail are on the same system,
we need only two user agents.
26.17
Figure 26.7 Second scenario in electronic mail
26.18
Wh th d d th i f
Note
When the sender and the receiver of an e-mail are on different systems, we
need two UAs and a pair of MTAs (client and server).s (c e t a d se e )
26.19
Figure 26.8 Third scenario in electronic mail
26.20
Note
When the sender is connected to the il i LAN WANmail server via a LAN or a WAN,
we need two UAs and two pairsof MTAs (client and server).
26.21
Figure 26.9 Fourth scenario in electronic mail
26.22
Figure 26.10 Push versus pull in electronic email
26.23
Note
When both sender and receiver are
Note
connected to the mail server via a LAN or a WAN we need twoa LAN or a WAN, we need two
UAs, two pairs of MTAs and a pair of MAAsand a pair of MAAs.
This is the most common situation today.
26.24
Figure 26.11 Services of user agent
26.25
Note
Some examples of command-driven t il iuser agents are mail, pine,
and elm.
26.26
Note
Some examples of GUI-based user t E d O tl k dagents are Eudora, Outlook, and
Netscape.
26.27
Figure 26.12 Format of an e-mail
26.28
Figure 26.13 E-mail address
26.29
Figure 26.14 MIME
26.30
Figure 26.15 MIME header
26.31
Table 26.5 Data types and subtypes in MIME
26.32
Table 26.6 Content-transfer-encoding
26.33
Figure 26.16 SMTP range
26.34
Figure 26.17 Commands and responses
26.35
Figure 26.18 Command format
26.36
Table 26.7 Commands
26.37
Table 26.8 Responses
26.38
Table 26.8 Responses (continued)
26.39
Example 26.3
Let us see how we can directly use SMTP to send ane-mail and simulate the commands and responses wedescribed in this section. We use TELNET to log into port
( h ll k f S ) h h25 (the well-known port for SMTP). We then use thecommands directly to send an e-mail. In this example,f b@ d l hi i di il hi [email protected] is sending an e-mail to himself.The first few lines show TELNET trying to connect to theAd l hi il Af i hAdelphia mail server. After connection, we can type theSMTP commands and then receive the responses, ash h lid N h h dd d fshown on the next slide. Note that we have added, for
clarification, some comment lines, designated by the “=”i Th li f h il d
26.40
signs. These lines are not part of the e-mail procedure.
Example 26.3 (continued)
$ telnet mail.adelphia.net 25Trying 68.168.78.100 . . .Connected to mail.adelphia.net (68.168.78.100).
26.41
Example 26.3 (continued)
26.42
Example 26.3 (continued)
26.43
Figure 26.19 POP3 and IMAP4
26.44
Figure 26.20 The exchange of commands and responses in POP3
26.45
2626--3 3 FILE TRANSFERFILE TRANSFER
T f iT f i filfil ff tt tt thth iiTransferringTransferring filesfiles fromfrom oneone computercomputer toto anotheranother isis oneoneofof thethe mostmost commoncommon taskstasks expectedexpected fromfrom aa networkingnetworking
i t t kii t t ki i ti t AA tttt ff f tf toror internetworkinginternetworking environmentenvironment.. AsAs aa mattermatter ofof fact,fact,thethe greatestgreatest volumevolume ofof datadata exchangeexchange inin thethe InternetInternett dt d ii dd tt filfil t ft ftodaytoday isis duedue toto filefile transfertransfer..
File Transfer Protocol (FTP)Topics discussed in this section:Topics discussed in this section:
Anonymous FTP
26.46
Note
FTP uses the services of TCP. It needs two TCP connections.
The well-known port 21 is used for the control connection and the well-knowncontrol connection and the well-known
port 20 for the data connection.
26.47
Figure 26.21 FTP
26.48
Figure 26.22 Using the control connection
26.49
Figure 26.23 Using the data connection
26.50
Example 26.4
The following shows an actual FTP session for retrievinga list of items in a directory. The colored lines show theresponses from the server control connection; the blackli h h d b h li h li ilines show the commands sent by the client. The lines inwhite with a black background show data transfer.
1. After the control connection is created, the FTP serverd h 220sends the 220 response.
2. The client sends its name.3 Th d i h 3313. The server responds with 331.
26.51
Example 26.4 (continued)
4. The client sends the password (not shown).5. The server responds with 230 (user log-in is OK).6. The client sends the list command (ls reports) to find
h li f fil h di dthe list of files on the directory named report.7. Now the server responds with 150 and opens the data
iconnection.8. The server then sends the list of the files or directories
h d ion the data connection.9. The client sends a QUIT command.10. The server responds with 221.
26.52
Example 26.4 (continued)
26.53
Example 26.5
We show an example of anonymous FTP. We assume that We show an example of anonymous FTP. We assume that some public data are available at internic.net.some public data are available at internic.net.
i d lidcontinued on next slide
26.54
Example 26.5 (continued)
26.55