0

I am confused about the udp tracker response message, what does "20 + 6 * n" or "24 + 6 * n" or "20 + 6 * N" mean? I try to think of 20 + 6 * n as there are number(index from 16 to 20)=n seeders and bytes with subscripts from 20 to 20 + 6 * n indicate the specific information about seeders, 6 bytes=4 byte for ip and 2 bytes from port, but it turn out to be wrong.

Offset      Size            Name            Value
0           32-bit integer  action          1 // announce
4           32-bit integer  transaction_id
8           32-bit integer  interval
12          32-bit integer  leechers
16          32-bit integer  seeders
20 + 6 * n  32-bit integer  IP address
24 + 6 * n  16-bit integer  TCP port
20 + 6 * N  

Here is a example of udp tracker responses I have received: 0,0,0,1,28,120,62,218,0,0,12,0,0,7,182,0,0,0,1,0,0,0,0,77,73,68,7,156,0,0,0,1,0,210,39,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,112,27,34,0,39,15,0,0,0,0,0,0...(all is 0)

Meister96Fels
  • 508
  • 1
  • 8
  • 26

1 Answers1

0

If the packet format were expressed as C struct then the last member of the struct would be a flexible array member with array members representing IP:port pairs.

In other words the tail of the packet consists of N * 6 bytes. 20 is the byte offset where that tail starts.

the8472
  • 40,999
  • 5
  • 70
  • 122