file transfer and access utilities

52
File Transfer and Access Utilities

Transcript of file transfer and access utilities

Page 1: file transfer and access utilities

File Transfer and Access Utilities

Page 2: file transfer and access utilities

What You'll Learn in This Hour:

FTP and TFTP

RCP

NFS

SMB

Page 3: file transfer and access utilities

At the completion of this hour, you will be able to

Explain the purpose and use of FTP

Initiate an FTP session and use FTP commands to traverse remote directory structures, transfer files to or from the remote system, and create or remove directories

Explain the purpose and use of TFTP

Explain the purpose and use of the rpc command

Explain the purpose and use of NFS and SMB

Page 4: file transfer and access utilities

File Transfer Protocol The File Transfer Protocol (FTP) is a widely used protocol that enables

a user to transfer files between two computers on a TCP/IP network.

A file transfer application (typically also called ftp) uses the FTP protocol to transfer files.

The user runs an FTP client application on one computer, and the other computer runs an FTP server program such as ftpd (FTP daemon) on a Unix/Linux computer, or an FTP service on other platforms.

Many FTP client programs are command-line based, but graphical versions are available as well.

Page 5: file transfer and access utilities

File Transfer Protocol (Cont)

FTP uses the TCP protocol and therefore operates through a reliable, connection-oriented session between the client and server computers.

The standard FTP daemon (on the server) listens on TCP port 21 for a request from a client.

When a client sends a request, a TCP connection is initiated The remote user is then authenticated by the FTP server, and a session begins.

A classic text-based FTP session requires the remote user to interact with the server through a command-line interface.

Page 6: file transfer and access utilities

File Transfer Protocol (Cont)

Typical commands start and stop the FTP session, navigate through the remote directory structure, and upload or download files.

Newer GUI-based FTP clients offer a graphic interface (rather than a command interface) for navigating directories and moving files.

FTP is also widely used on the World Wide Web, and the FTP protocol has been integrated into most Web browsers. Sometimes when you're downloading a file through a Web browser, you might notice the URL in the address box begins with ftp://.

Page 7: file transfer and access utilities

File Transfer Protocol (Cont) On most computers, you start a text-based FTP session by entering ftp

followed by the hostname or IP address of the FTP server.

FTP then prompts you for a user ID and a password, which are used by the FTP server to validate you as an authorized user and determine your rights. For example, the user account you log on with might be assigned read-only access, or it might be configured for both read and write operations.

Many FTP servers are available for public use and allow you to log on with a user ID called anonymous.

When the anonymous account is used as the user ID, you can enter virtually any password. However, it is customary to enter your email account name as the password.

Page 8: file transfer and access utilities

File Transfer Protocol (Cont) Many FTP client implementations allow you to enter either Unix-based

commands or DOS-based commands.

The actual commands available depend on the client software being used.

When you transfer files using FTP, you must specify to FTP the type of file that you are about to transfer; the most common choices are binary and ASCII.

Choose ASCII when the type of file you want to transfer is a simple text file.

Choose binary when the type of file you want to transfer is either a program file, a word processing document, or a graphics file. The default file transfer mode is ASCII.

Page 9: file transfer and access utilities

File Transfer Protocol (Cont)

Be aware that many FTP servers reside on Unix and Linux computers. Because Unix and Linux are case sensitive—that is, they distinguish between uppercase and lowercase letters—you must match the case exactly when entering filenames.

The current directory on the local computer from which you start an FTP session is the default location where files are transferred to or from.

Page 10: file transfer and access utilities

FTP Command

ftp - The ftp command is used to start the FTP client program

User - The user command is used to change the user ID and password information of the current session

ls or dir - The Unix/Linux ls or ls -l command or the Windows dir command lists the contents of a directory

pwd - The pwd command prints the name of the current working directory

cd - The cd command changes the current working directory on the FTP server

Page 11: file transfer and access utilities

FTP command (Cont) Mkdir - The Unix/Linux mkdir command creates a directory on the FTP

server inside the current working directory

rmdir - The Unix rmdir command removes a directory on the FTP server from the current working directory

