SlideShare a Scribd company logo
1 of 139
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 21
File Transfer:
FTP
and
TFTP
1
TCP/IP Protocol Suite
OBJECTIVES:
 To discuss FTP and two connections used in this protocol:
control connection and data connection.
 To discuss six classes of commands sent by the client to establish
communication with the server.
 To explain three types of file transfer transferred by FTP.
 To show some user-friendly commands used by some FTP
interfaces.
 To discuss anonymous FTP and its application.
 To discuss how file transfer can be done using a secure channel.
 To discuss TFTP as a simple file transfer protocol without the
complexities and sophistication of FTP.
2
TCP/IP Protocol Suite
OBJECTIVES (continued):
 To discuss five types of TFTP messages and their applications.
 To discuss the sorcerer’s apprentice bug related to TFTP’s flow-
and error-control mechanisms.
 To show how TFTP can be used in conjunction with DHCP to
initialize devices by downloading configuration files.
3
TCP/IP Protocol Suite
Chapter
Outline
21.1 FTP
21.2 TFTP
4
TCP/IP Protocol Suite
21-1 FTP
File Transfer Protocol (FTP) is the standard mechanism
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. For example, two
systems may use different file name conventions. Two
systems may have different ways to represent text and
data. Two systems may have different directory
structures. All of these problems have been solved by
FTP in a very simple and elegant approach.
5
TCP/IP Protocol Suite
Topics Discussed in the Section
 Connections
 Communication
 Command Processing
 File Transfer
 Anonymous FTP
 Security for FTP
 The sftp Program
6
TCP/IP Protocol Suite
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-known
port 20 for the data connection.
Note
7
TCP/IP Protocol Suite
Figure 21.1 FTP
8
TCP/IP Protocol Suite
Figure 21.2 Opening the control connection
9
TCP/IP Protocol Suite
Figure 21.3 Creating the data connection
10
TCP/IP Protocol Suite
Figure 21.4 Using the control connection
11
TCP/IP Protocol Suite
Figure 21.5 Using the data connection
12
TCP/IP Protocol Suite
Figure 21.6 Command processing
13
TCP/IP Protocol Suite
14
TCP/IP Protocol Suite
15
TCP/IP Protocol Suite
16
TCP/IP Protocol Suite
17
TCP/IP Protocol Suite
18
TCP/IP Protocol Suite
19
TCP/IP Protocol Suite
20
TCP/IP Protocol Suite
21
TCP/IP Protocol Suite
Figure 21.7 File transfer
22
TCP/IP Protocol Suite
Figure 21.8 shows an example of using FTP for retrieving a list of
items in a directory.
Example 21.1
23
TCP/IP Protocol Suite
Figure 21.8 Example 21.1
220 (Service ready)
USER forouzan
LIST /usr/user/forouzan/reports
PASS xxxxxx
125 (Data connection OK)
331 (User name OK. Password?)
PORT 8888
150 (Data connection opens shortly)
230 (User login OK)
1
2
3
4
5
6
7
8
9
List of files or directories
List of files or directories
10
11
QUIT
226 (Closing data connection)
221 (Service closing)
12
13
14
DATA
TRANSFER
24
TCP/IP Protocol Suite
The following shows an actual FTP session that parallels Example
21.1. 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 black background show data transfer.
Example 21.2
25
TCP/IP Protocol Suite
Figure 21.9 shows an example of how an image (binary) file is
stored.
Example 21.3
26
TCP/IP Protocol Suite
Figure 21.9 Example 21.3
220 (Service ready)
USER forouzan
TYPE EBCDIC
STRU R
STOR/usr/user/forouzan/reports/file1
PASS xxxxxx
200 (OK)
200 (OK)
250 (OK)
331 (User name OK. Password?)
PORT 1267
150 (Data connection opens shortly)
230 (User login OK)
1
2
3
4
5
6
7
8
9
10
11
12
13
DATA
TRANSFER
Records of file ..........
Records of file ..........
15
14
QUIT
226 (Closing data connection)
221 (Service closing)
16
17
18
27
TCP/IP Protocol Suite
We show an example of anonymous FTP. We assume that some
public data are available at internic.net.
Example 21.4
28
TCP/IP Protocol Suite
21-2 TFTP
There are occasions when we need to simply copy a
file without the need for all of the features of the FTP
protocol. For example, when a diskless workstation or a
router is booted, we need to download the bootstrap
and configuration files. Here we do not need all of the
sophistication provided in FTP. We just need a protocol
that quickly copies the files.
29
TCP/IP Protocol Suite
Topics Discussed in the Section
 Messages
 Connection
 Data Transfer
 UDP Ports
 TFTP Example
 TFTP Options
 Security
 Applications
30
TCP/IP Protocol Suite
TFTP uses the services of UDP on the
well-known port 69.
Note
31
TCP/IP Protocol Suite
Figure 21.10 Message categories
32
TCP/IP Protocol Suite
Figure 21.11 RRQ format
33
TCP/IP Protocol Suite
Figure 21.12 WRQ format
34
TCP/IP Protocol Suite
Figure 21.13 Data Format
35
TCP/IP Protocol Suite
Figure 21.14 ACK format
36
TCP/IP Protocol Suite
Figure 21.15 ERROR format
37
TCP/IP Protocol Suite
38
TCP/IP Protocol Suite
Figure 21.16 Connection establishment
39
TCP/IP Protocol Suite
Figure 21.17 Server’s apprentice bug
40
TCP/IP Protocol Suite
Figure 21.18 UDP port numbers used by TFTP
41
TCP/IP Protocol Suite
Figure 21.19 TFTP example
42
TCP/IP Protocol Suite
Figure 21.20 Use of TFTP with DHCP
1
2
3
4
5
43
TCP/IP Protocol Suite
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 22
World Wide
Web
and
HTTP
44
TCP/IP Protocol Suite
OBJECTIVES:
 To discuss the architecture of WWW and describe the concepts
