Peter Saint-Andre wrote:
> Justin Karneges wrote:
>> On Wednesday 05 November 2008 14:00:35 Peter Saint-Andre wrote:
>>> Discussion: Dave raised some questions about the TXT record data format.
>>> Peter to ping the DNS-SD authors, Dave and Ralph to do some testing of
>>> real-world deployments.
>> Kev fails for not contacting me about this.  The dig output is pretty and 
>> doesn't include the length byte which is indeed in the record data.  The 
>> question is really about XEP-174's usage of that "text-based DNS record 
>> description notation" (for lack of a better name) in the context of 
>> representing multiple strings, and not about the actual TXT raw byte format 
>> of which there is no dispute.
>>
>> I'm not sure if there's an authoritative source for that text-based DNS 
>> record 
>> description notation (other than RFC 1035, which is quite sketchy), but 
>> information about SPF reveals the use of multiple strings in one line.  E.g.:
>>
>>   example.com. 4500 IN TXT "string1" "string2" "string3"
>>
>> Indeed, sending dig at a TXT record containing multiple strings prints the 
>> result exactly this way.  You can dig iChat like this:
>>
>>   dig @ip_address_of_ichat -p 5353 -t txt [EMAIL PROTECTED]
>>
>> So, I think the right answer is to put all strings on one line.
>>
>> From what I can tell, the DNS-SD spec dodges this topic by not using the 
>> notation at all, which is not a bad approach either. :)  It's not like 
>> anyone 
>> implementing XEP-174 will be parsing this format.
> 
> Yes, I noticed that output in dig, too. Then I tried to watch it using
> tcpdump ('tcpdump -x -X -s 5000 -l -vvv host roundabout.local' in my case):
> 
> 16:28:12.408064 IP6 (hlim 255, next-header: UDP (17), length: 331)
> roundabout.local.mdns > ff02::fb.mdns: [udp sum ok] 0*- [0q] 4/0/2
> [EMAIL PROTECTED] (Cache flush) SRV
> roundabout.local.:53589 0 0, [EMAIL PROTECTED]
> (Cache flush) TXT "txtvers=1" "port.p2pj=53589" "status=avail"
> "1st=Peter" "[EMAIL PROTECTED]" "[EMAIL PROTECTED]"
> "last=Saint-Andre" "vc=SDCURA!XN" "ext=5I",
> _services._dns-sd._udp.local. PTR _presence._tcp.local.,
> _presence._tcp.local. PTR [EMAIL PROTECTED] ar:
> roundabout.local. (Cache flush) AAAA roundabout.local, roundabout.local.
> (Cache flush) A my.domain.com (323)
> 
> 0x0000:  6000 0000 014b 11ff fe80 0000 0000 0000  `....K..........
> 0x0010:  020d 93ff fe2c 5c18 ff02 0000 0000 0000  .....,\.........
> 0x0020:  0000 0000 0000 00fb 14e9 14e9 014b eba5  .............K..
> 0x0030:  0000 8400 0000 0004 0000 0002 1273 7470  .............stp
> 0x0040:  6574 6572 4072 6f75 6e64 6162 6f75 7409  [EMAIL PROTECTED]
> 0x0050:  5f70 7265 7365 6e63 6504 5f74 6370 056c  _presence._tcp.l
> 0x0060:  6f63 616c 0000 2180 0100 0000 7800 1300  ocal..!.....x...
> 0x0070:  0000 00d1 550a 726f 756e 6461 626f 7574  ....U.roundabout
> 0x0080:  c02e c00c 0010 8001 0000 1194 0086 0974  ...............t
> 0x0090:  7874 7665 7273 3d31 0f70 6f72 742e 7032  xtvers=1.port.p2
> 0x00a0:  706a 3d35 3335 3839 0c73 7461 7475 733d  pj=53589.status=
> 0x00b0:  6176 6169 6c09 3173 743d 5065 7465 7218  avail.1st=Peter.
> 0x00c0:  656d 6169 6c3d 7374 7065 7465 7240 7374  [EMAIL PROTECTED]
> 0x00d0:  7065 7465 722e 696d 166a 6964 3d73 7470  peter.im.jid=stp
> 0x00e0:  6574 6572 4073 7470 6574 6572 2e69 6d10  [EMAIL PROTECTED]
> 0x00f0:  6c61 7374 3d53 6169 6e74 2d41 6e64 7265  last=Saint-Andre
> 0x0100:  0c76 633d 5344 4355 5241 2158 4e06 6578  .vc=SDCURA!XN.ex
> 0x0110:  743d 3549 095f 7365 7276 6963 6573 075f  t=5I._services._
> 0x0120:  646e 732d 7364 045f 7564 70c0 2e00 0c00  dns-sd._udp.....
> 0x0130:  0100 0011 9400 02c0 1fc0 1f00 0c00 0100  ................
> 0x0140:  0011 9400 02c0 0cc0 4500 1c80 0100 0000  ........E.......
> 0x0150:  7800 10fe 8000 0000 0000 0002 0d93 fffe  x...............
> 0x0160:  2c5c 18c0 4500 0180 0100 0000 7800 040a  ,\..E.......x...
> 0x0170:  0201 e1
> 
> I'm not sure what to conclude from that...

Never mind. It does seem that the single byte length indicators are
included on the wire. So for instance the key-value pair txtvers=1 is
preceded by hex 09 (length 9), the pair status=avail is preceded by hex
0c (length 12), the pair [EMAIL PROTECTED] is preceded by hex 18
(length 24), and so on.

/psa

Reply via email to