netkit lab load balancer dns 1.2 Massimo Rimondini Version Author(s)



Similar documents
netkit lab Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group Version 1.

walkthrough Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group Version 1.

netkit lab load balancer web switch 1.1 Giuseppe Di Battista, Massimo Rimondini Version Author(s)

netkit lab web server and browser 1.2 Giuseppe Di Battista, Maurizio Patrignani, Massimo Rimondini Version Author(s)

netkit lab static-routing Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group

netkit lab dns Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group Version Author(s)

Services: DNS domain name system

DNS. Computer Networks. Seminar 12

CSIS 3230 Computer Networking Principles, Spring 2012 Lab 7 Domain Name System (DNS)

netkit lab two-hosts Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group

DNS based Load Balancing with Fault Tolerance

How To Manage Dns On An Elfiq Link Load Balancer (Link Balancer) On A Pcode (Networking) On Ipad Or Ipad (Netware) On Your Ipad On A Ipad At A Pc Or Ipa

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Environment. SEED Labs Local DNS Attack Lab 1

netkit lab MPLS VPNs with overlapping address spaces 1.0 S.Filippi, L.Ricci, F.Antonini Version Author(s)

Creating a master/slave DNS server combination for your Grid Infrastructure

DNS + DHCP. Michael Tsai 2015/04/27

Solaris Networking Guide. Stewart Watkiss. Volume. New User To Technical Expert Solaris Bookshelf. This document is currently under construction

Application and service delivery with the Elfiq idns module

DNS. Computer networks - Administration 1DV202. fredag 30 mars 12

- Domain Name System -

DNS and BIND Primer. Pete Nesbitt linux1.ca. April 2012

netkit lab bgp: multi-homed Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group

Lab 4 Domain Name System - DNS CMPE 150

netkit lab single-host Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group

DNS Pharming Attack Lab

SI455 Advanced Computer Networking. Lab2: Adding DNS and Servers (v1.0) Due 6 Feb by start of class

netkit lab Traffic Engineering with MPLS for Linux Version Author(s) F. Di Ciccio, F. Antonini (Kasko Networks S.r.l.)

Remote DNS Cache Poisoning Attack Lab

Configuring the BIND name server (named) Configuring the BIND resolver Constructing the name server database files

ECE 4321 Computer Networks. Network Programming

Using Webmin and Bind9 to Setup DNS Sever on Linux

Building a Linux IPv6 DNS Server

Wireshark DNS. Introduction. nslookup

DNS : Domain Name System

DNS Service on Linux. Supawit Wannapila CCNA, RHCE

2G1701 Advanced Internetworking Group 5 : KiStaNEt ISP Project Report

Tunnel Client FAQ. Table of Contents. Version 0v5, November 2014 Revised: Kate Lance Author: Karl Auer

DNS Session 4: Delegation and reverse DNS. Joe Abley AfNOG 2006 workshop

The secret life of a DNS query. Igor Sviridov <sia@nest.org>

Domain Name System :49:44 UTC Citrix Systems, Inc. All rights reserved. Terms of Use Trademarks Privacy Statement

The Use of DNS Resource Records

Securing an Internet Name Server

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

How to Add Domains and DNS Records

Zimbra :: The Leader in Open Source Collaboration. Administrator's PowerTip #3: June 21, 2007 Zimbra Forums - Zimbra wiki - Zimbra Blog

Advanced DNS Course. Module 4. DNS Load Balancing

How to set up the Integrated DNS Server for Inbound Load Balancing

How-to: DNS Enumeration

Version Author(s) Web Description

HTG XROADS NETWORKS. Network Appliance How To Guide: DNS Delegation. How To Guide

How to Configure Split DNS

Introduction to DNS and Application Issues related to DNS. Kirk Farquhar

Instructor Notes for Lab 3

3. The Domain Name Service

Module 2. Configuring and Troubleshooting DNS. Contents:

