AndyChiang
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
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
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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 2. 計算機網路簡介 ###### tags: `2022資工營` 待會要講的東西比較困難一點,大家當成聽故事就好~ ## 什麼是網路? 大家每天都在使用網路,但你有曾經想過網路背後是怎麼運作的嗎? 所謂的網路其實是由很多點和線連結而成的圖,其中的點可以是**路由器(router)**、**交換器(switch)** 或 **電腦主機(host)**,線可以是**雙絞線(twisted pair)**、**同軸電纜(coaxial cable)** 或 **光纖電纜(fiber optic cable)** 等等。 點之間可以使用這些線互相連接,並傳送由0和1組成的數位訊號。 ![](https://i.imgur.com/6UowYNN.png) ## 網路中的裝置 在網路中,通常就是我們的電腦主機或伺服器被稱為**網路邊緣裝置(network edge)**。 而路由器和交換器則被稱為**網路核心裝置(network core)**。 邊緣裝置負責產生和接收封包(寄件人、收件人),而核心裝置則負責傳遞封包(郵差)。 ![](https://i.imgur.com/kRIfFF6.jpg) ## 傳送封包 因為我們用網路傳很多東西,像是Youtube影片、網頁、聊天訊息等等,所以我們會將資料打包成一個個的 **封包(packet)** 來傳送。 我們舉一個簡單的例子,今天假如A想傳給B一個封包: ![](https://i.imgur.com/FCrgKIa.png) ## 封包格式 一個封包會分成兩的區塊,分別是 **標頭(header)** 和 **資料(data)**。 我們可以將一個封包比作為一封信,標頭部分相當於信封,而資料部分則相當於信的內容,所以路由器就相當於郵差,根據標頭決定要將封包送往何處。 ![](https://i.imgur.com/lge9xtj.png) ## 網路傳輸協定(Protocol) 所謂的「Protocol」是指在網路上一種可以彼此溝通的模式,雙方都要依照某些規則進行溝通。 這其實有點像一個國家裡會有很多方言,像是閩南語、客家語等等,但如果雙方都各講各的方言,彼此無法溝通,所以一定會規定一個語言是「國語」,如此一來雙方就能順利了解對方的意思了。 同樣的,在網路上,是由許多台各式各樣的電腦所組成,彼此的配備規格及工作平台都不太相同,例如有PC、MAC或工作站;也有可能裡面用的作業系統可能是Windows、MacOS或UNIX,因此我們也要給這些電腦定義共同的語言,就稱作Protocol。 依照不同的需求,也就有不同的Protocol,例如要瀏覽網站的話,要遵守網站的通訊協定,叫**HTTP(HyperText Transfer Protocol)**。 ## 網路模型(TCP/IP) 因為網路實在過於複雜,為了簡化網路的架構,於是我們將網路分成了四層,每層各司其職,且都有各自的協定: * **應用層**:處理應用程式的資料。ex. HTTP、FTP * **傳輸層**:保證封包成功送達且按照正確的順序。ex. TCP、UDP * **網路層**:決定該將封包傳送給哪個裝置。ex. IP * **鏈結層**:保證兩個裝置間的封包傳送。ex. Ethernet ![](https://i.imgur.com/6Qae1bK.jpg =x300) 封包在傳遞時就像寄包裹一樣,寄件方將資料一層層的加上標頭,傳到收件方後再一層層的去除標頭,拿到要傳遞的資料。 ![](https://i.imgur.com/lxuEaTH.png) **計算機網路就簡單介紹到這邊,這也是資工系大二的必修課,所以如果對網路有興趣的人,歡迎加入資工系! (絕對不是在工商)**

    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