Chapter 26 Standard Client-Server Protocols

Slides:



Advertisements
Similar presentations
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Advertisements

TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 23 Electronic Mail: SMTP,
Layer 7- Application Layer
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 23 Electronic Mail: SMTP,
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
26.1 Chapter 26 Remote Logging, Electronic Mail, and File Transfer Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or.
File Transfer Protocol (FTP)
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Chapter 26 remote logging & Ftp
Electronic Mail: SMTP, POP, and IMAP
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
TCP/IP Protocol Suite 1 Chapter 20 Upon completion you will be able to: Electronic Mail: SMTP, POP, and IMAP Understand four configurations of architecture.
26.1 Chapter 26 Remote Logging, Electronic Mail, and File Transfer Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or.
FTP (File Transfer Protocol) & Telnet
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Simple Mail Transfer Protocol (SMTP)
Web Technology. History of the Internet Internet was developed by ARPANet in ARPANet (American Research Project Agency Network)
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Network Protocols Chapter 26 (Data Communication and Networking): Remote Logging, Electronic Mail, and.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Electronic Mail: SMTP, POP IMAP, and MIME.
INTERNET TECHNOLOGIES
1 Architecture 2 User Agent 3 Message Transfer Agent 4 Message Access Agent 5 MIME 6 Web-Based Mail 7 Electronic Mail Security.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
26.1 Chapter 26 Remote Logging, Electronic Mail, and File Transfer Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or.
Chapter 26 Standard Client-Server Protocols Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
Chapter 2 Network Models
Introduction To Application Layer
Application layer Lecture 7.
Remote Logging, Electronic Mail, and File Transfer
Block 5: An application layer protocol: HTTP
Instructor Materials Chapter 5 Providing Network Services
Chapter 26 Standard Client-Server Protocols
WWW and HTTP King Fahd University of Petroleum & Minerals
JavaScript and Ajax (Internet Background)
Application layer 1 Principles of network applications 2 Web and HTTP
CNIT 131 Internet Basics & Beginning HTML
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet transport protocols services
Chapter 21 File Transfer: FTP and TFTP
Net 323 D: Networks Protocols
Web Development & Design Chapter 1, Sections 4, 5 & 6
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Computer Communication & Networks
Security at the Application Layer: PGP and S/MIME
Application layer Lecture 7.
Process-to-Process Delivery:
Chapter 2: Application layer
Net 323 D: Networks Protocols
HyperText Transfer Protocol
Chapter 2 Network Models
William Stallings Data and Computer Communications
Remote Logging, Electronic Mail,
FTP AND COMMAND PROCESSING IN FTP
PART 6 Application Layer
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
WEB SERVICES From Chapter 19, Distributed Systems
Chapter 7 Network Applications
Process-to-Process Delivery: UDP, TCP
Chapter 2 Application Layer
Presentation transcript:

Chapter 26 Standard Client-Server Protocols Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter 26: Outline 26.1 WORLD-WIDE WEB AND HTTP 26.2 FTP 26.3 ELECTRONIC MAIL 26.4 TELNET 26.5 SECURE SHELL (SSH) 26.6 DOMAIN NAME SYSTEM (DNS) 26.#

26-1 WORLD WIDE WEB AND HTTP In this section, we first introduce the World Wide Web (abbreviated WWW or Web). We then discuss the Hyper-Text Transfer Protocol (HTTP), the most common client-server application program used in relation to the Web. 26.3 26.#

26.26.1 World Wide Web The idea of the Web was first proposed by Tim Berners-Lee in 1989 at CERN, the European Organization for Nuclear Research, to allow several researchers at different locations throughout Europe to access each others’ researches. The commercial Web started in the early 1990s. 26.#

Example 26.1 Assume we need to retrieve a scientific document that contains one reference to another text file and one reference to a large image. Figure 26.1 shows the situation. The main document and the image are stored in two separate files in the same site (file A and file B); the referenced text file is stored in another site (file C). Since we are dealing with three different files, we need three transactions if we want to see the whole document. 26.5

Figure 26.1: Example 26.1 26.6 26.#

Figure 26.2: Browser 26.7 26.#

Example 26.2 The URL http://www.mhhe.com/compsci/forouzan/ defines the web page related to one of the of the computer in the McGraw-Hill company (the three letters www are part of the host name and are added to the commercial host). The path is compsci/forouzan/, which defines Forouzan’s web page under the directory compsci (computer science). 26.8

26.26.2 HyperText Transfer Protocol The HyperText Transfer Protocol (HTTP) is used to define how the client-server programs can be written to retrieve web pages from the Web. An HTTP client sends a request; an HTTP server returns a response. The server uses the port number 80; the client uses a temporary port number. HTTP uses the services of TCP, which, as discussed before, is a connection-oriented and reliable protocol. 26.#

