What are the general differences between a format and a protocol

3

I am still unsure about the distinction. I know that formats have definitions for symbols that represent data and how data is structured.

user3324945

Posted 2014-04-01T17:41:44.003

Reputation: 31

A format would be a shape, and a protocol would be how you shape it. – Ƭᴇcʜιᴇ007 – 2014-04-01T17:44:48.447

Answers

4

Format - applies to files

Protocol - applies to communications

In both instances you are talking about the index of various bytes in a stream and what they are supposed to represent.

Protocol can get more involved, as many protocols work in a "request-response" fashion where the client issues a well-formed request, and then a server responds with a well-formed response. So there may be different schema for request, response. Requests may change client or server "state" and thus the schema may be different again given a particular state.

File formats are typically always following the same schema unless they are a different version, though they can be complex as well - later bytes in a file format may depend on earlier bytes (the .PST file format or the Windows Registry hive format, for example).

LawrenceC

Posted 2014-04-01T17:41:44.003

Reputation: 63 487

1

A format describes the structure of some data, whereas a protocol defines a procedure to handle this data. If you take TCP as an example, you have a definition of the format of a data packet, which tells you at which bit position a specified field like the checksum of a packet starts and ends, and the protocol defines that for opening a TCP connection you need three packets, one from client to server with the SYN-bit set, a second one from server to client with ACK- and SYN-bit set and a third one with ACK-bit set from client to server.

Andreas Wiese

Posted 2014-04-01T17:41:44.003

Reputation: 1 911