of hypertext and hypermedia.
 To describe Web clients and Web servers and their components.
 To define URL as a tool to identify a Web server.
 To introduce three different Web documents: static document,
dynamic document, and active document.
 To discuss HTTP and its transactions.
 To define and list the fields in a request message.
45
TCP/IP Protocol Suite
OBJECTIVES (continued):
 To define non-persistent and persistent connections in HTTP.
 To introduce cookies and their applications in HTTP.
 To discuss Web caching, its application, and the method used to
update the cache.
46
TCP/IP Protocol Suite
Chapter
Outline
22.1 Architecture
22.2 Web Document
22.3 HTTP
47
TCP/IP Protocol Suite
22-1 ARCHITECTURE
The WWW today is a distributed client-server service,
in which a client using a browser can access a service
using a server. However, the service provided is
distributed over many locations called sites. Each site
holds one or more documents, referred to as Web
pages. Each Web page, however, can contain some links
to other Web pages in the same or other sites. In other
words, a Web page can be simple or composite.
48
TCP/IP Protocol Suite
Topics Discussed in the Section
 Hypertext and Hypermedia
 Web Client (Browser)
 Web Server
 Uniform Resource Locator (URL)
49
TCP/IP Protocol Suite
Assume we need to retrieve a Web page that contains the
biography of a famous character with some pictures, which are
embedded in the page itself. Since the pictures are not stored as
separate files, the whole document is a simple Web page. It can be
retrieved using one single request/ response transaction, as shown
in Figure 22.1.
Example 22.1
50
TCP/IP Protocol Suite
Figure 22.1 Example 22.1
Request
1
Response 2
51
TCP/IP Protocol Suite
Now assume we need to retrieve a scientific document that
contains one reference to another text file and one reference to a
large image. Figure 22.2 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. The first
transaction (request/response) retrieves a copy of the main
document (file A), which has a reference (pointer) to the second
and the third files.
Example 22.2
52
TCP/IP Protocol Suite
Figure 22.2 Example 22.2
Request 1
1
Response 1 2
Request 2
3
Response 2 4
Request 3
5
Response 3 6
53
TCP/IP Protocol Suite
A very important point we need to remember is that file A, file B,
and file C in Example 22.2 are independent Web pages, each with
independent names and addresses. Although references to file B or
C are included in file A, it does not mean that each of these files
cannot be retrieved independently. A second user can retrieve file
B with one transaction. A third user can retrieve file C with one
transaction.
Example 22.3
54
TCP/IP Protocol Suite
Figure 22.3 Browser
55
TCP/IP Protocol Suite
Figure 22.4 URL
56
TCP/IP Protocol Suite
22-2 WEB DOCUMENTS
The documents in the WWW can be grouped into three
broad categories: static, dynamic, and active. The
category is based on the time the contents of the
document are determined.
57
TCP/IP Protocol Suite
Topics Discussed in the Section
 Static Documents
 Dynamic Documents
 Active Documents
58
TCP/IP Protocol Suite
Figure 22.5 Static document
Request
1
Static document
2
59
TCP/IP Protocol Suite
HTML, XML, XSL, and XHTML are
discussed in Appendix E.
Note
60
TCP/IP Protocol Suite
Figure 22.6 Dynamic document using CGI
Request
1
Dynamic document
2
61
TCP/IP Protocol Suite
Figure 22.7 Dynamic document using server-site script
Request
1
Dynamic document
2
62
TCP/IP Protocol Suite
Dynamic documents are sometimes
referred to as server-site dynamic
documents.
Note
63
TCP/IP Protocol Suite
Figure 22.8 Active document using Java applet
Request
1
Result
Run the applet
to get the result
Active document
2
Applet
64
TCP/IP Protocol Suite
Figure 22.9 Active document using client-site script
Request
1
Run the JavaScript
(JS) to get the result
Result
2
JavaScript
JS
65
TCP/IP Protocol Suite
Active documents are sometimes
referred to as client-site dynamic
documents.
Note
66
TCP/IP Protocol Suite
22-3 HTTP
The Hypertext Transfer Protocol (HTTP) is a protocol
used mainly to access data on the World Wide Web.
HTTP functions like a combination of FTP (Chapter 21)
and SMTP (Chapter 23). It is similar to FTP because it
transfers files and uses the services of TCP. However,
it is much simpler than FTP because it uses only one
TCP connection. There is no separate control
connection; only data are transferred between the
client and the server.
67
TCP/IP Protocol Suite
Topics Discussed in the Section
 HTTP Transaction
 Conditional Request
 Persistence
 Cookies
 Web Caching: Proxy Server
 HTTP Security
