John
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # Open Flow, SDN & NFV ## **Overview** ### 1. 軟體定義網路(software definednetworking, SDN) 在目前大部分的網路系統中,當網路的狀態有所改變而必須調整事件回應規則時,網管人員通常必須手動地把網路中高階(high-level)的事件回應規則利用專業知識與經驗轉換為低階(low-level)的指令才能夠達成,而這通常是個能夠使用的工具非常有限的工作。所以如同大多數人經歷過的,網路系統不出事則已,一旦出現了網路事件的不尋常狀況(unusual condition)或是程式的未處理的例外情形(unmanaged exception),系統的維護與調校(tuning)便是個經常很具有挑戰性且容易出錯的過程。這主要是由於網管人員擁有的只有硬體供應商提供的裝置與功能性通常不甚完備足以處理所有狀況的操作介面,使得這些裝置對網管人員而言只是一些串連起來發揮功能的「黑盒子」(black box),只要一天無法完全明白其運作機制,要對於所有網路狀況應對如流便是一件幾乎不可能的任務。 網管與研究人員所面對的另外一個極難克服的問題是所謂的「網路骨化」(Internet ossification),所指的是由於網路的迅速普及以及大量網路裝置的使用。網路已經被大部分的人視為如交通運輸系統、電力系統等公共基礎建設的一部分,無論是硬體的抽換或是通訊協定的演進,只要存在使網路服務中斷的可能性就幾乎不可能被認可。這使得我們不得不對於網路架構做一些根本的改進,使其能夠更容易地適應新的演進。 這種可程式網路(programmable network)是將轉送封包的硬體(forwarding hardware)與控制封包轉送的決策單元分離開來,而使決策單元能夠以程式控制,大幅簡化網路事件回應規則與行為模式的管理,使得硬體與通訊協定的更新更加容易。在軟體定義網路中,由中央軟體控制封包傳輸的機制,封包轉送的元件僅負責資料傳輸,而軟體可藉由開放的介面(open interface)加以程式,目前最具影響力的主流介面有ForCES與OpenFlow二種。 **軟體定義網路(Software Defined Network, SDN)**,顧名思義,利用軟體來定義網路,網路中所有的資料傳輸路徑,皆透過軟體來定義,SDN為一種新型態網路運行之架構,依據非營利性組織開放式網路基金會 (Open networking Foundation, ONF)對SDN的定義,在SDN架構中,最重要的概念為控制(Control)與資料管道(Data Plane)分離。如下圖所示,傳統網路中所使用的交換器/路由器在執行指令與控制資料傳輸時,皆在設備自身操控,而SDN概念試圖將控制管道抽離設備,想像一台傳統的交換器/路由器只剩下單純的資料傳輸功能,至於執行指令、計算資料傳輸路徑…等功能,皆由額外的SDN控制器集中執行與控制,維運人員在操作設備時,僅需對SDN控制器調整設定,所有指令將由SDN控制器統一派送,維運人員不需至每台設備逐一設定,所有資料傳輸路徑不再依賴設備中的路由表,反之,SDN控制器會統一計算並控制資料傳輸。 ![](https://i.imgur.com/umtSYOL.png) ### 2. 軟體定義網路的架構 在網路中資料的傳輸由使用者對使用者或使用者對伺服器與網路基礎建設的連結所構成,而在連結上封包的傳送由路由器與交換器達成。這些路由器與交換器通常是「封閉」的系統,僅由網管人員借由一些由硬體供應商提供的控制介面來操作;==因此這些設備一旦開始服役,要更新這些無論是硬體還是通訊協定(例如將IPv4更新為IPv6),在不影響使用者正常使用的前提之下,就成為一項困難的工作,更不用說是將硬體或通訊協定徹底置換這樣的大工程了==。 如前所述,「網路骨化」的現象意味著封包傳輸或轉送的決策在網路元件上完成,也就是說在這樣的環境中,==任何新的網路應用程式(例如防火牆、入侵偵測系統等)或是功能性(functionality)(例如繞徑機制)有所改變時,網管人員便必須直接就基礎建設(也就是低階)層面去改變整個系統架構,這是個時間與人力成本都高的任務,SDN便是被提出試著解決這個現象進而促進網路系統的演進==。 **SDN為一可程式化(Programmable)網路**,如下圖所示,在SDN架構中,所有網路設備被SDN控制器集中控制,SDN控制器負責維護 所有的網路架構,對於最上層的應用程式來說,藉由取得SDN控制器的資訊,原本由實體網路設備組成的網路架構,在應用程式中,將改由一個個邏輯的交換器/ 路由器所組成。透過SDN,大幅簡化了網路管理者設計網路架構及操作網路設備的困難度,不僅如此,網路設備本身的硬體設計,也不需處理大量複雜的協定,僅 需接受來自SDN控制器所下達的指令運作,軟體開發人員更可利用SDN廠商所提供SDN控制器的API,自行開發介面管理SDN。 SDN將網路架構簡化為封包轉送硬體與網路決策控制器(decision-making network controller)二個單元,其中封包轉送硬體由 (1) 包含了條目(entry)以及對於活躍的流程(active flows)所必須採取的行動的流程表(flow table); (2) 以及能夠與控制器經由安全的通道溝通對於尚未在流程表上的新條目所必須採取行動的階層(layer)所構成。 ![](https://i.imgur.com/3bzP2mM.png) ### 3. Openflow Ar(A kind of data plane protocol) ![](https://i.imgur.com/WoWY5iu.png) * Blcok Diagram ![](https://i.imgur.com/jBYTg2J.png) ### `Flow Table Entry` ![](https://i.imgur.com/xv4cLKi.png) 這些包含的元件有一個Group Table以及多個Flow Table。而交換機會與圖1上方的Controller溝通,這個Controller再透過OpenFlow協定與OpenFlow Channel溝通。 在Flow Table中包含多筆所謂的Flow Entry資料,每一筆Flow Entry包含符合條件的內容、計數器以及針對符合的網路封包所要下達的指令(Instruction)等等。透過OpenFlow協定,Controller可以新增、修改以及刪除這些Flow Entry的內容。 1. Flow Table: 當網路封包抵達網路交換機時,就會開始根據Flow Table中的內容嘗試去比對符合的條件,Flow Table中的每一筆資料是有前後優先順序的,而Flow Table各個表格之間也會有優先順序。一旦找到相符的Flow Entry,就執行Flow Entry中所設定好的動作指令。 如果在某一個Flow Table中都沒有找到符合的Flow Entry,則會根據預先設定好的預設值執行動作指令,這預先設定好的動作可能是尋找下一個Flow Table的內容,或是直接丟棄,或者轉給OpenFlow Channel來處理。 2. Action: 剛才有提到每一筆Flow Entry都會有相對應的動作指令,一旦找到符合的Flow Entry,就會執行相對應的動作指令。而動作指令內容可以是一般的動作(Action)或是所謂的Pipeline Processing。一般的動作指令可能是轉發網路封包,或是修改網路封包內容,而Pipeline Processing代表的是讓下一個Flow Table來處理,當然網路封包相關的資訊也都會被傳到下一個Flow Table。如果Pipeline Processing並沒有指定下一個要處理的Flow Table,就不會丟到下一個Flow Table,通常這種時候都會直接針對這個網路封包做處理。 3. Statistics: 用來統計封包的資訊, 如封包的發送次數, 活動表項等等 ---

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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