Vous êtes sur la page 1sur 15

LECTURE x Contents

Application Layer:
• I. File Transfer
File Transfer, HTTP, SNMP • II. WWW and HTTP
• III. Network Management : SNMP

Chapter 26 Remote Logging, Electronic Mail, and File Transfer

Chapter 27 WWW and HTTP
Chapter 28 Network Management: SNMP
(Forouzan, Data Communications and Networking, 4th Edition)

1 2

I. File Transfer Figure 26.21 FTP

• Handle
Transferring files from one computer to another is one — Different file name conventions
of the most common tasks expected from a networking — Different directory structure
or internetworking environment. As a matter of fact, the — Different ways to represent text and data
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
FTP uses the services of TCP. It needs two TCP connections.

The well-known port 21 is used for the control connection and

3 the well-known port 20 for the data connection. 4
Figure 26.22 Using the control connection
FTP: Types of Transfer
• Retrieving (RETR): Copy a file from server to
• Storing (STOR): Copy a file from client to server
• LIST: Obtain a list of directory or file names
—Sent over the data connection

• Control connection remains connected during the

entire FTP session
—Each line is terminated by carriage return and line feed
(end-of-line token)
• Data connection is opened and closed for each
file transferred 5 6

Figure 26.23 Using the data connection Example 26.4

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
• Data connection must be prepared before use transfer.
—By control connection
1. After the control connection is created, the FTP server
—File type: ASCII or Binary/Image
sends the 220 response.
—Data structure: Transferring file, record, or page
structure 2. The client sends its name.
3. The server responds with 331.
—Transmission mode: Stream, block, or compressed

7 8
Example 26.4 (3) Example 26.4 (2)

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
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.

9 10

Example 26.5 Example 26.5 (2)

We show an example of anonymous FTP. We assume that

some public data are available at internic.net.

continued on next slide

11 12
II.1 Architecture Figure 27.1 Architecture of WWW

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.

Topics discussed in this section:

Client (Browser)
Uniform Resource Locator

13 14

Figure 27.2 Browser Figure 27.3 URL

• URL = Uniform resource locator

—Standard for specifying any kind of information on
the Internet
• Path = Pathname of the file where the
information is located
• Use client programs (HTTP, FTP, …) to access
the documents
• Use interpreters to display the documents
15 16
II.2 WEB Documents
• Storing client’s state The documents in the WWW can be grouped into three
—Created by server, using information from client’s
broad categories: static, dynamic, and active. The
request and previous cookie
category is based on the time at which the contents of
—Send back to client for storage
the document are determined.
• Allowing access to registered client
—Storing credential in cookie
• Electronic shopping cart Topics discussed in this section:
—Storing item in cookie Static Documents
• Track customer behavior Dynamic Documents
—Storing user behavior in cookie Active Documents

17 18

Figure 27.4 Static document

• HTML = Hypertext Markup Language

—Tell compositors how to format the text
—Let us use only ASCII characters for both main text
and formatting instructions
• Portable across platforms

• File’s content is determined when it is created

—Not when it is used

19 20
HTML Figure 27.7 Beginning and ending tags

• Hypertext Markup Language

—Tell compositors how to format the text
—Let us use only ASCII characters for both main text
and formatting instructions
• Portable across platforms

Figure 27.5 Boldface tags • Each beginning tag is followed by an optional list
of attributes
—With equal sign and value of attribute
Figure 27.6 Effect of boldface tags • Image tag <IMG SRC=“….”>
—Point to the file of a photo or image
• Hyperlink tag <A HREF=“http://...”>Author</A>
—Link an item to another document 22

Figure 27.8 Dynamic document using CGI Figure 27.9 Dynamic document using server-site script

• Created by a web server when the document is requested

• Server-side script is used if part of the document
— Content can vary from one request to another
does not need to be dynamic
• Can be done with CGI (Common Gateway Interface)
— http://www.abc.com/cgi-bin/prog.pl?23
— Part of the URL before ? identifies program to run Dynamic documents are sometimes referred to as
— Part of the URL after ? identifies program parameter 23 server-site dynamic documents. 24
Figure 27.10 Active document using Java applet Figure 27.11 Active document using client-site script

• Client-side script is executed on client

• Javascript can be used if content is mostly static
—Java applets is used if program is mostly dynamic
—Animated graphic or interactive program Active documents are sometimes referred to as client-
25 site dynamic documents. 26

II.3 HTTP Figure 27.12 HTTP transaction

The Hypertext Transfer Protocol (HTTP) is a protocol

used mainly to access data on the World Wide Web.
HTTP functions as a combination of FTP and SMTP.

Topics discussed in this section:

HTTP Transaction
HTTP uses the services of TCP on well-known port 80.
Persistent Versus Nonpersistent Connection

27 28
Figure 27.13 Request and response messages Figure 27.14 Request and status lines

