Secondary Client - File Request Sequence



The two types of file requesting methods utilised on the WPN are basically of either the Hash query or the Standard query types, the major difference is that Hash searches are global and Standard queries are limited to a subset of nodes radiating out from the Primary Client they pass through.

The maximum theoretical reach of a non hash search is shown below for visual scale, this limit is called the "search horizon", the most commonly observed horizon level is 6.



Let us now move on to the mechanisms involved in downloading and uploading the different files and types as outlined above.

Scenario: We are about to request a content search from a WPN Primary Client/node. The file type requested will be of the Hash type.

Note : The hash that is placed in the client search box is not identical to the one a WPN client sends across the network, an obscuring method is undertaken in the client but has nothing to do with the protocol.

This diagram shows the process of conversion.


Hash Type Query


Lets begin by contacting a Primary client we are connected to and sending the 0x1772 Hash Search request packet type in the following format.

[0x1772][ Packet Data Length : 2 ][ Search ID/Counter : 4 ][ Minimum Line Type : 1 ][ 00 : 1 ][ FileType : 1 ][ 00 : 1 ][ Hash : 16 ]

Notes:
1) Search ID/Counter increments each search,(including other searches).
2) File types and line type references can be located here.

Actually sent: Brackets added for clarity.
[72 17][18 00][0C 00 00 00][00][00][02][00] [AF 46 3C DE 83 F4 98 87 E9 E6 84 96 1D A1 82 13]  
 
ASCII = r      ?A<ށE愁E??  



We will now await the reception of 0x177A query result packets from the Primary client, a result will be obtained for each file matching our Hash located on the network.
The format for all WPN secondary query results is shown below.


Search Result Packet
[ 0x177A : 2 ][ Packet Data Length : 2 ][ Search ID/Counter : 4 ][ [ Primary IP : 4 ][ UDP Port : 2 ][ Unique Network Identifier : 5 ][ File Path : S ][ 00 : 1 ][ File Hash : 20 ][ File Size : 4 ][ (See Note 1) MetaData Length :  1 ]

*Metadata ComponentStart
[ Metadata type : 1 ][ Bitrate : 2 ][ Frequency : 4 ][ Playtime : 4 ]                        
*Metadata Component End

[ Line Type : 1 ][ Ping IP : 4 ][ UserName : S ][ 00 : 1 ][ Que Status : S ][ 00 : 1 ]      ; These fields are always present

Notes:
1) MetaData Length is zero for all files not containing MetaData components, zip, jpg etc. The Metadata component fields will only be present in those query results containing MP3 MetaData (Type 4D).


Actually recieved: Brackets added for clarity.
[7A 17][A7 00][0C 00 00 00][61 FF 87 4A][71 18][4E 8F 59 00 62][4D 75 73 69 6B 5C 39 30 65 72 5C 53 2D 55 5C 54 68 65 20 4B 4C 46 20 2D 20 4D 61 6B 65 20 4D 69 6E 65 20 41 20 27 27 39 39 27 27 2E 6D 70 33][00][AF 46 3C DE 83 F4 98 87 E9 E6 84 96 1D A1 82 13 CA 8D 81 00][CA 8D 81 00][0B][4D][C0 00][44 AC 00 00][61 01 00 00][08][4D BB 04 E7][5E 2A AB 7B 47 7D BB 2A 54 65 72 72 6F 72 6D 69 65 74 7A 65 2A AB 7B A3 7D BB 2A 5E 35 35 30 5F 31 39 32 37 36][00] 39 30 39 39 20 39 39 20 6F 66 20 31 30 30 20 61 76 61 69 6C 61 62 6C 65][00]

ASCII=z��     a_'JqNY bMusik\90er\S-U\The KLF - Make Mine A ''99''.mp3 ¯A<Þƒô˜��éæ„–¡‚ʍ ʍ MÀ D¬  a  M· ç^*«{G}»*Terrormietze*«{£}»*^550_19276 9099 99 of 100 available



The search results listing will continue until the primary has reached the end of its stored list results, depending on the popularity of a file this can be from one or two to thousands of listings.



Standard Type Query


Having survived the explanation above we can now relax a little and look at the various field settings for a Standard query.

Manual Search Request Packet ( Secondary to Primary)
[ 0x1771 ][ Packet Data Length : 2 ][ Search Number : 4 ][ 00 : 1 ][ Minimum Line Type : 1 ][ 00 : 1 ][ FileType : 1 ][ 00 : 1 ][ Search String : S ][ 00 : 2 ]

Notes:
1) Search ID/Counter increments each search,(including other searches).
2) File types and line type references can be located here.

Actually Sent: Brackets added for clarity.
ASCII=





Stop Search (Standard or Hash)


An important aspect of the WPN protocol that must be understood is that once you have made a file request using either query type (Hash/Standard) you must at the first opportunity inform the Primary when to stop searching, this is often done automatically in the WinMX client when the search window is closed or the user presses the "Stop" button, in ALL cases this must be undertaken.

Stop Search Packet
[ 0x1775 ][ Packet Data Length : 2 ][ Search ID/Counter : 4 ]

Note: Search ID/Counter will match the data sent in the original Search query and thus multiple searches can be conducted without conflict.

Actually Sent: Brackets added for clarity.
[75 17][04 00][04 00 00 00]    
ASCII=  u 




I hope the information contained in this guide is helpful to those of you able to put it to use and educational for those of you just studying the network.

©2005-2018 WinMXWorld.com. All rights reserved. Page last updated Mon Aug 20 2018