IPv6 Enable DNS Server
-
Upload
phelan-vaughn -
Category
Documents
-
view
55 -
download
1
description
Transcript of IPv6 Enable DNS Server
1
IPv6 Enable DNS Server
Rosenfeld Asaf & Timor Lior
Advisor: Uritzky Max
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
2
Some Background
• The Project deals with several major protocols
• DNS Servers play a very important role in the Internet
• New IP Protocol is quicky spreading worldwide
• Internet servers must be stable and usable
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
3
Domain Name Service
• Use names instead of numbers
• Servers are suffixes divided
• Servers arranged in tree like hierarchy
• Ever notice the dot ???
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
4
DNS (cont.)
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
DNS Server
ROOT Server
.il. Server
.ac.il. Server
DNS Server Database
CLIENT
1. www.te
chnion.ac.il ?2. www.technion.ac.il ?
3. .il. Server
4. www.te
chnion.ac.il ?5. .ac.il.
Server6. w
ww
.tech
nion
.ac.
il ?
7. 1
32.6
8.1.
1
8. 132.68.1.1
9. store 132.68.1.1
for www.te
chnion.ac.il
5
Internet Protocol V6• IPv4 supports poorly distirbuted
and not enough addresses. (4G)
• Modular Packet structure
• New features
• Different handling
• No backward compatibility
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
6
Project Goals
• Learn the DNS protocol
• Learn the IPv6 protocol
• Learn C# with MS .NET
• Implement a deployable DNS Server for IPv4 and IPv6 addresses, accoding to Industry standatds and RFCs
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
7
Challanges• Server needs to have dual stack. Support
for both platform and service
• Usable – handle large amount of requsets in short time. Parse, Find, Build and Send while Avoiding timeouts.
• Stable – withstand bursts and DoS attacks
• Testing (DoS, multiple environments, test app.)
• Native and Joined IP environments
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
8
Solution Concept
• Multiple Network-interface threads
• Single synchronized joined Database
• Database capable of learning
• Run-time protocol chooser
• Use .Net Socket, Threading and collections mechanisms
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
9
Class Diagram
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
+Record_type()+Record_class()+Record_ttl()+Record_rdata()
-RR_type : object = { A, AAAA, CNAME, HINFO, MX, NS, SOA }-RR_class : object = { IN, CH }-RR_ttl : int-RR_rdata : string
ResourceRecord
+node_get_rr_array()()+add_resource_record()()+Node_owner()
-node_owner : string-node_rr_array : object-MAX_RR_AMOUNT : int
Node
1 -Domain Name0..*
11..*
«uses»
«uses»
«uses»
+Query()()+produceResponse() : object
-SourceAddress-SourceAddressFamily-QueryID-OpCode-AA-TC-RD-RA-UserEndPoint-Node_name-Record_type-Record_class
Query
+startSocket()+endSocket()+startSocketV6()+endSocketV6()+listenerStartReceive()+listenerOnReceive()
-ipv4_socket_enabled-ipv6_socket_enabled-shared_ipv4_socket-shared_ipv6_socket-DNSDB
DNSListener
+add_node() : void+remove_node()+add_rr()+get_node() : object+get_ext_node() : object+load_db()-reader_start()-reader_finish()-writer_start()-writer_finish()
-readers_count : int-write_lock : object-db_nodes_array[] : object
NodesDB
DNSMain
*
-DNSDB
1
1
*
GUI
11
10
DatabaseDemands:• Support multiple read and write
transactions• Fast !
#Domain NameDomain Address
1www.a.com132.68.1.1
2www.a.com132.69.1.2
3www.bb.com192.168.1.1
4www.a.com132.68.1.3
5www.bb.com192.168.1.2
6www.a.com132.68.1.4
7www.bb.com192.168.1.3
8www.bb.com192.168.1.4
9www.a.com132.68.1.5
10www.ccc.com2001::1
11www.bb.com192.168.1.5
12www.a.com132.69.34.6
13www.dddd.com3055:1234:5678::1
14www.a.com2003:A::ABC5
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
#Domain NameDomain Address
1www.a.com132.68.1.1132.69.1.2132.68.1.3132.68.1.4132.68.1.5
132.69.34.62003:A::ABC5
2 www.bb.com192.168.1.1192.168.1.2192.168.1.3192.168.1.4192.168.1.5
3www.ccc.com2001::1
4www.dddd.com3055:1234:5678::1
Hash container
11
Database (cont.)
• .Net Interlocked methods
• Each function is either Writer or Reader
• Wrapped in try finally
• Learns using .Net resolver
Reader
+ 1
FOO()
- 1
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
Writer
BAR()
!= 0
12
Network Interface• Setting .Net framework to use IPv6• Use .Net Socket class with address families
IPv4 and IPv6• Ability handle large amout of requests
simultaneously Threads
• Starting a new thread is costy• Starting all needed threads at the beginning,
is a waste, and has a management overhead
THREADPOOL
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
13
.NET Threadpool
• Provides a pool of threads that can be used to post work items, process asynchronous I/O, wait on behalf of other threads, and process timers
• System managed
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
14
Network Interface (cont.)• Use StartReceiveFrom which uses threadpool• Each task re-assigns itself• v4 tasks and v6 tasks
DATABASE
MAIN THREAD
THREADPOOL
Uses single time
uses
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
Try get query in Non-Blocking manner
Re-assign the task in threadpool
Handle Query
Try get query in Non-Blocking manner
Re-assign the task in threadpool
Handle Query
Try get query in Non-Blocking manner
Re-assign the task in threadpool
Handle Query
Try get query in Non-Blocking manner
Re-assign the task in threadpool
Handle Query
15
Use case
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
DNSListener Datbase
www.host.com ?
don't konw
external www.host.com?
.NET DNS resolver
www.host.com is 2001::2
User
www.host.com ?
User
www.host.com is 2001::2
www.host.com is 2001::2
www.host.com ?
16
User Interface
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
On /Off button
Changes it’s text to indicate its functionality
Server Load Indicator
Visualizes the amount of thread pool threads
that are used, from the total amount
allowed (by the user)
Protocols Chooser
Enables the user to choose which of the IP protocols are used as medium to receive requests. If a
queried host has an IPv6 address, although the IPv6 button is not marked, the
IPv6 will return, as long as the query arrived piggy backed on IPv4 packet
Database source file
Here the user inserts the file containing the names to addresses data. Since the server is capable to learn new translations, it is possible to start it with an empty file and let it
learn alone
IPv6 ready logo
This is the IPv6 ready logo which is assigned by
the IPv6 forum. A commercial server would
have need to apply for such a logo, and was
granted one after it was proved as complied with
the IPv6 standard
17
Unit Testing
• real-life scenario. Remote applications use the DNS server
• Linux tools (nslookup, dig, etc..)
• Proprietary test application
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
18
Technology• C#• MS .NET Framwork
SocketThreadpoolContainerText.Encoding
• IPv6• DNS• Various Linux DNS test tools
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
19
Conclusions
• Although database strucure is optimized and hash table was used, it is still the bottleneck
• Commercial DNS products do not fully implement standard
• IPv6 support is far from being friendly. MS .Net support not fully works
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
20
Future Work
• IPSEC
• DNS-SEC
• Optimized Caching, threaded $ ?
• Mutual DNS Servers updates
• Server implemented as semi-cluster
• Threadpool fiddling - setMinThreads
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB
21
Acknowledgment
We would like to thank Max Uritzky for all the support. Always fast, regardless the day or the time !
And of course, the software lab, for answering our technical needs
TECHNION - ISRAEL INSTITUTE OF TECHNOLOGY
SOFTLAB