From what I have found, a very large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP, SMTP, FTP (I think this one is all text-based?), WHOIS, IRC.
In fact, some of these protocols jump through some hoops whenever they want to transmit binary data.
Is there a reason behind this? Text-based protocols obviously have a bit of an overhead as they require sending more data to transmit the same amount of information (see example below). What benefits outweigh this?
By text-based, I mean most of the characters used in the protocol are between 0x20
(space) and 0x7E
(~
), with the occasional "special character" used for very special purposes, such as the newlines, null, ETX, and EOT. This is opposed to transmitting raw, binary data over the connection.
For instance, transmitting the integer 123456
as text would involve sending the string 123456
(represented in hex as 31 32 33 34 35 36
), whereas the 32-bit binary value would be sent as (represented in hex) 0x0001E240
(and as you can see, "contains" the special null character.