github.com/jingruilea/kubeedge@v1.2.0-beta.0.0.20200410162146-4bb8902b3879/docs/proposals/quic-design.md (about)

     1  ---
     2  title: Quic Design
     3  status: implementable
     4  authors:
     5      - "@Qianchenjie"
     6  approvers:
     7  creation-date: 2019-05-01
     8  last-updated: 2019-05-08
     9  ---
    10  
    11  # Enhanced Cloud/Edge Communication
    12  
    13  ## Abstract
    14  In order to enhance cloud and edge communication efficiency, we introduced the [QUIC](https://quicwg.org/ops-drafts/draft-ietf-quic-applicability.html) protocol for cloudhub and edgehub.
    15  It is suggested that cloudHub should support both websocket and QUIC protocol access at the same time. And the edgehub can choose one of the protocols to access to the cloudhub.
    16  QUIC is a new transport which reduces latency compared to that of TCP. On the surface, QUIC is very similar to TCP+[TLS](http://technet.microsoft.com/en-us/library/cc785811.aspx)+HTTP/2 implemented on [UDP](http://c3lab.poliba.it/images/3/3b/QUIC_SAC15.pdf). Because TCP is implemented in operating system kernels, and middlebox firmware, making significant changes to TCP is next to impossible. However, since QUIC is built on top of UDP, it suffers from no such limitations.
    17  Key features of QUIC:
    18  
    19  1. [Dramatically reduced connection establishment time](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7867726)
    20  2. Improved congestion control
    21  3. [Multiplexing without head of line blocking](https://docs.google.com/document/d/1RNHkx_VvKWyWg6Lr8SZ-saqsQx7rFV-ev2jRFUoVD34/mobilebasic?pli=1)
    22  4. Forward error correction
    23  5. Connection migiation
    24  
    25  <img src="../images/proposals/quic-tcp-udp.png">
    26  <img src="../images/proposals/quic-connection.png">
    27  
    28  ## Motivation
    29  In edge scenarios, network connectivity could be unstable. With TCP + TLS, it becomes an overhead to establish / re-establish connections frequently due to intermittent networks. In such scenarios, QUIC with its zero RTT can help reduce this overhead and re-establish broken connections faster.
    30  
    31  ## Architecture
    32  <img src="../images/proposals/quic-design.png">
    33  
    34  ## Configuration of kubeedge with websocket/quic
    35  ### Start the websocket server only
    36  1. User edit controller.yaml  
    37  ```yaml
    38    cloudhub:
    39    protocol_websocket: true # enable websocket protocol
    40    port: 10000 # open port for websocket server
    41    protocol_quic: false # enable quic protocol
    42    quic_port: 10001 # open prot for quic server
    43    max_incomingstreams: # the max incoming stream for quic server
    44    address: 0.0.0.0
    45    ca: /etc/kubeedge/ca/rootCA.crt
    46    cert: /etc/kubeedge/certs/edge.crt
    47    key: /etc/kubeedge/certs/edge.key
    48    keepalive-interval: 30
    49    write-timeout: 30
    50    node-limit: 10
    51    ```
    52  
    53  2. Running the cloudhub, and start the websocket server.
    54  3. Waiting for client access through websocket protocol.
    55  
    56  ### Start the quic server only
    57  1. User edit controller.yaml
    58  ```yaml
    59    cloudhub:
    60    protocol_websocket: false # enable websocket protocol
    61    port: 10000 # open port for websocket server
    62    protocol_quic: true # enable quic protocol
    63    quic_port: 10001 # open prot for quic server
    64    max_incomingstreams: # the max incoming stream for quic server
    65    address: 0.0.0.0
    66    ca: /etc/kubeedge/ca/rootCA.crt
    67    cert: /etc/kubeedge/certs/edge.crt
    68    key: /etc/kubeedge/certs/edge.key
    69    keepalive-interval: 30
    70    write-timeout: 30
    71    node-limit: 10
    72    ```
    73  
    74  2. Running the cloudhub, and start the quic server.
    75  3. Waiting for client access through quic protocol.
    76  
    77  ### Start the websocket and quic server at the same time
    78  1. User edit controller.yaml
    79  ```yaml
    80    cloudhub:
    81    protocol_websocket: true # enable websocket protocol
    82    port: 10000 # open port for websocket server
    83    protocol_quic: true # enable quic protocol
    84    quic_port: 10001 # open prot for quic server
    85    max_incomingstreams: # the max incoming stream for quic server
    86    address: 0.0.0.0
    87    ca: /etc/kubeedge/ca/rootCA.crt
    88    cert: /etc/kubeedge/certs/edge.crt
    89    key: /etc/kubeedge/certs/edge.key
    90    keepalive-interval: 30
    91    write-timeout: 30
    92    node-limit: 10
    93    ```
    94  2. Running the cloudhub, and start the quic and websocket server.
    95  3. Waiting for client access through quic and websocket protocol.
    96  
    97  ### edgehub connect to cloudhub through websocket protocol
    98  1. User edit edge.yaml
    99  ```yaml
   100      websocket:
   101          url: wss://0.0.0.0:10000/e632aba927ea4ac2b575ec1603d56f10/edge-node/events
   102          certfile: /etc/kubeedge/certs/edge.crt
   103          keyfile: /etc/kubeedge/certs/edge.key
   104          handshake-timeout: 30 #second
   105          write-deadline: 15 # second
   106          read-deadline: 15 # second
   107      controller:
   108          protocol: websocket # websocket, quic
   109          placement: false
   110          heartbeat: 15  # second
   111          refresh-ak-sk-interval: 10 # minute
   112          auth-info-files-path: /var/IEF/secret
   113          placement-url: https://x.x.x.x:7444/v1/placement_external/message_queue
   114          project-id: e632aba927ea4ac2b575ec1603d56f10
   115          node-id: edge-node
   116    ```
   117  2. Running the edgecore, and start to connect to cloudhub through websocket protocol.
   118  
   119  ### edgehub connect to cloudhub through quic 
   120  1. User edit edge.yaml
   121  ```yaml
   122      quic:
   123          url: 127.0.0.1:10001
   124          cafile: /etc/kubeedge/ca/rootCA.crt
   125          certfile: /etc/kubeedge/certs/edge.crt
   126          keyfile: /etc/kubeedge/certs/edge.key
   127          handshake-timeout: 30 #second
   128          write-deadline: 15 # second
   129          read-deadline: 15 # second
   130      controller:
   131          protocol: quic # websocket, quic
   132          placement: false
   133          heartbeat: 15  # second
   134          refresh-ak-sk-interval: 10 # minute
   135          auth-info-files-path: /var/IEF/secret
   136          placement-url: https://x.x.x.x:7444/v1/placement_external/message_queue
   137          project-id: e632aba927ea4ac2b575ec1603d56f10
   138          node-id: edge-node
   139    ```
   140      
   141  2. Run the edgecore, and start to connect to cloudhub through quic protocol.