Project: KubeEdge (Provisioning / Automation & Configuration)
File: quic-design.md

title: Quic Design status: implementable authors: "@Qianchenjie" approvers: creation-date: 2019-05-01 last-updated: 2019-05-08 In order to enhance cloud and edge communication efficiency, we introduced the 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++HTTP/2 implemented on . 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: Improved congestion control Forward error correction Connection migration <img src="../images/proposals/quic-tcp-udp.png"> <img src="../images/proposals/quic-connection.png"> 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. <img src="../images/proposals/quic-design.png"> 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 ``` Running the cloudhub, and start the websocket server. Waiting for client access through websocket protocol. 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 ``` Running the cloudhub, and start the quic server. Waiting for client access through quic protocol. 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 ``` Running the cloudhub, and start the quic and websocket server. Waiting for client access through quic and websocket protocol. 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/placementexternal/messagequeue project-id: e632aba927ea4ac2b575ec1603d56f10 node-id: edge-node ``` Running the edgecore, and start to connect to cloudhub through websocket protocol. 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/placementexternal/messagequeue project-id: e632aba927ea4ac2b575ec1603d56f10 node-id: edge-node ``` Run the edgecore, and start to connect to cloudhub through quic protocol.