Load Balancing Microsoft Sharepoint 2010 Load Balancing Microsoft Sharepoint Deployment Guide

netkit lab bgp: prefix-filtering Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group

Citrix NetScaler Global Server Load Balancing Primer:

LinkProof DNS Quick Start Guide

KAREL UCAP DNS AND DHCP CONCEPTS MANUAL MADE BY: KAREL ELEKTRONIK SANAYI ve TICARET A.S. Organize Sanayi Gazneliler Caddesi 10

Advanced Internetworking

DNS ROUND ROBIN HIGH-AVAILABILITY LOAD SHARING

Red Hat system-config-bind BIND (Berkeley Internet Name Domain) DNS ( Domain Name System)

Application-layer protocols

DNS and BIND. David White

DNS and LDAP persistent search

2 HDE Controller X DNS Server Manual

DNS Resolving using nslookup

Domain Name Server. Training Division National Informatics Centre New Delhi

IPv6 support in the DNS

Domain Name Servers. Domain Types WWW host names. Internet Names. COMP476 Networked Computer Systems. Domain Name Servers

Computer Networks: Domain Name System

IP Address: the per-network unique identifier used to find you on a network

Wireshark Lab: DNS. 1. nslookup

ITIS 2110 Lab 11: Domain Name Server. Tyler Everhart 11/12/2010

Application Layer -1- Network Tools

Wireshark Lab: DNS v6.01

Domain Name System (DNS) Fundamentals

Domain Name System (DNS) Services

Domain Name System Security

Lab 5 Explicit Proxy Performance, Load Balancing & Redundancy

DNS. The Root Name Servers. DNS Hierarchy. Computer System Security and Management SMD139. Root name server. .se name server. .

DNS, CDNs Weds March Lecture 13. What is the relationship between a domain name (e.g., youtube.com) and an IP address?

Domain Name System Server Round-Robin Functionality for the Cisco AS5800

Deploying & Configuring a DNS Server on OpenServer 6 or UnixWare 7. Kirk Farquhar

Networking Domain Name System

Work No. 1 Samba. What is Samba?

IPv6 Support in the DNS. Workshop Name Workshop Location, Date

Understand Names Resolution

Introduction to DNS CHAPTER 5. In This Chapter

LAN TCP/IP and DHCP Setup

DnsCluster: A networking tool for automatic domain zone updating

Network Working Group. Category: Best Current Practice S. Bradner Harvard University M. Patton Consultant July 1997

SuperLumin Nemesis. Administration Guide. February 2011

Transcription:

netkit lab load balancer dns Version Author(s) 1.2 Massimo Rimondini E-mail Web Description contact@netkit.org http://www.netkit.org/ A lab showing how to perform simple load balancing on a set of web servers using the DNS

copyright notice All the pages/slides in this presentation, including but not limited to, images, photos, animations, videos, sounds, music, and text (hereby referred to as material ) are protected by copyright. This material, with the exception of some multimedia elements licensed by other organizations, is property of the authors and/or organizations appearing in the first slide. This material, or its parts, can be reproduced and used for didactical purposes within universities and schools, provided that this happens for non-profit purposes. Information contained in this material cannot be used within network design projects or other products of any kind. Any other use is prohibited, unless explicitly authorized by the authors on the basis of an explicit agreement. The authors assume no responsibility about this material and provide this material as is, with no implicit or explicit warranty about the correctness and completeness of its contents, which may be subject to changes. This copyright notice must always be redistributed together with the material, or its portions.

lab topology

lab topology root name server web.com US US server farm web.com EU EU server farm US US customer network EU EU customer network

lab topology root-ns US US server farm server3 EU EU server farm authority for for web.com authority for for example.us authority for for test.eu ns1 ns2

lab topology US US server farm server3 root-ns E EU EU server farm r3 C D A B r1 r2 ns1 ns2

lab topology server1 server2 US US server farm server3 root-ns E EU EU server farm server4 server5 r3 C D A B r1 r2 ns1 ns2

