Presentation is loading. Please wait.

Presentation is loading. Please wait.

FTP (File Transfer Protocol) & Telnet

Similar presentations


Presentation on theme: "FTP (File Transfer Protocol) & Telnet"— Presentation transcript:

1 FTP (File Transfer Protocol) & Telnet
Application Layer FTP (File Transfer Protocol) & Telnet

2 Transport Layer and Port Numbers
client Outlook WWW Server : 80 : 21 FTP Server FTP Client Browser MAIL Server : 25 Eagle Server Client Unique connection point : IP Address :Port number pair

3 Network Application Programs that run on different end systems and communicate over a network. Example: Browser on client machine communicates with a Server application transport network data link physical

4 Outline In this lecture, we will look at some Application Layer Protocols FTP (File Transfer Protocol) Command line interface Telnet

5 Application Layer Protocol defines
Types of messages exchanged, eg, request & response messages Syntax (Structure) of message Semantics of the fields, ie, meaning of information in fields Rules for when and how processes send & respond to messages

6 FTP: File Transfer Protocol
user interface client file transfer FTP server user at host local file system remote file system transfer file to/from remote host client/server model Client: side that initiates transfer (either to/from remote) Server: remote host FTP server listens on port 21

7 FTP: Control and Data connections
client server TCP control connection port 21 TCP data connection port 20 FTP client contacts FTP server at port 21 Client obtains authorization over control connection Client browses remote directory by sending commands over control connection. When server receives a command for a file transfer, the server opens a TCP data connection to client After transferring one file, server closes connection. Server opens a second TCP data connection to transfer another file. FTP server maintains “state”: current directory, earlier authentication

8 FTP – File Transfer Protocol
user Application Layer user interface Application Layer control connection (FTP commands and replies) protocol interpreter protocol interpreter data transfer function data transfer function file system file system data connection TCP TCP Three Way Handshake Client Server

9 FTP: Commands/Responses
Sample commands: Sent as text over control channel USER <username > PASS <password LIST return list of file in current directory RETR filename retrieves (gets) file STOR filename stores (puts) file onto remote host Sample return codes Status code and phrase 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing file

10 Telnet provides remote login service to users
works between hosts that use different operating systems Telnet client Telnet server login shell kernel kernel terminal driver TCP/IP TCP/IP pseudo- terminal driver user TCP connection

11 Example: Telnet Mail Server
C:\>telnet eagle-server.example.com 25 220 localhost.localdomain ESMTP Sendmail /8.13.1; Sun, 28 Jan :41:  HELO eagle-server.example.com 250 localhost.localdomain Hello [ ], pleased to meet you  MAIL From: Sender ok  RCPT To: Recipient ok  DATA 354 Please start mail input. I'm trying to test this connection from Telnet. Let me know if you get this message. . 250 Mail queued for delivery. QUIT 221 Closing connection. Good bye.Connection to host lost. C:\ > Client Server Client Server Client Server Client Client Server Client Server Client Server

12 HTTP - Hypertext Transfer Protocol
client/server model client: browser that requests, receives, “displays” Web objects server: Web server sends objects in response to requests HTTP request PC running Explorer HTTP response HTTP request Server running Apache Web server HTTP response Mac running Navigator

13 HTTP overview Uses TCP:
Client initiates and opens connection to WWW server at port 80 Server accepts TCP connection from client HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) Connection closed

14 HTTP connections Non-persistent HTTP Persistent HTTP
At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP Persistent HTTP Multiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode

15 HTTP request message Two types of HTTP messages: request, response
ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) header lines Carriage return, line feed indicates end of message

16 HTTP response message status line (protocol status code status phrase)
HTTP/ OK Connection close Date: Thu, 06 Aug :00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... header lines data, e.g., requested HTML file

17 HTTP response status codes
200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported

18 Web caches (proxy server)
Goal: satisfy client request without involving origin server user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client origin server Proxy server HTTP request HTTP request client HTTP response HTTP response HTTP request HTTP response client origin server


Download ppt "FTP (File Transfer Protocol) & Telnet"

Similar presentations


Ads by Google