SlideShare une entreprise Scribd logo
1  sur  92
Télécharger pour lire hors ligne
Build Dynamic DNS Server
from Scratch in C (Part 1)
SITCON 2017
yenWu(吳彥寬)
● NCKU CSIE (Master, Now)
● NCKU Mathematics(Bachelor)
● C
● Robotic
● RTOS
● Microkernel
2
DDNS
● Project Link: https://github.com/yenWu/DDNS
● DDNS = Dynamic DNS
● In order to figure out what's DNS and how it work, I would Implement
Dynamic DNS server in User-level.
3
Outline
1. Story Time
2. Introduction
3. Prerequisites
4. Aims
5. Cautions
4
Story Time
5
Story Time
Project “Build your own DNS Server in FreeBSD”
6
Story Time
Can I build one from scratch to be my final project?
7
Story Time
Sure. But you should try more difficult one,
“Dynamic DNS Server”.
8
Story Time
OK. That’s better than building one.
9
Story Time
OK. That’s better than building one.
I took three days long to fix
the lowercase bug when
building AMP.
10
Lots of documents ...
● rfc1033
● rfc1034
● rfc1035
● rfc2136
11
An Episode!
12
An Episode!
I said that I want to build a TCP/IP Stack at first time ...
13
Build TCP/IP Stack from
Scratch in C (Part 1)
SITCON 2017
Most frequently asked questions and comments
● Why do you try to build from scratch? I already have BIND(FreeBSD)!
● Your project doesn’t more better than BIND. Why do you still do that?
15
Most frequently asked questions and comments
● Why do you try to build from scratch? I already have BIND(FreeBSD)!
○ Writing one is the best pratice for me to understand the concept of DNS.
● Your project doesn’t more better than BIND. Why do you still do that?
16
Most frequently asked questions and comments
● Why do you try to build from scratch? I already have BIND(FreeBSD)!
○ Writing one is the best pratice for me to understand the concept of DNS.
● Your project doesn’t more better than BIND. Why do you still do that?
○ If you have wrote one, you can have more idea to improve it.
17
Introduction
18
Great Video
DNS Explained
19
Internet
● The Internet maintains two principal namespaces
○ Domain name hierarchy
○ Internet Protocol (IP) address spaces
20
What is DNS server?
21
What is DNS server?
22
What is DNS server?
● Hierarchical decentralized naming system
● Distributed database
● A little similar to Phonebook
● Translate readily memorized domain name to IP address
● DNS client v.s. DNS server
● Two category of the DNS server
○ Recursive DNS server
○ Iterative DNS server
23
Hierarchy of DNS servers
“www.yahoo.com”
24
Hierarchy of DNS servers
“www.yahoo.com.”
25
Hierarchy of DNS servers
“www.yahoo.com.”
26
Hierarchy of DNS servers
“www.yahoo.com.”
27
Let’s take it deeply
That’s all I knew before I started this.
28
What is DNS server?
● DNS client v.s. DNS server
○ DNS Server ⊇ { Resolver, Database, Cache}
○ DNS Client ⊇ { Resolver}
● Unlike a phonebook, DNS can be quickly updated, allowing a service's
location on the network to change without affecting the end users, who
continue to use the same host name.
● Responds with answers to queries against its database.
● Port 53
29
What is DNS server?
● The most common types of records
○ Start of Authority (SOA)
○ IP addresses (A and AAAA)
○ SMTP mail exchangers (MX)
○ Name servers (NS)
○ Pointers for reverse DNS lookups (PTR)
○ Domain name aliases (CNAME)
● Different reaction depend on the type of record
30
Glance
31
Resolver
A Resolver maps a name to an address and vice versa.
Query
Response
Resolver Name Server
32
Iterative Resolution
client
edu
2
root
3
com
4
NS: google.com
5
iterative request
“What is the IP address of
www.google.com?”
ncku
1
iterative response
“The IP address of www.google.com is
216.239.37.99.”
6
33
Iterative Resolution
client
edu
2
root
3
com
4
NS: google.com
5
iterative request
“What is the IP address of
www.google.com?”
ncku
1
iterative response
“The IP address of www.google.com is
216.239.37.99.”
6
Iterative Query
34
Recursive Resolution
client
edu
2
root
3
com
4
google
5
recursive request
“What is the IP address of
www.google.com?”
ncku
1
recursive response
“The IP address of www.google.com is
216.239.37.99.”
6
35
Recursive Resolution
client
edu
2
root
3
com
4
google
5
recursive request
“What is the IP address of
www.google.com?”
ncku
1
recursive response
“The IP address of www.google.com is
216.239.37.99.”
6
Recursive Query
36
● Why hierarchy?
Questions
37
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
Questions
38
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
Questions
39
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
Questions
40
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
● Is it true that react immediately when we update the informaition(RR)?
Questions
41
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
● Is it true that react immediately when we update the informaition(RR)?
○ Probably not … because of the cache.
Questions
42
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
● Is it true that react immediately when we update the informaition(RR)?
○ Probably not … because of the cache.
● Is it easy to update the information(RR)?
Questions
43
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
● Is it true that react immediately when we update the informaition(RR)?
○ Probably not … because of the cache.
● Is it easy to update the information(RR)?
○ Maybe not. In RFC 1035, we would load zone and startup file into database at local.
Questions
44
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
● Is it true that react immediately when we update the informaition(RR)?
○ Probably not … because of the cache.
● Is it easy to update the information(RR)?
○ Maybe not. In RFC 1035, we would load zone and startup file into database at local.
● Can we update the information on remote DNS Server?
Questions
45
● Why hierarchy?
○ More efficient than heterarchy.
○ Update could be immediately showed.
● Does it always waste a lot of time on process of lookup?
○ Right! So caching!
● Is it true that react immediately when we update the informaition(RR)?
○ Probably not … because of the cache.
● Is it easy to update the information(RR)?
○ Maybe not. In RFC 1035, we would load zone and startup file into database at local.
● Can we update the information on remote DNS Server?
○ No. We need another mechanism to do that. In RFC 2136, we could name DNS to DDNS with
remote updating mechanism.
● That’s why we need a Dynamic DNS Server.
Questions
46
Process flow
47
48
Client
DHCP
Server
Primary DNS Server
Zone File
IP Address?
IP Address Update
Dynamic DNS
Fine ! We know the concept of DNS.
Can we start it ?
49
Prerequisites
50
IP
header
UDP
header
DNS message
IP
header
TCP
header
DNS message
2-byte
DNS msg.
length
● DNS messages are encapsulated in UDP by default.
● If the resolver expects the response to exceed 512 bytes, the
resolver encapsulates the query in TCP instead.
● If a request is sent over UDP and the response is longer than 512
bytes, the server sends the first 512 bytes of the response using
UDP and sets the TC (truncated) flag. The resolver then re-sends
the query using TCP.
max. 512 bytes
no limit (up to max. TCP payload size)
51
Transport
DNS Protocol
52
Message Format
● Header Section
● Question Section
● RR Section
53
Header Section
● ID := identification of DNS transaction
● FLAG
● QDCOUNT := questions record count
● ANCOUNT := answer record count
● NSCOUNT := authority record count
● ARCOUNT := additional record count
54
Flag
● QR
● Opcode
● RCODE
55
Flag
Query 0
Respond 1
Query 0000
OpCode
Retired
0001
Status 0010
reserved 0011
Notify 0100
Update 0101
56
Flag NoError No Error 0000
FormErr Format Error 0001
ServFail Server Failure 0010
NXDomain Non-Existent Domain 0011
NotImp Not Implemented 0100
Refused Query Refused 0101
YXDomain Name Exists when it should not 0110
YXRRSet RR Set Exists when it should not 0111
NXRRSet RR Set that should exist does not 1000
NotAuth Server Not Authoritative for zone 1001
NotZone Name not contained in zone 1010
57
Message Formate
● Header Section
● Question Section
● RR Section
58
Message Formate
● Header Section
● Question Section
● RR Section
59
RR Section
● The most common Type
○ Start of Authority (SOA)
○ IP addresses (A and AAAA)
○ SMTP mail exchangers (MX)
○ Name servers (NS)
○ Pointers for reverse DNS lookups (PTR)
○ Domain name aliases (CNAME)
60
RR Section
● The most common TYPE
○ Start of Authority (SOA)
○ IP addresses (A and AAAA)
○ SMTP mail exchangers (MX)
○ Name servers (NS)
○ Pointers for reverse DNS lookups (PTR)
○ Domain name aliases (CNAME)
● RDATA depends on TYPE
61
RR Section
IN Internet 0x0001
CH Chaos 0x0003
HS Hesiod 0x0004
QCLASS
Only
Any 0x00FF
62
Aims of this Project
63
Aims
1. Efficiency
2. Uniform Protocol Access Interface
3. Consistency with RFC standard
4. Pluggable Database and DNS Complement
5. Benchmark
6. Education
64
Efficiency
Is it good enough ?
65
Efficiency
In order to send message
rapidly, we should maintain
continous memory buffer!
66
Uniform
Protocol
Access
Interface
● MACRO
● Hard to debug
67
Uniform Protocol Access Interface
68
Consistency with RFC standard
69
Pluggable Database and DNS Complement
70
Pluggable Database and DNS Complement
Object-Orien Programming in C
!?
71
Education
● A pioneer have shared all of the pitfalls he met at protocol level.
● Provide uniform protocol access interface.
● Easy to change implementation.
72
Benchmark
● Follow the assignment(phonebook) of Embedded System Course in
NCKU
● Mission: You need to optimize the building and searching time on
phonebook.
● Assignment Link: https://hackmd.io/s/rJYD4UPKe
73
Phonebook
● clear
● gnuplot
74
Great ! It time to work!
75
Cautions
76
Pitfalls!!!
77
Notice !!!
● If you start to build it, maybe you would be trapped in this three pitfalls:
○ Domain Name Format in Message Format
○ Message Compression
○ Endian Transfer
78
Domain Name in Message Format
class of network (1 = Internet)
12
5
2
1 Address – IPv4
Name Server (authoritative)
Canonical Name (alias)
Pointer – reverse lookup
15 Mail Exchange
28 Address - IPv6
252 Zone Transfer
PTR
CNAME
NS
A
MX
AAAA
AXFR
sent in query;
repeated in response
w w w . g o o g l e . c o m
Query Name
Query Type Query Class
16 bit 16 bit
Variable Length
79
Domain Name in Message Format
class of network (1 = Internet)
12
5
2
1 Address – IPv4
Name Server (authoritative)
Canonical Name (alias)
Pointer – reverse lookup
15 Mail Exchange
28 Address - IPv6
252 Zone Transfer
PTR
CNAME
NS
A
MX
AAAA
AXFR
sent in query;
repeated in response
w w w . g o o g l e . c o m .
Query Name
Query Type Query Class
16 bit 16 bit
Variable Length
80
Domain Name in Message Format
class of network (1 = Internet)
12
5
2
1 Address – IPv4
Name Server (authoritative)
Canonical Name (alias)
Pointer – reverse lookup
15 Mail Exchange
28 Address - IPv6
252 Zone Transfer
PTR
CNAME
NS
A
MX
AAAA
AXFR
sent in query;
repeated in response
3 w w w 6 g o o g l e 3 c o m 0
count
Query Name
Query Type Query Class
16 bit 16 bit
Variable Length
81
Question
Section
Answer
Section
3 w w w 6 g o o g l e 3 c o m 0
1 1 000 ... 1 1 0 0
2 bit 30 bit
16 bit
Query Name
Query Type Query Class
Header
Domain Name
16 bit 16 bit
Variable Length
Variable Length
12 byte
C0 0C
PointerCompression flag
Compression
82
Question
Section
Answer
Section
3 w w w 6 g o o g l e 3 c o m 0
1 1 000 ... 1 1 0 0
2 bit 14 bit
16 bit
Query Name
Query Type Query Class
Header
Domain Name
C0 0C
PointerCompression flag
Compression 11
Reserve 10
Reserve 01
Normal 00
Compression
83
Question
Section
Answer
Section
3 w w w 6 g o o g l e 3 c o m 0
1 1 000 ... 1 1 0 0
2 bit 30 bit
16 bit
Query Name
Query Type Query Class
Header
Domain Name
C0 0C
PointerCompression flag
Compression 11
Reserve 10
Reserve 01
Normal 00
Compression
84
The difficult one for Endian transfer
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0
QR Opcode AA TC RD RA Z AD CD RCODE
85
As I've said …………………………………..
0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0
QR Opcode AA TC RD RA Z AD CD RCODE
1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0
86
struct in C
● make sure
continuous memory space
87
Reference
● Request For Comments(RFC)
○ rfc1033
○ rfc1034
○ rfc1035
○ rfc2136
● INACON's protocol help
○ DNS Protocol
● University of Delaware
○ https://www.eecis.udel.edu/~amer/856/dns.04f.ppt
● University of Nebraska–Lincoln
○ http://cse.unl.edu/~ylu/csce855/notes/DNS.ppt
● Wikipedia DNS
88
Demo - Resolver
89
Project would continous when I have free
time (... graduated paper)
90
Contact me
● Github: yenWu
● LinkedIn: Yen-Kwan Wu
● NCKU CSIE WIKI: yenWu
● E-Mail: c14006078@gmail.com
91
Q & A
92

