How to connect to the whois++ network query

Source: Internet
Author: User
Tags extend

In the whois++ structure, the customer is responsible for the network roaming, because each host only informs the customer and its neighboring host is what, this protocol is not complex, the customer opens to a server connection, sends the inquiry request, receives the reply, closes the connection. The customer analyzes after receiving the reply, and then decides which host to contact next. This allows the customer to have an algorithm that allows the client to query the host does not duplicate, but also to find the host as soon as possible.

Each whois++ customer should be configured to automatically contact a specific whois++ server. This default server may have such a requirement, but the most basic requirement is that the local server is best.

After receiving a response from the server, if the number of hits is greater than 0, the result is returned to the user. If a customer is required to communicate with one or more servers, the customer needs to be able to know what these server pointers are.

There are two kinds of query methods are extended query, one is to use the server directory. If the hit count is 0, or if the user wants to extend the query, the client should extend the query by sending only the following two messages to the server: ' polled-by ' or ' polled-for ', and the customer can extend the query to the newly specified host.

The customer must keep the queried server and do not query the server again.

3.1.1. Optimizing Network

If a wants to use the whois++ server of B frequently, a will want to make the server of B available locally by creating a local index server. When A's client wants to query B through an extended query, the resolution is much faster.

The whois++ network is no longer a tree, and a direct channel has been established between B and F. This query speed is much faster, do not have to query after B query A, and then query C, and finally query F. Because B and F are already connected, the customer needs to refer to one of the data only when they need to, or return the contents of B and F nodes. On the client side, you can also use the Blacklist method to block some servers in the query because accessing them is too costly or for other reasons that users are unwilling to access these servers.

3.1.2. Algorithms used by customers

Query := 需要查询的数据;
QueriedServers := {};
AnswerList := {};
OriginalServers := { 客户所知的服务器 };
while OriginalServers非空 do:
  ServerList = OriginalServers;
  while ServerList非空 do:
   Server := ServerList[1];
   if Server未包括在QueriedServers中 then do:
   send Query to Server;
   Answer := 从Server返回的响应;
   将ServersToAsk附加到ServerList;
   将Server从ServerList删除;
   将Answers附加到AnswerList;
   end;
  done;
  if 应该扩充查询 then do:
   ServerList := OriginalServers;
   OriginalServers := {};
   while ServerList非空 do:
    Server := ServerList[1];
    发送Polled-For-Query到Server;
    Answer := 从Server返回的响应;
    将Answer附加到OriginalServers;
    将Server从ServerList删除;
   end;
  done;
done;

Show Answerlist;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.