Jan-Robin Aumann
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Assignment 2 - Jessica Werner (2563327), Varada Sudharshana Kumar (7029511), Jan-Robin Aumann (2576766) ## Question 1 ### (a) Objects can either be sent via a persistent or non-persistent HTTP connection. For the former, the server doesn't close the TCP connection to the requesting host after sending a response but instead keeps it open such that future requests and their responses are sent via that same TCP connection. This saves on both response time and ressources: One RTT is saved by not having to create a TCP connection before requesting an object; we also save on both local and server side ressources by having only one open TCP connection instead of one per requested object. For the latter we incur an additional RTT per object as compared to a persistent connection as well as additional open TCP connections for the benefits of being able to load multiple objects in parallel which can be beneficial (this concern was supposed to be addressed in HTTP/2 but adoption is slow, leading to HTTP/3 and QUIC which use UDP instead). ### (b) In HTTP, a server answers requests without prior knowledge of client. This means it can keep no state to correlate separate requests (at least not as per standard). This "problem" can be "solved" with ... Coooooookies! Cookies are pieces of data sent between the server (who generated it in the first place) and a willing client to identify a given client for the sake of keeping state (often called a session). ### \(c\) The Cache is (often) both closer to client than the actual application server and connected at a greater link speed. It can for example be as close as being in the same network and instead of being connected at the speed of the internet provider it is instead connected at local network speeds (10G/1G). A cached page (or other assets like fonts/images/...) is great but the webserver can not serve a customized document that's specific to the user. ### (d) ```shell=telnet telnet example.com 80 Trying 93.184.216.34... Connected to example.com. Escape character is '^]'. GET / HTTP/1.1 host: example.com HTTP/1.1 200 OK Age: 475364 Cache-Control: max-age=604800 Content-Type: text/html; charset=UTF-8 Date: Wed, 04 May 2022 15:28:29 GMT Etag: "3147526947+ident" Expires: Wed, 11 May 2022 15:28:29 GMT Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT Server: ECS (bsa/EB11) Vary: Accept-Encoding X-Cache: HIT Content-Length: 1256 <!doctype html> <html> <head> <title>Example Domain</title> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style type="text/css"> body { background-color: #f0f0f2; margin: 0; padding: 0; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } div { width: 600px; margin: 5em auto; padding: 2em; background-color: #fdfdff; border-radius: 0.5em; box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02); } a:link, a:visited { color: #38488f; text-decoration: none; } @media (max-width: 700px) { div { margin: 0 auto; width: auto; } } </style> </head> <body> <div> <h1>Example Domain</h1> <p>This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.</p> <p><a href="https://www.iana.org/domains/example">More information...</a></p> </div> </body> </html> GET / HTTP/1.1 host: example.com If-Modified-Since: Wed, 04 May 2022 15:28:30 GMT HTTP/1.1 304 Not Modified Age: 475393 Cache-Control: max-age=604800 Date: Wed, 04 May 2022 15:28:58 GMT Etag: "3147526947+ident" Expires: Wed, 11 May 2022 15:28:58 GMT Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT Server: ECS (bsa/EB11) Vary: Accept-Encoding X-Cache: HIT ``` ## Question 2 ### (a) While a (authoratative) nameserver is responsible for a certain set of domain names and responds to DNS requests for that set of domain names, a resolver only issues those requests to nameservers in order to get the IP address for a given domain name. Of those resolvers, there are three different types: * The stub resolver (typically) running on your local machine sends dns requests to the locally configured resolver on the behalf of any software running on the system (e.g. web browser). * The forwarding resolver, typically found on the local router, acts as a proxy forwarding requests it receives on to a recursive resolver that has been configured and relays the received answer back to the stub resolver that queried it. * The recursive resolver located at your ISP or DNS provider (Cloudflare, Google, ...) receives queries either from a forwarding or stub resolver. It then retrieves the information recursively by first querying a root server, then a top level domain server, a second level domain server and finally (one of) the authoratative nameserver(s) for that domain, returning that answer to the querying resolver. ### (b) First the Client sends a recursive request to the local DNS server. It in turn sends an iterative request to the root DNS server to find the tl-dns server for the .com tld. Once it has that information it will use it to again iteratively query the tl-dns server for the authoratative nameserver of yahoo.com. Lastly it iteratively queries dns.yahoo.com for the mail.yahoo.com address, returning the response to the client. ### \(c\) Most implementations retry sending the packet a few times after a given timeout has been reached. If there is still no result, a different nameserver can be tried. ## Question 3 ### (a) * A record An A record maps a given domain name to an IPv4 address. * AAAA record An AAAA record maps a given domain name to an IPv6 address. * CNAME record A CNAME record is used to alias two domain names together. For example, if `www.example.com` and `example.com` point to the same application, you only need an A record for the latter and a CNAME record for the former aliasing it the the latter. That way you only have to maintain/update one A record if the IP address changes. * NS rcord A NS record is used to map a DNS Zone either to a list of authoratative nameservers or chains together DNS Zones to a zone tree. * MX record A MX record maps a given domain name to a list of email delivery agents. ### (b) Often a given domain will have multiple A records pointing to different IP adresses for load balancing. IPv6 adoption is fairly low (most domains don't have an AAAA record, instead returning their nameservers in the authority section). MX records often contain five or more servers for redundancy to make sure mail arrives even in bigger outage scenarios. Some people don't bother using a CNAME record to alias their domain and their domain with the www. prefix, like the LSF at `lsf.uni-saarland.de` ehhhh excuse me `www.lsf.uni-saarland.de` (most browsers will actually fill in the www. for you). ### \(c\) The response time on the first run is 40ms, but any subsequent run is 0 msec because the results have been cached. ```shell=zsh ❯ dig stackoverflow.com a ; <<>> DiG 9.18.1 <<>> stackoverflow.com a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4556 ;; flags: qr rd ad; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;stackoverflow.com. IN A ;; ANSWER SECTION: stackoverflow.com. 0 IN A 151.101.129.69 stackoverflow.com. 0 IN A 151.101.193.69 stackoverflow.com. 0 IN A 151.101.65.69 stackoverflow.com. 0 IN A 151.101.1.69 ;; Query time: 40 msec ;; SERVER: 172.17.64.1#53(172.17.64.1) (UDP) ;; WHEN: Thu May 05 18:57:40 CEST 2022 ;; MSG SIZE rcvd: 116 ❯ dig stackoverflow.com a ; <<>> DiG 9.18.1 <<>> stackoverflow.com a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7034 ;; flags: qr rd ad; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;stackoverflow.com. IN A ;; ANSWER SECTION: stackoverflow.com. 0 IN A 151.101.129.69 stackoverflow.com. 0 IN A 151.101.193.69 stackoverflow.com. 0 IN A 151.101.65.69 stackoverflow.com. 0 IN A 151.101.1.69 ;; Query time: 0 msec ;; SERVER: 172.17.64.1#53(172.17.64.1) (UDP) ;; WHEN: Thu May 05 18:57:45 CEST 2022 ;; MSG SIZE rcvd: 116 ❯ dig stackoverflow.com a ; <<>> DiG 9.18.1 <<>> stackoverflow.com a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9324 ;; flags: qr rd ad; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;stackoverflow.com. IN A ;; ANSWER SECTION: stackoverflow.com. 0 IN A 151.101.129.69 stackoverflow.com. 0 IN A 151.101.193.69 stackoverflow.com. 0 IN A 151.101.65.69 stackoverflow.com. 0 IN A 151.101.1.69 ;; Query time: 0 msec ;; SERVER: 172.17.64.1#53(172.17.64.1) (UDP) ;; WHEN: Thu May 05 18:57:45 CEST 2022 ;; MSG SIZE rcvd: 116 ❯ dig stackoverflow.com a ; <<>> DiG 9.18.1 <<>> stackoverflow.com a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29285 ;; flags: qr rd ad; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;stackoverflow.com. IN A ;; ANSWER SECTION: stackoverflow.com. 0 IN A 151.101.129.69 stackoverflow.com. 0 IN A 151.101.193.69 stackoverflow.com. 0 IN A 151.101.65.69 stackoverflow.com. 0 IN A 151.101.1.69 ;; Query time: 0 msec ;; SERVER: 172.17.64.1#53(172.17.64.1) (UDP) ;; WHEN: Thu May 05 18:57:46 CEST 2022 ;; MSG SIZE rcvd: 116 ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully