On the IBM NS1 Connect platform, an answer is a unit of information within a DNS record corresponding to an application endpoint, service, or other resource to which you want to direct DNS traffic. The format and nature of each answer varies depending on the type of record it exists within. Unlike traditional DNS records that may contain only one answer, an NS1 record may contain multiple answers. In addition to simplifying record management, this type of configuration enables record-level traffic steering using the Filter Chain.
A record's Filter Chain configuration includes one or more traffic steering filters, each with a unique processing method to either rearrange or eliminate answers from the answer pool before responding to the DNS query. For example, the Up filter eliminates answers whose corresponding endpoints are considered down or unavailable before passing the list to the next filter in the chain. Many filters reference specific details or metrics found in the answer metadata for each answer. The Up filter references the "up/down" metadata, and geographic filters reference certain geolocation metadata for each answer.
In some cases, you may have multiple answers within a record that share some metadata, such as their geographic location, or you have a case where you need to apply different levels of traffic steering in a complex way that is not possible with a single-layer Filter Chain. In these situations, you can create answer groups to create subsections within the answer pool and edit the metadata for the group which is inherited by the answers within it. Then, you can use a group-based filter near the beginning of the Filter Chain to narrow in on one set of answers based on the shared characteristic, followed by the non-group filters to apply secondary processing within that group.
Here's an example use case to demonstrate how answer groups work in the Filter Chain:
-
Setup: Your network is divided into three clusters of servers in the continental United States—one cluster in Dallas, one in New York, and one in San Jose. Each cluster contains three individual servers where one is twice as powerful as the other two.
-
Desired Outcome: You want users in the US to be routed geographically to the closest server cluster from their location. You also want traffic for each cluster to be split among the three servers to ensure 50% of the traffic goes to the most powerful server, and the other two servers split the remaining 50% of the traffic evenly between them.
-
Solution: Use the Filter Chain to create the desired outcome using the following filters in this order: Geotarget Regional, Select First Group, Weighted Shuffle, Select First N.
To achieve the solution described above:
-
Create an A record within the corresponding DNS zone, leaving the answers blank for now.
-
Create three answer groups, naming them: Dallas, New York, and San Jose.
-
Edit the geo-region metadata field for each answer group based on the location of the data center: US-West for the San Jose data center, US-East for New York, and US-Central for Dallas.
-
Add three answers to each answer group where each answer represents a server in that geographic region.
-
Within each answer group, edit the answer metadata for the more powerful server in the group and set the "Weight" field to 20. Then, edit the answer metadata for the remaining answers in the group, setting the "Weight" to 10. In each answer group, you should have one answer with the weight set to 20 and two answers with the weight set to 10. This ensures the more powerful server will receive twice as much traffic as the other two.
-
Configure a Filter Chain for the record containing the following traffic steering filters in this order:
-
Geotarget regional filter - Rearranges the list of answers based on geographic proximity.
-
Select First Group filter - Eliminates all answers that are not part of the first answer group.
-
Weighted Shuffle filter - Rearranges the list of answers randomly, but prioritizes answers with higher weight values at a proportional rate.
-
Select First N filter - Eliminates all but the first answer in the list.
-
Result: When the record is queried, the platform references the Filter Chain and processes the answer pool as follows: All answers, despite the group they are in, are rearranged according to their geographic proximity to the requester. Then, any answer not part of the first answer group is eliminated from the list. At this point, there would be three answers remaining. The Weighted Shuffle filter takes the remaining three answers and shuffles them semi-randomly as it prioritizes answers with higher weights more often. In other words, the more powerful server will appear at the top of the shuffled list more often than the servers with lower weight values. Finally, the Select first N filter eliminates all but the first answer from the list and includes it in the response to the requester.
Note that, in the example above, you may also want to include the Up filter at or near the beginning of the Filter Chain to avoid steering requesters to down or unavailable endpoints.