lab topology server1 server2 US US server farm server3 root-ns E EU EU server farm server4 server5 r3 C D A B client1 ns1 r1 r2 client2 ns2

lab topology 150.0.0.0/30 root-ns 2 100.0.0.0/24 eth0 200.0.0.0/24 server1 US US server farm server2 server3 1 eth0 1 eth1 E 1 eth2 EU EU server farm server4 server5 r3 3 eth0 4 eth0 5 eth0 C D 6 eth0 7 eth0 A 3 eth0 10.0.0.0/24 20.0.0.0/24 2 eth0 1 eth0 2 eth1 B 3 eth0 2 eth0 1 eth0 2 eth1 r1 r2 client1 ns1 client2 ns2

lab description web servers server1,2,3,4,5} are all web servers running apache2 each server hosts a single default HTML page (in /var/www/index.html) with different contents, to easily distinguish one server from the others server3 also runs bind, because it is the authority for zone web.com

lab description routers to make the setup simpler, static routes are used on all devices, including routers r3.config ifconfig eth0 100.0.0.1 netmask 255.255.255.0 up up ifconfig eth1 150.0.0.1 netmask 255.255.255.252 up up ifconfig eth2 200.0.0.1 netmask 255.255.255.0 up up route add add -net 10.0.0.0/24 gw gw 100.0.0.2 route add add -net 20.0.0.0/24 gw gw 200.0.0.2

lab description clients have a text-based web browser (links) have the system-wide resolver configured to point to the local name server client1 s /etc/resolv.conf nameserver 10.0.0.2 domain example.us client2 s /etc/resolv.conf nameserver 20.0.0.2 domain test.eu

lab description name servers root-ns is the root name server there are no authoritative servers for zones com., us., and eu. ns1 is the authority for example.us. try pinging client.example.us and ns.example.us from the clients ns2 is the authority for test.eu. try pinging client.test.eu and ns.test.eu from the clients server3 is the authority for web.com. www.web.com is the name behind which the farm offers the web service TTLs are zeroed to appreciate load balancing

lab description name servers different load balancing mechanisms round robin location-based random all simultaneously operating in the same lab

lab description name servers there are multiple A records for www.web.com, one for each server in the farm round robin server3 s /etc/bind/db.web.com-us $TTL $TTL 0 0 ; ; do do not not cache, cache, so so that that we we can can appreciate appreciate ; ; load load balancing balancing @ @ IN IN SOA SOA web.com. web.com. root.localhost. root.localhost. ( ( 2 2 ; ; Serial Serial 604800 604800 ; ; Refresh Refresh 86400 86400 ; ; Retry Retry 2419200 2419200 ; ; Expire Expire 604800 604800 ) ) ; ; Negative Negative Cache Cache TTL TTL ; ; @ @ IN IN NS NS ns.web.com. ns.web.com. ns ns IN IN A A 100.0.0.5 100.0.0.5 www www IN IN A A 100.0.0.3 100.0.0.3 www www IN IN A A 100.0.0.4 100.0.0.4 www www IN IN A A 100.0.0.5 100.0.0.5

lab description name servers round robin there are multiple A records for www.web.com, one for each server in the farm these records are all returned to the client when it performs a query client1 client1:~# dig www.web.com +noall +answer be be terse ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.5 www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.4 client1:~#

lab description name servers round robin there are multiple A records for www.web.com, one for each server in the farm these records are all returned to the client when it performs a query user applications (e.g., web browsers) usually only consider the first returned record by default, bind rotates returned records in a round robin fashion round robin load balancing

lab description name servers client2 round robin load balancing client2:~# dig www.web.com +noall +answer round robin ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 200.0.0.6 www.web.com. 0 IN A 200.0.0.7 client2:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 200.0.0.7 www.web.com. 0 IN A 200.0.0.6 client2:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 200.0.0.6 www.web.com. 0 IN A 200.0.0.7 client2:~#

