binary protocols v. text protocols

后端 未结 8 1747
慢半拍i
慢半拍i 2020-12-12 09:27

does anyone have a good definition for what a binary protocol is? and what is a text protocol actually? how do these compare to each other in terms of bits sent on the wire?

相关标签:
8条回答
  • 2020-12-12 10:12

    Examples of binary protocols: RTP, TCP, IP.

    Examples of text protocols: SMTP, HTTP, SIP.

    This should allow you to generalise to a reasonable definition of binary vs text protocols.

    Hint: just skip to the example sections, or the diagrams. They serve to illustrate Tyler's rocking answer.

    0 讨论(0)
  • 2020-12-12 10:14

    As most of you suggested we can't differentiate whether the protocol is Binary or text simply by looking at the content on the wire

    AFIK

    Binary protocol - Bits are boundary Order is very critical

    Eg., RTP

    First two bits are version Next bit is MarkUp bit

    Text protocol - Delimiters specific to protocol Order of the fields is not important

    Eg., SIP

    One more is, in binary protocol, we can split a byte, i.e., a single bit might have a specific individual meaning; While in a text protocol minimum meaningful unit is BYTE. You can't split a byte.

    0 讨论(0)
提交回复
热议问题