Example 26.3 Figure 26.3 shows an example of a nonpersistent connection. The client needs to access a file that contains one link to an image. The text file and image are located on the same server. Here we need two connections. For each connection, TCP requires at least three handshake messages to establish the connection, but the request can be sent with the third one. After the connection is established, the object can be transferred. After receiving an object, another three handshake messages are needed to terminate the connection, as we will see in Chapter 23. 26.10

Figure 26.3: Example 26.3 26.11 26.#

Example 26.4 Figure 26.4 shows the same scenario as in Example 26.3, but using a persistent connection. Only one connection establishment and connection termination is used, but the request for the image is sent separately. 26.12

Figure 26.4: Example 26.4 26.13 26.#

Figure 26.5: Formats of the request and response messages 26.14 26.#

Table 26.1: Methods 26.15

Table 26.2: Request Header Names 26.16

Table 26.3: Response Header Names 26.17

Example 2656 This example retrieves a document (see Figure 26.6). We use the GET method to retrieve an image with the path /usr/bin/image26. The request line shows the method (GET), the URL, and the HTTP version (26.1). The header has two lines that show that the client can accept images in the GIF or JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, content encoding (MIME version, which will be described in electronic mail), and length of the document. The body of the document follows the header.. 26.18

Figure 26.6: Example 26.5 26.19 26.#

Example 26.6 In this example, the client wants to send a web page to be posted on the server. We use the PUT method. The request line shows the method (PUT), URL, and HTTP version (26.1). There are four lines of headers. The request body contains the web page to be posted. The response message contains the status line and four lines of headers. The created document, which is a CGI document, is included as the body (see Figure 26.7). 26.20

Figure 26.7: Example 26.6 26.21 26.#

Example 26.7 The following shows how a client imposes the modification data and time condition on a request. The status line in the response shows the file was not modified after the defined point in time. The body of the response message is also empty. 26.22

Example 26.8 Figure 26.8 shows a scenario in which an electronic store can benefit from the use of cookies. Assume a shopper wants to buy a toy from an electronic store named BestToys. The shopper browser (client) sends a request to the BestToys server. The server creates an empty shopping cart (a list) for the client and assigns an ID to the cart (for example, 12343). The server then sends a response message, which contains the images of all toys available, with a link under each toy that selects the toy if it is being clicked. This response message also includes the Set-Cookie header line whose value is 12343. The client displays the images and stores the cookie value in a file named BestToys. 26.23

Figure 26.8: Example 26.8 26.24 26.#

Example 26.9 Figure 26.9 shows an example of a use of a proxy server in a local network, such as the network on a campus or in a company. The proxy server is installed in the local network. When an HTTP request is created by any of the clients (browsers), the request is first directed to the proxy server If the proxy server already has the corresponding web page, it sends the response to the client. Otherwise, the proxy server acts as a client and sends the request to the web server in the Internet. When the response is returned, the proxy server makes a copy and stores it in its cache before sending it to the requesting client. 26.25

Figure 26.9: Example of a proxy server 26.26 26.#

26-2 FTP File Transfer Protocol (FTP) is the standard protocol provided by TCP/IP for copying a file from one host to another. Although transferring files from one system to another seems simple and straightforward, some problems must be dealt with first. 26.27 26.#

Figure 26.10: FTP 26.28 26.#

26.2.1 Two Connections The two connections in FTP have different lifetimes. The control connection remains connected during the entire interactive FTP session. The data connection is opened and then closed for each file transfer activity. It opens each time commands that involve transferring files are used, and it closes when the file is transferred. 26.#

26.2.2 Control Connection For control communication, FTP uses the same approach as TELNET (discussed later). It uses the NVT ASCII character set as used by TELNET. Communication is achieved through commands and responses. This simple method is adequate for the control connection because we send one command (or response) at a time. Each line is terminated with a two-character (carriage return and line feed) end-of-line token. 26.#

Table 26.4: Some FTP commands 26.31

Table 26.4 : Some FTP commands (continued) 26.32

Table 26.5: Some responses in FTP 26.33

26.2.3 Data Connection The data connection uses the well-known port 20 at the server site. However, the creation of a data connection is different from the control connection. The following shows the steps: The client, not the server, issues a passive open using an ephemeral port. Using the PORT command the client sends this port number to the server. 3. The server receives the port number and issues an active open using the well-known port 20 and the received ephemeral port number. 26.#