lab description name servers round robin load balancing round robin start links http://www.web.com/ on client2 and issue disconnect (ctrl+s) & reload (ctrl+r) multiple times you should see pages coming from different servers

lab description name servers round robin round robin load balancing the count_server_replies.sh script on the clients issues 100 HTTP requests to www.web.com and counts the number of times the reply came from each server client2 client2:~#./count_server_replies.sh Sending 100 requests to www.web.com... 50 replies received from server 4 50 replies received from server 5

lab description name servers server3 is the sole authority for www.web.com, but different countries are offered different views of the DNS database, to improve load balancing location-based round robin server3 s /etc/bind/named.conf view view "US" "US" match-clients match-clients 10.0.0.0/24; 10.0.0.0/24;...... zone zone "web.com" "web.com" type type master; master; file file "/etc/bind/db.web.com-us"; "/etc/bind/db.web.com-us"; rrset-order rrset-order order order random; random; view view "Europe" "Europe" match-clients match-clients 20.0.0.0/24; 20.0.0.0/24;...... zone zone "web.com" "web.com" type type master; master; file file "/etc/bind/db.web.com-eu"; "/etc/bind/db.web.com-eu"; rrset-order rrset-order order order cyclic; cyclic;

lab description name servers server3 is the sole authority for www.web.com, but different countries are offered different views of the DNS database, to improve load balancing location-based location-based load balancing

lab description name servers client1 location-based load balancing client1:~# dig www.web.com +noall +answer location-based ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.5 www.web.com. 0 IN A 100.0.0.3 client2 client2:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 200.0.0.7 www.web.com. 0 IN A 200.0.0.6

lab description name servers location-based location-based load balancing start links http://www.web.com/ on client1 and client2 and see that pages are always obtained from different servers

lab description name servers location-based location-based load balancing also check with count_server_replies.sh client1 client1:~#./count_server_replies.sh Sending 100 requests to www.web.com... 33 replies received from server 1 33 replies received from server 2 34 replies received from server 3 client2 client2:~#./count_server_replies.sh Sending 100 requests to www.web.com... 50 replies received from server 4 50 replies received from server 5

lab description name servers different orderings are used when returning records to clients default is round robin (cyclic) location-based random server3 s /etc/bind/named.conf view view "US" "US" match-clients match-clients 10.0.0.0/24; 10.0.0.0/24;...... zone zone "web.com" "web.com" type type master; master; file file "/etc/bind/db.web.com-us"; "/etc/bind/db.web.com-us"; rrset-order rrset-order order order random; random; view view "Europe" "Europe" match-clients match-clients 20.0.0.0/24; 20.0.0.0/24;...... zone zone "web.com" "web.com" type type master; master; file file "/etc/bind/db.web.com-eu"; "/etc/bind/db.web.com-eu"; rrset-order rrset-order order order cyclic; cyclic;

lab description name servers different orderings are used when returning records to clients default is round robin (cyclic) random server3 s /etc/bind/named.conf view view "US" "US" match-clients match-clients 10.0.0.0/24; 10.0.0.0/24;...... zone zone "web.com" "web.com" type type master; master; file file "/etc/bind/db.web.com-us"; "/etc/bind/db.web.com-us"; rrset-order rrset-order order order random; random; so, US US clients are supposed to to see records returned in in random order... view view "Europe" "Europe" match-clients match-clients 20.0.0.0/24; 20.0.0.0/24;...... zone zone "web.com" "web.com" type type master; master; file file "/etc/bind/db.web.com-eu"; "/etc/bind/db.web.com-eu"; rrset-order rrset-order order order cyclic; cyclic;

lab description name servers so, US clients are supposed to see records returned in random order... random random load balancing

lab description name servers client1 random load balancing client1:~# dig www.web.com +noall +answer random ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.5 client1:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.5 www.web.com. 0 IN A 100.0.0.3 client1:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.5 www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.4

