Metadata is sometimes available within the file itself. For example, MP3 music files often contain an ID3 tag at the end. This tag provides metadata for that file, such as title, artist, album, year and genre. Since all file types do not have this ability an external metadata scheme has been proposed, and implemented in modern Gnutella clients.
The proposed scheme uses XML to encode a rich query, but is still able to maintain compatibility with older clients. A Query message containing a rich query contains an XML block after the null terminated query string. This block is also null terminated, and will be discarded by older clients. The format of a rich Query message is outlined in table tbl:gnutellametaquery.
A rich QueryHit message contains embedded XML in the EQHD block and private vendor data fields of the QueryHit message. The EQHD block and private vendor data has the format shown in table tbl:gnutellametareply for rich replies. See also table tbl:gnutellaqueryhit for a description of the QueryHit message and table tbl:gnutellaqueryhiteqhdblock for a description of the original EQHD block.
The size of the private area is calculated by subtracting the size of the XML payload from the total size of the EQHD block.