About the discover poll

Started by 165432896, December 20, 2011, 02:28:37 PM

Previous topic - Next topic

165432896

Merry Christmas!

That's the workflow I think in the passive discovery polls :
1、The server get it's own Interfaces and create a manager node(The manager node is Server's host itself)
2、When The manager node create,it will be inserted into the Node Queue.(The manager node will be the first node in the queue)
3、The DiscoveryPoller() run for the first time and It get a Node in the Node Queue(The First node is The manager node)
4、Access the Node above and get the arp table or route table information and add the relevant nodes into the  Node Queue.

My question is:
The Node object is create in the DiscoveryPoller.But I can not find when the interface object and the subbet object created in the source code.
Can you point it out for me?

- 10.0.1.0/24    //subnet
  |
   -10.10.1.10   // Node(Server)
    |
     -eth0       //Interface

best wish!

Victor Kirhenshtein

Hi!

Discovery poller only puts candidate node into poll queue. Another thread is responsible for node validation and appropriate object creation. All this code located in file np.cpp. Polling thread looks like this:

      pInfo = (NEW_NODE *)g_nodePollerQueue.GetOrBlock();
      if (pInfo == INVALID_POINTER_VALUE)
         break;   // Shutdown indicator received

      DbgPrintf(4, _T("NodePoller: processing node %s/%s in zone %d"),
                IpToStr(pInfo->dwIpAddr, szIpAddr), IpToStr(pInfo->dwNetMask, szNetMask), (int)pInfo->zoneId);
      if (AcceptNewNode(pInfo->dwIpAddr, pInfo->dwNetMask, pInfo->zoneId))
      {
         Node *node = PollNewNode(pInfo->dwIpAddr, pInfo->dwNetMask, 0, NULL, 0, 0, NULL, pInfo->zoneId, true);
      }
      free(pInfo);


AcceptNewNode checks candidate node against current discovery filter, and if it passes, PollNewNode is called, where actual node object being created. Inside PollNewNode method Node::configurationPoll is called, where all interface and subnet objects are created, as required.

Best regards,
Victor

165432896

Very thank you for answering me so carefully and so rapidly

In all, the theory of it is :

1、The DiscoveryPoller() is deal with the existing Network Node and find out the candidate nodes by arp/route table and deliver to the NodePoller()

2、The  NodePoller() is validation the candidate nodes and Create the real Network Node.    And The new create Network Node deliver to the DiscoveryPoller()

The above workflowis a cycle flow.

And the first existing Network Node in the Server itself and be create by CheckForMgmtNode().


It that right ?


Victor Kirhenshtein

Yes, that's correct.

Best regards,
Victor