News for hackers. Stuff that matters.
Re:How not to design a wire protocol by DoofusOfDeath on Tuesday March 05, 2019 @04:47PM (#19314556)
IIRC, Silicon Graphics (the company) used to maintain a registry for "magic numbers" designating each file's type. Customers could contact SGI to be issued a magic number for whatever file formats they were cooking up.

I wonder if there's merit to recreating such a thing under ICANN, where the issued serial numbers are useful for file types, wire protocols, etc.

Then anyone needing to reliably interpret a packet could (1) look for the format serial number at some well-known location, and then (2) consult the well-publicized registry for whatever information has been provided regarding the format.

Re:How not to design a wire protocol by wmf on Tuesday March 05, 2019 @04:56PM (#19314628)
Magic numbers are better than nothing, but "next protocol" fields accomplish the same thing without magic. Usually the steward of each protocol maintains a registry of protocol IDs. For example, IEEE maintains a list of Ethernet protocols: http://standards-oui.ieee.org/ethertype/eth.txt and IANA tracks IP protocols: https://www.iana.org/assignments/protocol-numbers/protocol-n... and TCP/UDP port numbers: https://www.iana.org/assignments/service-names-port-numbers/... and MIME types are used for HTTP and email: https://www.iana.org/assignments/media-types/media-types.xht...

In classic Mac OS and BeOS, file inodes carried file types so you didn't have to guess about file types either.

Re:How not to design a wire protocol by AnimalMuppet on Tuesday March 05, 2019 @04:56PM (#19314632)
IIRC, it was magic numbers and offsets. And you could run the charmingly-named magic program on a file to find out if the system knew what it was...
Re:How not to design a wire protocol by Gibbon1 on Tuesday March 05, 2019 @07:52PM (#19315594)
If you want something like that, using an IEEE OUI/CID would be a good start.

https://standards.ieee.org/content/dam/ieee-standards/standa...

Re:How not to design a wire protocol by richardwhiuk on Wednesday March 06, 2019 @11:48AM (#19320297)