Meow~
      • 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
    • 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 Versions and GitHub Sync Note Insights 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
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    計算機網路 3-B === ###### tags: `courses meow` :::success :::spoiler Click to open TOC [TOC] ::: :::info :::spoiler 清大教學(畫質低且年代久遠請注意) https://www.youtube.com/watch?v=wcdUhDkoWAo&list=PL9jciz8qz_zxeXaMgy4Z77P7dKNRWegE0&index=2 ::: > 第一次期中考到第四章結束,剛看了一下,總共有四百五十頁的PPT,完蛋了QQ[name=在系K讀到瘋掉的醬油] > 期中考超佛,但是我耍蠢最高只剩80 [name=蛋蕉] # Ch1 ## Definition > The Internet (or internet) is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. [name=wikipedia] > 大概就是裝置之間可以進行連線,透過IP定址且按照協定規範傳輸資料的都可以叫做Internet - ISP - 提供網際網路服務的供應商,通常大型的電信公司會兼職ISP。 - 有高低層級差距 - interface(介面) - 資料連結、傳輸的方式,定義了裝置之間如何傳送資料 - protocol(協定) - 資料傳輸的格式、順序,以及在傳輸資料時該隊資料做哪些處理 - Traceroute - 封包在傳輸時會經過的路由器位置 - DoS - 一種網路攻擊手法,透過對server大量傳送、要求封包,造成server無法負荷如此大量的請求導致過載,使server資源耗盡而停止服務 > 話說DoS最初的起源其實是一種網路抗議,所以現在常見的DDoS其實是一種示威活動? ## Routing ### packet switching - queueing - 不會預留頻寬給user,所以理論上可以一次給很多user使用,丟了封包以後就進到buffer排隊(queue)。但是如果user都使用占用很多流量的話就有可能會有buffer爆炸封包丟失等問題 ### circuit switching - commonly used in tranditional telephone networks - 預留頻寬給user,因此假設總頻寬100mb,每個user分配10mb,一次就只能最多10個user同時使用,即使在線中的user沒有在傳輸資料,也可能會有佔據頻寬的問題 - FDM (Frequency Division Multiplexing) - 將頻寬切開進行分配,所有使用者同時分配所有頻寬進行使用 - TDM (Time division Multiplexing) - 將時間切開進行分配,每個使用者特定時間內可以享有所有的頻寬 > 其實我還有看到一種叫做message switching,好像是packet switching的前身。 :::success ![](https://i.imgur.com/yaNgXte.png) ::: ## trace route > sending many packet with different hop limit(TTL: Time To Live) to trace the route everytime a packet passed by a router , packet.TTL will be reduce by one. ```bash= #!/bin/bash traceroute google.com ``` 示意圖: > TTL = Time To Live ``` host -> packet1(TTL=1), packet2(TTL=2)... host -> router1 -> router2 -> router3 -> ... (respones (respones (respones packet1) packet2) packet3) ``` ## packet delay :::success ![](https://i.imgur.com/hsb9RzN.png) ::: - ==$d_{nodal} = d_{proc} + d_{queue} + d_{trans} + d_{prop}$== - $d_{proc}$:processing delay - 資料上傳以後,節點進行確認、處理,尋找路徑等所需的時間 - $d_{queue}$:queueing delay - 欸斗應沒啥好說的,就是資料在buffer排隊等待的時間 - 比較需要注意假如資料要傳入buffer時buffer滿了,資料就有可能會loss掉,因此在這部分有時還要去注意loss的機率 - $d_{trans}:$transmission delay - 資料從節點傳出去到線上所需的時間 - L:資料的長度(bits) - R:資料傳輸的速度(bits/s) - 總共時間:==L/R== - $d_{prop}:$propagation delay - 資料傳到目的地所需的時間 - d:資料傳輸的路徑長度(m) - s:資料在網路上傳輸的速度(m/s) - 通常是$2*10^{8}$左右 - 總共時間:==d/s== ### Traffic intensity - 封包傳輸的密集度 - L:每個封包資料的長度(bits) - R:資料傳輸的頻率(bits/s) - A:平均封包到達的頻率 - Traffic intensity:$(L*A)/R$ - Traffic intensity >= 1 - 要等超久,久到接近無限大的久,可能久到醬油死掉骨頭長毛了還傳不出去。 - Traffic intensity <= 1 - 正常的平均等待時間 - Traffic intensity = 0 - 無與倫比的上傳速度 > $L*a$意思相當於平均資料到達的頻率(bits/s),所以$L*A$/R的大概就是平均資料到達頻率跟平均資料處理頻率的比值 ## Throughput - 網路從host到host實際傳輸的時間 - 由於現實面各種因素,因此傳輸資料的速率不一定能達到網路實際頻寬 - 通常受限於最小傳輸速率,因此取最小傳輸的速率進行運算 - e.g.假設網路受限於使用者網卡(R1)、演算法的效能(R2)、伺服器網卡(R3),則計算時取$min(R1,R2,R3)$做運算 - 即$throughput = min(R1,R2,R3)$ ## Internet Security > 大概就是簡述一sniffing、DOS什麼的吧,看起來很簡單沒甚麼特別的 ## Layered Internet Protocol Stack |Protocol| | -------- | |Application| |Transport| |Network| |Link| |Physical| > 上面的層級皆是建構在下面層級的基礎上 ### Application(應用層) - 利用網路應用程式進行資料交換的規範 - 一般利用網路傳輸資料的應用程式可以接觸到的層級 - e.g.HTTP,HTTPS,SMTP,POP3,IMAP,DNS,TELNET... - DHCP應該也算在這裡(? ### Transport(傳輸層) - 大致上是在規範資料處理的過程,資料運送是否保證完整性、可靠性... - e.g.TCP,UDP ### Network(網路層) - 負責進行定址,決定資料傳輸的路線,要經過哪些router,解決router雍塞問題等等... - e.g.IP,router protocol ### Link(鏈結層) - 負責處理node之間的傳輸,確保node之間資料傳輸的可靠性等等 - wifi,PPP ### Physical(物理層?) - 一切看的到的基本上屬於這層,定義上來說,這層處理線上的0和1 - 網路卡,網路線等等 :::success ![](https://i.imgur.com/FzFs2vx.png) ::: ### 資料傳輸 #### 資料的包裝 - 1.應用層傳送一筆資料$M$丟給傳輸層 - 2.傳輸層得到一筆資料$M$,會對資料進行處理,在資料表頭插入一個表頭$H_t$ - $H_t$儲存的資料之後會交給對方的傳輸層閱讀,即哪一層加的表頭由哪一層的傳輸協定進行閱讀,彼此之間透過此表頭進行溝通 - e.g.有的表頭會對資料進行運算(xor,checksum...),運算完成的數字加入表頭,之後傳輸層得到資料後也對資料進行運算,運算完比對是否正確 - 3.網路層得到一筆資料$H_tM$,一樣進行處理加入表頭$H_n$丟下去 - 4.鏈結層得到一筆資料$H_nH_tM$,進行處理往下傳送 - 5.物理層開始傳輸資料 #### 資料的拆裝 - 1.物理層得到資料往上傳 - 2.鏈結層得到一筆資料$H_nH_tM$,將表頭$H_n$部分拆出來解讀,再把資料往上丟 - ...以此類推 #### Summary - 總之資料往下傳會變大,往上傳會變小 :::success ![](https://i.imgur.com/m2WQ771.png) ::: ## Internet History > 想當然而是不用理他的,黎明你考這個我就送你吧 # CH2 ## network application - network application運行在網路edge端,彼此之間會透過網路進行溝通 - core端並不會運行application ## Client and Server ### Clients - 一般是主動端 - 會去請求server做連線、溝通 - 不一定要一直開機,也可以是dynamic IP - 彼此之間不一定要有聯繫 ### Server - 通常是always-on的 - 通常是permanent IP address - 但其實server還是可以透過DNS做到dynamic的 - 通常是資料儲存的中心 - 一般是被動端 ### Peer-Peer(P2P) - 不需要有一個always-on的主機。 - 可以彼此之間隨意地連線。 - 每台主機都可以提供服務及接受服務,意即大家都是server跟client。 - 因為彼此之間斷斷續續聯繫,沒有一個固定的連接。因此管理上較為複雜。 ### Processes Communicating - in the same host,processes之間的溝通由OS架構處理。 - in the diffirient hosts,processes之間的溝通透過交換資訊實現。 #### Client and Server Processse - Client - 通常Client的process目的是為與他人連線。 - Server - 通常Server的process目的是要等待他人連線。 - P2P - 通常兩者皆須具備 ## Socket :::success ![](https://i.imgur.com/GiaqnVe.png) ::: - OS定義的process與網路進行溝通和傳輸訊息的方法。process可以透過socket與任何一個網路端點進行連線,從而傳輸、獲取資訊。 - socket像是一個接口,位置大致上位於Application層和Transport層之間,Server會先建立好一個socket,等待他人來連線,Client建立好socket以後便可以與Server之間連結,連結完成以後Application透過socket將輸入資料傳給transport層,transport打包以後進行傳送,Server的socket接收到以後會將資料透過socket網上傳給Application,然後Application便可輸出。 > 另外分層算是抽象的概念,其實沒辦法去硬歸類哪個動作在哪層,不過socket是屬於應用層還有傳輸層的交界,這樣說是沒錯的。[name=助教] :::info ### 三方交握 - 通常TCP在建立連線時,為了確保雙方的連線之間有穩定,建立連線時會進行以下步驟: - 1.Client傳輸連線請求給Server - 2.Server收到來自Client的連線請求,回傳封包給Client,其中封包內容會包含可用於確認的資料 - 3.Client收到資料後會進行確認,確認完後回傳確認值給Server。 - 其中在第三步時,若Server遲遲收不到Client的回傳資料,或是回傳的確認資料和預期不符,就會放棄這次連線重新建立,以確保連線品質。 - 三方交握的位置在第四層transport層上,是上面socket那邊圖片的虛線位置,三方交握進行完成功連線以後便會透過socket傳輸資料。 ::: :::success :::spoiler socket流程 ![](https://i.imgur.com/l1Py7h2.png) :::success ::: ## Addressing processes - socket在傳輸資料時,identifier須包含IP和Port Number兩個資訊 - IP是位置 - Port Number是要使用的協定代碼 - 常見的Port Number - | Port Number | Protocol | | -------- | -------- | | 20,21 | 檔案傳輸協定 | |25|Mail傳輸協定| |23|DNS| |80|HTTP| ## Transport service and Application - Data integrity - 資料是否可以接受遺失,又或者是要求百分之百正確送達。 - Timing - 是否要求資料傳輸的時間 - Throughput - 是否要求資料傳輸的速率(穩定性和速度) - elastic - 我有多少頻寬用多少頻寬 - effective - 要穩定且高效的傳達 :::success ![](https://i.imgur.com/psPEqfD.png) ::: ## TCP vs UDP :::success ![](https://i.imgur.com/Ad7oyV7.png) ::: ### TCP - 要求資料的穩定性和可靠性 - 透過三方交握建立連線等方式確保資料沒有遺失,寧可多花費時間在資料檢查上,也不願意資料的遺失 - 為了避免資料丟失,傳輸過程會特別避免頻寬雍塞、buffer爆炸等問題 - flow control - 避免資料傳輸端將buffer塞爆的問題 - congestion control - 避免資料傳輸端將傳輸線路塞爆的問題 - 資料傳輸時會按照順序傳送 - 通常用於需要確保高度資料正確性但步要求時間的Applicatoin - e.g.Email,網頁程式碼檔案(Html...),檔案傳輸等... - Pipiline機制 - 如果每一次TCP都確認完這個封包沒有問題才傳送下一個封包,那網路速度會相當的慢,因此會透過Pipeline一次執行多個封包 ### UDP - 不在乎資料的可靠性 - 資料按照串流拼接方式傳輸 - 不特別在乎傳輸順序 - 不需要建立連線即可傳輸資料 - 不需要像TCP一樣三方交握完建立連線,然後才傳輸檔案。UDP確定好IP位置等資訊即可直接開始把資料上傳到網路上開始傳送 - 通常運用在不在乎資料可靠性但需要時間急迫性的Application - e.g.串流媒體(人類實在是感受不出來影片少了一幀之類的問題)... ### UDP的優點 - 不需要建立連線,因此少花費了一個RTT左右的時間,且不需要特別Pipeline等工作費時,時間上確實有差 - 標頭檔比起TCP要小的多,TCP加上各種確認機制的限制,最小的標頭檔也有20bytes左右,UDP的標準標頭檔只需8bytes - 不需要維護連線,TCP在維護連線時有許多狀態參數需要由OS維護,UDP不建立連線因此可以省下系統資源 - 不用管流量限制等問題,想傳多少就傳多少 :::success ![](https://i.imgur.com/sy6OgET.png) ::: ## Web - 網頁是一種程式,會有輸入輸出跟很多物件,物件可以是個html,jpeg,png... - 物件可能存在很多不同web server,透過URL進行定址 ### URL > 網路協定://伺服器位址/檔案位址(可以是個程式,如果是個執行檔,電腦會叫起來執行;如果是資料檔,電腦會把資訊傳遞給你)?傳遞訊息 ## HTTP - Hypertext Transport Protocol(超文本傳輸協定) - Port Number:80 - 屬於application層的協定 - 是在TCP的規範下架構出來的 - Clinet透過TCP向Server傳輸請求(Port=80) - Server從TCP得到請求,並透過TCP回傳答覆 - Clinet從TCP接收到回傳 - Server-Client的model - Server - 利用HTTP傳輸物件給Client作為回復 - Clinet - 向Server請求檔案,並將接收到的回傳物件展示出來 - HTTP是Stateless,每次連線都視為獨立連線 ### Persistent & Non-Persistent - Non-Persistent - 每次連線最多傳輸一個物件 - 優點 - 傳輸一個連線就關閉,不會佔用資源 - 缺點 - 每傳輸一個物件就要新開一個連線,可能造成雍塞和CPU資源消耗等問題($RTT*2$ $per$ o$bject$) - Persistent - 每次連線可以傳輸多個物件 - 優點 - 比較不易造成雍塞且節省記憶體資源 - 可一次請求大量物件,不需花費大量時間傳遞請求($RTT*2$ $all$ $object$) - 缺點 - 連結建完不會馬上關閉(initial=15s),容易造成佔用 - 若遇到每傳輸一個物件就開一個連線的網站,可能會大量佔用資源 - e.g.大量圖片網站 ### Request in HTTP #### 請求的方法 (HTTP Methods) > method 為 http request 中的其中一個欄位,用來表示這次 request 的意圖 > 注意!這並不是一個強制性的規定,畢竟最後的 application 是某工程師自己寫的 > 你也是可以讓你的 server 做成 `DELETE` 會回傳資料, `GET` 會刪除資料。只是會讓別人很困惑你的腦袋是不是有問題 > 會這樣寫的感覺不是CTF那些愛整人的出題者就是混亂邪惡哈哈 - GET - 向Server請求、查詢指定資料,不會對伺服器資料產生任何修改動作 - 對Server而言此請求是安全且冪等價的 - 會將請求加於URL後,此行為並不安全,Server應對此進行加密動作保證資料不可洩漏性 - > 定義上 GET 不應該擁有 body,所以對於資源的額外需求會添加在 URL 上,又稱 'query string' 或 'get parameter', > 像是 "http://starbrust-stream-online.io/players?limit=100" > 後面的 "limit=100" 就是 "query string" > https://www.google.com/search?q=%E4%B8%AD%E5%A4%AE%E5%A4%A7%E5%AD%B8 > 或是像這個,前面是google search,?後面則是GET方法附帶傳遞的訊息,說明我要透過google search請求"中央大學"的資訊回傳 - HEAD - 和GET一樣是向Server請求、查詢指定資料,但差別在於HEAD僅回傳此資料的頭資訊 - 通常用於確認資料是否存在及基本資訊 - POST - 對Server進行input - HTTP對於POST請求並沒有大小限制,受限的是Server處理能力 - PUT - 向Server上傳檔案資料 - DELETE - 很直覺的,刪除資料 - OPTIONS - 確認Server接受那些請求 - 亦可以測試Server效能,有點類似ping指令 - 但十有八九會回傳Error 405,大部分網站基於安性考量只支援get,post - ![](https://i.imgur.com/RY1ctLT.png =600x) > POST 與 PUT 的差別在於, POST 一般用來表達上傳一份新的資料(像是新增玩家), PUT 一般用來表達更新部份資料(像是更新某玩家暱稱) #### 請求的格式 - 請求行 - 應包含請求的方法、目標和HTTP版本 - Head - 一堆裝置資訊 - CRLF - 一行空的CRLF作為表頭的結束判斷 - CR: `\r` - LF: `\n` - Body - 乘載資料的地方 :::success ![](https://i.imgur.com/vVeqT4y.png) ::: :::info [HTTP1.1請求格式](https://notfalse.net/39/http-message-format) ::: #### 回復的格式 - 狀態行 - 狀態和HTTP版本 ![](https://i.imgur.com/uYj179y.png =500x) - [http status code reference](https://http.cat/) - Head - 一堆裝置資訊 - CRLF - 一行空的CRLF作為表頭的結束判斷 - Body - 乘載資料的地方 :::success ## Magic Cookie > 為什麼要叫餅乾,可能是因為寫程式的大家常常忘記吃飯,所以就用甜點的名子吧[name=許老大] > 國外偶爾會下雪雪雪雪雪雪雪雪雪雪雪,而下雪時,為了避免雪在身上融化溼答答,常常會穿大衣,可是大衣進到餐廳之類的會很不方便,所以會有櫃台人員幫你把大衣收起來,然後給你一張ticket,之後拿ticket便可換回你的大衣。cookie就像是ticket,可以進行驗證,可是櫃台人員只認ticket不認人,任何人都可以拿ticket拿到大衣。 - 用於儲存登入資訊等狀態 - 就算我拿不到帳號密碼,我只要拿到身分認證用的cookie,我就可以用你權限行動。 - 當我們在某些網站進行身分認證時,我們輸入帳號密碼,成功登入後便會產生cookie,之後進行任何動作,cookie都會幫助我們進行分認證。沒有了cookie我們每次進行任何動作都得認證一次身分,會相當的麻煩。 - ==Cookie只是一段文字、一段紀錄,可能可以用來傳送廣告。但它絕對不是程式,它沒辦法下載惡意程式或是讓你電腦中毒。== - Set-Cookie; Name=*VALUE*; expires=*DATE*;path=*PATH*; domain=*DOMAIN_NAME*; secure; - 斜體代表自行輸入。 - ";" "," " "屬於保留字不可用 - 如果真的要使用,利用%xx - xx代表ASCII - expires是cookie有效時間,沒設定則離開此網站便消失 - 沒設定不代表存在時間比較短,這之間沒有任何關係,就像很多人習慣電腦不關機,FB不登出,那它的Cookie存在的時間到半年都有可能。 - 先比對Domain_Name和Host_Name有沒有match,match的再去比對Path是否match,都match的話便會傳送cookie > Request 的 Header 其中一欄便是 Cookie,其為很多"對"的 cookie ::: ## Web Cache - user會設置一段Web Cache在Browser中,每次要向Server端傳送請求時,便先到Web Cache當中查找是否有符合的物件,若有變回傳,沒有才到Server端請求資料 - 減少Server需要回復的請求量,可以降低雍塞發生的機率 - 不用每次都傳送請求道Server端,降低連線所需時間 - Server一樣可以設置Web Cache,減少查詢物件所需時間 ## HTTP2 - HOL Blocking - 假如今天向Server請求了$O_1,O_2,O_3,O_4$四個檔案,$O_1$特別大,會造成剩下的檔案必須等到$O_1$傳送完,會有雍塞的情形 - HTTP2會將檔案分割成更小的Frame,有時可能先傳送$O_1$的Frame,有時先傳送後面的,避免$O_1$的傳輸佔用大量時間 :::success ![](https://i.imgur.com/bnhB2Oc.png) ![](https://i.imgur.com/HPQDjJ3.png) ::: ## HTTP3 - 做了更多效能、Pipeling和Security上的優化 ## Email ### SMTP - User Agent - 撰寫信件、對信件進行編輯,以及收發郵件等 - mail Server - 儲存和管理信件資料 - 對使用者進行認證、授權 - SMTP Protocol - 以TCP為基礎 - Port Number:25 - Client - 寄信者 - Server - 收信者 - 流程 - 1.建立TCP連線 - 2.Client端向Server傳送連線請求 - 3.Server端回傳220 - 4.Client傳送HELO及Client資訊 - 5.Server回傳250 - 6.資料傳輸 - 寄件者User Agent會先傳送資料給Client端 - Client透過TCP傳送給Server - Server收件以後會將資料傳給收件者User Agent :::success ![](https://i.imgur.com/NnCuoWp.png) ::: ### POP3 - 相比於SMTP是用Server來傳輸資料,POP3的Server用於儲存資料,User需要去Server將郵件下載下來才可以查看 - 之後有出POP4,不過好像停止更新了 ### STMP vs HTTP - 兩者皆是以TCP作為傳輸基礎 - Client & Server - HTTP的Client比較像是在做pull的動作,將資料從Server請求回電腦 - STMP的Client是在push,將資料傳給Server - Object - HTTP的每個object獨立封裝 - STMP的許多object封裝在一起 - STMP是Persistent的connection ### STMP Syntext - blank line一樣是CRLF :::success ![](https://i.imgur.com/3CTm8s0.png) ::: ## un ### http - non-persistence TCP - 每次每個檔案都要重連 TCP - persistence TCP - pipline - paral TCP ### FTP - out-of-band control - FTP has 2 TCP connection, 1 for file-data, 1 for command - so the command is "out-of-band" ## DNS - IP:一串二進位編碼 - Domain Name:方便辨認的名字 - 大概是為了方便人類小小的腦袋記憶或是辨認,一般我們打網址或是在網路上請求連線定址時,並不會真的把IP打出來,會將Domain Name丟給DNS servise幫我們進行查詢。 - DNS有分層級,從最高級的Root DNS(全世界總共13個?)開始往下 :::success ![](https://i.imgur.com/mBIWSZ2.png) ::: ### DNS查詢方式 - Recursive(遞迴):向一個DNS查詢,那個DNS便會幫我找到答案回傳給我 :::success ![](https://i.imgur.com/0ugoHCJ.png) ::: - Iterated(跌代):向一個DNS查詢,DNS回傳給該向哪一個DNS查詢,之後繼續 :::success ![](https://i.imgur.com/4Kj82oq.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