68
TCP/IP Protocol Suite
HTTP uses the services of TCP on well-
known port 80.
Note
69
TCP/IP Protocol Suite
Figure 22.10 HTTP transaction
1
Request message
Request line
Headers
Body
A blank line
2
Response message
Status line
Headers
Body
A blank line
70
TCP/IP Protocol Suite
Figure 22.11 Format of the request message
71
TCP/IP Protocol Suite
72
TCP/IP Protocol Suite
73
TCP/IP Protocol Suite
Figure 22.12 Format of the response message
74
TCP/IP Protocol Suite
75
TCP/IP Protocol Suite
76
TCP/IP Protocol Suite
This example retrieves a document (see Figure 22.13). We use the
GET method to retrieve an image with the path /usr/bin/image1.
The request line shows the method (GET), the URL, and the HTTP
version (1.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,
MIME version, and length of the document. The body of the
document follows the header.
Example 22.4
77
TCP/IP Protocol Suite
Figure 22.13 Example 22.4
78
TCP/IP Protocol Suite
In this example, the client wants to send data to the server. We
use the POST method. The request line shows the method
(POST), URL, and HTTP version (1.1). There are four lines of
headers. The request body contains the input information. 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 22.14).
Example 22.5
79
TCP/IP Protocol Suite
Figure 22.14 Example 22.5
80
TCP/IP Protocol Suite
HTTP uses ASCII characters. The following shows how a client can
directly connect to a server using TELNET, which logs into port 80.
Example 22.6
81
TCP/IP Protocol Suite
The following shows how a client imposes the modification data
and time condition on a request.
Example 22.7
The status line in the responds shows the file is not modified after
the defined point of time. The body of the response message is
also empty.
82
TCP/IP Protocol Suite
Figure 22.15 shows an example of a nonpersistent connection. The
client needs to access a file that contains two links to images. The
text file and images are located on the same server.
Example 22.8
83
TCP/IP Protocol Suite
Figure 22.15 Example 22.8
84
TCP/IP Protocol Suite
HTTP version 1.1 specifies a persistent
connection by default.
Note
85
TCP/IP Protocol Suite
Figure 22.16 shows the same scenario as Example 22.8, but using
persistent connection.
Example 22.9
86
TCP/IP Protocol Suite
Figure 22.16 Example 22.9
87
TCP/IP Protocol Suite
Figure 22.17 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.
Example 22.10
88
TCP/IP Protocol Suite
Figure 22.17 Example 22.10
A customer file is
created with ID: 12343
Request
GET BestToys.com HTTP/1.1
1
Response
HTTP/1.1 200 OK
Set-Cookie: 12343
Page Representing the Toys
2
A vendor file is created
with cookie: 12343
Update
3
Request
GET image HTTP/1.1
Response
Cookie: 12343
Cookie
4
HTTP/1.1 200 OK
Page Representing the price
Update
5
Request
GET image HTTP/1.1
Cookie: 12343
Information about the payment
Cookie
6
Response
HTTP/1.1 200 OK
Order confirmation
Update
89
TCP/IP Protocol Suite
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 23
Electronic
Mail:
SMTP, POP
IMAP, and
MIME
90
TCP/IP Protocol Suite
OBJECTIVES:
 To explain the architecture of electronic mail using four
scenarios.
 To explain the user agent (UA), services provided by it, and two
types of user agents.
 To explain the mechanism of sending and receiving e-mails.
 To introduce the role of a message transfer agent and Simple
Mail
 Transfer Protocol (SMTP) as the formal protocol that handles
MTA.
 To explain e-mail transfer phases.
 To discuss two message access agents (MAAs): POP and IMAP.
91
TCP/IP Protocol Suite
OBJECTIVES (continued):
 To discuss MIME as a set of software functions that transforms
non-ASCII data to ASCII data and vice versa.
 To discuss the idea of Web-based e-mail.
 To explain the security of the e-mail system.
92
TCP/IP Protocol Suite
Chapter
Outline
23.1 Architecture
23.2 User Agent
23.3 Message Transfer Agent
23.4 Message Access Agent
23.5 MIME
23.6 Web-Based Mail
23.7 Electronic Mail Security
93
TCP/IP Protocol Suite
23-1 ARCHITECTURE
To explain the architecture of e-mail, we give four
scenarios. We begin with the simplest situation and add
complexity as we proceed. The fourth scenario is the
most common in the exchange of e-mail.
94
TCP/IP Protocol Suite
Topics Discussed in the Section
 First Scenario
 Second Scenario
 Third Scenario
 Fourth Scenario
95
TCP/IP Protocol Suite
Figure 23.1 First scenario
1
2
96
TCP/IP Protocol Suite
When the sender and the receiver of an
e-mail are on the same mail server,
we need only two user agents.
Note
97
TCP/IP Protocol Suite
Figure 23.2 Second scenario
1
2 3 4
5
98
TCP/IP Protocol Suite
When the sender and the receiver of an
e-mail are on different mail servers,
we need two UAs and a pair of MTAs
(client and server).
Note
99
TCP/IP Protocol Suite
Figure 23.3 Third scenario
1
2
3
4
5
6
7
100
TCP/IP Protocol Suite
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).
Note
101
TCP/IP Protocol Suite
Figure 23.4 Fourth scenario
1
2
3
4
5
6
8
9
102
TCP/IP Protocol Suite
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 (client and server), and a pair of
MAAs (client and server). This is the
most common situation today.
Note
103
TCP/IP Protocol Suite
Figure 23.5 Push versus pull
104
TCP/IP Protocol Suite
23-2 USER AGENT
The first component of an electronic mail system is the
user agent (UA). It provides service to the user to
make the process of sending and receiving a message
easier.
105
TCP/IP Protocol Suite
Topics Discussed in the Section
 Services Provided by a User Agent
 User Agent Types
 Sending Mail
 Receiving Mail
 Addresses
 Mailing List or Group List
106
TCP/IP Protocol Suite
Some examples of command-driven
user agents are mail, pine, and elm.
Note
107
TCP/IP Protocol Suite
Some examples of GUI-based user
agents are Eudora, Outlook,
And Netscape.
Note
108
TCP/IP Protocol Suite
Figure 23.6 Format of an email
109
TCP/IP Protocol Suite
Figure 23.7 E-mail address
110
TCP/IP Protocol Suite
23-3 MESSAGE TRANSFER AGENT
The actual mail transfer is done through message
transfer agents (MTAs). To send mail, a system must
have the client MTA, and to receive mail, a system must
have a server MTA. The formal protocol that defines the
MTA client and server in the Internet is called Simple
Mail Transfer Protocol (SMTP). As we said before, two
pairs of MTA client-server programs are used in the
most common situation (fourth scenario). Figure 23.8
shows the range of the SMTP protocol in this scenario.
111
TCP/IP Protocol Suite
Topics Discussed in the Section
 Commands and Responses
 Mail Transfer Phases
