little-mi
    • 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
    • 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
    • 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 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
  • 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
    --- type: slide --- # 網路概論 *郭偉宏 Jason_Kuo* --- 要建立一套「電腦網路」是一個大工程。 需要哪些材料?位元的編碼方式?資料如何分段、標記? --- ## 協定(Protocol) --- 由於要銜沙填海,網路協定基本是百家爭鳴: * 加密網頁最常用的"身分證"[SSL/TLS (httpS)](https://datatracker.ietf.org/doc/html/rfc6101) * 傳輸檔案用的[ftp](https://datatracker.ietf.org/doc/html/rfc959) * 網頁![http (HTML)](https://datatracker.ietf.org/doc/html/rfc2616) * 埠號[TCP (ports)](https://datatracker.ietf.org/doc/html/rfc9293) * 另一種埠號[UDP (ports)](https://datatracker.ietf.org/doc/html/rfc768) * 電腦位址[IP (... IP。)](https://datatracker.ietf.org/doc/html/rfc791) * 測試指令集[ICMP (ping、tracert...)](https://datatracker.ietf.org/doc/html/rfc792) * [ARP (MAC <-> IP)](https://datatracker.ietf.org/doc/html/rfc826) * IEEE 802.3 (Ethernet,包含MAC) --- 可見,單個協定規範的範籌非常小。\ 只靠一兩個協定顯然不足以建構一個多元、便利的通訊網路。\ 因此,也出現了許多方法能將協定分類,便於整理目前需要的協定為何。 --- 目前最常用的分類方式有2 (3) 種: OSI 7層 與 IPS 4層 / 5層 ![OSI-and-TCP/IP-model](https://ipcisco.com/wp-content/uploads/2018/10/tcpip-model.jpg) ##### (圖片來源:ipcisco.com) 在上圖三個模型當中,最貼近使用者的(越上面),層數最大; 最接近電腦硬體的(越下面),層數最小。 --- 如圖所示,TCP/IP的基本就是把上面3層合稱應用層,其中4層結構把下面2層合稱為連結層。 OSI雖然分得比較細膩,然而在管理上只是徒增複雜度;只分4層的話,硬體與韌體又切分不徹底\ 因此電腦網路實作時更多討論IPS (TCP/IP) 5層架構。 --- ## L1-實體層(Physical layer) ```yaml -知名協定:IEEE 802.3 乙太網路(Ethernet) -常見機台:集線器 (Hub) -傳輸資訊:位元 (bit) ``` --- 例如網路線的2種順序就是802.3上寫的: ![RJ45 T568 A & B diagram](https://c8.alamy.com/comp/R7K5AW/rj45-crossover-pin-assignment-in-t568a-and-t568b-connections-types-infographic-scheme-R7K5AW.jpg =65%x) --- (萬一不是這倆,那代表這條網路線目前沒辦法跑到最高速度&這條網路線原本不能用了,是有人弄的補救措施~~或他純粹想搞你:D~~ ) --- ## L2-資料連結層(Data-link layer) ```yaml -知名協定:IEEE 802.3 乙太網路(Ethernet) & RFC 826 位址解析協定(ARP,Address Resolution Protocol) -常見機台:交換器 (Switch) -傳輸資訊:幀 (frame) ``` --- ### MAC位址 共48位元,通常以 6組 2位元 16進位數字表示 例如 FF:FF:FF:FF:FF:FF(廣播用) ![mac-addr](https://media.geeksforgeeks.org/wp-content/uploads/mac.jpg) (當然,這些表示法也是802.3指定的) --- ### ARP MAC位址(L2) 與 IP位址(L3) 的轉換協定 L2跟L3各自有獨立的位址... y tho ? --- MAC Address直接與「廠商」、「網卡」關聯 \>\> 沒特別追蹤的前提,編號等於「完全隨機洗牌」 *想像一下,能紀錄全球上億台電腦位址的機器,它的神奇價碼 :D* --- ## L3-網路層(Network layer) ```yaml -知名協定:RFC 791 網際網路通訊協定第四版(IPv4,Internet Protocol version 4) -常見機台:路由器 (Router) -傳輸資訊:封包 (packet) ``` ![meme-ip](https://cdn-img-a.facciabuco.com/24/u8dffctx2z-i-hacked-127-0-0-1-solo-per-nerd_b.jpg =30%x) --- #### IPv4位址格式:4組以.分隔的 8bit (0~255) 十進位數 ![ip-addr-format](https://www.cloudns.net/blog/wp-content/uploads/2023/03/IPv4-Address-Format.png =80%x) --- ### 保留IP位址 * 127.x.x.x/8 (loopback) * 192.168.x.x/16 (private) * 172.17.x.x/16 (private) * 10.0.x.x/16 (private) * 0.x.x.x/8 (self) --- ### 子網路遮罩 ![16bitMaskExample](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTzKDK5kUqzPOy9oUjkyskoPHOu3IlYOCKLHjfsVn9I48TcenLlMGAqTeesktWf-oU-GQ&usqp=CAU =200%x) ##### (圖片來源:https://www.javatpoint.com) --- 為了更方便管理,IP位址分成網路跟主機位址 大範圍尋址時(基本上,路由器之間)都使用網路位址;小範圍則使用主機位址 如此一來,紀錄可以節省不少空間、尋址也會快速許多 子網路遮罩則是**告訴電腦位址界線的方式** --- ### 子網遮罩格式 1. 與IPv4格式相同,可以用4組以.分隔的0~255表示 2. 直接在位址後面用 /位元 表示起始端為1的連續位元數量 --- #### 還沒有子網的時代--Classful IP Addressing: [GeeksForGeeks](https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/) [維基百科](https://zh.wikipedia.org/zh-tw/%E5%88%86%E7%B1%BB%E7%BD%91%E7%BB%9C) --- #### 更新後的IP位址--IPv6 [iThome](https://www.ithome.com.tw/tech/92046) [Microsoft Learn](https://learn.microsoft.com/zh-tw/dotnet/fundamentals/networking/ipv6-overview) -----/////////////////////////////---- #### v4與v6怎麼互相通訊? [iThome](https://www.ithome.com.tw/tech/92048) [維基百科](https://zh.wikipedia.org/zh-tw/IPv6%E8%BF%87%E6%B8%A1%E6%9C%BA%E5%88%B6) --- ## L4-傳輸層(Transport layer) ```yaml -知名協定:RFC 9293 傳輸控制協定(TCP,Transmission Control Protocol) -機台:硬體式防火牆 (Hardware Firewall) //不常見但存在.A. -傳輸資訊:段(segment) ``` --- 網頁用的:8080或:80、麥塊用的:25565或:19132都是通訊埠號碼(port number)的一例 其中0~1024是讓各種其他協定使用的保留號 而1025~49151是可以到IANA(網際網路號碼分配局)註冊的 剩下的49152~65535是動態分配用的保留號 --- ## L7-應用層(Application layer) ```yaml -知名協定:RFC 2616 超文本傳輸協定(HTTP,HyperText Transfer Protocol) & RFC 6101 安全通訊協定/傳輸層安全協定(SSL/TLS,Secure Sockets Layer/Transport Layer Scurity) -傳輸資訊:資料(data) ``` --- ## Quick Review L1:外修時要背順序 L2:開學時要登記 ~~(我們也知道很奇怪:D)~~,接單時也要檢查 L3:外修時要幫人家檢查 L4:架服務時不小心就會設定到 L7:就是要設定的東西,其作用體現為服務 --- ## 網路協定 (internet protocol) 為了讓網路上的各個設備有個「共通設定/校準方案」而訂定出來的標準 --- ## 但是,是設定什麼東西呢? ##### ~~電腦,當然 :D~~ --- ## 電腦(Computer) 一切電腦網路規定的意義所在,網絡中的節點 在其上可以運行: * 服務(Service):為使用者提供的事務 * 伺服器(Server):對「提供服務者」的稱呼 * 環境(Environment):對負責設定用的相關元件之統稱 * 作業系統(Operating System):讓軟體伺服器運行的必要環境 * 族繁不及備載... --- # 課程結束 [:3](https://www.youtube.com/watch?v=k1BneeJTDcU)

    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