29 30

Table 27.1 Methods Table 27.2 Status codes

• Request type is categorized into methods

• Status code is similar to those in FTP and SMTP

—Consist of three digits that are separated into five
31 32
Table 27.2 Status codes (2) Figure 27.15 Header format

• Header categories
—General header
—Request header: Specify client’s configuration and
preferred document format
—Response header: Specify server’s configuration and
special information about the request
—Entity header: Give information on document body
33 34

Table 27.4 Request headers

Table 27.3 General headers

35 36
Table 27.5 Response headers Table 27.6 Entity headers

37 38

Example 27.1 Figure 27.16 Example 27.1

This example retrieves a document. 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 (see Figure

39 40
Example 27.2 Figure 27.17 Example 27.2

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 27.17).

41 42

Example 27.3 Example 27.3 (continued)

HTTP uses ASCII characters. A client can directly connect to a

server using TELNET, which logs into port 80 (see next slide). The
next three lines show that the connection is successful. We then type
three lines. The first shows the request line (GET method), the
second is the header (defining the host), the third is a blank,
terminating the request. The server response is seven lines starting
with the status line. The blank line at the end terminates the server
response. The file of 14,230 lines is received after the blank line (not
shown here). The last line is the output by the client.

43 44
III. Network Management
HTTP Connection Types System
• Nonpersistent connection
—One TCP connection is made for each
We can define network management as monitoring,
request/response testing, configuring, and troubleshooting network
components to meet a set of requirements defined by
• Persistent connection
an organization.
—Server leaves the connection open for more requests
after sending a response
Topics discussed in this section:
• Proxy server
Configuration Management
—A cache server that keeps copies of responses to Fault Management
recent requests Performance Management
Security Management
Accounting Management
HTTP version 1.1 specifies a persistent connection by default.
45 46

Simple Network Management

Figure 28.1 Functions of a network management system Protocol (SNMP)

The Simple Network Management Protocol (SNMP) is a

framework for managing devices in an internet using the
TCP/IP protocol suite. It provides a set of fundamental
operations for monitoring and maintaining an internet.
• Controlling • Collect
network information
access necessary to
charge Topics discussed in this section:
• Adjusting • Detecting,
network isolating,
users for the
components correcting,
and features and
• Monitor and services they Management Components
control received from
• Record recording network the network
Structure of Management Information (SMI)
configuration efficiency Management Information Base (MIB)
changes • Predict and
prevent SNMP
47 48
Figure 28.2 SNMP concept Figure 28.3 Components of network management on the Internet

• SNMP manager controls and monitors a set of agents

— Agent keeps performance information in a database
— Manager has access to the value in the database • SMI = Structure of Management Information
— Manager can also make agent perform certain actions
• MIB = Management Information Base
• Agent can send a warning message to manager if it
notices something unusual
— Called trap
49 50

Note Note

SNMP defines the format of packets exchanged between a We can compare the task of network management to the task of
manager and an agent. It reads and changes the status (values) writing a program.
of objects (variables) in SNMP packets.
ҩ Both tasks need rules.
SMI defines the general rules for naming objects, defining object
In network management this is handled by SMI.
types (including range and length), and showing how to encode
ҩ Both tasks need variable declarations.
objects and values. SMI does not define the number of objects
In network management this is handled by MIB.
an entity should manage or name the objects to be managed or
ҩ Both tasks have actions performed by statements.
define the association between the objects and their values.
In network management this is handled by SNMP.
MIB creates a collection of named objects, their types, and their
relationships to each other in an entity to be managed.

51 52
Figure 28.4 Management overview Figure 28.6 Object identifier

• A manager station All objects managed by

(SNMP client) wants SNMP are given an object
to send a message to an identifier.
agent station (SNMP
server) to find the number Identifier is hierarchical,
based on tree structure
of UDP user datagrams
received by the agent mib-2 object identifier always
• MIB identifies the object starts with
• SMI encodes object name
• SNMP creates a message

53 54

Figure 28.15 mib-2 Figure 28.16 udp group

• sys (System) defines general information about

• An instance suffix is needed to show
the node, such as name, location, and lifetime
contents of each variable
• udp defines general information related to UDP, —Instance suffix = 0 for simple variable
such as number of ports and number of packets —udpInDatagrams.0 =
sent and received —udpNoPorts.0 =
—udpInErrors.0 =
55 56
Figure 28.20 SNMP PDUs
SNMPv3 PDU Types
• GetRequest retrieves value of a variable
• GetNextRequest retrieves values of the entries in a table
• GetBulkRequest is used for large amount of data
• SetRequest sets (store) a value in a variable
• Response PDU responses to GetRequest
• Trap is sent from agent to manager
• InformRequest is sent from one manager to another
remote manager to get value of some variables
• Report PDU reports some types of error between

57 58

Figure 28.25 Port numbers for SNMP