Contenu connexe

Tendances

Kvm virtualization platform
Kvm virtualization platformKvm virtualization platform
Kvm virtualization platformAhmad Hafeezi
 
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)Philip Hammer
 
Seminar Report on Unreal Engine 4
Seminar Report on Unreal Engine 4Seminar Report on Unreal Engine 4
Seminar Report on Unreal Engine 4AbhiJeet Singh
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Novell
 
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...Unity Technologies
 
Architecture business cycle ( abc )
Architecture business cycle ( abc )Architecture business cycle ( abc )
Architecture business cycle ( abc )Dr Reeja S R
 
High availability virtualization with proxmox
High availability virtualization with proxmoxHigh availability virtualization with proxmox
High availability virtualization with proxmoxOriol Izquierdo Vibalda
 
DNS Query Deconstructed
DNS Query DeconstructedDNS Query Deconstructed
DNS Query DeconstructedDNS Made Easy
 
6 arquitectura desoftware
6 arquitectura desoftware6 arquitectura desoftware
6 arquitectura desoftwaregaston6711
 
Star Ocean 4 - Flexible Shader Managment and Post-processing
Star Ocean 4 - Flexible Shader Managment and Post-processingStar Ocean 4 - Flexible Shader Managment and Post-processing
Star Ocean 4 - Flexible Shader Managment and Post-processingumsl snfrzb
 