112
TCP/IP Protocol Suite
Figure 23.8 SMTP range
113
TCP/IP Protocol Suite
Figure 23.9 Commands and responses
114
TCP/IP Protocol Suite
115
TCP/IP Protocol Suite
116
TCP/IP Protocol Suite
Figure 23.10 Connection establishment
220 service ready 1
HELO: deanza.edu
2
250 OK 3
117
TCP/IP Protocol Suite
Figure 23.11 Message transfer
118
TCP/IP Protocol Suite
Figure 23.12 Connection termination
1 QUIT
2
221 service closed
119
TCP/IP Protocol Suite
Let us see how we can directly use SMTP to send an e-mail and
simulate the commands and responses we described in this
section. We use TELNET to log into port 25 (the well-known port
for SMTP). We then use the commands directly to send an e-mail.
In this example, forouzanb@adelphia.net is sending an e-mail to
himself. The first few lines show TELNET trying to connect to the
adelphia mail server.
Example 23.1
After connection, we can type the SMTP commands and then
receive the responses as shown below. We have shown the
commands in black and the responses in color. Note that we have
added for clarification some comment lines, designated by the “=”
sign. These lines are not part of the e-mail procedure.
120
TCP/IP Protocol Suite
Example 19.1 Continued
121
TCP/IP Protocol Suite
23-4 MESSAGE ACCESS AGENT
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; it pushes the
message from the client to the server. In other words,
the direction of the bulk data (messages) is from the
client to the server. On the other hand, the third stage
needs a pull protocol; the client must pull messages
from the server. The direction of the bulk data are from
the server to the client. The third stage uses a message
access agent.
122
TCP/IP Protocol Suite
Topics Discussed in the Section
 POP3
 IMAP4
123
TCP/IP Protocol Suite
Figure 23.13 Pop3 and IMAP4
124
TCP/IP Protocol Suite
Figure 23.14 Pop3
125
TCP/IP Protocol Suite
23-5 MIME
Electronic mail has a simple structure. Its simplicity,
however, comes with a price. It can send messages only in
NVT 7-bit ASCII format. In other words, it has some
limitations. Multipurpose Internet Mail Extensions (MIME)
is a supplementary protocol that allows non-ASCII data to
be sent through e-mail. MIME transforms non-ASCII data
at the sender site to NVT ASCII data and delivers it to
the client MTA to be sent through the Internet. The
message at the receiving site is transformed back to the
original data.
126
TCP/IP Protocol Suite
Topics Discussed in the Section
 MIME Headers
127
TCP/IP Protocol Suite
Figure 23.15 MIME
128
TCP/IP Protocol Suite
Figure 23.16 MIME header
129
TCP/IP Protocol Suite
130
TCP/IP Protocol Suite
131
TCP/IP Protocol Suite
Figure 23.17 Base64
132
TCP/IP Protocol Suite
133
TCP/IP Protocol Suite
Figure 23.18 Quoted printable
134
TCP/IP Protocol Suite
23-6 WEB-BASED MAIL
E-mail is such a common application that some
websites today provide this service to anyone who
accesses the site. Three common sites are Hotmail,
Yahoo, and Google. The idea is very simple. Let us go
through two cases:
135
TCP/IP Protocol Suite
Topics Discussed in the Section
 Case I
 Case II
136
TCP/IP Protocol Suite
Figure 23.19 Web-based e-mail, case 1
1
2
3
4
HTTP
transactions
137
TCP/IP Protocol Suite
Figure 23.20 Web-based e-mail, case 2
HTTP
transactions
HTTP
transactions
1 2 3
138
TCP/IP Protocol Suite
23-6 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 MIME (SMIME) are discussed in Chapter 30
after we have discussed the basic network security.
139
TCP/IP Protocol Suite

More Related Content

Similar to PowerPoint_merge.ppt

UDP and TCP header.ppt
UDP and TCP header.pptUDP and TCP header.ppt
UDP and TCP header.pptnehayarrapothu
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocolMohd Arif
 
Cisco discovery d homesb module 6 - v.4 in english.
Cisco discovery   d homesb module 6 - v.4 in english.Cisco discovery   d homesb module 6 - v.4 in english.
Cisco discovery d homesb module 6 - v.4 in english.igede tirtanata
 
2.4 Write a stream –based echo server and a client sending message t.pdf
2.4 Write a stream –based echo server and a client sending message t.pdf2.4 Write a stream –based echo server and a client sending message t.pdf
2.4 Write a stream –based echo server and a client sending message t.pdfexcellentmobiles
 
transfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imaptransfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imapAKSHIT KOHLI
 
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 eraHTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 erapeychevi
 
TCP/IP Training Basic Concepts.
TCP/IP Training Basic Concepts.TCP/IP Training Basic Concepts.
TCP/IP Training Basic Concepts.Amir Panahi
 
CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5Irsandi Hasan
 
12 coms 525 tcpip - applications - http - telnet
12   coms 525 tcpip - applications - http - telnet12   coms 525 tcpip - applications - http - telnet
12 coms 525 tcpip - applications - http - telnetPalanivel Kuppusamy
 
Protocol Ppt[1]
Protocol Ppt[1]Protocol Ppt[1]
Protocol Ppt[1]anil933
 
1.- Networking Models, Devices.pdf
1.- Networking Models, Devices.pdf1.- Networking Models, Devices.pdf
1.- Networking Models, Devices.pdfOpositorGonzalez1
 

