# **OSI七層架構與TCP/IP協定** ## **Outline** 1.序論 2.介紹OSI架構 3.介紹TCP/IP協定 4.比較OSI和TCP/IP協定之異同 ### **序論**:rocket: 網路是個複雜而龐大的世界,就像電影《駭客帝國》一切的位元都是由數字購成,一連串看來令人頭痛的數字,卻有著其代表的意義。而大約在1970年代,電腦和網際網路慢慢興起,隨之而來的問題也一一浮現。舉例來說,當電腦數量龐大時,該如何區別某一訊息是來自何方,因此就有了IP這東西。而當時,各家電信廠商都有自己的網際網路,在同一廠牌的網路裡,彼此是可以互通交流的,但如果跨廠牌的話則無法通信了。因此,制定一套大家都通用的傳輸方式因應而生。而OIS和TCP/IP協定都是一種制度,界下來就會介紹兩者之間的異同。 ### **何為OSI七層架構**:rocket: 國際標準組織(ISO)於1977年成立一委員會發展通信網路協定,制定了OSI。而OSI有七層架構。而每一層裡還有許多子協定在裡頭規範更多細節,就像憲法下還有法律、規則等詳細規範實際內容。 | 英文名稱 | 中文翻譯 | | ----------------- |:----------------------- | | Application Layer | 應用層[:link:][GitHub-Sync] | | Presention Layer |表現層 [:link:][HackMD-it] | | Session Layer |會談層 [:link:][Book-mode] | | Transport Layer |傳輸層 [:link:][Slide-mode] | | Network Layer |網路層 [:link:][Share-Publish] | | Data Layer|資料連結層 [:link:][Slide-mode] | | Physical Layer|實體層 [:link:][Share-Publish] | #### 應用層:tada: 應用程式,如電子郵件系統,資料庫管理系統。 #### 表現層:tada: 資料的壓縮還原、網路安全、檔案傳送。 #### 會談層:tada: 網路管理、密碼辨識、簽到簽退、網路監控。 #### 傳輸層:tada: 資料傳輸錯誤的偵測和復原,資料封包的重行排列。 #### 網路層:tada: 定義虛擬電路的建立、維持和終止,封包交換的路由選擇、擁塞控制等。 #### 資料連結層:tada: 定義把傳輸資料分裝成資料封包的規範, 檢查資料傳輸中是否有錯誤發生,執行資料傳送中的流量控制及鏈路管理。 #### 實體層:tada: 定義實際傳輸資料的硬體設備的規範,像是纜線規格、接頭尺寸、信號電壓、資料傳輸時序等等。 #### 小結:tada: 而實際上,OSI更像是一種理論,在應用上很少有人會用此規則分層,因為它太過繁瑣及詳細,其實有些層是可以合併的,在後面會一一介紹。 ### **何為TCP/IP協定**:rocket: ### **比較OSI和TCP/IP協定之異同**:rocket: 前面介紹了OSI和TCP/IP各層的功能及特性後,現在就來比較二者之差異吧!! ![](https://i.imgur.com/m3gs2u9.jpg) 由此圖可以發現,OSI相較於TCP/IP協定是較複雜的。在TCP/IP的應用層裡,就已經含括了OSI的三層,而實際也正是如此, :rocket: ### Step 2: Write something in Markdown Let's try it out! Apply different styling to this paragraph: **HackMD gets everyone on the same page with Markdown.** ==Real-time collaborate on any documentation in markdown.== Capture fleeting ideas and formalize tribal knowledge. - [x] **Bold** - [ ] *Italic* - [ ] Super^script^ - [ ] Sub~script~ - [ ] ~~Crossed~~ - [x] ==Highlight== :::info :bulb: **Hint:** You can also apply styling from the toolbar at the top :arrow_upper_left: of the editing area. ![](https://i.imgur.com/Cnle9f9.png) ::: > Drag-n-drop image from your file system to the editor to paste it! ### Step 3: Invite your team to collaborate! Click on the <i class="fa fa-share-alt"></i> **Sharing** menu :arrow_upper_right: and invite your team to collaborate on this note! ![permalink setting demo](https://i.imgur.com/PjUhQBB.gif) - [ ] Register and sign-in to HackMD (to use advanced features :tada: ) - [ ] Set Permalink for this note - [ ] Copy and share the link with your team :::info :pushpin: Want to learn more? ➜ [HackMD Tutorials](https://hackmd.io/c/tutorials) ::: --- ## BONUS: More cool ways to HackMD! - Table | Features | Tutorials | | ----------------- |:----------------------- | | GitHub Sync | [:link:][GitHub-Sync] | | Browser Extension | [:link:][HackMD-it] | | Book Mode | [:link:][Book-mode] | | Slide Mode | [:link:][Slide-mode] | | Share & Publish | [:link:][Share-Publish] | [GitHub-Sync]: https://hackmd.io/c/tutorials/%2Fs%2Flink-with-github [HackMD-it]: https://hackmd.io/c/tutorials/%2Fs%2Fhackmd-it [Book-mode]: https://hackmd.io/c/tutorials/%2Fs%2Fhow-to-create-book [Slide-mode]: https://hackmd.io/c/tutorials/%2Fs%2Fhow-to-create-slide-deck [Share-Publish]: https://hackmd.io/c/tutorials/%2Fs%2Fhow-to-publish-note - LaTeX for formulas $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ - Code block with color and line numbers: ```javascript=16 var s = "JavaScript syntax highlighting"; alert(s); ``` - UML diagrams ```sequence Alice->Bob: Hello Bob, how are you? Note right of Bob: Bob thinks Bob-->Alice: I am good thanks! Note left of Alice: Alice responds Alice->Bob: Where have you been? ``` - Auto-generated Table of Content [ToC] > Leave in-line comments! [color=#3b75c6] - Embed YouTube Videos {%youtube PJuNmlE74BQ %} > Put your cursor right behind an empty bracket {} :arrow_left: and see all your choices. - And MORE ➜ [HackMD Tutorials](https://hackmd.io/c/tutorials)