Tokens [A-Z]+ - command name or status .* - byte stream (the '.' here means any byte value 0-255) [SP] - space separating character/byte (this is a sequence of space and/or space characters of an arbitrary length greater than zero.) [0-9]+ - numeric value/length in our case Valid Messages MESSAGE := (REQUEST | RESPONSE) Request Protocol Definition REQUEST := [SP][SP] | [SP][SP][SP][SP] := [A-Z]+ := [0-9]+ := .* := .* Note: 0 length objects are allowed. However, we would like to treat those as an error case in this project. (1) Get Object Command GETRD[SP][SP] The response should either be: OK or NOTFOUND. If OK, then the RESPONSE should be a valid URL, with = len(). If NOTFOUND, then the RESPONSE should be zero, and a trailing [SP] with no bytes following for the remainder. (2) Add Object Command ADDFILE[SP][SP][SP][SP] The response should either be: OK or ERROR. If OK, then RESPONSE should be zero, and a trailing [SP] with no bytes following for the remainder. If ERROR, then RESPONSE may optionally be a value greater than 0 and RESPONSE should contain an ASCII-encoded error message (not nul-terminated). Response Protocol Definition RESPONSE := [SP][SP] := [A-Z]+ := [0-9]+ := .* (1) OK Response to a GET Object Command OK[SP][SP] can not be 0, must be a valid URL. (2) OK Response to a Add Object Command OK[SP]0[SP] (3) ERROR Response to a Get Object Command NOTFOUND[SP]0[SP] (4) ERROR Response to an Add Object Command ERROR[SP][SP] is allowed to be 0, which means no error message follows.