You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by gi...@apache.org on 2019/10/16 05:44:48 UTC

[dubbo-website] branch asf-site updated: Automated deployment: Wed Oct 16 05:44:37 UTC 2019 dd30e24528d58732a391248c009eeeb49cd75534

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new fa14c8d  Automated deployment: Wed Oct 16 05:44:37 UTC 2019 dd30e24528d58732a391248c009eeeb49cd75534
fa14c8d is described below

commit fa14c8d24d30ed5eddc2b74533e7579cd8dd903e
Author: htynkn <ht...@users.noreply.github.com>
AuthorDate: Wed Oct 16 05:44:38 2019 +0000

    Automated deployment: Wed Oct 16 05:44:37 UTC 2019 dd30e24528d58732a391248c009eeeb49cd75534
---
 build/blog.js                  |   2 +-
 build/ecology.js               |   2 +-
 en-us/blog/dubbo-protocol.html | 196 +++++++++++++++++++++++++++++++++++++++++
 en-us/blog/dubbo-protocol.json |  10 +++
 en-us/blog/index.html          |   2 +-
 md_json/blog.json              |  13 ++-
 zh-cn/blog/dubbo-protocol.html |  34 +++----
 zh-cn/blog/dubbo-protocol.json |   6 +-
 zh-cn/blog/index.html          |   2 +-
 9 files changed, 241 insertions(+), 26 deletions(-)

diff --git a/build/blog.js b/build/blog.js
index a442592..4d52392 100644
--- a/build/blog.js
+++ b/build/blog.js
@@ -1,4 +1,4 @@
-!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/build/",t(t.s=315 [...]
+!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/build/",t(t.s=315 [...]
   Copyright (c) 2017 Jed Watson.
   Licensed under the MIT License (MIT), see
   http://jedwatson.github.io/classnames
diff --git a/build/ecology.js b/build/ecology.js
index ef6130e..394d715 100644
--- a/build/ecology.js
+++ b/build/ecology.js
@@ -3,7 +3,7 @@
   Licensed under the MIT License (MIT), see
   http://jedwatson.github.io/classnames
 */
