You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "cmdmspaint (via GitHub)" <gi...@apache.org> on 2023/03/09 07:33:15 UTC

[I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

cmdmspaint opened a new issue, #2157:
URL: https://github.com/apache/brpc/issues/2157

   在wireshark写了一个lua插件,按照sofa_pbrpc_meta.proto格式解析了一下。发现格式好像不太正确,所以想请教一下brpc协议格式
   ![image](https://user-images.githubusercontent.com/50624748/223951455-257513d5-eedb-46d8-b3a0-776a3f1029c2.png)
   ![image](https://user-images.githubusercontent.com/50624748/223951649-c9f938d3-4af4-49d8-a155-7aba7fe0968e.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "chenBright (via GitHub)" <gi...@apache.org>.
chenBright commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1461629248

   看了一下代码,SOFA协议应该是24字节吧
   https://github.com/apache/brpc/blob/2ec8f469f82a30c0abfb534f98b7fce0f0f77455/src/brpc/policy/sofa_pbrpc_protocol.cpp#L132-L138


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1461546270

   > src/brpc/policy/baidu_rpc_meta.proto,这个吧
   
   目前就是不太清楚包体的格式


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1463184856

   是开了什么压缩导致的吗?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1461543462

   > src/brpc/policy/baidu_rpc_meta.proto,这个吧
   
   应该是由包头和包体组成,包体又分为metadata、data和payload
   包头我知道是12个字节,通过包头我解析出来是SOFA协议
   ![image](https://user-images.githubusercontent.com/50624748/223962519-58cc5f4c-fb43-4813-89d7-9d22eb193fda.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1463350202

   看了一下代码 rpcmeta是通过protobuf进行了编码,应该是按照Base 128 Varints来进行压缩的。待会验证一下看看是否正确。
   ![image](https://user-images.githubusercontent.com/50624748/224243432-0ebee61a-644f-4db4-bccd-aa272b93ef6b.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1463138345

   我理解brpc包的结构是这样的,目前了解到RpcMessageHeader是24字节。
   ![image](https://user-images.githubusercontent.com/50624748/224207552-ad2fbcf4-956b-4503-98dd-b4cb5c77db4b.png)
   这个是RpcMeta的结构,按照对应的字节数进行解析。为什么对不上呢? enum类型应该是占4字节吧
   message RpcMeta {
     enum Type {
       REQUEST = 0;
       RESPONSE = 1;
     };
     required Type type = 1;                 // 4bytes
     required uint64 sequence_id = 2;  //8bytes
     optional string method = 100;       
     optional int64 server_timeout = 101;
     optional bool failed = 200;
     optional int32 error_code = 201;
     optional string reason = 202;
     optional CompressType compress_type = 300;
     optional CompressType expected_response_compress_type = 301;
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "wasphin (via GitHub)" <gi...@apache.org>.
wasphin commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1463802874

   需要看具体解析或者序列化部分,部分协议只是内部用 protobuf 传递,而没有在网络传输时用,并不能完全按照 proto 文件解析。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint closed issue #2157: brpc的协议格式是什么样子的,想通过wireshark解析一下brpc
URL: https://github.com/apache/brpc/issues/2157


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "chenBright (via GitHub)" <gi...@apache.org>.
chenBright commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1461500981

   src/brpc/policy/baidu_rpc_meta.proto,这个吧


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] brpc的协议格式是什么样子的,想通过wireshark解析一下brpc (brpc)

Posted by "cmdmspaint (via GitHub)" <gi...@apache.org>.
cmdmspaint commented on issue #2157:
URL: https://github.com/apache/brpc/issues/2157#issuecomment-1461764585

   > body_size
   
   SOFA header是4(sofa_header) 4(meta_size) 8(body_size) 8(metasize+body_size) 这样的格式吗 ? 然后后面跟上sofa_pbrpc_meta.proto 怎么看起来还是不太对呢?
   ![image](https://user-images.githubusercontent.com/50624748/223998760-dd94e768-55c7-42bc-bac3-e0af8f0fe373.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org