Web sphere application server performance tuning workshop
Web sphere application server performance tuning workshopWeb sphere application server performance tuning workshop
Web sphere application server performance tuning workshopRohit Kelapure
 
Siggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentialsSiggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentialsTristan Lorach
 
Edge Computing Platforms and Protocols - Ph.D. thesis
Edge Computing Platforms and Protocols - Ph.D. thesisEdge Computing Platforms and Protocols - Ph.D. thesis
Edge Computing Platforms and Protocols - Ph.D. thesisNitinder Mohan
 
Introduction of cloud computing
Introduction of cloud computingIntroduction of cloud computing
Introduction of cloud computingSuman Sharma
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceNagios
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsElectronic Arts / DICE
 

Tendances (18)

Kvm virtualization platform
Kvm virtualization platformKvm virtualization platform
Kvm virtualization platform
 
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
 
Seminar Report on Unreal Engine 4
Seminar Report on Unreal Engine 4Seminar Report on Unreal Engine 4
Seminar Report on Unreal Engine 4
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
 
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
 
Architecture business cycle ( abc )
Architecture business cycle ( abc )Architecture business cycle ( abc )
Architecture business cycle ( abc )
 
High availability virtualization with proxmox
High availability virtualization with proxmoxHigh availability virtualization with proxmox
High availability virtualization with proxmox
 