-!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var o=n.apply(null,r);o&&e.push(o)}else if("object"===a)for(var i in r)c.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}var c={}.hasOwnProperty;void 0!==e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(a=function(){return n}.apply(t,r))&&(e.exports=a))}()},function(e,t,n){"use strict";Objec [...]
+!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var o=n.apply(null,r);o&&e.push(o)}else if("object"===a)for(var i in r)c.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}var c={}.hasOwnProperty;void 0!==e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(a=function(){return n}.apply(t,r))&&(e.exports=a))}()},function(e,t,n){"use strict";Objec [...]
 object-assign
 (c) Sindre Sorhus
 @license MIT
diff --git a/en-us/blog/dubbo-protocol.html b/en-us/blog/dubbo-protocol.html
new file mode 100644
index 0000000..af651e0
--- /dev/null
+++ b/en-us/blog/dubbo-protocol.html
@@ -0,0 +1,196 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+	<meta name="keywords" content="Dubbo, Protocol, RPC" />
+	<meta name="description" content="This article introduces the design of the Dubbo protocol." />
+	<!-- 网页标签标题 -->
+	<title>Introduction to the Dubbo protocol</title>
+	<link rel="shortcut icon" href="/img/dubbo.ico"/>
+	<link rel="stylesheet" href="/build/blogDetail.css" />
+</head>
+<body>
+	<div id="root"><div class="blog-detail-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/en-us/index.html"><img class="logo" src="/img/dubbo_colorful.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">中</span><div class="header-menu"><img class="header-menu-toggle" src="/img/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a hr [...]
+<p>The protocol is the foundation of communication between two network entities, and data is transmitted from one entity to another in the form of a byte stream over the network. In the world of byte streams, this one-dimensional byte stream cannot be reshaped into two-dimensional or multi-dimensional data structures and domain objects without a protocol.</p>
+<h3>What is the protocol</h3>
+<p>The protocol is the semantics determined by both parties for the communication. For example, we design a protocol for string transmission, which allows the client to send a string and the server receives the corresponding string.</p>
+<p>This protocol is quite simple, first 4-byte represent the total length of the message, followed by 1-byte represents the length of the charset, and then followed by the message payload, charset name and string body.</p>
+<p>For example, Send a string <code>abc</code> encoded by <code>iso-8859-1</code> to the server end. After protocol trans-coding, the content is: <code>18 = 4 + 1 + 10 + 3|10|iso-8859-1|abc</code>, when the server receives these byte streams, it first reads 4-byte and converts it to int, in this case is 18, which is the length of message. Then continue to read the remaining 14 bytes, the remaining first byte read will be the length of the charset name, which is 10, the after 10-byte cont [...]
+<p>In the previous example of a custom string transfer protocol, we have already seen the role of protocols in data transmission. Without a protocol, the data exchange cannot be completed. The following is Wikipedia's definition of the communication protocol.</p>
+<blockquote>
+<p>In telecommunication, a communication protocol is a system of rules that allow two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules syntax, semantics and synchronization of communication and possible error recovery methods. Protocols may be implemented by hardware, software, or a combination of both.</p>
+</blockquote>
+<p>Communication protocols need to define syntax, semantics, and communication synchronization operations. The content described here is actually a formal description of the previous custom string transfer protocol.</p>
+<h3>The definition of <code>Codec</code></h3>
+<p><code>org.apache.dubbo.remoting.Codec2</code> define the <strong>Codec</strong>'s I/O processing, so the main methods are <code>encode</code> and <code>decode</code>, as defined below:</p>
+<pre><code class="language-java"><span class="hljs-meta">@SPI</span>
+<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">Codec2</span> </span>{
+
+    <span class="hljs-meta">@Adaptive</span>({Constants.CODEC_KEY})
+    <span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">encode</span><span class="hljs-params">(Channel channel, ChannelBuffer buffer, Object message)</span> <span class="hljs-keyword">throws</span> IOException</span>;
+
+    <span class="hljs-meta">@Adaptive</span>({Constants.CODEC_KEY})
+    <span class="hljs-function">Object <span class="hljs-title">decode</span><span class="hljs-params">(Channel channel, ChannelBuffer buffer)</span> <span class="hljs-keyword">throws</span> IOException</span>;
+
+
+    <span class="hljs-keyword">enum</span> DecodeResult {
+        NEED_MORE_INPUT, SKIP_SOME_INPUT
+    }
+
+}
+</code></pre>
+<p>​	<code>Codec</code> works on a protocol, <code>encode</code> method means to encode the communication object to the <code>ByteBufferWrapper</code>, and <code>decode</code> method decodes the <code>ChannelBuffer</code> read from the network into <code>Object</code>, which is the communication object.</p>
+<h2>Common protocol mode</h2>
+<p>Protocols in application layer have three general forms: fixed-length protocol, special delimiter protocol and protocol header + payload mode. The specific contents of these forms are described below.</p>
+<p>When reading data from the network in the form of a byte stream, it is necessary to determine when a meaningful transmission content ends. Moreover, the transmission of data on the network, there are sticky packets and fragment packets problem. The solution to this problem is that the protocol can accurately identify, when the sticky packets or fragment packets occurs, it can handle it correctly.</p>
+<h3>Fixed-length protocol</h3>
+<p>The fixed-length protocol means that the length of the protocol content is fixed. For example, the protocol byte length is 50. When 50 bytes are read from the network, the decoding operation is performed. The fixed-length protocol is more efficient when reading or writing, because the size of the data cache is basically determined, just like an array. The defect is the lack of adaptability. Taking the RPC scene as an example, it is difficult to estimate the length.</p>
+<blockquote>
+<p>Refer to Netty's <code>FixedLengthFrameDecoder</code></p>
+</blockquote>
+<h3>Special delimiter protocol</h3>
+<p>Compared to fixed-length protocols, if we can define a special character as the end of each protocol unit, we can communicate in a variable length, so as to balance the data transmission and efficiency, such as the delimiter \n.</p>
+<p>The problem with the special delimiter method is that it think about the process of protocol transmission in a simple way. For a protocol unit, it must be read all before it can be processed. In addition, it must be prevented that the data transmitted by the user cannot be the same as the delimiter, otherwise it will be disordered.</p>
+<blockquote>
+<p>Refer to Netty's <code>DelimiterBasedFrameDecoder</code></p>
+</blockquote>
+<h3>Variable length protocol(protocol head + payload)</h3>
+<p>Generally, it is a custom protocol, which is composed of a fixed length and a variable content. The fixed length part needs to specify the length of the variable content part.</p>
+<pre><code class="language-sh">+————————————————+
+|fixed-length    |
++————————————————+
+|variable content|
++————————————————+
+</code></pre>
+<blockquote>
+<p>Refer to Netty's <code>LengthFieldBasedFrameDecoder</code></p>
+</blockquote>
+<p>The Dubbo protocol is actually a variable length protocol, which is covered in more detail in later chapters.</p>
+<h2>The Dubbo protocol</h2>
+<h3>Overview to the Dubbo protocol</h3>
+<p>The Dubbo framework defines a proprietary RPC protocol in which the specific content of the request and response protocols is presented using a table.</p>
+<p><img src="http://dubbo.apache.org/docs/zh-cn/dev/sources/images/dubbo_protocol_header.png" alt="/dev-guide/images/dubbo_protocol_header.jpg"></p>
+<h3>Dubbo protocol details</h3>
+<ul>
+<li>
+<p>Magic - Magic High &amp; Magic Low (16 bits)</p>
+<p>Identify protocol version, Dubbo protocol: 0xdabb</p>
+</li>
+<li>
+<p>Req/Res (1 bit)</p>
+<p>Identify a request or response. request: 1; response: 0.</p>
+</li>
+<li>
+<p>2 Way (1 bit)</p>
+<p>Only useful when Req/Res is 1(request), identifying if you expect to return a value from the server. Set to 1 if a return value from the server is required.</p>
+</li>
+<li>
+<p>Event (1 bit)</p>
+<p>Identifies whether it is an event message, for example, a heartbeat event. Set to 1 if this is an event.</p>
+</li>
+<li>
+<p>Serialization ID (5 bit)</p>
+<p>Identifies the serialization type: for example, the value of fastjson is 6.</p>
+</li>
+<li>
+<p>Status (8 bits)</p>
+<p>Only useful when Req/Res is 0 (response), used to identify the status of the response</p>
+<ul>
+<li>20 - OK</li>
+<li>30 - CLIENT_TIMEOUT</li>
+<li>31 - SERVER_TIMEOUT</li>
+<li>40 - BAD_REQUEST</li>
+<li>50 - BAD_RESPONSE</li>
+<li>60 - SERVICE_NOT_FOUND</li>
+<li>70 - SERVICE_ERROR</li>
+<li>80 - SERVER_ERROR</li>
+<li>90 - CLIENT_ERROR</li>
+<li>100 - SERVER_THREADPOOL_EXHAUSTED_ERROR</li>
+</ul>
+</li>
+<li>
+<p>Request ID (64 bits)</p>
+<p>Identifies the only request, the type is long.</p>
+</li>
+<li>
+<p>Data Length (32 bits)</p>
+<p>The length of the serialized content (variable part), counted in bytes, the type is int.</p>
+</li>
+<li>
+<p>Variable Part</p>
+<p>After being serialized by a specific serialization type (identified by the serialization ID), each part is a byte [] or byte.</p>
+<ul>
+<li>If it is a request packet (Req/Res = 1), each part is:
+<ul>
+<li>Dubbo version</li>
+<li>Service name</li>
+<li>Service version</li>
+<li>Method name</li>
+<li>Method parameter types</li>
+<li>Method arguments</li>
+<li>Attachments</li>
+</ul>
+</li>
+<li>If it is a response packet (Req/Res = 0), each part is:
+<ul>
+<li>Return value's type (byte), identifying the type of value returned from the server:
+<ul>
+<li>Return null: RESPONSE_NULL_VALUE 2</li>
+<li>Normal response value: RESPONSE_VALUE  1</li>
+<li>Exception: RESPONSE_WITH_EXCEPTION  0</li>
+</ul>
+</li>
+<li>Return value: response bytes returned from the server</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+<p>**Note: ** For the variable part, when uses json serialization in current version of Dubbo framework, an additional line break is added as a separator between each part of the content. Please add a new line break after each part of the variable part, such as:</p>
+<pre><code>Dubbo version bytes (line break)
+Service name bytes  (line break)
+...
+</code></pre>
+<h2>Advantages and disadvantages about the Dubbo protocol</h2>
+<h3>Advantages</h3>
+<ul>
+<li>The protocol is designed to be very compact. The data type can be represented by 1 bit will not be represented by a byte, such as a boolean type identifier.</li>
+<li>The request header is the same as response header, and the specific content is assembled to the variable part through the serializer, and it is simple to implement.</li>
+</ul>
+<h3>To be improved</h3>
+<ul>
+<li>
+<p>Similar to the http request, the header can determine the resource to be accessed, and Dubbo needs to involve the specific serializer to resolve the service name, method, method signature, and these resource locators are string type or string array. It's easy to convert to bytes, so it can be assembled into the header. Similar to http2 header compression, resources called for rpc can also be negotiated with an int to identify, which improves performance. This is easier to implement if [...]
+</li>
+<li>
+<p>Use req/res to determine if it is a request, then you can refine the protocol, remove some unwanted identifiers and add some specific identifiers. For example, <code>status</code>, <code>twoWay</code> can be strictly customized to remove redundant identifiers. There is also a timeout identifier that is transmitted as the <code>attachment</code> of the Dubbo. In theory, it should be placed in the header of the request protocol, because the timeout is essential in the network request. R [...]
+</li>
+<li>
+<p>Dubbo will convert the service name <code>com.alibaba.middleware.hsf.guide.api.param.ModifyOrderPriceParam</code> to <code>Lcom/alibaba/middleware/hsf/guide/api/param/ModifyOrderPriceParam;</code>, which is theoretically unnecessary, simply append a <code>;</code> will be fine.</p>
+</li>
+<li>
+<p>The Dubbo protocol does not reserve extension fields, and cannot add new identifiers. The scalability is not very good. For example, the only way to add the <code>response context</code> function is to change the protocol version, but this requires both the client and server versions to be upgraded. Very unfriendly in distributed scenarios.</p>
+</li>
+</ul>
+<h2>Conclusion</h2>
+<p>This article mainly introduces the concept of the protocol and the commonly used protocol mode. Then it analyzes the Dubbo protocol in detail and also mentions some shortcomings. However, compared with its simplicity and ease of implementation, the above shortcomings are not enough to drive us to redesign a new version of the protocol, so we welcome suggestions and features for protocol optimization.</p>
+</section><footer class="footer-container"><div class="footer-body"><img src="/img/dubbo_gray.png"/><img class="apache" src="/img/apache_logo.png"/><div class="cols-container"><div class="col col-12"><h3></h3><p></p></div><div class="col col-4"><dl><dt>ASF</dt><dd><a href="http://www.apache.org" target="_self">Foundation</a></dd><dd><a href="http://www.apache.org/licenses/" target="_self">License</a></dd><dd><a href="http://www.apache.org/events/current-event" target="_self">Events</a></ [...]
+	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
+	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
+	<script>
+		window.rootPath = '';
+  </script>
+  <script src="/build/blogDetail.js"></script>
+  <!-- Global site tag (gtag.js) - Google Analytics -->
+	<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112489517-1"></script>
+	<script>
+		window.dataLayer = window.dataLayer || [];
+		function gtag(){dataLayer.push(arguments);}
+		gtag('js', new Date());
+
+		gtag('config', 'UA-112489517-1');
+	</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/en-us/blog/dubbo-protocol.json b/en-us/blog/dubbo-protocol.json
new file mode 100644
index 0000000..ee2a876
--- /dev/null
+++ b/en-us/blog/dubbo-protocol.json
@@ -0,0 +1,10 @@
+{
+  "filename": "dubbo-protocol.md",
+  "__html": "<h2>The concept of the protocol</h2>\n<p>The protocol is the foundation of communication between two network entities, and data is transmitted from one entity to another in the form of a byte stream over the network. In the world of byte streams, this one-dimensional byte stream cannot be reshaped into two-dimensional or multi-dimensional data structures and domain objects without a protocol.</p>\n<h3>What is the protocol</h3>\n<p>The protocol is the semantics determined by  [...]
+  "link": "/en-us/blog/dubbo-protocol.html",
+  "meta": {
+    "title": "Introduction to the Dubbo protocol",
+    "keywords": "Dubbo, Protocol, RPC",
+    "description": "This article introduces the design of the Dubbo protocol."
+  }
+}
\ No newline at end of file
diff --git a/en-us/blog/index.html b/en-us/blog/index.html
index dbe15fc..1eda5e9 100644
--- a/en-us/blog/index.html
+++ b/en-us/blog/index.html
@@ -12,7 +12,7 @@
 	<link rel="stylesheet" href="/build/blog.css" />
 </head>
 <body>
