How a gRPC message uses length-prefixed framing?
2020-05-06
Categories: DevOps Networking
Once we have the encoded data to send to the other end, we need to package the data in a way that other end can easily extract the information. gRPC uses a message framing technique called length-prefixed framing.
Filter gRPC messages:
1$ tshark -r grpc.pcapng -Y 'grpc'
Find out a stream: DATA
:
1216 923.033355 127.0.0.1 → 127.0.0.1 GRPC 108 DATA[1] (GRPC) (PROTOBUF)
and show the packet details:
1tshark -r grpc.pcapng -Y "frame.number == 216" -V
1HyperText Transfer Protocol 2 2 GRPC Message: /book.BookInfo/getBook, Request 3 Compressed Flag: Not Compressed (0) 4 Message Length: 38 5 Message Data: 38 bytes
- first byte: indicate whether data is compressed or not
- next 4 bytes: size of the encoding binary message (38)
Tags: grpc protocol-buffers length-prefixed-framing
Related Posts:
- How to show all HTTP2 headers using tshark?
- Docker rootless keeps restarting?
- gocloud - writing data to a bucket: 403
- Terraform failed to acquire state lock: 403: Access denied., forbidden
- Docker Compose healthcheck