DNS resolution flow: Part 2 - Routing traffic to nearest web server

In Last article (DNS resolution flow: Part 1 - User accessing web server hosted at Azure), we discussed how DNS resolution is done when there is single server deployed to a region. Consider the web server hosting the web site grows popularity and users from different regions also accessing it with more latency than user from same region. And, the reason is simple, each access request has to travel across regions.

To address the performance issue, web site is now deployed to other regions as well (say US and Europe) and Azure traffic manager is used to route the traffic based upon the routing method.

No alt text provided for this image

URL of different services involved

Since there are two Web Server (Using Azure App Service) deployed at two different locations:

  1. US Location : https://learningwebapp-1.azurewebsites.net
  2. Europe Location : https://learningwebapp-2.azurewebsites.net
  3. Traffic Manager: https://learningtm-1.trafficmanager.net

Traffic Manager Configuration

Traffic Manager Endpoints needs to be configured. Refer here to know more

* US Location : https://learningwebapp-1.azurewebsites.net

* Europe Location : https://learningwebapp-2.azurewebsites.net

No alt text provided for this image

Understand flow in detail

  1. User typed web server URL (https://learningtm-1.trafficmanager.net) in its browser to access the content. Browser looks for the associated IP in its cache and use it if it finds.
  2. If its not find in cache, then it takes help from recursive DNS by passing web server URL.
  3. Recursive DNS returns the IP from its cache if it has else ask to Root Name server.
  4. Root Name server extract the TLD (Top level domain), which is .net, from the web server URL and return the TLD (Top level domain) server IPs to recursive DNS.
  5. Recursive DNS picks one of the TLD IPs to connect to. TLD server extracts domain from the URL, which is trafficmanager, and return the list of Authoritative Name server IPs (which is Traffic Manager Name servers) to recursive DNS.
  6. Recursive DNS then picks up one of the IPs and establish connection with Traffic Manager Name server to get the IP of web server. Traffic Manager Name server picks the Web server based upon the Routing method setting.
  7. During the process of finding the appropriate web server, it considers Recursive DNS IP address is considered instead of user's desktop/laptop.
  8. Traffic Manager Name server looks for URL to Endpoints mapping in its database and return Web server URL (https://learningwebapp-1.azurewebsites.net) to recursive DNS.
  9. Recursive DNS still does not have IP. Instead it has web server URL. It starts the process again from calling Root Server to getting the IPs of Name servers holding info of azurewebsites.net domain which is cloud app name server.
  10. Recursive DNS then contacts the cloud app name server to get the IP.
  11. Recursive DNS stores this mapping (Web server URL to IP) in its cache and return IP to browser.
  12. Browser then uses this IP to connect to WebServer.

References

https://docs.microsoft.com/en-us/azure/traffic-manager/traffic-manager-how-it-works

Thank you so much for reading. If you learn anything new, kindly share with your friends, colleagues and follow?me?.

Lets together learn amazing stuff and feel free to give comments/suggestions. Thanks again!

要查看或添加评论,请登录

Naveen Rai的更多文章

  • OAuthV2: Single Sign On (SSO)

    OAuthV2: Single Sign On (SSO)

    As per the wikipedia, Single sign-on is an authentication scheme that allows a user to log in with a single ID to any…

    1 条评论
  • OAuth V2: Role of browser cookie in the login process

    OAuth V2: Role of browser cookie in the login process

    During the login flow, there are multiple browser redirect and user is asked to enter credentials for successful…

    1 条评论
  • OAuth V2: Implicit flow

    OAuth V2: Implicit flow

    Read this article which explains Auth code flow. This flow is designed for SPA (Single page application which doesn't…

  • OAuth 2.0: Authorization Code Grant flow

    OAuth 2.0: Authorization Code Grant flow

    Please go through my previous article in which I explained the token generation before continuing. This flow is…

    1 条评论
  • OAuthV2: Abstract theory of Token generation and sharing

    OAuthV2: Abstract theory of Token generation and sharing

    Scenario Customer has been using multiple Resource Server(s) to store different data and now another application comes…

    1 条评论
  • Basics of AuthN and AuthZ

    Basics of AuthN and AuthZ

    To understand the world of authentication (AuthN) and authorization (AuthZ), lets start with understanding the common…

    1 条评论
  • Does time and space complexity varies with code?

    Does time and space complexity varies with code?

    Being an enthusiastic about enhancing the performance of the system, I consistently re-look the same code to find where…

  • DNS resolution flow: Part 1 - User accessing web server hosted at Azure

    DNS resolution flow: Part 1 - User accessing web server hosted at Azure

    DNS (Domain name server) is involved in resolution of domain name to its IP address of the machine (web server) hosted…