binary - The binary command switches the FTP client to binary transfer mode from the default ASCII transfer mode

ascii - The ascii command switches the FTP client to ASCII transfer mode from binary mode

type - The type command displays the current mode (ASCII or binary) for file transfer

Page 12: file transfer and access utilities

FTP Command (Cont) Status - The status command displays information about the various

settings on the FTP client

get - The get command retrieves a file from an FTP server to an FTP client

mget - The mget command is similar to the get command except that it lets you retrieve multiple files

put - The put command transfers a file from the FTP client to the FTP server

mput - The mput command is similar to the put command, except that it enables you to transfer multiple files with one command

Page 13: file transfer and access utilities

FTP Command (Cont)

open - The open command allows you to establish a new session with an FTP server

close - The close command ends the current session with an FTP server

bye or quit - These commands close the current FTP session and terminate the FTP client

Page 14: file transfer and access utilities

FTP Protocol

port 20

Page 15: file transfer and access utilities

Trivial File Transfer Protocol

The Trivial File Transfer Protocol (TFTP) is used to transfer files between the TFTP client and a TFTP server, a computer running the tftpd TFTP daemon.

This protocol uses UDP as a transport and, unlike FTP, does not require a user to log on to transfer files.

Because TFTP does not require a user logon, it is often considered a security hole, especially if the TFTP server permits writing.

Page 16: file transfer and access utilities

TFTP (Cont) The TFTP protocol was designed to be small so that both it and the

UDP protocol could be implemented on a PROM (Programmable Read Only Memory) chip.

The TFTP protocol is limited (hence the name trivial) when compared to the FTP protocol. The TFTP protocol can only read and write files; it cannot list the contents of directories, create or remove directories, or allow a user to log on as the FTP protocol allows.

The TFTP protocol is primarily used in conjunction with the RARP and BOOTP protocols to boot diskless workstations and, in some cases, to upload new system code or patches to routers or other network devices.

Page 17: file transfer and access utilities

Remote Copy - RCP The rcp command provides an alternative to ftp; it allows users

to copy files over the network.

The rcp command is the remote version of the Unix cp (copy) command. When using the rcp command, you do not need to supply a user ID or password; this might be considered a security hole.

However, a level of security is provided by the fact that the name of your computer must reside in either of two server-based files named rhosts and hosts.equiv.

Page 18: file transfer and access utilities

RCP (Cont)

The rcp command allows a user to copy files between a local computer and the host server or between two remote computers. The syntax for the rcp command is

rcp [hostname1]:filename1 [hostname2]:filename2

Page 19: file transfer and access utilities

Integrating Network File Access

Network File System (NFS)— A protocol used on Unix and Linux computers

Server Message Block (SMB)— A protocol used to provide remote file access for Windows clients

Page 20: file transfer and access utilities

Network File System - NFS

The Network File System (NFS) was originally developed by Sun but is now supported on Unix, Linux, and many other systems.

NFS allows users to access (read, write, create, and delete) directories and files located on a remote computer as if those directories and files were located on the local computer.

Because NFS is designed to provide a transparent interface between local file systems and remote file systems, and because it is implemented within the operating system of both computers, it does not require any changes to application programs.

Page 21: file transfer and access utilities

NFS (Cont)

Programs are capable of accessing both local files and remote files and directories via NFS without any recompilation or other changes.

To the user, all files and directories appear and operate as if they existed only on the local file system.

The original implementation of NFS used the UDP protocol for its transport and was intended for use on a LAN.

However, later revisions allow use of the TCP protocol; the additional reliability of TCP allows for expanded capabilities of NFS, which can now operate in a WAN

Page 22: file transfer and access utilities

NFS (Cont)

Local file access

TCP/UDPIP

NFS Client

Local file access

TCP/UDPIP

NFSServer

User access

Local Disk

Local Disk

Client Kernel Server Kernel

Page 23: file transfer and access utilities

Server Message Block – SMB

Server Message Block (SMB) is the protocol that supports the network-integrated tools of the Windows user interface, such as Explorer, Network Neighborhood, and the Map Network Drive feature.