DNS Query Deconstructed
DNS Query DeconstructedDNS Query Deconstructed
DNS Query Deconstructed
 
6 arquitectura desoftware
6 arquitectura desoftware6 arquitectura desoftware
6 arquitectura desoftware
 
Star Ocean 4 - Flexible Shader Managment and Post-processing
Star Ocean 4 - Flexible Shader Managment and Post-processingStar Ocean 4 - Flexible Shader Managment and Post-processing
Star Ocean 4 - Flexible Shader Managment and Post-processing
 
Web sphere application server performance tuning workshop
Web sphere application server performance tuning workshopWeb sphere application server performance tuning workshop
Web sphere application server performance tuning workshop
 
Siggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentialsSiggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentials
 
Introduction to Docker on AWS
Introduction to Docker on AWSIntroduction to Docker on AWS
Introduction to Docker on AWS
 
Edge Computing Platforms and Protocols - Ph.D. thesis
Edge Computing Platforms and Protocols - Ph.D. thesisEdge Computing Platforms and Protocols - Ph.D. thesis
Edge Computing Platforms and Protocols - Ph.D. thesis
 
Windows Server 2019 -InspireTech 2019
Windows Server 2019 -InspireTech 2019Windows Server 2019 -InspireTech 2019
Windows Server 2019 -InspireTech 2019
 
Introduction of cloud computing
Introduction of cloud computingIntroduction of cloud computing
Introduction of cloud computing
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical Experience
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-Graphics
 

En vedette

How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 
開發學校雲端服務的奇技淫巧(Tips for Building Third-Party School Service)
開發學校雲端服務的奇技淫巧(Tips for Building  Third-Party School Service)開發學校雲端服務的奇技淫巧(Tips for Building  Third-Party School Service)
開發學校雲端服務的奇技淫巧(Tips for Building Third-Party School Service)Sheng-Hao Ma
 
Presentacion inclusion
Presentacion inclusionPresentacion inclusion
Presentacion inclusionJulio Jimenez
 
The theater of taormina
The theater of taorminaThe theater of taormina
The theater of taorminarobydellem
 
DNS - Domain Name System
DNS - Domain Name SystemDNS - Domain Name System
DNS - Domain Name SystemPeter R. Egli
 
Gävle kopia
Gävle kopiaGävle kopia
Gävle kopiaEdwjen
 
Summer Internship Project - Remote Render
Summer Internship Project - Remote RenderSummer Internship Project - Remote Render
Summer Internship Project - Remote RenderYen-Kuan Wu
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsoViller Hsiao
 
如何靠自學成為工程師
如何靠自學成為工程師如何靠自學成為工程師
如何靠自學成為工程師Joseph Lu
 
嵌入式平台移植技巧概說
嵌入式平台移植技巧概說嵌入式平台移植技巧概說
嵌入式平台移植技巧概說Joseph Lu
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 
La entrada de la cueva original
La entrada de la cueva originalLa entrada de la cueva original
La entrada de la cueva originalencararroyo
 
OSDcLang On Mobile Devices
OSDcLang On Mobile DevicesOSDcLang On Mobile Devices
OSDcLang On Mobile DevicesJonathan Oxer
 
Hw2 2017-spring
Hw2 2017-springHw2 2017-spring
Hw2 2017-spring奕安 陳
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 

En vedette (20)

How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Introduction to DNS
Introduction to DNSIntroduction to DNS
Introduction to DNS
 
開發學校雲端服務的奇技淫巧(Tips for Building Third-Party School Service)
開發學校雲端服務的奇技淫巧(Tips for Building  Third-Party School Service)開發學校雲端服務的奇技淫巧(Tips for Building  Third-Party School Service)
開發學校雲端服務的奇技淫巧(Tips for Building Third-Party School Service)
 
Role of Technology in Recruitment
Role of Technology in Recruitment Role of Technology in Recruitment
Role of Technology in Recruitment
 
Poodle
PoodlePoodle
Poodle
 
