Presentation is loading. Please wait.

Presentation is loading. Please wait.

Communications and Networks Lecture 5 Instructor: Rina Zviel-Girshin.

Similar presentations


Presentation on theme: "Communications and Networks Lecture 5 Instructor: Rina Zviel-Girshin."— Presentation transcript:

1 Communications and Networks Lecture 5 Instructor: Rina Zviel-Girshin

2 2 Lecture overview  Proxy  Mail  Web-mail

3 3 Proxy  One of the definitions: The person who is authorized to act or vote for another  Why not to use in CS? Proxy - or Proxy Server – is a technique used to cache information on a Web server. Proxy acts as an intermediary between a Web client and that Web server.

4 4 Proxy server  Caching responses  Anonymizing clients  Transforming requests and responses  Gateway to non-HTTP systems  Filtering requests and responses  Firewall Proxy: A program in the path between the user agent (web- browser) and an origin server that functions as server to the user agent and as client to the origin server client Proxy server client http request http response http request http response http request http response origin server origin server

5 5 Steps in a browser process with proxy in the path URL 1 query 2 TCP Connection 3 HTTP Request 8 HTTP Response 9 Optional parallel connections Browser Proxy DNS server Origin server 5 TCP Connection 6 HTTP Request 7 HTTP Response 10 Optional parallel connections 4

6 6 Proxy chain on the web clientproxy-1proxy-norigin server …

7 7 Web Caches (proxy server)  User sets browser: web accesses via web cache  Client sends all http requests to web cache if object at web cache, web cache immediately returns object in http response else requests object from origin server, then returns http response to client Goal: satisfy client request without involving origin server client Proxy server client http request http response http request http response http request http response origin server origin server Cache: Store of messages used to reduce user-perceived latency and load on the network and server

8 8 Why Web Caching? Assume: cache is “close” to client (e.g., in same network)  smaller response time: cache “closer” to client  decrease traffic to distant servers link out of institutional/local ISP network often bottleneck origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps access link institutional cache

9 9 Example

10 10 Improve Performance  Proxy servers can dramatically improve performance for groups of users Application level proxy saves the results of all requests for a certain amount of time in order to provide quicker access and to increase server security (since usually one proxy server is used by all clients connected to a subnet).  Since the proxy server is often on the same network as the user, this is a much faster operation. This is common for an ISP especially if they have a slow link to the Internet.  Proxy servers also allow direct Internet access from behind a firewall. An application-level proxy makes a firewall safely permeable for users in an organization, without creating a potential security hole through which one might get into the subnet.

11 11 Filter Requests  Proxy servers can also be used to filter requests.  For example a company might use a proxy server to prevent its employees from accessing a specific set of web sites.  A good proxy system gives suitable tools for managing and controlling the data flow: user authorization for accessing sites, blocking "strangers" trying to get into the local net, tracing users operations storing some common information for the benefit of all the net users without the need to bring it again from outside.

12 12 Filtering  URL based filtering: prevent visiting a set of sites considered to be unsuitable  Filtering requests to search engines when certain keywords appear in the search string  Remove certain headers (such as user’s email)  May removes certain request/responses in certain media formats  Check responses for security risks (viruses, java applets,..)

13 13 Proxy gateway  Applications do not have to provide native support for all protocols.  They can rely on the support of proxies and gateways to help doing the job.  Transactions of a client with the proxy server done using HTTP only, even when accessing a resource served by a remote server using another protocol: HTTP, Gopher, FTP. Gateway - hardware or software set-up that translates between two dissimilar protocols, or any mechanism for providing access to another system.

14 14 Gateway to non-HTTP systems Client 1 Client 2 proxy A A F Mail server M Proxy servers can serve as "protocol translators" which can convert a request in the HTTP protocol to an equivalent request in another protocol, for example FTP or Gopher. HTTP server

15 15 Gateway  A gateway is a network point that acts as an entrance to another network.  On the Internet, a node or stopping point can be either a gateway node or a host node.  The computers that control traffic within your company's network or at your local ISP are gateway nodes.

16 16 Electronic Mail Three major components:  user agents  mail servers  simple mail transfer protocol: smtp User Agent  Also known as - “mail reader”  composing, editing, reading mail messages  e.g., Eudora, Outlook, elm, Netscape Messenger  outgoing, incoming messages stored on server user mailbox outgoing message queue mail server SMTP mail server mail server user agent user agent user agent user agent user agent

17 17 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 email messages client: sending mail server “server”: receiving mail server mail server SMTP mail server mail server user agent user agent user agent user agent SMTP user agent

18 18 Direct transfer from sending server to receiving server

19 19 Scenario: Alice sends message to Bob 1) Alice uses UA to compose message and “to” bob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) Client side of SMTP opens TCP connection with Bob’s mail server 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message user agent mail server mail server user agent 1 2 3 4 5 6

20 20 Simple Mail Transfer Protocol [RFC 821]  Uses TCP to transfer email msg on port 25 (uses persistent connections)  Three phases of transfer handshaking (greeting) transfer of messages closure  Command/response interaction commands: ASCII text response: status code and phrase  smtp server uses CRLF.CRLF to determine end of message  Messages must be in 7-bit ASCII (header & body)  Thus, message has to be encoded (base-64 or quoted printable)

21 21 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 alice@crepes.fr... Sender ok C: RCPT TO: S: 250 bob@hamburger.edu... 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

22 22 Comparison with HTTP  http: pull  smtp: push  http: have ASCII command/response interaction, status codes  smtp: same as above  http: response includes a Content-length: header  smtp: the body ends with “ CRLF.CRLF ’’  http: each object is encapsulated in its own response message  smtp: multiple objects message sent in a multipart message

23 23 Mail access protocols  SMTP: delivery/storage to receiver’s server  Mail access protocol: retrieval from server POP: Post Office Protocol [RFC 1939] (used to retrieve e-mail from a mail server) authorization (agent server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: Hotmail, Yahoo! Mail, etc. sender’s mail server SMTP POP3 or IMAP receiver’s mail server user agent user agent

24 24 POP3 protocol [RFC 1939] authorization phase  client commands: user: declare username pass: password  server responses +OK -ERR transaction phase, client:  list: list message numbers  retr: retrieve message by number  dele: delete  quit C: list S: 1 498 S: 2 912 S:. C: retr 1 S: S:. C: dele 1 C: retr 2 S: S:. C: dele 2 C: quit S: +OK POP3 server signing off S: +OK POP3 server ready C: user alice S: +OK C: pass hungry S: +OK user successfully logged on port 110

25 25 IMAP protocol [RFC 1999]  Many more features than POP3, but complex  Allow users to manipulate remote mailboxes (search)  Maintain a folder hierarchy for each user  Allow to obtain components of messages

26 26 Web-based email sender’s mail server HTTPSMTPHTTP receiver’s mail server Web Mail is a server-based email system that allows you to access your email account from the World Wide Web. You can send and receive email messages from almost any computer that is connected to the Internet. Web Mail uses the HTTP protocol user agent user agent

27 27 Web-mail features  Sending email messages to multiple recipients.  Sending up to five file attachments per email message.  Automatically adding personal signatures to outgoing email messages.  Creating personal email folders to archive or categorize your messages.  An online address book.

28 28 Mail message format smtp: protocol for exchanging email msgs RFC 822: standard for text message format:  header lines, e.g., To: From: Subject: different from smtp commands!  body the “message”, ASCII characters only!!! header body blank line

29 29 HTML and email  In browser environment you can invoke client mail service by using:  Simple mailto:  Mail to multiple recipients  Mail with subject

30 30 Any questions?


Download ppt "Communications and Networks Lecture 5 Instructor: Rina Zviel-Girshin."

Similar presentations


Ads by Google