1 / 30

Part II

Part II. Web caches (proxy server). proxy server. client. origin server. client. origin server. why Web caching?. More about Web caching. Goal: don’t send object if cache has up-to-date cached version. HTTP response HTTP/1.0 304 Not Modified. Conditional GET. server. client.

jham
Download Presentation

Part II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Part II Application Layer

  2. Web caches (proxy server) proxy server client origin server client origin server Application Layer

  3. why Web caching? More about Web caching Application Layer

  4. Goal: don’t send object if cache has up-to-date cached version HTTP response HTTP/1.0 304 Not Modified Conditional GET server client HTTP request msg If-modified-since: <date> object not modified before <date> HTTP request msg If-modified-since: <date> object modified after <date> HTTP response HTTP/1.0 200 OK <data> Application Layer

  5. HTTP • Response response protocol but how can the server push updates to the client • Example instant messages • Does the client need to constantly resquest/ poll • Do you have a message for me • Answers full duplex websockets Application Layer

  6. WebSocket's • Full duplex communication • Allows the webserver to send content without first being requested • Kind of new standardized in RFC 6455 in 2011 https://tools.ietf.org/html/rfc6455 Application Layer

  7. Request a socket GET /chat HTTP/1.1 Host: server.example.comUpgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Origin: http://example.com Sec-WebSocket-Protocol: chat, superchatSec-WebSocket-Version: 13 Application Layer

  8. Servrer Response HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: UpgradeSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Protocol: chat dGhlIHNhbXBsZSBub25jZQ== + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" SHA1 Hash Base 64 encoding s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Application Layer

  9. Subsequent Messages • Don’t follow frames/packets don’t follow standard framing: • There are 16 frame times 6 are use and 10 are reverse for the future. • Binary • Text • etc Application Layer

  10. JavaScript example of WebSocket Application Layer

  11. JavaScript webrequest Application Layer

  12. Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP 2.8 socket programming with TCP Application Layer

  13. FTP user interface FTP client FTP server FTP: the file transfer protocol user at host remote file system local file system • ftp: RFC 959 https://tools.ietf.org/html/rfc959 • ftp server: port 21 Application Layer

  14. Application Layer

  15. FTP: separate control, data connections TCP control connection, server port 21 TCP data connection, server port 20 FTP client FTP server Application Layer

  16. sample commands: sample return codes FTP commands, responses Application Layer

  17. Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP 2.8 socket programming with TCP Application Layer

  18. A Story: The Inventor of email • Still Alive • Shiva Ayyadurai Application Layer

  19. Three major components: User Agent user agent user agent user agent user agent user agent user agent mail server mail server mail server outgoing message queue user mailbox Electronic mail Application Layer

  20. mail servers: mailbox message queue SMTP protocol user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server Electronic mail: mail servers Application Layer

  21. 1 ) 2) 3) 4) Electronic Mail: SMTP [RFC 2821] Application Layer

  22. user agent user agent mail server mail server Scenario: Alice sends message to Bob Alice’s mail server Bob’s mail server Application Layer

  23. Sample SMTP interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 250 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> 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 Application Layer

  24. comparison with HTTP & FTP: SMTP: final words Application Layer

  25. SMTP: RFC 822: : header lines, e.g., different Body: Mail message format header blank line body Application Layer

  26. SMTP: delivery/storage to receiver’s server mail access protocol: retrieval from server POP: IMAP: HTTP: user agent user agent sender’s mail server Mail access protocols mail access protocol SMTP SMTP (e.g., POP, IMAP) receiver’s mail server Application Layer

  27. authorization phase client commands: : . server responses : : transaction phase,client: : : : : POP3 protocol S: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged on C: list S: 1 498 S: 2 912 S: . C: retr 1 S: <message 1 contents> S: . C: dele 1 C: retr 2 S: <message 1 contents> S: . C: dele 2 C: quit S: +OK POP3 server signing off Application Layer

  28. Application Layer Protocols IOT • MQTT: • Message Queuing Telemetry Transport • Application layer protocol implement ontop of TCP/IP • Why not UDP • Small footprint • Andy Stanford-Clark • First version of the protocol in 1999 (IBM) Application Layer

  29. Why is MQTT interesting • This maybe one of the protocols that power the internet of things • Amazon has added MQTT support AWS and freeRTOS • https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html http://mqtt.org/ Application Layer

  30. How does MQTT work • Topics • There is no need to configure a topic, publishing on it is enough. • Topics are treated as a hierarchy • Temperature/roof Application Layer

More Related