NCNU-OpenSource
      • 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

      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
    • 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 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

    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
    --- tags: 1092, lsa --- # Week 03(2021/03/11) - Book mode https://hackmd.io/@ncnu-opensource/book [TOC] ## 網路架構 ### OSI 七層 - 太複雜惹,通常用在理論的部分 - physical layer - data link - data frame - [mac address](https://zh.wikipedia.org/wiki/MAC%E5%9C%B0%E5%9D%80) - 用來確認網路位址 - 每個網卡都有一個 - `ip link show` : 看自己的 mac address - network layer - 將ip 加到加到封包 - 決定封包路徑 - ipv4 & ipv6 - class A/B/C/D/E - `ifconfig` - 子網路遮罩 - 判斷網路是否在同一網域 - 詳情請看上學期共筆 ^_^ - ICMP - 包含封包裡面 - 回報錯誤訊息跟分析路由 - ex : ttl (time to live) - 每轉發一次 ttl - 1 - if ttl == 0: 傳輸錯誤(逾時) - `traceroute` 實做方式 - 發icmp封包 ttl 為 1...n(n = 主機經過節點數目) - 如果 網速很慢可以看看網路速度哪裡最慢 - transport layer - tcp - 三向交握(重複交談直到另一方有回應) - 慢啟動:一開始的傳輸資料速度較慢 - udp(射後不理) - session layer - 負責建立網路連線 & 保持網路連線 - presentation layer - ssl -> 現在叫 TLS - application layer - HTTP - 1.0: - 預設關閉 - 只能保持一個連線 - 因為慢啟動, so 傳輸速度不高 - 1.1: - 預設開啟 - keep alive : 保持與伺服器的聯繫,不用每次重建 - 2.0: - 保持開著,速度不會掉 ### TCP/IP 五層(四層) - application layer - 輸入網址會發生麼事哩 1. 檢查瀏覽器是否由瀏覽過,有的會就用暫存,不然就往下做 2. etc/hosts 3. udp 53 port 4. DNS - `nslookup` - `dig` - `traceroute` 5. 透過 http 解析原本的網站內容 - `GET 網址 HTTP/1.0` - transport layer - 如果是 HTTPS 會在這邊加解密 - network layer - linkkk - 包上 MAC - 轉換成位元組 - `arp` - 轉換成 實體ip ##### 偷偷補充個 || Layer |中文| 資料 | 設備名稱 | 負責功能 | 協定 | 例子 | |-| --- |---|---| ---- |---| --- |---| |7| Application |應用層| message || 定義介面給應用程式 | HTTP FTP SMTP DHCP POP3|網路瀏覽器(IE、Firefox)、電子郵件、線上遊戲、即時通訊(MSN Messenger、ICQ)等| |6| Presentation |表現層|message || 轉成網路的標準格式 加解密 加解壓縮 |SSL|將ASCII編碼轉成應用層可以使用的資料,或是處理圖片及其他多媒體檔案,如JPGE圖片檔或MIDI音效檔。| |5| Session |會談層| message|| 同步控制(群播) 網路建立連線的確認 |ADSP SOCKS NetBIOS |NetBIOS names-檔案及列印分享(網路上的芳鄰)| |4| Transport |傳送層(TCP層)| segment| |end-to-end 流量控制 資料完整偵測 | TCP UDP || |3| Network |網路層(IP層)|packet|router |決定`route`路徑 header格式偵測 | IP IPX ICMP|| |2| Data-Link |資料鏈結層| frame| switch | point-to-point 壅塞控制 資料完整偵測 |有線-802.3 無線-802.11|| |1| Physical |實體層|bits | hub repeater |把`位元串`傳出去||| google BBR : 很方便的酷東西 [Private IP](https://zh.wikipedia.org/wiki/%E4%B8%93%E7%94%A8%E7%BD%91%E7%BB%9C) ### 光纖網路線 - 是由很多玻璃或塑膠製的纖維組成,用全內反射原理來傳導光線。 - [更多詳情](https://hackmd.io/@ncnu-opensource/book/%2FgbyngS7lRzutIpBibjyIjQ?type=book#%E5%85%89%E7%BA%96%E7%B6%B2%E8%B7%AF%E7%B7%9A) ### POE (Power Over Ethernet) - 讓網路線可以**供電**到裝置的技術 - [更多詳情](https://hackmd.io/@ncnu-opensource/book/%2FgbyngS7lRzutIpBibjyIjQ?type=book#%E7%84%A1%E7%B7%9A%E7%B6%B2%E8%B7%AF) ### 為什麼 SNMP 要用 UDP ? :::spoiler 解答 如果 server 壞掉成功傳送的機率 50%,用 TCP 的話會因為三向交握的關係導致連線一直無法成功,UDP 會直接將封包丟過去,成功的機率較高。 ::: ### BGP (邊界匝道器協定) - 有一台專屬的 switch 可以幫你把封包傳送到某個特定的目的地 - [更多詳情](https://hackmd.io/@ncnu-opensource/book/%2FgbyngS7lRzutIpBibjyIjQ?type=book#Anycast) ### 流量控制 - SHAPING(限制 ) - Leaky Bucket - 輸入速率可以變化但輸出速率不變 - Token Bucket - Bucket 滿了就不在放封包 - SCHEDULING(排程) - SFQ - 多個動態分配的 queues 組成﹐一個 queue 負責一個 conversation - TBF - 一個緩衝區 (bucket) 構成,存放 tokens - 僅在有足夠的 token 可用時才發送封包 - CBQ - 網路排程的一種排隊規則 - HTB - 保證每個類別的頻寬,但也允許特定的類別可以突破頻寬上限,佔用別的類的頻寬 - POLICING(策略) - DROPPING(丟棄) - [更多詳情](https://hackmd.io/gbyngS7lRzutIpBibjyIjQ#SHAPING%EF%BC%88%E9%99%90%E5%88%B6)

    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