資工系必修 共筆
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    ###### tags: `計算機網路概論` :::info [回共筆首頁](https://hackmd.io/SSJDgNdiQ02odihzTkkQpg) [回科目首頁](https://hackmd.io/v_hdETFnSwCLMTNXEWM9Og) ::: # 沈上翔 教授 Midterm Review 2022 ## 未撰寫review - Four sources of packet delay - Alice sends message to Bob - DNS records - Connection-oriented demux ![](https://i.imgur.com/bqf6bus.png =70%x) :::spoiler Alternative core: circuit switching - end-end resources allocated to, reserved for "call" between source & dest - 來源和目的地之間會指定一條通道給他們連接,這條通道是會被保留、**不共用的** - 如果沒有人用通道,通道狀態為**idle**(閒置的),並不會給其他人使用(no sharing) - 常見於傳統的**telephone network** ::: ![](https://i.imgur.com/R3DLXki.png =70%x) :::spoiler Packet switch versus circuit switching - packet switching allows more users to use network - 在circuit-switch設計下,1Mbps link只能夠給10個人使用 - 在packet-switching設計下,若有35個人,同時會佔滿通道的機率小於0.0004,所以這種設計下,可以讓更多使用者使用,比較經濟 - 若超過35人的話,可能會導致壅塞(congestion) - 因為packet-switch能夠resource sharing,當有突然的資料需要被傳送時,不用"call"接線生幫忙接線,就可以馬上傳輸 - 若packet-switching要有像circuit-switching一樣的bandwidth guarantees,可以透過QoS機制達成 ::: ![](https://i.imgur.com/9iWJUJF.png =70%x) ![](https://i.imgur.com/KCAUiei.png =70%x) ![](https://i.imgur.com/BDiBBFa.png =70%x) :::spoiler Caravan analogy - Q: How Long until carvan is lined up before 2nd too booth? - 全部車子通過第一個收費站的時間 + 最後一台車從第一個收費站到第二個收費站的時間 ::: ![](https://i.imgur.com/I0crD4P.png =70%x) :::spoiler Internet protocol stack - application: 給網路的相關應用,http、SMTP、FTP,使用者透過這層可以對資料以人的方式撰寫儲存在點腦上,或是下達發送的指令、瀏覽網頁。 - transport: 傳輸資料之間的功能,TCP、UDP,TCP機制可確保資料有被receiver接收到;UDP可以讓sender不斷發送封包。 - network: 解析封包的資訊,把封包正確的導向給目的。 - link: 乙太網,由於數據經由網路線傳輸過程中難免會錯誤,這一層具有數據糾錯的功能,例如漢明碼。 - physical: 處理網路線、無線傳輸設備,例如光纖。 ::: ![](https://i.imgur.com/6ha8oSE.png =70%x) :::spoiler Non-persistent HTTP: response time - RTT: - Round-Trip Time,是指client向server建立連線or發出請求的過去加回來的時間。 - 舉例:我發出建立連線的請求,直到我確認server已經跟我確立連線、我發出request,直到收到response。 - 在Non-persistent HTTP中,他的respone time是 - 建立連線RTT - 發送請求RTT - 資料傳輸transmission time - 等於2RTT + file transmission time - Non-persistent 跟 Persistent 的差別在於 - Non-persistent會把每一項動作建立屬於他的conection,不管那個動作是否重複過,Persistent會把一連串的動作使用同一個connection,所以他只需要建立一次connection。 - Non-persistent每傳送一個物件,TCP connection就必須做一次,假設client跟server要求多個檔案,當第一個檔案傳輸後 會關閉連線,要下載第二個檔案的時候 必須再對server做一次要求(要求->回應->接收 整個步驟都會重新做)。這種模式主要為HTTP1.0使用,相較於HTTP1.1 較費時,因為有一部份的時間都花在建立連線上。 ::: ![](https://i.imgur.com/6ZkcsHE.png =70%x) :::spoiler Web caches (proxy server) - 目標:讓使用者每次在Request的時候都要到server得到資料 - 在client跟server之間建造proxy server,用來做部分資料的快取(cache) - 當使用者要request時,會先向proxy server請求 - 若proxy server有對應的快取資料,就直接回傳給client - 若沒有,則會向original server請求,得到後快取在自己的server,並回傳給client,下次再有client向他索取那份資料,就能夠直接回傳,省去向original server請求的時間。 ::: ![](https://i.imgur.com/tJAqZDB.png =70%x) :::spoiler Alice sends message to Bob ::: ![](https://i.imgur.com/EUYlULt.png =70%x) :::spoiler DNS name resolution example 1 - iterated query: 我不知道你要去的人在哪裡,但我會跟你說下一層在哪裡。 - Domain Name是長成Tree的結構 ![](https://i.imgur.com/8oBwMsW.png =50%x) ::: ![](https://i.imgur.com/vcQgDdg.png =70%x) :::spoiler DNS name resolution example 2 - recursice query: 我不知道你要等人去哪裡,我去幫你問下一層的人知不知道。 - 遞迴的概念,直至問到人在哪後,回傳。 ::: ![](https://i.imgur.com/KIkdAt8.png =70%x) :::spoiler DNS records - RR: resource records ::: ![](https://i.imgur.com/XoT5aj4.png =70%x) :::spoiler Connection-oriented demux ::: ![](https://i.imgur.com/OaRAyTb.png =70%x) :::spoiler Internet checksun: example - UDP雖然不停的發送封包,但receiver會用check sum去檢測得到的封包是否有因為傳輸的過程中發生錯誤。 - check sum的產生,兩組二進制碼相加,若超出最高位元,會進行端回進位,在反相sum的結果,生成出check sum。 - 致命的缺點,在某些情況,得到的封包有錯誤,但是得到的check sum會一樣,導致無法偵測出錯誤。 ::: ![](https://i.imgur.com/RrYOuno.png =70%x) :::spoiler Pipelining: increased utilization - utilization time: fraction of time sender busy sending 在一次傳RTT的時間內,他的使用率如何。 - U越大越好,表示在RTT+(L/R)的時間內,傳送的封包越多。 - Pipelining: sender得到receiver的ACK回應前,繼續發送封包 - sequence number會增加,因為一次會傳好多個不同的封包,要能夠辨識出舊的跟新的。 - sender/receiver都必須要要有buffer可以緩存這些資料。 ::: ![](https://i.imgur.com/iWtuF5W.png =70%x) :::spoiler Go-Back-N: sender - 在sender會有buffer紀錄每個sequence number的狀態 - 這一長串的sequence會用window把狀態「sent, not yet ack'ed」和「usable, not sent」的sequence匡起來,用意是表示待處理的項目,且必須會從最前面依序處理到最後。 - 假設一次傳送封包的數量是n,n可能小於或大於window size,當timeout發生時,會把window當中前n項的封包一次重新傳送。 :::

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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