Similar to PowerPoint_merge.ppt (20)

UDP and TCP header.ppt
UDP and TCP header.pptUDP and TCP header.ppt
UDP and TCP header.ppt
 
unit 3 ns.ppt
unit 3 ns.pptunit 3 ns.ppt
unit 3 ns.ppt
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Chap 11
Chap 11Chap 11
Chap 11
 
Cisco discovery d homesb module 6 - v.4 in english.
Cisco discovery   d homesb module 6 - v.4 in english.Cisco discovery   d homesb module 6 - v.4 in english.
Cisco discovery d homesb module 6 - v.4 in english.
 
Chap 19 ftp & tftp
Chap 19 ftp & tftpChap 19 ftp & tftp
Chap 19 ftp & tftp
 
Chap 13
Chap 13Chap 13
Chap 13
 
2.4 Write a stream –based echo server and a client sending message t.pdf
2.4 Write a stream –based echo server and a client sending message t.pdf2.4 Write a stream –based echo server and a client sending message t.pdf
2.4 Write a stream –based echo server and a client sending message t.pdf
 
transfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imaptransfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imap
 
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 eraHTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
 
TCP/IP Training Basic Concepts.
TCP/IP Training Basic Concepts.TCP/IP Training Basic Concepts.
TCP/IP Training Basic Concepts.
 
COMPUTER NETWORKS UNIT 4
COMPUTER NETWORKS UNIT 4COMPUTER NETWORKS UNIT 4
COMPUTER NETWORKS UNIT 4
 
CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chap 02
Chap 02Chap 02
Chap 02
 
12 coms 525 tcpip - applications - http - telnet
12   coms 525 tcpip - applications - http - telnet12   coms 525 tcpip - applications - http - telnet
12 coms 525 tcpip - applications - http - telnet
 
Protocol Ppt[1]
Protocol Ppt[1]Protocol Ppt[1]
Protocol Ppt[1]
 
1.- Networking Models, Devices.pdf
1.- Networking Models, Devices.pdf1.- Networking Models, Devices.pdf
1.- Networking Models, Devices.pdf
 

Recently uploaded

Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Personfurqan222004
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 

Recently uploaded (20)

Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Person
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 

