55
Chapter 26 Remote Logging, Electronic Mail, and File Transfer and File Transfer 26.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

  • Upload
    others

  • View
    7

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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.

Page 2: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 3: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Note

TELNET is a general-purpose li t/ li ticlient/server application program.

26.3

Page 4: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.1 Local and remote log-in

26.4

Page 5: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.2 Concept of NVT

26.5

Page 6: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.1 Some NVT control characters

26.6

Page 7: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.3 An example of embedding

26.7

Page 8: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.2 Options

26.8

Page 9: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

T bl 26 3 h f i i iTable 26.3 NVT character set for option negotiation

26.9

Page 10: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 11: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.4 Example 26.1: Echo option

26.11

Page 12: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.4 Character set for suboptions

26.12

Page 13: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 14: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.5 Example of suboption negotiation

26.14

Page 15: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 16: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.6 First scenario in electronic mail

26.16

Page 17: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 18: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.7 Second scenario in electronic mail

26.18

Page 19: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 20: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.8 Third scenario in electronic mail

26.20

Page 21: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 22: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.9 Fourth scenario in electronic mail

26.22

Page 23: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.10 Push versus pull in electronic email

26.23

Page 24: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 25: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.11 Services of user agent

26.25

Page 26: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Note

Some examples of command-driven t il iuser agents are mail, pine,

and elm.

26.26

Page 27: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Note

Some examples of GUI-based user t E d O tl k dagents are Eudora, Outlook, and

Netscape.

26.27

Page 28: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.12 Format of an e-mail

26.28

Page 29: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.13 E-mail address

26.29

Page 30: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.14 MIME

26.30

Page 31: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.15 MIME header

26.31

Page 32: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.5 Data types and subtypes in MIME

26.32

Page 33: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.6 Content-transfer-encoding

26.33

Page 34: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.16 SMTP range

26.34

Page 35: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.17 Commands and responses

26.35

Page 36: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.18 Command format

26.36

Page 37: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.7 Commands

26.37

Page 38: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.8 Responses

26.38

Page 39: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Table 26.8 Responses (continued)

26.39

Page 40: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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.

Page 41: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Example 26.3 (continued)

$ telnet mail.adelphia.net 25Trying 68.168.78.100 . . .Connected to mail.adelphia.net (68.168.78.100).

26.41

Page 42: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Example 26.3 (continued)

26.42

Page 43: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Example 26.3 (continued)

26.43

Page 44: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.19 POP3 and IMAP4

26.44

Page 45: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.20 The exchange of commands and responses in POP3

26.45

Page 46: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 47: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 48: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.21 FTP

26.48

Page 49: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.22 Using the control connection

26.49

Page 50: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Figure 26.23 Using the data connection

26.50

Page 51: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 52: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 53: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Example 26.4 (continued)

26.53

Page 54: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

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

Page 55: Chapter 26 Remote Logging, Electronic Mail, and File ...plw/dccn/presentation/ch26.pdf · Figure 26.9 Fourth scenario in electronic mail 26.22. Figure 26.10 Push versus pull in electronic

Example 26.5 (continued)

26.55