SMB is designed to operate above a variety of different protocol systems, including IPX/SPX (the NetWare protocols stack), NetBEUI (an aging protocol for PC LANs), and TCP/IP.

SMB resides above the NetBIOS layer, which interfaces to the Transport layer protocols and provides services related to resource naming and location

Page 24: file transfer and access utilities

SMB (Cont)

Page 25: file transfer and access utilities

SMB (Cont) If the logon is successful, the client sends an SMB specifying the name of

the network share it wishes to access. If the share access is successful, the client may open, close, read from, or write to the network resource, and the server sends the necessary data to fulfill the request.

SMB is generally considered a Windows protocol, and it is true that the primary importance of SMB is its tight integration with the Windows client user interface. But details of the SMB protocol are well known to developers, and other operating systems support servers that speak SMB to Windows clients.

A popular open source server called Samba (which is, if you'll notice, SMB with two vowels to make a dance) provides SMB file services for Unix/Linux systems.

Page 26: file transfer and access utilities

HTTP, HTML, and the World Wide Web

Page 27: file transfer and access utilities

What You'll Learn in This Hour:

HTTP and HTML

URLs (Uniform Resource Locator)

Advanced Web techniques

Page 28: file transfer and access utilities

At the completion of this hour, you will be able to

Describe URLs and formulate your own URLs

Build a basic Web page using text and HTML tags

Discuss the HTTP protocol and describe how it works

List the benefits of server-end and client-end scripting

Page 29: file transfer and access utilities

A Closer look at URLs URLs are so common now that they appear with little or no explanation on TV

commercials and bubble gum wrappers.

But the home page URLs you hear in the media are only a small subset of the many options available with this versatile form.

Not all URLs refer to HTTP. In fact, the URL form was devised as a universal method for several different Internet protocols.

The protocol portion of the URL is referred to as the scheme. The scheme identifies a protocol and therefore tells the computer how to interpret the rest of the URL. The general format for a URL is described in RFC 1738 as

<scheme>:<scheme-specific-part>

Page 30: file transfer and access utilities

URL Schemes

Page 31: file transfer and access utilities

General form of HTTP URL

The general form for later an HTTP URL is http://<host>[:<port>]/<path>[;<parameters>][?<search>]

<host> is the DNS name of the server (for example, www.google.com)

<path> is the path to the HTML document or other resource.

<port>— The port number of the daemon or service to which the browser is connecting. The port number reserved for HTTP servers is TCP port 80.

<parameters>— Optional parameters supplied by the client. The user almost never has to enter parameters in order to access a Web site

<search>— Lets the client send a query string to the user. The user almost never enters a query into a URL by hand.

Page 32: file transfer and access utilities

Understanding HTML HTML is the payload that is transmitted through the processes of HTTP.

An HTML document includes text, formatting codes, references to other files, and links.

When you inspect the contents of a basic HTML document using a text processing application such as Windows Notepad or Unix's vi, you'll find that the document is actually an ordinary text file.

The file contains any text that will appear with the page, and it also includes a number of special HTML codes called tags.

Tags are instructions to the browser. They do not appear as written on the Web page, but they affect the way the data appears and the way the page behaves.

The HTML tags supply all the formatting, file references, and links associated with a Web page.

Page 33: file transfer and access utilities

Understanding HTML (Cont)

Page 34: file transfer and access utilities

Understanding HTTP

HTTP has the following duties:

– To establish a connection between the browser (the client) and the server

– To negotiate settings and establish parameters for the session

– To provide for the orderly transfer of HTML content

– To close the connection with the server

Page 35: file transfer and access utilities

Understanding HTTP

When you enter a URL into the browser window, the browser first checks the scheme of the URL to determine the protocol.

If the browser determines that the URL refers to a resource on an HTTP site, it extracts the DNS name from the URL and initiates the name resolution process.

The client computer sends the DNS lookup request to a name server and receives the server's IP address.

The browser then uses the server's IP address to initiate a TCP connection with the server.

Page 36: file transfer and access utilities

Understanding HTTP

After the TCP connection is established, the browser uses the HTTP GET command to request the Web page from the server. The GET command contains the URL of the resource the browser is requesting and the version of HTTP the browser wants to use for the transaction. The browser can send the relative URL with the GET request (rather than the full URL) because the connection with the server has already been established:

GET /watergate/tapes/transcript HTTP/1.1

The server receives the request and returns the requested document. Along with the document is a header containing several settings. The parameters specified in the header take the form

keyword:value

Page 37: file transfer and access utilities

HTTP header

Page 38: file transfer and access utilities

Advanced HTML Technique The Web grew up around the vision of the HTML file as a simple, static text file

served uniformly to all requests, but this vision has gotten complicated in recent years by advances in Web technology.

Web sites now commonly generate Web content at the time of the client's request. These Dynamic HTML techniques allow the content to adapt to the specific preferences and requests of the user.

Dynamic HTML also simplifies the task of Web design because the Web server can serve up unlimited combinations of output through a single template.

At the same time, another vision is now playing out in the Web world: client-side programming. In this vision, programmatic instructions are passed to the client along with the HTML data, and these instructions execute on the client computer while the user views the Web page.

Page 39: file transfer and access utilities

Server-Side HTML Technique The example of server-side scripting process is as follows:

1. The user browses to a page that includes a form for purchasing a product or entering visitor information.

2. The server generates the form based on user choices and transmits the form to the browser.

3. The user enters the necessary information into the form, and the browser transmits the form back to the server. (Note that the HTML form feature reverses the usual process. The browser sends content to the server at the server's request.)

4. The server accepts the data from the browser and uses a programming interface to pass the data to programs that process the user information. If the user is purchasing a product, these behind-the-scenes programs may check credit card information or send a shipment order to the mail room. If the user is adding his name to a mailing list or joining a restricted online site, a program may add the user information to a database.

Page 40: file transfer and access utilities

Server-Side HTML Technique

Page 41: file transfer and access utilities

Client-Side HTML Technique

Client-side processing has also enhanced and transformed the Web experience.

Today's browsers are capable of executing code passed directly to the client computer from the Web server.

Client-side processing reduces the processor load on the server infrastructure and often reduces the total amount of information that must be transmitted over the network.

Java applets (and other, similar technologies) are the basis for the bouncing balls and laughing monkeys that move about in the browser window when you access certain Web sites.

These technologies also have a more serious side. For instance, you can use client-side scripts to check the integrity of a data entry form.

Page 42: file transfer and access utilities

XML As soon as users, vendors, and Web designers became accustomed to HTML,

they started to ask for more.

The growth of server-side and client-side programming techniques, and the evolution of the Web services architecture caused many experts to wonder if there might be a way to extend the rigid tag system of HTML.

Their goal was to get beyond the conception of a markup language as a means for formatting text and graphics and to employ the language simply as a means for transmitting data.

The result of this discussion was a new markup language called Extensible Markup Language, or XML.

Page 43: file transfer and access utilities

XML

As you learned earlier in this hour, the meaning and context for HTML data is limited to what you can express through a set of predefined HTML tags

If the data is enclosed in <H1> tags, it is interpreted as a heading. If the data is enclosed in <A> tags, it is interpreted as a link.

XML, on the other hand, lets users define their own elements.

The data can signify whatever you want it to signify, and you can invent the tag you will use to mark the data.

For instance, if you follow horse racing, you could create an XML file with information on your favorite horses. That file might contain entries such as:

Page 44: file transfer and access utilities

XML (example)

<horses> <horse_name="winky" breed="Thoroughbred"> <sex="male" /> <age="3" /> </horse> <horse_name="Goddess" breed="Arabian"> <sex="female" /> <age="3" /> </horse> <horse_name="Gecko" breed="Uncertain"> <sex="male" /> <age="14" /> </horse> </horses>

Page 45: file transfer and access utilities

XML XML is an extremely powerful tool for passing data between applications.

It is very easy for a script or homegrown application to create XML as output or read XML as input.

Even though a browser can't read XML directly, XML is still used extensively on the Web.

In some cases, the XML data is generated on the server side and then converted to display-ready HTML before it is transmitted to the browser.

Another technique is to provide an accompanying file called a Cascading Style Sheet (CSS) that tells how to interpret and display the XML data. However, XML is not limited to the Web.

Programmers now use XML for other contexts that require a simple, convenient format for assigning values to attributes.

Page 46: file transfer and access utilities

The New Web The Web continues to grow more sophisticated as programmers and vendors

build new and better variations.

In recent years, the Web has come to rely more on custom services and special-purpose applications.

In these new contexts, the Web server and Web browser are little more than links in an extensive delivery infrastructure.

In fact, the concept of application data delivered through HTTP has outgrown the Web itself and is now simply a tool for software development.

In the meantime, the following sections discuss some recent developments in the Web world. You'll learn about:

– Web multimedia

– Web transactions

– Peer-to-peer

Page 47: file transfer and access utilities

Web Multimedia When you install the software on the client computer (for instance,

when you install the QuickTime viewer), the installer application typically registers the file extension(s) that the computer should use to open the application.

Some common video file formats and their extensions are as follows:

– .AVI (Audio Visual Interleave)— An audio/visual format developed by Microsoft

– .MPEG (Motion Picture Experts Group)— A popular and high-quality digital video format

– .MOV (QuickTime)— Apple originally developed the QuickTime format for Macintosh systems, but QuickTime is widely available for other systems

Page 48: file transfer and access utilities

Web Transaction A typical Web transaction scenario is shown in next slide. The process is as follows:

1. A Web server provides an online catalog accessible from the Web. A user browses through the product offerings from a remote location across the Internet.

2. The user decides to buy a product and clicks a Buy This Product link on the Web page.

3. The server and browser establish a secure connection. At this point, the browser sometimes displays a message that says something like "You are now entering a secure area…" Different browsers have different methods for indicating a secure connection. Netscape Navigator, for instance, displays a golden key.

4. After the connection is established, some form of authentication usually follows. On most transaction sites, the buyer establishes some form of user account with the vendor. This is partly for security reasons and partly for convenience (so the user can track the status of purchases). The user account information also lets the vendor track the behavior of the user and correlate the user's demographic information and purchase history. This logon step requires the Web server to contact some form of back end database server—either to establish a new account or to check the credentials for logon to an existing account.

5. After the user is logged in, the server (or some application working on the server back end) must verify the credit card information and register the transaction with some credit card authority. Often this credit card authority is a commercial service affiliated with the credit card company.

6. If the transaction is approved, notice of the purchase and mailing information is transmitted to the vendor's fulfillment department, and the transaction application attends to the final details of confirming the purchase with the user and updating the user's account profile.

Page 49: file transfer and access utilities

Web Transaction

Page 50: file transfer and access utilities

Peer-to-Peer A new information sharing technique that emerged through Internet

music-sharing communities such as Napster is called peer-to-peer (P2P).

The term peer-to-peer is actually borrowed from a related configuration on LAN networks, in which services are decentralized and every computer acts as both a client and a server.

This new Internet peer-to-peer variant allows computers throughout the Internet to share data in data-sharing communities.

In other words, the data doesn't come from a single Web server serving requests from a multitude of clients. Instead, the data resides on ordinary PCs throughout the community.

Page 51: file transfer and access utilities

Peer-to-Peer The designers of the peer-to-peer technique knew their vision of a diverse music-sharing

community would not work unless they solved these problems.

Their solution was to provide a central server to dispense connection information that the clients could then use to establish connections with each other.

As shown in next slide,User A logs on to the Internet. The client software on the user's PC registers the user's presence with the server.

The server keeps a record of the client's IP address and any files the client has made available to the community.

User B connects to the server and discovers that a desired file is available on User A's computer.

The server gives User B the necessary information to contact User A.

User B contacts User A, establishes a direct connection, and downloads the file.

Page 52: file transfer and access utilities

Peer-to-Peer