درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامهنویسی در اینترنت 1 SMTP, FTP
درس مهندسی اینترنت Common protocols defined for URLs n HTTP is also used as a generic protocol for communication between user agents and proxies/gateways to other Internet systems, including those supported by the next protocols: – SMTP, NNTP, FTP n In this way, HTTP allows basic hypermedia access to resources available from diverse applications
درس مهندسی اینترنت Transmission by using the HTTP HTTP/TCP/IP packets TCP/IP packets DNS/UDP/IP packets
درس مهندسی اینترنت Web Client-Browser Detailed Operation The browser determines the URL –(by seeing what was selected after user clicking) The browser asks DNS for the IP address of turul.eet.bme.hu DNS replies The browser makes a TCP connection to port 80 on It then sends a GET /subjects/index.html command The turul.eet.bme.hu server sends the file index.html The TCP connection is released The browser displays all the text in the index.html The browser fetches and displays all images in the index.html
درس مهندسی اینترنت ftp: separate control, data connections ftp client contacts ftp server at port 21, specifying TCP as transport protocol two parallel TCP connections opened: –control: exchange commands, responses between client, server. “out of band control” –data: file data to/from server ftp server maintains “state”: current directory, earlier authentication FTP client FTP server TCP control connection port 21 TCP data connection port 20
درس مهندسی اینترنت Electronic Mail: mail servers Mail Servers mailbox contains incoming messages (yet to be read) for user message queue of outgoing (to be sent) mail messages smtp protocol between mail servers to send messages –client: sending mail server –“server”: receiving mail server mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP
درس مهندسی اینترنت Electronic Mail: smtp [RFC 821] uses TCP to reliably transfer message from client to server, port 25 direct transfer: sending server to receiving server three phases of transfer –handshaking (greeting) –transfer of messages –closure command/response interaction –commands: ASCII text –response: status code and phrase messages must be in 7-bit ASCII
درس مهندسی اینترنت Sample smtp interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 Sender ok C: RCPT TO: S: 250 Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C:. S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection
درس مهندسی اینترنت bash-2.05b$ telnet localhost 25 Trying Connected to localhost. Escape character is '^]'. 220 Nimrud.eet.bme.hu ESMTP Sendmail / ; Mon, 13 Nov :25: mail from: Sender ok rcpt to: Recipient ok data 354 Enter mail, end with "." on a line by itself asda sdas. ing with non-existing sender Here any text can be written, but it must be followed by a line with a simple point Command, this ends the header Open a session with the SMTP server The sender The recipient
درس مهندسی اینترنت Mail message format smtp: protocol for exchanging msgs RFC 822: standard for text message format: header lines, e.g., –To: –From: –Subject: different from smtp commands! body –the “message”, 7-bit ASCII characters only header body blank line
درس مهندسی اینترنت Message format: multimedia extensions MIME: multimedia mail extension, RFC 2045, 2056 supports inclusion on non-ASCII data in message additional lines in message header declare MIME (Multimedia Internet Mail Extensions) content type From: To: Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data base64 encoded data multimedia data type, subtype, parameter declaration method used to encode data MIME version encoded data
درس مهندسی اینترنت Multipart Type From: To: Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Dear Bob, Please find a picture of a crepe Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data base64 encoded data
درس مهندسی اینترنت Mail access protocols SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server –POP3: Post Office Protocol [RFC 1939] authorization (agent server) and download –IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored messages on server –HTTP: Hotmail, Yahoo! Mail, SquirrelMail, etc. user agent sender’s mail server user agent SMTP POP3 or IMAP receiver’s mail server