Example 26.10 Figure 26.11 shows an example of using FTP for retrieving a file. The figure shows only one file to be transferred. The control connection remains open all the time, but the data connection is opened and closed repeatedly. We assume the file is transferred in six sections. After all records have been transferred, the server control process announces that the file transfer is done. Since the client control process has no file to retrieve, it issues the QUIT command, which causes the service connection to be closed. 26.35

Figure 26.11: Example 26.12 26.36 26.#

Example 26.11 The following shows an actual FTP session that lists the directories. 26.37

26.2.4 Security for FTP The FTP protocol was designed when security was not a big issue. Although FTP requires a password, the password is sent in plaintext (unencrypted), which means it can be intercepted and used by an attacker. The data transfer connection also transfers data in plaintext, which is insecure. To be secure, one can add a Secure Socket Layer between the FTP application layer and the TCP layer. In this case FTP is called SSL-FTP. We also explore some secure file transfer applications when we discuss SSH later in the chapter. 26.#

26-3 ELECTRONIC MAIL Electronic mail (or e-mail) allows users to exchange messages. The nature of this application is different from other applications discussed so far. This means that the idea of client/server programming should be implemented in another way: using some intermediate computers (servers). 26.39 26.#

26.3.1 Architecture To explain the architecture of e-mail, we give a common scenario, as shown in Figure 26.12. Another possibility is the case in which Alice or Bob is directly connected to the corresponding mail server, in which LAN or WAN connection is not required, but this variation in the scenario does not affect our discussion. 26.#

Figure 26.12: Common scenario 26.41 26.#

Figure 26.13: Format of an e-mail 26.42 26.#

Figure 26.14: E-mail address 26.43 26.#

Figure 26.15: Protocols used in electronic mail 26.44 26.#

Table 26.6: SMTP Commands 26.45

Table 26.7: SMTP responses (Continued) 26.46

Table 26.7: SMTP responses (continued) 26.47

Example 26.12 To show the three mail transfer phases, we show all of the steps described above using the information depicted in Figure 26.16. In the figure, we have separated the messages related to the envelope, header, and body in the data transfer section. Note that the steps in this figure are repeated two times in each e-mail transfer: once from the e-mail sender to the local mail server and once from the local mail server to the remote mail server. The local mail server, after receiving the whole e-mail message, may spool it and send it to the remote mail server at another time. 26.48

Figure 26.16: Example 26.12 26.49 26.#

Figure 26.17: POP3 26.50 26.#

Figure 26.18: MIME 26.51 26.#

Figure 26.19: MIME header 26.52 26.#

Table 26.8: Data Types and Subtypes in MIME 26.53

Table 2.9: Methods for Content-Transfer-Encoding 26.54

Figure 26.20: Base64 conversion 26.55 26.#

Table 26.10: Base64 Converting Table 26.56

Figure 26.21: Quoted-printable 26.57 26.#

26.3.2 E-Mail Security The protocol discussed in this chapter does not provide any security provisions per se. However, e-mail exchanges can be secured using two application-layer securities designed in particular for e-mail systems. Two of these protocols, Pretty Good Privacy (PGP) and Secure/Multipurpose Internet Mail Extensions (S/MIME), are discussed in Chapter 32 after we have discussed basic network security. 26.#

Figure 26.22: Web-based e-mail, cases I and II 26.59 26.#

26.3.3 Iter. Programming Using TCP We are now ready to discuss network programming using the service of TCP, a connection-oriented service. 26.#

26-4 TELNET It is impossible to have a client/server pair for each type of service we need; the number of servers soon becomes intractable. The idea is not scalable. The solution is to have a specific client/server program for a set of common scenarios, but to have some generic client/server programs for the rest. 26.61 26.#

26.4.1 Local versus Remote Logging We first discuss the concept of local and remote logging as shown in Figure 26.23. 26.#

Figure 2.23: Local versus remote logging 26.63 26.#

Figure 26.24: Concept of NVT 26.64 26.#

Table 26.11: Examples of interface commands 26.65

26-5 SECURE SHELL (SSH) Although Secure Shell (SSH) is a secure application program that can be used today for several purposes such as remote logging and file transfer, it was originally designed to replace TELNET. There are two versions of SSH. The first version, SSH-1, is now deprecated because of security flaws in it. In this section, we discuss only SSH-2. 26.66 26.#

26.5.1 Components SSH is an application-layer protocol with three components, as shown in Figure 26.25. 26.#

Figure 26.25: Components of SSH 26.68 26.#

26.5.2 Applications Although SSH is often thought of as a replacement for TELNET, SSH is, in fact, a general-purpose protocol that provides a secure connection between a client and server. 26.#

Figure 26.26: Port Forwarding 26.70 26.#

Figure 26.27: SSH Packet Format 26.71 26.#