Aprendizaje
AprendizajeAprendizaje
Aprendizaje
 
Presentacion inclusion
Presentacion inclusionPresentacion inclusion
Presentacion inclusion
 
The theater of taormina
The theater of taorminaThe theater of taormina
The theater of taormina
 
DNS - Domain Name System
DNS - Domain Name SystemDNS - Domain Name System
DNS - Domain Name System
 
Gävle kopia
Gävle kopiaGävle kopia
Gävle kopia
 
Summer Internship Project - Remote Render
Summer Internship Project - Remote RenderSummer Internship Project - Remote Render
Summer Internship Project - Remote Render
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
 
如何靠自學成為工程師
如何靠自學成為工程師如何靠自學成為工程師
如何靠自學成為工程師
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
嵌入式平台移植技巧概說
嵌入式平台移植技巧概說嵌入式平台移植技巧概說
嵌入式平台移植技巧概說
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
La entrada de la cueva original
La entrada de la cueva originalLa entrada de la cueva original
La entrada de la cueva original
 
OSDcLang On Mobile Devices
OSDcLang On Mobile DevicesOSDcLang On Mobile Devices
OSDcLang On Mobile Devices
 
Hw2 2017-spring
Hw2 2017-springHw2 2017-spring
Hw2 2017-spring
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 

Similaire à Build Dynamic DNS server from scratch in C (Part1)

MongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the FieldMongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the FieldMongoDB
 
DNS/DNSSEC by Nurul Islam
DNS/DNSSEC by Nurul IslamDNS/DNSSEC by Nurul Islam
DNS/DNSSEC by Nurul IslamMyNOG
 
DNS Over HTTPS by Michael Casadevall
DNS Over HTTPS by Michael CasadevallDNS Over HTTPS by Michael Casadevall
DNS Over HTTPS by Michael CasadevallGlenn McKnight
 
DNS_Tutorial 2.pptx
DNS_Tutorial 2.pptxDNS_Tutorial 2.pptx
DNS_Tutorial 2.pptxviditsir
 
Signing DNSSEC answers on the fly at the edge: challenges and solutions
Signing DNSSEC answers on the fly at the edge: challenges and solutionsSigning DNSSEC answers on the fly at the edge: challenges and solutions
Signing DNSSEC answers on the fly at the edge: challenges and solutionsAPNIC
 
DNS Survival Guide
DNS Survival GuideDNS Survival Guide
DNS Survival GuideAPNIC
 
DNS Survival Guide.
DNS Survival Guide.DNS Survival Guide.
DNS Survival Guide.Qrator Labs
 
Get your instance by name integration of nova, neutron and designate
Get your instance by name  integration of nova, neutron and designateGet your instance by name  integration of nova, neutron and designate
Get your instance by name integration of nova, neutron and designateMiguel Lavalle
 
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...JosephTesta9
 
Implementing Domain Name
Implementing Domain NameImplementing Domain Name
Implementing Domain NameNapoleon NV
 
Voldemort : Prototype to Production
Voldemort : Prototype to ProductionVoldemort : Prototype to Production
Voldemort : Prototype to ProductionVinoth Chandar
 
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...Felipe Prado
 
IGF 2023: DNS Privacy
IGF 2023: DNS PrivacyIGF 2023: DNS Privacy
IGF 2023: DNS PrivacyAPNIC
 
A Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's RoadmapA Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's RoadmapItai Yaffe
 
NANOG32 - DNS Anomalies and Their Impacts on DNS Cache Servers
NANOG32 - DNS Anomalies and Their Impacts on DNS Cache ServersNANOG32 - DNS Anomalies and Their Impacts on DNS Cache Servers
NANOG32 - DNS Anomalies and Their Impacts on DNS Cache ServersChika Yoshimura
 

Similaire à Build Dynamic DNS server from scratch in C (Part1) (20)

Hands-on DNSSEC Deployment
Hands-on DNSSEC DeploymentHands-on DNSSEC Deployment
Hands-on DNSSEC Deployment
 
MongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the FieldMongoDB Days UK: Tales from the Field
MongoDB Days UK: Tales from the Field
 
6421 b Module-03
6421 b Module-036421 b Module-03
6421 b Module-03
 
DNS/DNSSEC by Nurul Islam
DNS/DNSSEC by Nurul IslamDNS/DNSSEC by Nurul Islam
DNS/DNSSEC by Nurul Islam
 
DNS Over HTTPS by Michael Casadevall
DNS Over HTTPS by Michael CasadevallDNS Over HTTPS by Michael Casadevall
DNS Over HTTPS by Michael Casadevall
 
DNS_Tutorial 2.pptx
DNS_Tutorial 2.pptxDNS_Tutorial 2.pptx
DNS_Tutorial 2.pptx
 
Signing DNSSEC answers on the fly at the edge: challenges and solutions
Signing DNSSEC answers on the fly at the edge: challenges and solutionsSigning DNSSEC answers on the fly at the edge: challenges and solutions
Signing DNSSEC answers on the fly at the edge: challenges and solutions
 