PowerPoint_merge.ppt

  • 1. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 21 File Transfer: FTP and TFTP 1 TCP/IP Protocol Suite
  • 2. OBJECTIVES:  To discuss FTP and two connections used in this protocol: control connection and data connection.  To discuss six classes of commands sent by the client to establish communication with the server.  To explain three types of file transfer transferred by FTP.  To show some user-friendly commands used by some FTP interfaces.  To discuss anonymous FTP and its application.  To discuss how file transfer can be done using a secure channel.  To discuss TFTP as a simple file transfer protocol without the complexities and sophistication of FTP. 2 TCP/IP Protocol Suite
  • 3. OBJECTIVES (continued):  To discuss five types of TFTP messages and their applications.  To discuss the sorcerer’s apprentice bug related to TFTP’s flow- and error-control mechanisms.  To show how TFTP can be used in conjunction with DHCP to initialize devices by downloading configuration files. 3 TCP/IP Protocol Suite
  • 5. 21-1 FTP File Transfer Protocol (FTP) is the standard mechanism 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. For example, two systems may use different file name conventions. Two systems may have different ways to represent text and data. Two systems may have different directory structures. All of these problems have been solved by FTP in a very simple and elegant approach. 5 TCP/IP Protocol Suite
  • 6. Topics Discussed in the Section  Connections  Communication  Command Processing  File Transfer  Anonymous FTP  Security for FTP  The sftp Program 6 TCP/IP Protocol Suite
  • 7. 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-known port 20 for the data connection. Note 7 TCP/IP Protocol Suite
  • 8. Figure 21.1 FTP 8 TCP/IP Protocol Suite
  • 9. Figure 21.2 Opening the control connection 9 TCP/IP Protocol Suite
  • 10. Figure 21.3 Creating the data connection 10 TCP/IP Protocol Suite
  • 11. Figure 21.4 Using the control connection 11 TCP/IP Protocol Suite
  • 12. Figure 21.5 Using the data connection 12 TCP/IP Protocol Suite
  • 13. Figure 21.6 Command processing 13 TCP/IP Protocol Suite
  • 22. Figure 21.7 File transfer 22 TCP/IP Protocol Suite
  • 23. Figure 21.8 shows an example of using FTP for retrieving a list of items in a directory. Example 21.1 23 TCP/IP Protocol Suite
  • 24. Figure 21.8 Example 21.1 220 (Service ready) USER forouzan LIST /usr/user/forouzan/reports PASS xxxxxx 125 (Data connection OK) 331 (User name OK. Password?) PORT 8888 150 (Data connection opens shortly) 230 (User login OK) 1 2 3 4 5 6 7 8 9 List of files or directories List of files or directories 10 11 QUIT 226 (Closing data connection) 221 (Service closing) 12 13 14 DATA TRANSFER 24 TCP/IP Protocol Suite
  • 25. The following shows an actual FTP session that parallels Example 21.1. 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 black background show data transfer. Example 21.2 25 TCP/IP Protocol Suite
  • 26. Figure 21.9 shows an example of how an image (binary) file is stored. Example 21.3 26 TCP/IP Protocol Suite
  • 27. Figure 21.9 Example 21.3 220 (Service ready) USER forouzan TYPE EBCDIC STRU R STOR/usr/user/forouzan/reports/file1 PASS xxxxxx 200 (OK) 200 (OK) 250 (OK) 331 (User name OK. Password?) PORT 1267 150 (Data connection opens shortly) 230 (User login OK) 1 2 3 4 5 6 7 8 9 10 11 12 13 DATA TRANSFER Records of file .......... Records of file .......... 15 14 QUIT 226 (Closing data connection) 221 (Service closing) 16 17 18 27 TCP/IP Protocol Suite
  • 28. We show an example of anonymous FTP. We assume that some public data are available at internic.net. Example 21.4 28 TCP/IP Protocol Suite
  • 29. 21-2 TFTP There are occasions when we need to simply copy a file without the need for all of the features of the FTP protocol. For example, when a diskless workstation or a router is booted, we need to download the bootstrap and configuration files. Here we do not need all of the sophistication provided in FTP. We just need a protocol that quickly copies the files. 29 TCP/IP Protocol Suite
  • 30. Topics Discussed in the Section  Messages  Connection  Data Transfer  UDP Ports  TFTP Example  TFTP Options  Security  Applications 30 TCP/IP Protocol Suite
  • 31. TFTP uses the services of UDP on the well-known port 69. Note 31 TCP/IP Protocol Suite
  • 32. Figure 21.10 Message categories 32 TCP/IP Protocol Suite
  • 33. Figure 21.11 RRQ format 33 TCP/IP Protocol Suite
  • 34. Figure 21.12 WRQ format 34 TCP/IP Protocol Suite
  • 35. Figure 21.13 Data Format 35 TCP/IP Protocol Suite
  • 36. Figure 21.14 ACK format 36 TCP/IP Protocol Suite
  • 37. Figure 21.15 ERROR format 37 TCP/IP Protocol Suite
  • 39. Figure 21.16 Connection establishment 39 TCP/IP Protocol Suite
  • 40. Figure 21.17 Server’s apprentice bug 40 TCP/IP Protocol Suite
  • 41. Figure 21.18 UDP port numbers used by TFTP 41 TCP/IP Protocol Suite
  • 42. Figure 21.19 TFTP example 42 TCP/IP Protocol Suite
  • 43. Figure 21.20 Use of TFTP with DHCP 1 2 3 4 5 43 TCP/IP Protocol Suite
  • 44. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP 44 TCP/IP Protocol Suite
  • 45. OBJECTIVES:  To discuss the architecture of WWW and describe the concepts of hypertext and hypermedia.  To describe Web clients and Web servers and their components.  To define URL as a tool to identify a Web server.  To introduce three different Web documents: static document, dynamic document, and active document.  To discuss HTTP and its transactions.  To define and list the fields in a request message. 45 TCP/IP Protocol Suite
  • 46. OBJECTIVES (continued):  To define non-persistent and persistent connections in HTTP.  To introduce cookies and their applications in HTTP.  To discuss Web caching, its application, and the method used to update the cache. 46 TCP/IP Protocol Suite
  • 47. Chapter Outline 22.1 Architecture 22.2 Web Document 22.3 HTTP 47 TCP/IP Protocol Suite
  • 48. 22-1 ARCHITECTURE The WWW today is a distributed client-server service, in which a client using a browser can access a service using a server. However, the service provided is distributed over many locations called sites. Each site holds one or more documents, referred to as Web pages. Each Web page, however, can contain some links to other Web pages in the same or other sites. In other words, a Web page can be simple or composite. 48 TCP/IP Protocol Suite
  • 49. Topics Discussed in the Section  Hypertext and Hypermedia  Web Client (Browser)  Web Server  Uniform Resource Locator (URL) 49 TCP/IP Protocol Suite
  • 50. Assume we need to retrieve a Web page that contains the biography of a famous character with some pictures, which are embedded in the page itself. Since the pictures are not stored as separate files, the whole document is a simple Web page. It can be retrieved using one single request/ response transaction, as shown in Figure 22.1. Example 22.1 50 TCP/IP Protocol Suite
  • 51. Figure 22.1 Example 22.1 Request 1 Response 2 51 TCP/IP Protocol Suite
  • 52. Now assume we need to retrieve a scientific document that contains one reference to another text file and one reference to a large image. Figure 22.2 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. The first transaction (request/response) retrieves a copy of the main document (file A), which has a reference (pointer) to the second and the third files. Example 22.2 52 TCP/IP Protocol Suite
  • 53. Figure 22.2 Example 22.2 Request 1 1 Response 1 2 Request 2 3 Response 2 4 Request 3 5 Response 3 6 53 TCP/IP Protocol Suite
  • 54. A very important point we need to remember is that file A, file B, and file C in Example 22.2 are independent Web pages, each with independent names and addresses. Although references to file B or C are included in file A, it does not mean that each of these files cannot be retrieved independently. A second user can retrieve file B with one transaction. A third user can retrieve file C with one transaction. Example 22.3 54 TCP/IP Protocol Suite
  • 56. Figure 22.4 URL 56 TCP/IP Protocol Suite
  • 57. 22-2 WEB DOCUMENTS The documents in the WWW can be grouped into three broad categories: static, dynamic, and active. The category is based on the time the contents of the document are determined. 57 TCP/IP Protocol Suite
  • 58. Topics Discussed in the Section  Static Documents  Dynamic Documents  Active Documents 58 TCP/IP Protocol Suite
  • 59. Figure 22.5 Static document Request 1 Static document 2 59 TCP/IP Protocol Suite
  • 60. HTML, XML, XSL, and XHTML are discussed in Appendix E. Note 60 TCP/IP Protocol Suite
  • 61. Figure 22.6 Dynamic document using CGI Request 1 Dynamic document 2 61 TCP/IP Protocol Suite
  • 62. Figure 22.7 Dynamic document using server-site script Request 1 Dynamic document 2 62 TCP/IP Protocol Suite
  • 63. Dynamic documents are sometimes referred to as server-site dynamic documents. Note 63 TCP/IP Protocol Suite
  • 64. Figure 22.8 Active document using Java applet Request 1 Result Run the applet to get the result Active document 2 Applet 64 TCP/IP Protocol Suite
  • 65. Figure 22.9 Active document using client-site script Request 1 Run the JavaScript (JS) to get the result Result 2 JavaScript JS 65 TCP/IP Protocol Suite
  • 66. Active documents are sometimes referred to as client-site dynamic documents. Note 66 TCP/IP Protocol Suite
  • 67. 22-3 HTTP The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. HTTP functions like a combination of FTP (Chapter 21) and SMTP (Chapter 23). It is similar to FTP because it transfers files and uses the services of TCP. However, it is much simpler than FTP because it uses only one TCP connection. There is no separate control connection; only data are transferred between the client and the server. 67 TCP/IP Protocol Suite
  • 68. Topics Discussed in the Section  HTTP Transaction  Conditional Request  Persistence  Cookies  Web Caching: Proxy Server  HTTP Security 68 TCP/IP Protocol Suite
  • 69. HTTP uses the services of TCP on well- known port 80. Note 69 TCP/IP Protocol Suite
  • 70. Figure 22.10 HTTP transaction 1 Request message Request line Headers Body A blank line 2 Response message Status line Headers Body A blank line 70 TCP/IP Protocol Suite
  • 71. Figure 22.11 Format of the request message 71 TCP/IP Protocol Suite
  • 74. Figure 22.12 Format of the response message 74 TCP/IP Protocol Suite
  • 77. This example retrieves a document (see Figure 22.13). We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.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, MIME version, and length of the document. The body of the document follows the header. Example 22.4 77 TCP/IP Protocol Suite
  • 78. Figure 22.13 Example 22.4 78 TCP/IP Protocol Suite
  • 79. In this example, the client wants to send data to the server. We use the POST method. The request line shows the method (POST), URL, and HTTP version (1.1). There are four lines of headers. The request body contains the input information. 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 22.14). Example 22.5 79 TCP/IP Protocol Suite
  • 80. Figure 22.14 Example 22.5 80 TCP/IP Protocol Suite
  • 81. HTTP uses ASCII characters. The following shows how a client can directly connect to a server using TELNET, which logs into port 80. Example 22.6 81 TCP/IP Protocol Suite
  • 82. The following shows how a client imposes the modification data and time condition on a request. Example 22.7 The status line in the responds shows the file is not modified after the defined point of time. The body of the response message is also empty. 82 TCP/IP Protocol Suite
  • 83. Figure 22.15 shows an example of a nonpersistent connection. The client needs to access a file that contains two links to images. The text file and images are located on the same server. Example 22.8 83 TCP/IP Protocol Suite
  • 84. Figure 22.15 Example 22.8 84 TCP/IP Protocol Suite
  • 85. HTTP version 1.1 specifies a persistent connection by default. Note 85 TCP/IP Protocol Suite
  • 86. Figure 22.16 shows the same scenario as Example 22.8, but using persistent connection. Example 22.9 86 TCP/IP Protocol Suite
  • 87. Figure 22.16 Example 22.9 87 TCP/IP Protocol Suite
  • 88. Figure 22.17 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. Example 22.10 88 TCP/IP Protocol Suite
  • 89. Figure 22.17 Example 22.10 A customer file is created with ID: 12343 Request GET BestToys.com HTTP/1.1 1 Response HTTP/1.1 200 OK Set-Cookie: 12343 Page Representing the Toys 2 A vendor file is created with cookie: 12343 Update 3 Request GET image HTTP/1.1 Response Cookie: 12343 Cookie 4 HTTP/1.1 200 OK Page Representing the price Update 5 Request GET image HTTP/1.1 Cookie: 12343 Information about the payment Cookie 6 Response HTTP/1.1 200 OK Order confirmation Update 89 TCP/IP Protocol Suite
  • 90. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 23 Electronic Mail: SMTP, POP IMAP, and MIME 90 TCP/IP Protocol Suite
  • 91. OBJECTIVES:  To explain the architecture of electronic mail using four scenarios.  To explain the user agent (UA), services provided by it, and two types of user agents.  To explain the mechanism of sending and receiving e-mails.  To introduce the role of a message transfer agent and Simple Mail  Transfer Protocol (SMTP) as the formal protocol that handles MTA.  To explain e-mail transfer phases.  To discuss two message access agents (MAAs): POP and IMAP. 91 TCP/IP Protocol Suite
  • 92. OBJECTIVES (continued):  To discuss MIME as a set of software functions that transforms non-ASCII data to ASCII data and vice versa.  To discuss the idea of Web-based e-mail.  To explain the security of the e-mail system. 92 TCP/IP Protocol Suite
  • 93. Chapter Outline 23.1 Architecture 23.2 User Agent 23.3 Message Transfer Agent 23.4 Message Access Agent 23.5 MIME 23.6 Web-Based Mail 23.7 Electronic Mail Security 93 TCP/IP Protocol Suite
  • 94. 23-1 ARCHITECTURE To explain the architecture of e-mail, we give four scenarios. We begin with the simplest situation and add complexity as we proceed. The fourth scenario is the most common in the exchange of e-mail. 94 TCP/IP Protocol Suite
  • 95. Topics Discussed in the Section  First Scenario  Second Scenario  Third Scenario  Fourth Scenario 95 TCP/IP Protocol Suite
  • 96. Figure 23.1 First scenario 1 2 96 TCP/IP Protocol Suite
  • 97. When the sender and the receiver of an e-mail are on the same mail server, we need only two user agents. Note 97 TCP/IP Protocol Suite
  • 98. Figure 23.2 Second scenario 1 2 3 4 5 98 TCP/IP Protocol Suite
  • 99. When the sender and the receiver of an e-mail are on different mail servers, we need two UAs and a pair of MTAs (client and server). Note 99 TCP/IP Protocol Suite
  • 100. Figure 23.3 Third scenario 1 2 3 4 5 6 7 100 TCP/IP Protocol Suite
  • 101. 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). Note 101 TCP/IP Protocol Suite
  • 102. Figure 23.4 Fourth scenario 1 2 3 4 5 6 8 9 102 TCP/IP Protocol Suite
  • 103. 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 (client and server), and a pair of MAAs (client and server). This is the most common situation today. Note 103 TCP/IP Protocol Suite
  • 104. Figure 23.5 Push versus pull 104 TCP/IP Protocol Suite
  • 105. 23-2 USER AGENT The first component of an electronic mail system is the user agent (UA). It provides service to the user to make the process of sending and receiving a message easier. 105 TCP/IP Protocol Suite
  • 106. Topics Discussed in the Section  Services Provided by a User Agent  User Agent Types  Sending Mail  Receiving Mail  Addresses  Mailing List or Group List 106 TCP/IP Protocol Suite
  • 107. Some examples of command-driven user agents are mail, pine, and elm. Note 107 TCP/IP Protocol Suite
  • 108. Some examples of GUI-based user agents are Eudora, Outlook, And Netscape. Note 108 TCP/IP Protocol Suite
  • 109. Figure 23.6 Format of an email 109 TCP/IP Protocol Suite
  • 110. Figure 23.7 E-mail address 110 TCP/IP Protocol Suite
  • 111. 23-3 MESSAGE TRANSFER AGENT The actual mail transfer is done through message transfer agents (MTAs). To send mail, a system must have the client MTA, and to receive mail, a system must have a server MTA. The formal protocol that defines the MTA client and server in the Internet is called Simple Mail Transfer Protocol (SMTP). As we said before, two pairs of MTA client-server programs are used in the most common situation (fourth scenario). Figure 23.8 shows the range of the SMTP protocol in this scenario. 111 TCP/IP Protocol Suite
  • 112. Topics Discussed in the Section  Commands and Responses  Mail Transfer Phases 112 TCP/IP Protocol Suite
  • 113. Figure 23.8 SMTP range 113 TCP/IP Protocol Suite
  • 114. Figure 23.9 Commands and responses 114 TCP/IP Protocol Suite
  • 117. Figure 23.10 Connection establishment 220 service ready 1 HELO: deanza.edu 2 250 OK 3 117 TCP/IP Protocol Suite
  • 118. Figure 23.11 Message transfer 118 TCP/IP Protocol Suite
  • 119. Figure 23.12 Connection termination 1 QUIT 2 221 service closed 119 TCP/IP Protocol Suite
  • 120. Let us see how we can directly use SMTP to send an e-mail and simulate the commands and responses we described in this section. We use TELNET to log into port 25 (the well-known port for SMTP). We then use the commands directly to send an e-mail. In this example, forouzanb@adelphia.net is sending an e-mail to himself. The first few lines show TELNET trying to connect to the adelphia mail server. Example 23.1 After connection, we can type the SMTP commands and then receive the responses as shown below. We have shown the commands in black and the responses in color. Note that we have added for clarification some comment lines, designated by the “=” sign. These lines are not part of the e-mail procedure. 120 TCP/IP Protocol Suite
  • 122. 23-4 MESSAGE ACCESS AGENT 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; it pushes the message from the client to the server. In other words, the direction of the bulk data (messages) is from the client to the server. On the other hand, the third stage needs a pull protocol; the client must pull messages from the server. The direction of the bulk data are from the server to the client. The third stage uses a message access agent. 122 TCP/IP Protocol Suite
  • 123. Topics Discussed in the Section  POP3  IMAP4 123 TCP/IP Protocol Suite
  • 124. Figure 23.13 Pop3 and IMAP4 124 TCP/IP Protocol Suite
  • 125. Figure 23.14 Pop3 125 TCP/IP Protocol Suite
  • 126. 23-5 MIME Electronic mail has a simple structure. Its simplicity, however, comes with a price. It can send messages only in NVT 7-bit ASCII format. In other words, it has some limitations. Multipurpose Internet Mail Extensions (MIME) is a supplementary protocol that allows non-ASCII data to be sent through e-mail. MIME transforms non-ASCII data at the sender site to NVT ASCII data and delivers it to the client MTA to be sent through the Internet. The message at the receiving site is transformed back to the original data. 126 TCP/IP Protocol Suite
  • 127. Topics Discussed in the Section  MIME Headers 127 TCP/IP Protocol Suite
  • 128. Figure 23.15 MIME 128 TCP/IP Protocol Suite
  • 129. Figure 23.16 MIME header 129 TCP/IP Protocol Suite
  • 134. Figure 23.18 Quoted printable 134 TCP/IP Protocol Suite
  • 135. 23-6 WEB-BASED MAIL E-mail is such a common application that some websites today provide this service to anyone who accesses the site. Three common sites are Hotmail, Yahoo, and Google. The idea is very simple. Let us go through two cases: 135 TCP/IP Protocol Suite
  • 136. Topics Discussed in the Section  Case I  Case II 136 TCP/IP Protocol Suite
  • 137. Figure 23.19 Web-based e-mail, case 1 1 2 3 4 HTTP transactions 137 TCP/IP Protocol Suite
  • 138. Figure 23.20 Web-based e-mail, case 2 HTTP transactions HTTP transactions 1 2 3 138 TCP/IP Protocol Suite
  • 139. 23-6 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 MIME (SMIME) are discussed in Chapter 30 after we have discussed the basic network security. 139 TCP/IP Protocol Suite