King Fahd University of Petroleum Minerals College of

  • Slides: 59
Download presentation
King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information

King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department ICS 343 Fundamentals of Computer Networks Remote Logging, Electronic Mail, and File Transfer These slides are based on: Chapter 26, Data Communications and Networking, 4 th Edition

26. 2 REMOTE LOGGING It would be impossible to write a specific client/server program

26. 2 REMOTE LOGGING It would be impossible to write a specific client/server program for each demand. The better solution is a general-purpose client/server program that lets a user access any application program on a remote computer. Topics discussed in this section: TELNET

26. 3 Note TELNET is a general-purpose client/server application program. It uses one TCP

26. 3 Note TELNET is a general-purpose client/server application program. It uses one TCP connection on the wellknown port 23.

26. 4 Figure 26. 1 Local and remote log-in

26. 4 Figure 26. 1 Local and remote log-in

26. 5 Figure 26. 2 Concept of NVT For compatibility, TELNET translates characters (data

26. 5 Figure 26. 2 Concept of NVT For compatibility, TELNET translates characters (data and commands to/from NVT character set.

26. 6 Table 26. 1 Some NVT control characters

26. 6 Table 26. 1 Some NVT control characters

26. 7 Figure 26. 3 An example of embedding Result of correcting a character:

26. 7 Figure 26. 3 An example of embedding Result of correcting a character: cat filea<backspace>1

26. 8 Table 26. 2 Options TELNET lets the client and the server negotiate

26. 8 Table 26. 2 Options TELNET lets the client and the server negotiate options before or during the use of the service.

Table 26. 3 NVT character set for option negotiation 26. 9

Table 26. 3 NVT character set for option negotiation 26. 9

Example Figure 26. 4 shows an example of option negotiation. In this example, the

Example Figure 26. 4 shows an example of option negotiation. In this example, the client wants the server to echo each character sent to the server. The echo option is enabled by the server because it is the server that sends the characters back to the user terminal. Therefore, the client should request from the server the enabling of the option using DO. The request consists of three characters: IAC, DO, and ECHO. The server accepts the request and enables the option. It informs the client by sending the three-character approval: IAC, WILL, and ECHO. 26. 10

Figure 26. 4 Example 26. 1: Echo option 26. 11

Figure 26. 4 Example 26. 1: Echo option 26. 11

26. 12 Table 26. 4 Character set for suboptions

26. 12 Table 26. 4 Character set for suboptions

Example Figure 26. 5 shows an example of suboption negotiation. In this example, the

Example Figure 26. 5 shows an example of suboption negotiation. In this example, the client wants to negotiate the type of the terminal. 26. 13

Figure 26. 5 Example of suboption negotiation 26. 14

Figure 26. 5 Example of suboption negotiation 26. 14

ELECTRONIC MAIL One of the most popular Internet services is electronic mail (e-mail). The

ELECTRONIC MAIL One of the most popular Internet services is electronic mail (e-mail). The designers of the Internet probably never imagined the popularity of this application program. Its architecture consists of several components that we discuss in this chapter. Topics discussed in this section: Architecture User Agent Message Transfer Agent: SMTP Message Access Agent: POP and IMAP Web-Based Mail 26. 15

Figure 26. 6 First scenario in electronic mail 26. 16

Figure 26. 6 First scenario in electronic mail 26. 16

26. 17 Note When the sender and the receiver of an e-mail are on

26. 17 Note When the sender and the receiver of an e-mail are on the same system, we need only two user agents.

Figure 26. 7 Second scenario in electronic mail 26. 18

Figure 26. 7 Second scenario in electronic mail 26. 18

26. 19 Note When the sender and the receiver of an e-mail are on

26. 19 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).

Figure 26. 8 Third scenario in electronic mail 26. 20

Figure 26. 8 Third scenario in electronic mail 26. 20

26. 21 Note When the sender is connected to the mail server via a

26. 21 Note When the sender is connected to the mail server via a LAN or a WAN, we need two UAs and two pairs of MTAs (client and server).

26. 22 Figure 26. 9 Fourth scenario in electronic mail

26. 22 Figure 26. 9 Fourth scenario in electronic mail

Figure 26. 10 Push versus pull in electronic email 26. 23

Figure 26. 10 Push versus pull in electronic email 26. 23

26. 24 Note When both sender and receiver are connected to the mail server

26. 24 Note When both sender and receiver are connected to the mail server via a LAN or a WAN, we need two UAs, two pairs of MTAs and a pair of MAAs. This is the most common situation today.

User Agent (UA) A User Agent (UA) is a software package (program) that composes,

User Agent (UA) A User Agent (UA) is a software package (program) that composes, reads, replies to, and forwards messages. The typical services of a UA are: There are two types of user UA: Command-driven GUI-based 26. 25

26. 26 Note Some examples of command-driven user agents are mail, pine, and elm.

26. 26 Note Some examples of command-driven user agents are mail, pine, and elm.

26. 27 Note Some examples of GUI-based user agents are Eudora, Outlook, and Netscape.

26. 27 Note Some examples of GUI-based user agents are Eudora, Outlook, and Netscape.

Figure 26. 12 Format of an e-mail 26. 28

Figure 26. 12 Format of an e-mail 26. 28

Figure 26. 13 E-mail address 26. 29

Figure 26. 13 E-mail address 26. 29

Multipuropse Internet Mail Extensions (MIME) Electronic mail can send messages only in NVT 7

Multipuropse Internet Mail Extensions (MIME) Electronic mail can send messages only in NVT 7 -bits ASCII format MIME is a supplementary protocol that allows non-ASCII data to be sent through e-mail. 26. 30

Figure 26. 15 MIME header 26. 31

Figure 26. 15 MIME header 26. 31

Table 26. 5 Data types and subtypes in MIME 26. 32

Table 26. 5 Data types and subtypes in MIME 26. 32

Table 26. 6 Content-transfer-encoding 26. 33

Table 26. 6 Content-transfer-encoding 26. 33

Simple Mail Transfer Protocol (SMTP) SMTP is a protocol to transfer mails It defines

Simple Mail Transfer Protocol (SMTP) SMTP is a protocol to transfer mails It defines the MTA client and server in the Internet SMTP defines how commands and responses must be sent back and forth between MTA client and server. 26. 34

Figure 26. 17 Commands and responses 26. 35

Figure 26. 17 Commands and responses 26. 35

Figure 26. 18 Command format 26. 36

Figure 26. 18 Command format 26. 36

Table 26. 7 Commands sent from the client to the server 26. 37

Table 26. 7 Commands sent from the client to the server 26. 37

Table 26. 8 Responses are sent from the server to the client 26. 38

Table 26. 8 Responses are sent from the server to the client 26. 38

Table 26. 8 Responses (continued) 26. 39

Table 26. 8 Responses (continued) 26. 39

Example $ telnet mail. adelphia. net 25 Trying 68. 168. 78. 100. . .

Example $ telnet mail. adelphia. net 25 Trying 68. 168. 78. 100. . . Connected to mail. adelphia. net (68. 168. 78. 100). 26. 40

Example 26. 41

Example 26. 41

Example 26. 42

Example 26. 42

POP 3 and IMAP 4 The first and the second stages of mail delivery

POP 3 and IMAP 4 The first and the second stages of mail delivery use SMTP. However, SMTP is not involved in the third stage because SMTP is a push protocol. There are two message access protocols: Post Office Protocol, version 3 (POP 3) Internet Mail Access Protocol, version 4 (IMAP 4) 26. 43

Figure 26. 19 POP 3 and IMAP 4 26. 44

Figure 26. 19 POP 3 and IMAP 4 26. 44

POP 3 vs IMAPv 4 POP 3 is deficient in several ways IMAP 4

POP 3 vs IMAPv 4 POP 3 is deficient in several ways IMAP 4 is more powerful and more complex POP 3 does not allow the user to organize her mail on the server POP 3 does not allow the user to partially check the contents of mail before downloading With IMAP 4, the user can check the e-mail header prior to downloading With IMAP 4, the user can search the contents of the email for a specific string of characters prior to downloading With IMAP 4, the user can partially download e-mail 26. 45

POP 3 vs IMAP 4 26. 46

POP 3 vs IMAP 4 26. 46

Figure 26. 20 The exchange of commands and responses in POP 3 26. 47

Figure 26. 20 The exchange of commands and responses in POP 3 26. 47

Web-based Mail Some websites provide email service to anyone who accesses the site Mail

Web-based Mail Some websites provide email service to anyone who accesses the site Mail transfer from the sender’s browser to the mail server is done through HTTP The transfer of the message from the sending mail server to the receiving mail server is still through SMTP The transfer from the receiving server to the receiver’s browser is done also through HTTP. 26. 48

FILE TRANSFER Transferring files from one computer to another is one of the most

FILE TRANSFER Transferring files from one computer to another is one of the most common tasks expected from a networking or internetworking environment. As a matter of fact, the greatest volume of data exchange in the Internet today is due to file transfer. Topics discussed in this section: File Transfer Protocol (FTP) Anonymous FTP 26. 49

26. 50 Note FTP uses the services of TCP. It needs two TCP connections:

26. 50 Note FTP uses the services of TCP. It needs two TCP connections: one for data transfer and the other for control information. The well-known port 21 is used for the control connection and the well-known port 20 for the data connection.

Figure 26. 21 FTP 26. 51

Figure 26. 21 FTP 26. 51

Figure 26. 22 Using the control connection Commands are responses are coverted to/from NVT

Figure 26. 22 Using the control connection Commands are responses are coverted to/from NVT 7 bit ASCII character set. 26. 52

Figure 26. 23 Using the data connection 26. 53

Figure 26. 23 Using the data connection 26. 53

Example The following shows an actual FTP session for retrieving a list of items

Example The following shows an actual FTP session for retrieving a list of items in a directory. The colored lines show the responses from the server control connection; the black lines show the commands sent by the client. The lines in white with a black background show data transfer. 1. After the control connection is created, the FTP server sends the 220 response. 2. The client sends its name. 3. The server responds with 331. 26. 54

Example 4. The client sends the password (not shown). 5. The server responds with

Example 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 the list of files on the directory named report. 7. Now the server responds with 150 and opens the data connection. 8. The server then sends the list of the files or directories on the data connection. 9. The client sends a QUIT command. 10. The server responds with 221. 26. 55

Example 26. 56

Example 26. 56

26. 57 Example We show an example of anonymous FTP. We assume that some

26. 57 Example We show an example of anonymous FTP. We assume that some public data are available at internic. net. continued on next slide

Example 26. 58

Example 26. 58

The end Important to do at home : - read chapter 26 of the

The end Important to do at home : - read chapter 26 of the textbook