DNS Survival Guide
DNS Survival GuideDNS Survival Guide
DNS Survival Guide
 
DNS Survival Guide.
DNS Survival Guide.DNS Survival Guide.
DNS Survival Guide.
 
Get your instance by name integration of nova, neutron and designate
Get your instance by name  integration of nova, neutron and designateGet your instance by name  integration of nova, neutron and designate
Get your instance by name integration of nova, neutron and designate
 
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
 
Implementing Domain Name
Implementing Domain NameImplementing Domain Name
Implementing Domain Name
 
Voldemort : Prototype to Production
Voldemort : Prototype to ProductionVoldemort : Prototype to Production
Voldemort : Prototype to Production
 
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
 
Introduction
IntroductionIntroduction
Introduction
 
IGF 2023: DNS Privacy
IGF 2023: DNS PrivacyIGF 2023: DNS Privacy
IGF 2023: DNS Privacy
 
A Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's RoadmapA Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's Roadmap
 
NANOG32 - DNS Anomalies and Their Impacts on DNS Cache Servers
NANOG32 - DNS Anomalies and Their Impacts on DNS Cache ServersNANOG32 - DNS Anomalies and Their Impacts on DNS Cache Servers
NANOG32 - DNS Anomalies and Their Impacts on DNS Cache Servers
 
2 technical-dns-workshop-day1
2 technical-dns-workshop-day12 technical-dns-workshop-day1
2 technical-dns-workshop-day1
 
DNSCurve
DNSCurveDNSCurve
DNSCurve
 

