Difference between revisions of "HAW"

From Gnutella2
Jump to: navigation, search
(Sending)
(Receiving)
Line 14: Line 14:
 
== Receiving ==
 
== Receiving ==
  
Upon receiving HAW packet, re-send packet to another neighbour. reduce TTL and increase Hops should be done before re-send.
+
Upon receiving HAW packet, store the hub address from the NA child packet into the host cache and then forward the packet to another neighbour with the following rules:
 +
* Reduce the TTL by 1 and increase the hops by 1
 +
* Select a random neighbor hub that has not already seen this HAW packet
 +
 
 +
The GUID for this HAW should be recorded along with the hub that sent it so that it won't be forwarded to that hub if the same HAW packet is received again.
  
 
== Payload ==
 
== Payload ==

Revision as of 02:25, 28 October 2011

Root Packets
CRAWLA - CRAWLR
HAW - LNI
KHL - KHLA - KHLR
PI - PO - PUSH
QKA - QKR
Q2 - QA - QH2 - QHT
UPROC - UPROD

/HAW - Hub Advertising Walker

The HAW packet ...

Sending

The /HAW packet should only be sent by a hub to another hub. A timer should be maintained for each neighbor that tracks when a HAW packet was last sent to that neighbor. Approximately every 5 minutes a new HAW packet should be created and sent to the neighbor.

A new HAW packet should have a TTL of 100 and hops set to 0. The GUID must be randomly generated for each HAW packet. The GUID should be recorded as having been sent to that particular neighbor. In this way if the same HAW packet is received again it can be forwarded to a neighbor that hasn't seen it before.

Receiving

Upon receiving HAW packet, store the hub address from the NA child packet into the host cache and then forward the packet to another neighbour with the following rules:

  • Reduce the TTL by 1 and increase the hops by 1
  • Select a random neighbor hub that has not already seen this HAW packet

The GUID for this HAW should be recorded along with the hub that sent it so that it won't be forwarded to that hub if the same HAW packet is received again.

Payload

  • 1byte TTL
  • 1byte Hops
  • 16byte GUID

TTL should probably be 100 and Hops should be set to 0 when packet first created. GUID is not node ID, it is packet ID for determine where the packet should be routed. rule of routing is if TTL has enough amount, and the packet has ever been to routed to the neighbour. as GUID on HAW packet is not node ID, it can be used to determine if the packet has been routed to the neighbour or not.


Children

The /HAW packet has the following child packets defined:

  • /HAW/NA - Network Address
  • /HAW/HS - Hub Status
  • /HAW/V - Vendor Code