-	<div id="root"><div class="blog-list-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/en-us/index.html"><img class="logo" src="/img/dubbo_colorful.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">中</span><div class="header-menu"><img class="header-menu-toggle" src="/img/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a href [...]
+	<div id="root"><div class="blog-list-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/en-us/index.html"><img class="logo" src="/img/dubbo_colorful.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">中</span><div class="header-menu"><img class="header-menu-toggle" src="/img/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a href [...]
 	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
 	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
 	<script>
diff --git a/md_json/blog.json b/md_json/blog.json
index a9afb5c..b5e39ed 100644
--- a/md_json/blog.json
+++ b/md_json/blog.json
@@ -145,6 +145,15 @@
       }
     },
     {
+      "filename": "dubbo-protocol.md",
+      "link": "/en-us/blog/dubbo-protocol.html",
+      "meta": {
+        "title": "Introduction to the Dubbo protocol",
+        "keywords": "Dubbo, Protocol, RPC",
+        "description": "This article introduces the design of the Dubbo protocol."
+      }
+    },
+    {
       "filename": "dubbo-zk.md",
       "link": "/en-us/blog/dubbo-zk.html",
       "meta": {
@@ -590,9 +599,9 @@
       "filename": "dubbo-protocol.md",
       "link": "/zh-cn/blog/dubbo-protocol.html",
       "meta": {
-        "title": "DUBBO协议详解",
+        "title": "Dubbo 协议详解",
         "keywords": "Dubbo, Protocol, RPC",
-        "description": "本文介绍了dubbo协议的设计"
+        "description": "本文介绍了 Dubbo 协议的设计"
       }
     },
     {
diff --git a/zh-cn/blog/dubbo-protocol.html b/zh-cn/blog/dubbo-protocol.html
index b1d9aca..b6bb509 100644
--- a/zh-cn/blog/dubbo-protocol.html
+++ b/zh-cn/blog/dubbo-protocol.html
@@ -5,9 +5,9 @@
 	<meta charset="UTF-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
 	<meta name="keywords" content="Dubbo, Protocol, RPC" />
-	<meta name="description" content="本文介绍了dubbo协议的设计" />
+	<meta name="description" content="本文介绍了 Dubbo 协议的设计" />
 	<!-- 网页标签标题 -->
-	<title>DUBBO协议详解</title>
+	<title>Dubbo 协议详解</title>
 	<link rel="shortcut icon" href="/img/dubbo.ico"/>
 	<link rel="stylesheet" href="/build/blogDetail.css" />
 </head>
@@ -15,7 +15,7 @@
 	<div id="root"><div class="blog-detail-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/zh-cn/index.html"><img class="logo" src="/img/dubbo_colorful.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">En</span><div class="header-menu"><img class="header-menu-toggle" src="/img/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a h [...]
 <p>协议是两个网络实体进行通信的基础,数据在网络上从一个实体传输到另一个实体,以字节流的形式传递到对端。在这个字节流的世界里,如果没有协议,就无法将这个一维的字节流重塑成为二维或者多维的数据结构以及领域对象。</p>
 <h3>协议是什么</h3>
-<p>协议是双方确定的交流语义,比如:我们设计一个字符串传输的协议,它允许客户端发送一个字符串,服务端接收到对应的字符	串。这个协议很简单,首先发送一个4字节的消息总长度,然后再发送1字节的字符集charset长度,接下来就是消息的payload,字符集名称和字符串正文。</p>
+<p>协议是双方确定的交流语义,比如:我们设计一个字符串传输的协议,它允许客户端发送一个字符串,服务端接收到对应的字符串。这个协议很简单,首先发送一个4字节的消息总长度,然后再发送1字节的字符集charset长度,接下来就是消息的payload,字符集名称和字符串正文。</p>
 <p>发送一个<code>iso-8859-1</code>的字符串<code>abc</code>到对端。经过协议编码,内容是:<code>18 = 4 + 1 + 10 + 3|10|iso-8859-1|abc</code>,当这些字节流发往服务端后,当服务端收到字节流后,首先读取4个字节,将其转换为int,在这个例子中是18,接下来继续读14个字节,将首个字节得到字符集名称长度10,将后续内容的前10字节转换为字符串,内容是<code>iso-8859-1</code>,使用该字符集将后续的字节数组造型成为字符串<code>new String(bytes, &quot;iso-8859-1&quot;)</code>。</p>
 <p>在前面自定义字符串传输协议的例子中,我们已经看到协议在双方传输数据中起到的作用,没有协议就无法完成数据交换,下面是维基百科对于通信协议的定义。</p>
 <blockquote>
@@ -66,16 +66,16 @@
 <blockquote>
 <p>可以参考Netty的<code>LengthFieldBasedFrameDecoder</code></p>
 </blockquote>
-<p>DUBBO协议实际上就是一种变长协议,后面的章节会详细介绍。</p>
-<h2>DUBBO协议</h2>
+<p>Dubbo 协议实际上就是一种变长协议,后面的章节会详细介绍。</p>
+<h2>Dubbo 协议</h2>
 <h3>协议概览</h3>
-<p>DUBBO框架定义了私有的RPC协议,其中请求和响应协议的具体内容我们使用表格来展示。</p>
+<p>Dubbo 框架定义了私有的RPC协议,其中请求和响应协议的具体内容我们使用表格来展示。</p>
 <p><img src="http://dubbo.apache.org/docs/zh-cn/dev/sources/images/dubbo_protocol_header.png" alt="/dev-guide/images/dubbo_protocol_header.jpg"></p>
 <h3>协议详情</h3>
 <ul>
 <li>
 <p>Magic - Magic High &amp; Magic Low (16 bits)</p>
-<p>标识协议版本号,dubbo 协议:0xdabb</p>
+<p>标识协议版本号,Dubbo 协议:0xdabb</p>
 </li>
 <li>
 <p>Req/Res (1 bit)</p>
@@ -95,7 +95,7 @@
 </li>
 <li>
 <p>Status (8 bits)</p>
-<p>仅在 Req/Res 为0(响应)时有用,用于标识响应的状态</p>
+<p>仅在 Req/Res 为0(响应)时有用,用于标识响应的状态。</p>
 <ul>
 <li>20 - OK</li>
 <li>30 - CLIENT_TIMEOUT</li>
@@ -147,34 +147,34 @@
 </ul>
 </li>
 </ul>
-<p>**注意:**对于(Variable Part)变长部分,当前版本的dubbo框架使用json序列化时,在每部分内容间额外增加了换行符作为分隔,请选手在Variable Part的每个part后额外增加换行符, 如:</p>
+<p>**注意:**对于(Variable Part)变长部分,当前版本的Dubbo 框架使用json序列化时,在每部分内容间额外增加了换行符作为分隔,请在Variable Part的每个part后额外增加换行符, 如:</p>
 <pre><code>Dubbo version bytes (换行符)
 Service name bytes  (换行符)
 ...
 </code></pre>
-<h2>DUBBO协议的优缺点</h2>
+<h2>Dubbo 协议的优缺点</h2>
 <h3>优点</h3>
 <ul>
-<li>协议设计上很紧凑,可用用 1 个 bit 表示的,不会用一个 byte 来表示,比如 boolean 类型的标识</li>
-<li>请求、响应的 header 一致,通过序列化器对 content 组装特定的内容,代码实现起来简单</li>
+<li>协议设计上很紧凑,能用 1 个 bit 表示的,不会用一个 byte 来表示,比如 boolean 类型的标识。</li>
+<li>请求、响应的 header 一致,通过序列化器对 content 组装特定的内容,代码实现起来简单。</li>
 </ul>
 <h3>可以改进的点</h3>
 <ul>
 <li>
-<p>类似于 http 请求,通过 header 就可以确定要访问的资源,而 dubbo 需要涉及到用特定序列化协议才可以将服务名、方法、方法签名解析出来,并且这些资源定位符是 string 类型或者 string 数组,很容易转成 bytes,因此可以组装到 header 中。类似于 http2 的 header 压缩,对于 rpc 调用的资源也可以协商出来一个int来标识,从而提升性能,如果在<code>header</code>上组装资源定位符的话,该功能则更易实现。</p>
+<p>类似于 http 请求,通过 header 就可以确定要访问的资源,而 Dubbo 需要涉及到用特定序列化协议才可以将服务名、方法、方法签名解析出来,并且这些资源定位符是 string 类型或者 string 数组,很容易转成 bytes,因此可以组装到 header 中。类似于 http2 的 header 压缩,对于 rpc 调用的资源也可以协商出来一个int来标识,从而提升性能,如果在<code>header</code>上组装资源定位符的话,该功能则更易实现。</p>
 </li>
 <li>
-<p>通过 req/res 是否是请求后,可以精细定制协议,去掉一些不需要的标识和添加一些特定的标识。比如<code>status</code>,<code>twoWay</code>标识可以严格定制,去掉冗余标识。还有超时时间是作为 DUBBO 的 <code>attachment</code> 进行传输的,理论上应该放到请求协议的header中,因为超时是网络请求中必不可少的。提到 <code>attachment</code> ,通过实现可以看到 <code>attachment</code> 中有一些是跟协议 <code>content</code>中已有的字段是重复的,比如 <code>path</code>和<code>version</code>等字段,这些会增大协议尺寸。</p>
+<p>通过 req/res 是否是请求后,可以精细定制协议,去掉一些不需要的标识和添加一些特定的标识。比如<code>status</code>,<code>twoWay</code>标识可以严格定制,去掉冗余标识。还有超时时间是作为 Dubbo 的 <code>attachment</code> 进行传输的,理论上应该放到请求协议的header中,因为超时是网络请求中必不可少的。提到 <code>attachment</code> ,通过实现可以看到 <code>attachment</code> 中有一些是跟协议 <code>content</code>中已有的字段是重复的,比如 <code>path</code>和<code>version</code>等字段,这些会增大协议尺寸。</p>
 </li>
 <li>
-<p>DUBBO 会将服务名<code>com.alibaba.middleware.hsf.guide.api.param.ModifyOrderPriceParam</code>,转换为<code>Lcom/alibaba/middleware/hsf/guide/api/param/ModifyOrderPriceParam;</code>,理论上是不必要的,最后追加一个<code>;</code>即可。</p>
+<p>Dubbo 会将服务名<code>com.alibaba.middleware.hsf.guide.api.param.ModifyOrderPriceParam</code>,转换为<code>Lcom/alibaba/middleware/hsf/guide/api/param/ModifyOrderPriceParam;</code>,理论上是不必要的,最后追加一个<code>;</code>即可。</p>
 </li>
 <li>
-<p>DUBBO协议没有预留扩展字段,没法新增标识,扩展性不太好,比如新增<code>响应上下文</code>的功能,只有改协议版本号的方式,但是这样要求客户端和服务端的版本都进行升级,对于分布式场景很不友好。</p>
+<p>Dubbo 协议没有预留扩展字段,没法新增标识,扩展性不太好,比如新增<code>响应上下文</code>的功能,只有改协议版本号的方式,但是这样要求客户端和服务端的版本都进行升级,对于分布式场景很不友好。</p>
 </li>
 </ul>
 <h2>总结</h2>
-<p>本文主要介绍了协议的概念和常用的协议模式,后面对DUBBO协议进行了详细分析,也提到了一些不足的地方,但是相对于其简洁性和易于实现性,以上提出的缺点不足以有动力设计出一个新版本的协议,所以欢迎大家提出对协议优化方面的建议和特性。</p>
+<p>本文主要介绍了协议的概念和常用的协议模式,后面对 Dubbo 协议进行了详细分析,也提到了一些不足的地方,但是相对于其简洁性和易于实现性,以上提出的缺点不足以有动力设计出一个新版本的协议,所以欢迎大家提出对协议优化方面的建议和特性。</p>
 </section><footer class="footer-container"><div class="footer-body"><img src="/img/dubbo_gray.png"/><img class="apache" src="/img/apache_logo.png"/><div class="cols-container"><div class="col col-12"><h3></h3><p></p></div><div class="col col-4"><dl><dt>ASF</dt><dd><a href="http://www.apache.org" target="_self">基金会</a></dd><dd><a href="http://www.apache.org/licenses/" target="_self">证书</a></dd><dd><a href="http://www.apache.org/events/current-event" target="_self">事件</a></dd><dd><a href=" [...]
 	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
 	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
diff --git a/zh-cn/blog/dubbo-protocol.json b/zh-cn/blog/dubbo-protocol.json
index 157a0a4..fab9f1b 100644
--- a/zh-cn/blog/dubbo-protocol.json
+++ b/zh-cn/blog/dubbo-protocol.json
@@ -1,10 +1,10 @@
 {
   "filename": "dubbo-protocol.md",
-  "__html": "<h2>协议的概念</h2>\n<p>协议是两个网络实体进行通信的基础,数据在网络上从一个实体传输到另一个实体,以字节流的形式传递到对端。在这个字节流的世界里,如果没有协议,就无法将这个一维的字节流重塑成为二维或者多维的数据结构以及领域对象。</p>\n<h3>协议是什么</h3>\n<p>协议是双方确定的交流语义,比如:我们设计一个字符串传输的协议,它允许客户端发送一个字符串,服务端接收到对应的字符\t串。这个协议很简单,首先发送一个4字节的消息总长度,然后再发送1字节的字符集charset长度,接下来就是消息的payload,字符集名称和字符串正文。</p>\n<p>发送一个<code>iso-8859-1</code>的字符串<code>abc</code>到对端。经过协议编码,内容是:<code>18 = 4 + 1 + 10 + 3|10|iso-8859-1|abc</code>,当这些字节流发往服务端后,当服务端收到字节流后,首先
 读取4个字节,将其转换为int,在这个例子中是18,接下来继续读14个字节,将首个字节得到字符集名称长 [...]
+  "__html": "<h2>协议的概念</h2>\n<p>协议是两个网络实体进行通信的基础,数据在网络上从一个实体传输到另一个实体,以字节流的形式传递到对端。在这个字节流的世界里,如果没有协议,就无法将这个一维的字节流重塑成为二维或者多维的数据结构以及领域对象。</p>\n<h3>协议是什么</h3>\n<p>协议是双方确定的交流语义,比如:我们设计一个字符串传输的协议,它允许客户端发送一个字符串,服务端接收到对应的字符串。这个协议很简单,首先发送一个4字节的消息总长度,然后再发送1字节的字符集charset长度,接下来就是消息的payload,字符集名称和字符串正文。</p>\n<p>发送一个<code>iso-8859-1</code>的字符串<code>abc</code>到对端。经过协议编码,内容是:<code>18 = 4 + 1 + 10 + 3|10|iso-8859-1|abc</code>,当这些字节流发往服务端后,当服务端收到字节流后,首先�
 �取4个字节,将其转换为int,在这个例子中是18,接下来继续读14个字节,将首个字节得到字符集名称长度1 [...]
   "link": "/zh-cn/blog/dubbo-protocol.html",
   "meta": {
-    "title": "DUBBO协议详解",
+    "title": "Dubbo 协议详解",
     "keywords": "Dubbo, Protocol, RPC",
-    "description": "本文介绍了dubbo协议的设计"
+    "description": "本文介绍了 Dubbo 协议的设计"
   }
 }
\ No newline at end of file
diff --git a/zh-cn/blog/index.html b/zh-cn/blog/index.html
index cf9426b..48d6f09 100644
--- a/zh-cn/blog/index.html
+++ b/zh-cn/blog/index.html
@@ -12,7 +12,7 @@
 	<link rel="stylesheet" href="/build/blog.css" />
 </head>
 <body>
-	<div id="root"><div class="blog-list-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/zh-cn/index.html"><img class="logo" src="/img/dubbo_colorful.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">En</span><div class="header-menu"><img class="header-menu-toggle" src="/img/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a hre [...]
+	<div id="root"><div class="blog-list-page" data-reactroot=""><header class="header-container header-container-normal"><div class="header-body"><a href="/zh-cn/index.html"><img class="logo" src="/img/dubbo_colorful.png"/></a><div class="search search-normal"><span class="icon-search"></span></div><span class="language-switch language-switch-normal">En</span><div class="header-menu"><img class="header-menu-toggle" src="/img/menu_gray.png"/><ul><li class="menu-item menu-item-normal"><a hre [...]
 	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
 	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
 	<script>