Dernier

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Dernier (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Build Dynamic DNS server from scratch in C (Part1)

  • 1. Build Dynamic DNS Server from Scratch in C (Part 1) SITCON 2017
  • 2. yenWu(吳彥寬) ● NCKU CSIE (Master, Now) ● NCKU Mathematics(Bachelor) ● C ● Robotic ● RTOS ● Microkernel 2
  • 3. DDNS ● Project Link: https://github.com/yenWu/DDNS ● DDNS = Dynamic DNS ● In order to figure out what's DNS and how it work, I would Implement Dynamic DNS server in User-level. 3
  • 4. Outline 1. Story Time 2. Introduction 3. Prerequisites 4. Aims 5. Cautions 4
  • 6. Story Time Project “Build your own DNS Server in FreeBSD” 6
  • 7. Story Time Can I build one from scratch to be my final project? 7
  • 8. Story Time Sure. But you should try more difficult one, “Dynamic DNS Server”. 8
  • 9. Story Time OK. That’s better than building one. 9
  • 10. Story Time OK. That’s better than building one. I took three days long to fix the lowercase bug when building AMP. 10
  • 11. Lots of documents ... ● rfc1033 ● rfc1034 ● rfc1035 ● rfc2136 11
  • 13. An Episode! I said that I want to build a TCP/IP Stack at first time ... 13
  • 14. Build TCP/IP Stack from Scratch in C (Part 1) SITCON 2017
  • 15. Most frequently asked questions and comments ● Why do you try to build from scratch? I already have BIND(FreeBSD)! ● Your project doesn’t more better than BIND. Why do you still do that? 15
  • 16. Most frequently asked questions and comments ● Why do you try to build from scratch? I already have BIND(FreeBSD)! ○ Writing one is the best pratice for me to understand the concept of DNS. ● Your project doesn’t more better than BIND. Why do you still do that? 16
  • 17. Most frequently asked questions and comments ● Why do you try to build from scratch? I already have BIND(FreeBSD)! ○ Writing one is the best pratice for me to understand the concept of DNS. ● Your project doesn’t more better than BIND. Why do you still do that? ○ If you have wrote one, you can have more idea to improve it. 17
  • 20. Internet ● The Internet maintains two principal namespaces ○ Domain name hierarchy ○ Internet Protocol (IP) address spaces 20
  • 21. What is DNS server? 21
  • 22. What is DNS server? 22
  • 23. What is DNS server? ● Hierarchical decentralized naming system ● Distributed database ● A little similar to Phonebook ● Translate readily memorized domain name to IP address ● DNS client v.s. DNS server ● Two category of the DNS server ○ Recursive DNS server ○ Iterative DNS server 23
  • 24. Hierarchy of DNS servers “www.yahoo.com” 24
  • 25. Hierarchy of DNS servers “www.yahoo.com.” 25
  • 26. Hierarchy of DNS servers “www.yahoo.com.” 26
  • 27. Hierarchy of DNS servers “www.yahoo.com.” 27
  • 28. Let’s take it deeply That’s all I knew before I started this. 28
  • 29. What is DNS server? ● DNS client v.s. DNS server ○ DNS Server ⊇ { Resolver, Database, Cache} ○ DNS Client ⊇ { Resolver} ● Unlike a phonebook, DNS can be quickly updated, allowing a service's location on the network to change without affecting the end users, who continue to use the same host name. ● Responds with answers to queries against its database. ● Port 53 29
  • 30. What is DNS server? ● The most common types of records ○ Start of Authority (SOA) ○ IP addresses (A and AAAA) ○ SMTP mail exchangers (MX) ○ Name servers (NS) ○ Pointers for reverse DNS lookups (PTR) ○ Domain name aliases (CNAME) ● Different reaction depend on the type of record 30
  • 32. Resolver A Resolver maps a name to an address and vice versa. Query Response Resolver Name Server 32
  • 33. Iterative Resolution client edu 2 root 3 com 4 NS: google.com 5 iterative request “What is the IP address of www.google.com?” ncku 1 iterative response “The IP address of www.google.com is 216.239.37.99.” 6 33
  • 34. Iterative Resolution client edu 2 root 3 com 4 NS: google.com 5 iterative request “What is the IP address of www.google.com?” ncku 1 iterative response “The IP address of www.google.com is 216.239.37.99.” 6 Iterative Query 34
  • 35. Recursive Resolution client edu 2 root 3 com 4 google 5 recursive request “What is the IP address of www.google.com?” ncku 1 recursive response “The IP address of www.google.com is 216.239.37.99.” 6 35
  • 36. Recursive Resolution client edu 2 root 3 com 4 google 5 recursive request “What is the IP address of www.google.com?” ncku 1 recursive response “The IP address of www.google.com is 216.239.37.99.” 6 Recursive Query 36
  • 38. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. Questions 38
  • 39. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? Questions 39
  • 40. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! Questions 40
  • 41. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! ● Is it true that react immediately when we update the informaition(RR)? Questions 41
  • 42. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! ● Is it true that react immediately when we update the informaition(RR)? ○ Probably not … because of the cache. Questions 42
  • 43. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! ● Is it true that react immediately when we update the informaition(RR)? ○ Probably not … because of the cache. ● Is it easy to update the information(RR)? Questions 43
  • 44. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! ● Is it true that react immediately when we update the informaition(RR)? ○ Probably not … because of the cache. ● Is it easy to update the information(RR)? ○ Maybe not. In RFC 1035, we would load zone and startup file into database at local. Questions 44
  • 45. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! ● Is it true that react immediately when we update the informaition(RR)? ○ Probably not … because of the cache. ● Is it easy to update the information(RR)? ○ Maybe not. In RFC 1035, we would load zone and startup file into database at local. ● Can we update the information on remote DNS Server? Questions 45
  • 46. ● Why hierarchy? ○ More efficient than heterarchy. ○ Update could be immediately showed. ● Does it always waste a lot of time on process of lookup? ○ Right! So caching! ● Is it true that react immediately when we update the informaition(RR)? ○ Probably not … because of the cache. ● Is it easy to update the information(RR)? ○ Maybe not. In RFC 1035, we would load zone and startup file into database at local. ● Can we update the information on remote DNS Server? ○ No. We need another mechanism to do that. In RFC 2136, we could name DNS to DDNS with remote updating mechanism. ● That’s why we need a Dynamic DNS Server. Questions 46
  • 48. 48 Client DHCP Server Primary DNS Server Zone File IP Address? IP Address Update Dynamic DNS
  • 49. Fine ! We know the concept of DNS. Can we start it ? 49
  • 51. IP header UDP header DNS message IP header TCP header DNS message 2-byte DNS msg. length ● DNS messages are encapsulated in UDP by default. ● If the resolver expects the response to exceed 512 bytes, the resolver encapsulates the query in TCP instead. ● If a request is sent over UDP and the response is longer than 512 bytes, the server sends the first 512 bytes of the response using UDP and sets the TC (truncated) flag. The resolver then re-sends the query using TCP. max. 512 bytes no limit (up to max. TCP payload size) 51 Transport
  • 53. Message Format ● Header Section ● Question Section ● RR Section 53
  • 54. Header Section ● ID := identification of DNS transaction ● FLAG ● QDCOUNT := questions record count ● ANCOUNT := answer record count ● NSCOUNT := authority record count ● ARCOUNT := additional record count 54
  • 56. Flag Query 0 Respond 1 Query 0000 OpCode Retired 0001 Status 0010 reserved 0011 Notify 0100 Update 0101 56
  • 57. Flag NoError No Error 0000 FormErr Format Error 0001 ServFail Server Failure 0010 NXDomain Non-Existent Domain 0011 NotImp Not Implemented 0100 Refused Query Refused 0101 YXDomain Name Exists when it should not 0110 YXRRSet RR Set Exists when it should not 0111 NXRRSet RR Set that should exist does not 1000 NotAuth Server Not Authoritative for zone 1001 NotZone Name not contained in zone 1010 57
  • 58. Message Formate ● Header Section ● Question Section ● RR Section 58
  • 59. Message Formate ● Header Section ● Question Section ● RR Section 59
  • 60. RR Section ● The most common Type ○ Start of Authority (SOA) ○ IP addresses (A and AAAA) ○ SMTP mail exchangers (MX) ○ Name servers (NS) ○ Pointers for reverse DNS lookups (PTR) ○ Domain name aliases (CNAME) 60
  • 61. RR Section ● The most common TYPE ○ Start of Authority (SOA) ○ IP addresses (A and AAAA) ○ SMTP mail exchangers (MX) ○ Name servers (NS) ○ Pointers for reverse DNS lookups (PTR) ○ Domain name aliases (CNAME) ● RDATA depends on TYPE 61
  • 62. RR Section IN Internet 0x0001 CH Chaos 0x0003 HS Hesiod 0x0004 QCLASS Only Any 0x00FF 62
  • 63. Aims of this Project 63
  • 64. Aims 1. Efficiency 2. Uniform Protocol Access Interface 3. Consistency with RFC standard 4. Pluggable Database and DNS Complement 5. Benchmark 6. Education 64
  • 65. Efficiency Is it good enough ? 65
  • 66. Efficiency In order to send message rapidly, we should maintain continous memory buffer! 66
  • 68. Uniform Protocol Access Interface 68
  • 69. Consistency with RFC standard 69
  • 70. Pluggable Database and DNS Complement 70
  • 71. Pluggable Database and DNS Complement Object-Orien Programming in C !? 71
  • 72. Education ● A pioneer have shared all of the pitfalls he met at protocol level. ● Provide uniform protocol access interface. ● Easy to change implementation. 72
  • 73. Benchmark ● Follow the assignment(phonebook) of Embedded System Course in NCKU ● Mission: You need to optimize the building and searching time on phonebook. ● Assignment Link: https://hackmd.io/s/rJYD4UPKe 73
  • 75. Great ! It time to work! 75
  • 78. Notice !!! ● If you start to build it, maybe you would be trapped in this three pitfalls: ○ Domain Name Format in Message Format ○ Message Compression ○ Endian Transfer 78
  • 79. Domain Name in Message Format class of network (1 = Internet) 12 5 2 1 Address – IPv4 Name Server (authoritative) Canonical Name (alias) Pointer – reverse lookup 15 Mail Exchange 28 Address - IPv6 252 Zone Transfer PTR CNAME NS A MX AAAA AXFR sent in query; repeated in response w w w . g o o g l e . c o m Query Name Query Type Query Class 16 bit 16 bit Variable Length 79
  • 80. Domain Name in Message Format class of network (1 = Internet) 12 5 2 1 Address – IPv4 Name Server (authoritative) Canonical Name (alias) Pointer – reverse lookup 15 Mail Exchange 28 Address - IPv6 252 Zone Transfer PTR CNAME NS A MX AAAA AXFR sent in query; repeated in response w w w . g o o g l e . c o m . Query Name Query Type Query Class 16 bit 16 bit Variable Length 80
  • 81. Domain Name in Message Format class of network (1 = Internet) 12 5 2 1 Address – IPv4 Name Server (authoritative) Canonical Name (alias) Pointer – reverse lookup 15 Mail Exchange 28 Address - IPv6 252 Zone Transfer PTR CNAME NS A MX AAAA AXFR sent in query; repeated in response 3 w w w 6 g o o g l e 3 c o m 0 count Query Name Query Type Query Class 16 bit 16 bit Variable Length 81
  • 82. Question Section Answer Section 3 w w w 6 g o o g l e 3 c o m 0 1 1 000 ... 1 1 0 0 2 bit 30 bit 16 bit Query Name Query Type Query Class Header Domain Name 16 bit 16 bit Variable Length Variable Length 12 byte C0 0C PointerCompression flag Compression 82
  • 83. Question Section Answer Section 3 w w w 6 g o o g l e 3 c o m 0 1 1 000 ... 1 1 0 0 2 bit 14 bit 16 bit Query Name Query Type Query Class Header Domain Name C0 0C PointerCompression flag Compression 11 Reserve 10 Reserve 01 Normal 00 Compression 83
  • 84. Question Section Answer Section 3 w w w 6 g o o g l e 3 c o m 0 1 1 000 ... 1 1 0 0 2 bit 30 bit 16 bit Query Name Query Type Query Class Header Domain Name C0 0C PointerCompression flag Compression 11 Reserve 10 Reserve 01 Normal 00 Compression 84
  • 85. The difficult one for Endian transfer 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 QR Opcode AA TC RD RA Z AD CD RCODE 85
  • 86. As I've said ………………………………….. 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 QR Opcode AA TC RD RA Z AD CD RCODE 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 86
  • 87. struct in C ● make sure continuous memory space 87
  • 88. Reference ● Request For Comments(RFC) ○ rfc1033 ○ rfc1034 ○ rfc1035 ○ rfc2136 ● INACON's protocol help ○ DNS Protocol ● University of Delaware ○ https://www.eecis.udel.edu/~amer/856/dns.04f.ppt ● University of Nebraska–Lincoln ○ http://cse.unl.edu/~ylu/csce855/notes/DNS.ppt ● Wikipedia DNS 88
  • 90. Project would continous when I have free time (... graduated paper) 90
  • 91. Contact me ● Github: yenWu ● LinkedIn: Yen-Kwan Wu ● NCKU CSIE WIKI: yenWu ● E-Mail: c14006078@gmail.com 91