sccs 420 ch 26 27 28 (ftp http snmp)
Post on 11-Apr-2015
29 Views
Preview:
TRANSCRIPT
1
LECTURE x Application Layer: File Transfer, HTTP, SNMP
Chapter 26 Remote Logging, Electronic Mail, and File TransferChapter 27 WWW and HTTPChapter 28 Network Management: SNMP(Forouzan, Data Communications and Networking, 4th Edition)
2
Contents• I. File Transfer
• II. WWW and HTTP
• III. Network Management : SNMP
3
I. 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.
File Transfer Protocol (FTP)Anonymous FTP
Topics discussed in this section:Topics discussed in this section:
4
Figure 26.21 FTP
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.
• Handle— Different file name conventions— Different directory structure— Different ways to represent text and data
5
Figure 26.22 Using the control 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 6
FTP: Types of Transfer• Retrieving (RETR): Copy a file from server to
client• Storing (STOR): Copy a file from client to server• LIST: Obtain a list of directory or file names
—Sent over the data connection
7
Figure 26.23 Using the data connection
• Data connection must be prepared before use—By control connection—File type: ASCII or Binary/Image—Data structure: Transferring file, record, or page
structure—Transmission mode: Stream, block, or compressed
8
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 serversends the 220 response.
2. The client sends its name.3. The server responds with 331.
Example 26.4
9
Example 26.4 (3)
10
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.
Example 26.4 (2)
9. The client sends a QUIT command.10. The server responds with 221.
11
We show an example of anonymous FTP. We assume that some public data are available at internic.net.
Example 26.5
continued on next slide
12
Example 26.5 (2)
13
II.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.
Client (Browser)ServerUniform Resource LocatorCookies
Topics discussed in this section:Topics discussed in this section:
II. WWW and HTTP
14
Figure 27.1 Architecture of WWW
15
Figure 27.2 Browser
• Use client programs (HTTP, FTP, …) to access the documents
• Use interpreters to display the documents
16
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
17
Cookie• Storing client’s state
—Created by server, using information from client’s request and previous cookie
—Send back to client for storage
• Allowing access to registered client—Storing credential in cookie
• Electronic shopping cart—Storing item in cookie
• Track customer behavior—Storing user behavior in cookie
18
II.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 at which the contents of the document are determined.
Static DocumentsDynamic DocumentsActive Documents
Topics discussed in this section:Topics discussed in this section:
19
Figure 27.4 Static document
• File’s content is determined when it is created—Not when it is used
20
• 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
21
Figure 27.5 Boldface 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.6 Effect of boldface tags
HTML
22
Figure 27.7 Beginning and ending tags
• Each beginning tag is followed by an optional list of attributes—With equal sign and value of attribute
• 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
23
Figure 27.8 Dynamic document using CGI
• Created by a web server when the document is requested— Content can vary from one request to another
• 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— Part of the URL after ? identifies program parameter 24
Figure 27.9 Dynamic document using server-site script
Dynamic documents are sometimes referred to as server-site dynamic documents.
• Server-side script is used if part of the document does not need to be dynamic
25
Figure 27.10 Active document using Java applet
• Client-side script is executed on client—Java applets is used if program is mostly dynamic—Animated graphic or interactive program
26
Figure 27.11 Active document using client-site script
Active documents are sometimes referred to as client-site dynamic documents.
• Javascript can be used if content is mostly static
27
II.3 HTTP
The Hypertext Transfer Protocol (HTTP) is a protocol The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. used mainly to access data on the World Wide Web. HTTP functions as a combination of FTP and SMTP. HTTP functions as a combination of FTP and SMTP.
HTTP TransactionPersistent Versus Nonpersistent Connection
Topics discussed in this section:Topics discussed in this section:
28
Figure 27.12 HTTP transaction
HTTP uses the services of TCP on well-known port 80.
29
Figure 27.13 Request and response messages
30
Figure 27.14 Request and status lines
31
Table 27.1 Methods
• Request type is categorized into methods
32
Table 27.2 Status codes
• Status code is similar to those in FTP and SMTP—Consist of three digits that are separated into five
categories
33
Table 27.2 Status codes (2)
34
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
35
Table 27.3 General headers
36
Table 27.4 Request headers
37
Table 27.5 Response headers
38
Table 27.6 Entity headers
39
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). Theheader 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 27.16).
Example 27.1
40
Figure 27.16 Example 27.1
41
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).
Example 27.2
42
Figure 27.17 Example 27.2
43
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.
Example 27.3
44
Example 27.3 (continued)
45
HTTP Connection Types• Nonpersistent connection
—One TCP connection is made for each request/response
• Persistent connection—Server leaves the connection open for more requests
after sending a response
• Proxy server—A cache server that keeps copies of responses to
recent requests
HTTP version 1.1 specifies a persistent connection by default.46
III. Network Management System
We can define network management as monitoring, testing, configuring, and troubleshooting network components to meet a set of requirements defined by an organization.
Configuration ManagementFault ManagementPerformance ManagementSecurity ManagementAccounting Management
Topics discussed in this section:Topics discussed in this section:
47
Figure 28.1 Functions of a network management system
• Adjusting network components and features
• Record configuration changes
• Detecting, isolating, correcting, and recording faults
• Predict and prevent failures
• Monitor and control network efficiency
• Controlling network access
• Collect information necessary to charge individual users for the services they received from the network
48
Simple Network ManagementProtocol (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.
ConceptManagement ComponentsStructure of Management Information (SMI)Management Information Base (MIB)SNMP
Topics discussed in this section:Topics discussed in this section:
49
Figure 28.2 SNMP concept
• 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— Manager can also make agent perform certain actions
• Agent can send a warning message to manager if it notices something unusual— Called trap
50
Figure 28.3 Components of network management on the Internet
• SMI = Structure of Management Information• MIB = Management Information Base
51
SMI defines the general rules for naming objects, defining object types (including range and length), and showing how to encode objects and values. SMI does not define the number of objects an entity should manage or name the objects to be managed or
define the association between the objects and their values.
Note
SNMP defines the format of packets exchanged between a manager and an agent. It reads and changes the status (values)
of objects (variables) in SNMP packets.
MIB creates a collection of named objects, their types, and their relationships to each other in an entity to be managed.
52
We can compare the task of network management to the task of writing a program.
���� Both tasks need rules. In network management this is handled by SMI.
���� Both tasks need variable declarations. In network management this is handled by MIB.
���� Both tasks have actions performed by statements. In network management this is handled by SNMP.
Note
53
Figure 28.4 Management overview
• A manager station (SNMP client) wants to send a message to an agent station (SNMP server) to find the number of UDP user datagramsreceived by the agent
• MIB identifies the object• SMI encodes object name• SNMP creates a message
54
Figure 28.6 Object identifier
All objects managed by SNMP are given an object
identifier.
Identifier is hierarchical, based on tree structure
mib-2 object identifier always starts with 1.3.6.1.2.1.
55
Figure 28.15 mib-2
• sys (System) defines general information about the node, such as name, location, and lifetime
• udp defines general information related to UDP, such as number of ports and number of packets sent and received
56
Figure 28.16 udp group
• An instance suffix is needed to show contents of each variable—Instance suffix = 0 for simple variable—udpInDatagrams.0 = 1.3.6.1.2.1.7.1.0—udpNoPorts.0 = 1.3.6.1.2.1.7.2.0—udpInErrors.0 = 1.3.6.1.2.1.7.3.0
57
Figure 28.20 SNMP PDUs
58
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
managers
59
Figure 28.25 Port numbers for SNMP
top related