diff --git a/docs/architecture/cloud/cloudhub.md b/docs/architecture/cloud/cloudhub.md index 331c22c8b..4b699e794 100644 --- a/docs/architecture/cloud/cloudhub.md +++ b/docs/architecture/cloud/cloudhub.md @@ -62,6 +62,6 @@ Event object is then passed through the channel. The CloudHub can be configured in three ways as mentioned below : -- **Start the websocket server only**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-server-only) to see the details. -- **Start the quic server only**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-quic-server-only) to see the details. -- **Start the websocket and quic server at the same time**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-and-quic-server-at-the-same-time) to see the details +- **Start the websocket server only**: Click [here](../quic-design.md#start-the-websocket-server-only) to see the details. +- **Start the quic server only**: Click [here](../quic-design.md#start-the-quic-server-only) to see the details. +- **Start the websocket and quic server at the same time**: Click [here](../quic-design.md#start-the-websocket-and-quic-server-at-the-same-time) to see the details diff --git a/docs/architecture/cloud/edge_controller.md b/docs/architecture/cloud/edge_controller.md index 365fddfca..6d2018477 100644 --- a/docs/architecture/cloud/edge_controller.md +++ b/docs/architecture/cloud/edge_controller.md @@ -33,17 +33,17 @@ The following are the functions performed by Edge controller: - Creates message channel to update Nodestatus, Podstatus, Secret and configmap related events - Gets pod condition information like Ready, Initialized, Podscheduled and Unschedulable details - **Below is the information for PodCondition** -   - **Ready**: PodReady means the pod is able to service requests and should be added to the load balancing pools for all matching services -   - **PodScheduled**: It represents the status of the scheduling process for this pod -   - **Unschedulable**: It means the scheduler cannot schedule the pod right now, maybe due to insufficient resources in the cluster -   - **Initialized**: It means that all Init containers in the pod have started successfully -   - **ContainersReady**: It indicates whether all containers in the pod are ready + - **Ready**: PodReady means the pod is able to service requests and should be added to the load balancing pools for all matching services + - **PodScheduled**: It represents the status of the scheduling process for this pod + - **Unschedulable**: It means the scheduler cannot schedule the pod right now, maybe due to insufficient resources in the cluster + - **Initialized**: It means that all Init containers in the pod have started successfully + - **ContainersReady**: It indicates whether all containers in the pod are ready - **Below is the information for PodStatus** -   - **PodPhase**: Current condition of the pod -   - **Conditions**: Details indicating why the pod is in this condition -   - **HostIP**: IP address of the host to which pod is assigned -   - **PodIp**: IP address allocated to the Pod -   - **QosClass**: Assigned to the pod based on resource requirement + - **PodPhase**: Current condition of the pod + - **Conditions**: Details indicating why the pod is in this condition + - **HostIP**: IP address of the host to which pod is assigned + - **PodIp**: IP address allocated to the Pod + - **QosClass**: Assigned to the pod based on resource requirement    ![Upstream Controller](/img/edgecontroller/UpstreamController.png) @@ -54,6 +54,6 @@ The following are the functions performed by Edge controller: - Manages OnAdd, OnUpdate and OnDelete events which will be updated to the respective edge node from the K8s Api-server - Creates an eventManager(configMaps, pod, secrets) which will start a CommonResourceEventHandler, NewListWatch and a newShared Informer for each event to sync(add/update/delete)event(pod, configmap, secret) to edgecore via cloudHub - **Below is the List of handlers created by the controller Manager** -   - **CommonResourceEventHandler**: NewcommonResourceEventHandler creates CommonResourceEventHandler which is used for Configmap and pod Manager -   - **NewListWatch**: Creates a new ListWatch from the specified client resource namespace and field selector -   - **NewSharedInformer**: Creates a new Instance for the Listwatcher \ No newline at end of file + - **CommonResourceEventHandler**: NewcommonResourceEventHandler creates CommonResourceEventHandler which is used for Configmap and pod Manager + - **NewListWatch**: Creates a new ListWatch from the specified client resource namespace and field selector + - **NewSharedInformer**: Creates a new Instance for the Listwatcher \ No newline at end of file diff --git a/docs/architecture/edge/edgehub.md b/docs/architecture/edge/edgehub.md index 153a34bfc..59daabd04 100644 --- a/docs/architecture/edge/edgehub.md +++ b/docs/architecture/edge/edgehub.md @@ -73,5 +73,5 @@ The major steps involved in this process are as follows :- EdgeHub can be configured to communicate in two ways as mentioned below: -- **Through websocket protocol**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#edgehub-connect-to-cloudhub-through-websocket-protocol) for details. -- **Through QUIC protocol**: Click [here](https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#edgehub-connect-to-cloudhub-through-quic) for details. +- **Through websocket protocol**: Click [here](../quic-design.md#edgehub-connect-to-cloudhub-through-websocket-protocol) for details. +- **Through QUIC protocol**: Click [here](../quic-design.md#edgehub-connect-to-cloudhub-through-quic) for details. diff --git a/docs/architecture/quic-design.md b/docs/architecture/quic-design.md new file mode 100644 index 000000000..196a048c1 --- /dev/null +++ b/docs/architecture/quic-design.md @@ -0,0 +1,141 @@ +--- +title: Quic Design +status: implementable +authors: + - "@Qianchenjie" +approvers: +creation-date: 2019-05-01 +last-updated: 2019-05-08 +--- + +# Enhanced Cloud/Edge Communication + +## Abstract +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. +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. +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. +Key features of QUIC: + +1. [Dramatically reduced connection establishment time](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7867726) +2. Improved congestion control +3. [Multiplexing without head of line blocking](https://docs.google.com/document/d/1RNHkx_VvKWyWg6Lr8SZ-saqsQx7rFV-ev2jRFUoVD34/mobilebasic?pli=1) +4. Forward error correction +5. Connection migration + +![Quic-tcp-udp](/img/images/proposals/quic-tcp-udp.png) +![Quic-connection](/img/images/proposals/quic-connection.png) + +## Motivation +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. + +## Architecture +![Quic-design](/img/images/proposals/quic-design.png) + +## Configuration of kubeedge with websocket/quic +### Start the websocket server only +1. User edit controller.yaml +```yaml + cloudhub: + protocol_websocket: true # enable websocket protocol + port: 10000 # open port for websocket server + protocol_quic: false # enable quic protocol + quic_port: 10001 # open prot for quic server + max_incomingstreams: # the max incoming stream for quic server + address: 0.0.0.0 + ca: /etc/kubeedge/ca/rootCA.crt + cert: /etc/kubeedge/certs/edge.crt + key: /etc/kubeedge/certs/edge.key + keepalive-interval: 30 + write-timeout: 30 + node-limit: 10 + ``` + +2. Running the cloudhub, and start the websocket server. +3. Waiting for client access through websocket protocol. + +### Start the quic server only +1. User edit controller.yaml +```yaml + cloudhub: + protocol_websocket: false # enable websocket protocol + port: 10000 # open port for websocket server + protocol_quic: true # enable quic protocol + quic_port: 10001 # open prot for quic server + max_incomingstreams: # the max incoming stream for quic server + address: 0.0.0.0 + ca: /etc/kubeedge/ca/rootCA.crt + cert: /etc/kubeedge/certs/edge.crt + key: /etc/kubeedge/certs/edge.key + keepalive-interval: 30 + write-timeout: 30 + node-limit: 10 + ``` + +2. Running the cloudhub, and start the quic server. +3. Waiting for client access through quic protocol. + +### Start the websocket and quic server at the same time +1. User edit controller.yaml +```yaml + cloudhub: + protocol_websocket: true # enable websocket protocol + port: 10000 # open port for websocket server + protocol_quic: true # enable quic protocol + quic_port: 10001 # open prot for quic server + max_incomingstreams: # the max incoming stream for quic server + address: 0.0.0.0 + ca: /etc/kubeedge/ca/rootCA.crt + cert: /etc/kubeedge/certs/edge.crt + key: /etc/kubeedge/certs/edge.key + keepalive-interval: 30 + write-timeout: 30 + node-limit: 10 + ``` +2. Running the cloudhub, and start the quic and websocket server. +3. Waiting for client access through quic and websocket protocol. + +### edgehub connect to cloudhub through websocket protocol +1. User edit edge.yaml +```yaml + websocket: + url: wss://0.0.0.0:10000/e632aba927ea4ac2b575ec1603d56f10/edge-node/events + certfile: /etc/kubeedge/certs/edge.crt + keyfile: /etc/kubeedge/certs/edge.key + handshake-timeout: 30 #second + write-deadline: 15 # second + read-deadline: 15 # second + controller: + protocol: websocket # websocket, quic + placement: false + heartbeat: 15 # second + refresh-ak-sk-interval: 10 # minute + auth-info-files-path: /var/IEF/secret + placement-url: https://x.x.x.x:7444/v1/placement_external/message_queue + project-id: e632aba927ea4ac2b575ec1603d56f10 + node-id: edge-node + ``` +2. Running the edgecore, and start to connect to cloudhub through websocket protocol. + +### edgehub connect to cloudhub through quic +1. User edit edge.yaml +```yaml + quic: + url: 127.0.0.1:10001 + cafile: /etc/kubeedge/ca/rootCA.crt + certfile: /etc/kubeedge/certs/edge.crt + keyfile: /etc/kubeedge/certs/edge.key + handshake-timeout: 30 #second + write-deadline: 15 # second + read-deadline: 15 # second + controller: + protocol: quic # websocket, quic + placement: false + heartbeat: 15 # second + refresh-ak-sk-interval: 10 # minute + auth-info-files-path: /var/IEF/secret + placement-url: https://x.x.x.x:7444/v1/placement_external/message_queue + project-id: e632aba927ea4ac2b575ec1603d56f10 + node-id: edge-node + ``` + +2. Run the edgecore, and start to connect to cloudhub through quic protocol. \ No newline at end of file diff --git a/static/img/images/proposals/quic-connection.png b/static/img/images/proposals/quic-connection.png new file mode 100644 index 000000000..9a5461085 Binary files /dev/null and b/static/img/images/proposals/quic-connection.png differ diff --git a/static/img/images/proposals/quic-design.png b/static/img/images/proposals/quic-design.png new file mode 100644 index 000000000..ced83f195 Binary files /dev/null and b/static/img/images/proposals/quic-design.png differ diff --git a/static/img/images/proposals/quic-tcp-udp.png b/static/img/images/proposals/quic-tcp-udp.png new file mode 100644 index 000000000..dec182fec Binary files /dev/null and b/static/img/images/proposals/quic-tcp-udp.png differ