lab description name servers client1 random load balancing client1:~# dig www.web.com +noall +answer random ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.5 client1:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: printcmd www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.5 www.web.com. 0 IN A 100.0.0.3 client1:~# dig www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> www.web.com +noall +answer ;; global options: but printcmd www.web.com. this 0 is is round IN robin! A 100.0.0.5 www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.4

beware of address sorting random BIND 4 servers, by default, sort addresses if [...] the host that sent the query to the name server shares a network with the name server host. [...] When BIND starts up, it finds all the interface addresses of the host it's running on. [...] to create the default sort list. When a query is received, BIND checks whether the sender's address is on a network in the default sort list. If it is, then the query is local and BIND sorts the addresses in the response. [P. Albitz, C. Liu. DNS and Bind, 4th edition. O Reilly.]

beware of address sorting random address sorting happens at 3 places: 1. server (rrset-order) 2. client (default behavior or explicit sortlist) 3. end user s resolver

lab description name servers random so what? random load balancing you can still appreciate random load balancing by directly querying ns.web.com (100.0.0.5) client1 client1:~# dig @ns.web.com www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> @ns.web.com www.web.com +noall +answer ; (1 server found) ;; global options: printcmd www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.5 client1:~# dig @ns.web.com www.web.com +noall +answer ; <<>> DiG 9.5.0-P2 <<>> @ns.web.com www.web.com +noall +answer ; (1 server found) ;; global options: printcmd www.web.com. 0 IN A 100.0.0.3 www.web.com. 0 IN A 100.0.0.4 www.web.com. 0 IN A 100.0.0.5

experiments start links http://www.web.com/ on client1 and client2 and see the effects of round robin location-based random load balancing on the choice of the machine that serves the request

experiments change client1 s resolver configuration to use 100.0.0.5 as name server start links http://www.web.com/ on client1, issue disconnect (ctrl+s) & reload (ctrl+r) multiple times, and appreciate the effect of random load balancing...or use count_server_replies.sh to do the same

questions answering these proposed questions requires interaction with the lab and investigation in the bind documentation easy medium hard

questions for the round robin case, does bind rotate records independently for each client? [no: consider that that would mean keeping a state for each client; check it] does changing the TTL of resource records kill load balancing? [no, because local name servers keep rotating records when returning them to client1 and client2, even though none of the TTLs has expired; check it] consider a set of multiple resource records for the same resource (e.g., www.web.com): what TTL is returned to clients if different records have different TTLs? [the TTL of the first record in the set; check it]

(more advanced) questions try querying 100.0.0.5 (server3) for www.web.com from a machine that is outside the customer networks, both recursively and iteratively: does the server reply? [no, because the client s address does not fall into any of the subnets specified in match-clients statements] how could you reconfigure server3 to answer queries for www.web.com from any hosts? [by setting one of the existing match-clients statements to match 0.0.0.0/0 or by defining an additional view that matches 0.0.0.0/0; note that bind does not tolerate any zone statements outside views if at least one view is defined; moreover, bind always replies according to the first matching view, considering them in the order in which they are specified in named.conf]

([even] more advanced) questions try querying 10.0.0.2 (ns1) for www.web.com from any location in the network (particularly from the EU), both recursively and iteratively: does the server reply? [only when the query comes from a client in the same 10.0.0.0/24 subnet; although by default bind accepts queries from any clients, if the query comes from a different subnet than the server s and it implies an attempt to access the server s cache, then bind refuses it; in general, queries that require climbing up the name hierarchy imply a cache access attempt to avoid the climbing ; this behavior can be overridden by using the allow-query-cache configuration option, that defaults to localnets; localhost;] try querying 10.0.0.2 (ns1) for client.example.us from any location in the network (particularly from the EU), both recursively and iteratively: does the server reply? [yes, because ns1 is the authority for client.example.us and therefore this query does not imply any cache access attempts]