Beruflich Dokumente
Kultur Dokumente
1. INTRODUCTION
IPv6 is a key cutting Edge Technology and top 4th Technology all
around the world from EFY Magazine resources. It is a Top 6th Technology
of Computer Networks from Network Magazine website. The project mainly
deals with creating a Dual IP stack node with provision of complete support
for both IPV4 and IPV6 in hosts and servers. This can be achieved by
making a recursive copy of the kernel and configuring the necessary network
properties to support both IPv4 and IPv6. The kernel is configured by using
scripts in shell programming and C programming. The main idea of the
project is configure a DNS server in Linux with IPv6 name resolution
facility. The concept of encapsulation of IPv6 packets within IPv4 headers to
carry then an IPv4 network simply called as IPv6 over IPv4 tunneling.
Finally Resources are accessed in the network regardless of the platform.
Page 1
Building a Linux IPv6 DNS Server
Page 2
Building a Linux IPv6 DNS Server
Page 3
Building a Linux IPv6 DNS Server
software development, and outsourced product development to application
maintenance.
The process focus will bring about process focus through well-
defined, institutionalized processes and finally, Maze Net would also work
towards improving the predictability of delivery time, effort and quality of
delivery. Maze Net is on its way to CMM Level 5.
Page 4
Building a Linux IPv6 DNS Server
2. LITERATURE SURVEY
Page 5
Building a Linux IPv6 DNS Server
3. SYSTEM SPECIFICATION
Page 6
Building a Linux IPv6 DNS Server
About Kernel
The kernel is the part of the operating system that handles the most
basic functions and control interactions with the computer hardware. The
Linux kernel is very modular. Each driver, for a file system or a piece of
hardware, needs to be compiled into the kernel, or inserted as a module. The
file /proc/file systems contain a list of all the file systems that the kernel
understands.
There are two ways to get IPV6 support. The simplest is to probe the
IPV6 module to the kernel (as root). If this fails, then your distribution didn’t
install the IPV6 module. The second way is to recompile the kernel,
yourself. This sounds like a lot of work, but isn’t that hard.
Page 7
Building a Linux IPv6 DNS Server
Kernels, being the backbone of an operating system are of two types:
(i) Open Kernel
(ii) Closed Kernel
The open kernel is a free source and easily modifiable by any one
familiar with Linux. The closed kernel is a kernel of proprietary software
which cannot be modified by normal user.
The Kernel versions prior to 2.3 did not have provisions for IPV6, so
a Program module has to be added by recompiling the kernel. But the
current versions from 2.4 have provisions to support IPv6 and are IPv6 ready
kernels. Appropriate RPMS has to be enabled in the kernel. Most users
won’t have to compile anything to enable IPV6 support.
Page 8
Building a Linux IPv6 DNS Server
Almost every Linux distribution comes with IPv6 support out of the
box. For any RedHat 7.3 or RedHat 8.0 user, the user probably doesn’t have
to recompile the kernel. If there is an older version of RedHat, or other
distribution which doesn’t include IPv6 support, then the user has to
recompile the kernel.
Why Linux?
Page 9
Building a Linux IPv6 DNS Server
• The X Window System - The X Window System is a graphics
system for UNIX machines. This powerful interface supports many
applications and is the standard interface for the industry.
• Built-in networking support - Linux uses standard TCP/IP
protocols, including Network File System (NFS) and Network
Information Service (NIS, formerly known as YP). By connecting
your system with an Ethernet card or over a modem to another
system, you can access the Internet.
• Shared libraries - Each application, instead of keeping its own copy
of software, shares a common library of subroutines that it can call at
runtime. This saves a lot of hard drive space on your system.
• Compatibility with the IEEE POSIX.1 standard - Because of this
compatibility, Linux supports many of the standards set forth for all
UNIX systems.
• Nonproprietary source code - The Linux kernel uses no code from
AT&T, nor any other proprietary source. Other organizations, such as
commercial companies, the GNU project, hackers, and programmers
from all over the world have developed software for Linux.
• Lower cost than most other UNIX systems and UNIX clones - If
you have the patience and the time, you can freely download Linux
off the Internet. Many books also come with a free copy.
• GNU software support - Linux can run a wide range of free software
available through the GNU project. This software includes everything
from application development (GNU C and GNU C++) to system
administration (gawk, groff, and so on), to games (for example, GNU
Chess, GnuGo, NetHack).
Page 10
Building a Linux IPv6 DNS Server
BIND has gone through numerous revisions over years. The Most
common BIND used since about 1995 was version 8. BIND 9 was released
in September 2000. The development of BIND 9 made important
improvements in security and robustness. In addition it provides IPv6
support, allows eight-bit clean names, and better multi-threading.
Page 11
Building a Linux IPv6 DNS Server
Apart from passing commands to the kernel, the main task of a shell is
providing a user environment, which can be configured individually using
shell resource configuration files.
Page 12
Building a Linux IPv6 DNS Server
Bash can run most sh scripts without modification. Like the other
GNU projects, the bash initiative was started to preserve, protect and
promote the freedom to use, study, copy, modify and redistribute software. It
is generally known that such conditions stimulate creativity. This was also
the case with the bash program, which has a lot of extra features that other
shells can't offer.
Luxury of C
The programming language C was developed in 1972 by Dennis
Ritchie at AT & T Bell Laboratory, Murray Hill, New Jersy. It was mainly
influenced by the language by the languages BCPL and B. It was named as
C to present it as the successor B language which was designed earlier by
Ken Thompson in 1970 for the first UNIX system on the DEC PDP – 7
computer.
C proved to be an excellent programming language for writing system
programs; Hence, it got wide popularity especially among the programmers
in research in research centers, universities and colleges. The UNIX
operating system, C compiler and all UNIX applications software are written
in C.
Features / Characteristics of C
C is attractive and popular because of the following reasons.
• General purpose language.
• Structured Language.
• Flexible and Powerful language.
• System programming language.
Page 13
Building a Linux IPv6 DNS Server
• Relatively low-level language.
• Machine independent and hence portable.
• Memory addresses are directly accessed by pointers.
• More Built-in functions.
• Free format language.
• Programs are made up of functions.
Java Unleashed
Java is a general-purpose, object-oriented programming language
developed by Sun Microsystems of USA in 1991. Originally call Oak by
James Gosling; one of the inventors of the language, Java was designed for
the development of software for consumer electronic devices like TVs,
VCRs, toasters and such other electronic machines. This goal has a strong
impact on the development team to make the language simple, portable and
highly reliable. The Java team, which included Patrick Naughton,
discovered that the existing language like C and C++ had limitations in
terms of both reliability and portability.
Page 14
Building a Linux IPv6 DNS Server
Stand-alone applications are programs written in java to carry out
certain tasks on a stand-alone local computer. In fact, java can be used to
develop programs for all kinds of applications, which earlier, were
developed using languages like C and C++. As pointed out earlier, Hot Java
itself is java application program.
Executing a stand-alone java program involves two steps.
1. Compiling source code into byte code using javac compiler
2. Executing the byte code program using java interpreter.
Java Features
The inventors of Java wanted to design a language, which could offer
solutions to some of the problems encountered in modern programming.
They wanted the language to be reliable, portable and distributed but also
simple, compact and interactive. Sun Microsystems officially describes java
with the following attributes:
¾ Compiled and Interpreted
¾ Platform-Independent and portable
¾ Object-oriented
¾ Robust and secure
¾ Distributed
¾ Familiar, Simple and small
Page 15
Building a Linux IPv6 DNS Server
¾ Multithreaded and Interactive
¾ High Performance
¾ Dynamic and Extensible
Swing Components
The Swing components conform to the Swing architecture, which
means that they are lightweight, have a pluggable look and feel and so on.
Despite the plethora of features, the components are easy to use. Swing
components and applications commonly present information to the user and
invite the user's interaction using a GUI.
Page 16
Building a Linux IPv6 DNS Server
4. SYSTEM DESIGN
Data flow diagram clearly tells about the pipeline and how the
modules are marshaled in the project.
Start
Kernel Compilation
Lookup module
(Registering the
clients with server and
checks the status)
Configuring IPv6
over Ipv4
Building Linux
DNS Server
Cross Platform
Resource Access
Stop
Page 17
Building a Linux IPv6 DNS Server
Page 18
Building a Linux IPv6 DNS Server
¾ Header Length
This 4-bit field reflects the total length of the IP header built by
the sending machine; it is specified in 32-bit words.
¾ Type of Service
The 8-bit (1 byte) Service Type field instructs IP how to
process the datagram properly.
¾ Datagram Length (or Packet Length)
This field gives the total length of the datagram, including the
header, in bytes.
¾ Identification
This field holds a number that is a unique identifier created by
the sending node.
¾ Flags
The Flags field is a 3-bit field, the first bit of which is left
unused (it is ignored by the protocol and usually has no value written to
it).
¾ Fragment Offset
This enables IP to reassemble fragmented packets in the proper
order.
¾ Time to Live (TTL)
This field gives the amount of time in seconds that a datagram
can remain on the network before it is discarded.
¾ Transport Protocol
This field holds the identification number of the transport
protocol to which the packet has been handed.
Page 19
Building a Linux IPv6 DNS Server
¾ Header Checksum
The number in this field of the IP header is a checksum for the
protocol header field (but not the data fields) to enable faster processing.
¾ Sending Address and Destination Address
These fields contain the 32-bit IP addresses of the sending and
destination devices.
¾ Options
The Options field is optional, composed of several codes of
variable length.
¾ Padding
The content of the padding area depends on the options
selected. The padding is usually used to ensure that the datagram header
is a round number of bytes.
¾ DF
It stands for don’t fragment, given as an order to the routers not to
fragment the datagram because the destination is incapable of putting
the pieces back together again.
¾ MF
It stands for more fragments it is needed to know if all the fragments
of the datagram have arrived.
Page 20
Building a Linux IPv6 DNS Server
• NAT is no longer adequate
Page 21
Building a Linux IPv6 DNS Server
IPv6 – Key Advantages
These are the prominent key advantages of IPv6
• Global addressing:
– Scaling well beyond 4 trillion public endpoints
– Stateless address auto-configuration
• Plug and play:
– Simple instant-on ad-hoc networking
• Efficient mobility:
– Mobile IPv6, unlike IPv4, does not need the Foreign Agent
• Secure:
– IPSec is a requirement and integral part of the IP layer
– Anonymous addresses ensure privacy
Page 22
Building a Linux IPv6 DNS Server
4.3 IPV6 HEADER
The Figure 3. Portrays the IPv6 Header Format
Page 23
Building a Linux IPv6 DNS Server
¾ Destination address: A 128-bit address consists of receiving address.
A comparison between the IPv4 and IPv6 header formats will show
that a number of IPv4 header fields have no direct equivalents in the IPv6
header.
Page 24
Building a Linux IPv6 DNS Server
Packets with this address as source or destination should never leave the
sending host.
Unspecified Address
This is a special address like "any" or "0.0.0.0" in IPv4 . For IPv6 it's:
0000:0000:0000:0000:0000:0000:0000:0000 or: ::
These addresses are mostly used/seen in socket binding (to any IPv6
address) or routing tables.
Page 25
Building a Linux IPv6 DNS Server
4.5 TUNNELING
When IPv6 or IPv6/IPv4 systems are separated from other similar
systems that they wish to communicate with by older IPv4 networks, then
IPv6 packets must be tunneled through the IPv4 network.IPv6 packets are
tunnelled over IPv4 very simply; the IPv6 packet is encapsulated in an IPv4
datagram, or in other words, a complete IPv4 header is added to the IPv6
packet. The presence of the IPv6 packet within the IPv4 datagram is
indicated by a protocol value of 41 in the IPv4 header.
There are two kinds of tunneling of IPv6 packets over IPv4 networks:
• Automatic Tunneling
• Configured Tunneling
Automatic Tunneling
Automatic tunneling relies on IPv4-compatible addresses. The
decision to when to tunnel is made by an IPv6/IPv4 host that has a packet to
send across an IPv4-routed network area.
Configured Tunneling
Configured tunneling is used for host-router or router-router tunneling
of IPv6-over-IPv4. The sending host or the forwarding router is configured
so that the route, as well as having a next hop, also has a tunnel end address
(which is always an IPv4-compatible address).
Page 26
Building a Linux IPv6 DNS Server
Overview of Socket Programming
A socket is nothing more than a convenient abstraction. It represents a
connection point into a TCP/IP network, much like the electrical sockets in
your home provide a connection point for your appliances. When two
computers want to converse, each uses a socket. One computer is termed the
server--it opens a socket and listens for connections. The other computer is
termed the client--it calls the server socket to start the connection. To
establish a connection, all that's needed is a server's destination address and
port number.
Connection-Oriented Mode
Connection-oriented sockets operate like a telephone: they must
establish a connection and then hang up. Everything that a flow between
these two events arrives in the same order it was sent.
Page 27
Building a Linux IPv6 DNS Server
Connection-oriented operation uses the Transport Control Protocol
(TCP). A socket in this mode must connect to the destination before sending
data. Once connected, the sockets are accessed using a streams interface:
open-read-write-close. Connection-oriented operation is less efficient than
connectionless operation, but it's guaranteed.
Connectionless Mode
Connectionless sockets operate like the mail: delivery is not
guaranteed, and multiple pieces of mail may arrive in an order distinct from
that in which they were sent.
Page 28
Building a Linux IPv6 DNS Server
If all you use Java for is to write Web browser applets, the URL and
URLConnection classes, in all likelihood, will handle your network
communications needs.
Page 29
Building a Linux IPv6 DNS Server
communicate. Server sockets listen on a given port for connection requests
when their accept() method is called. The ServerSocket offers the same
connection-oriented, ordered stream protocol (TCP) that the Socket object
does. In fact, once a connection has been established, the accept() method
returns a Socket object to talk with the remote end.
Class Purpose
Page 30
Building a Linux IPv6 DNS Server
The structure of the DNS database, shown in Figure 2., is very similar
to the structure of the UNIX file system. The whole database (or file system)
is pictured as an inverted tree, with the root node at the top. Each node in the
tree has a text label, which identifies the node relative to its parent.
Page 31
Building a Linux IPv6 DNS Server
Each node is also the root of a new subtree of the overall tree. Each of
these subtrees represents a partition of the overall database - a "directory" in
the UNIX filesystem, or a domain in the Domain Name System. Each
domain or directory can be further divided into additional partitions, called
subdomains in DNS, like a filesystem's "subdirectories." Subdomains, like
subdirectories, are drawn as children of their parent domains.
Page 32
Building a Linux IPv6 DNS Server
The Figure 3. Portraits the DNS upside down tree structure which is in
a hierarchical manner. Every domain has a unique name, like every
directory. A domain's domain name identifies its position in the database,
much as a directory's "absolute pathname" specifies its place in the file
system. In DNS, the domain name is the sequence of labels from the node at
the root of the domain to the root of the whole tree, with "." separating the
labels.
DNS Lookups
DNS have a couple of lookups, one is forward lookup and the other is
reverse of forward lookup.
Forward Lookup
- It Resolves Hostname into IP address.
Reverse Lookup
- It Resolves IP address into Host Name.
Page 33
Building a Linux IPv6 DNS Server
Page 34
Building a Linux IPv6 DNS Server
• Additional
HEADER
The header section is always present. The header includes fields that
specify which of the remaining sections are present, and also specify
whether the message is a query or a response, a standard query or some other
opcode, etc.
The names of the sections after the header are derived from their use
in standard queries. The question section contains fields that describe a
question to a name server. These fields are a query type (QTYPE), a query
class (QCLASS), and a query domain name (QNAME). The last three
sections have the same format: a possibly empty list of concatenated
resource records (RRs).
The answer section contains RRs that answer the question; the
authority section contains RRs that point toward an authoritative name
Page 35
Building a Linux IPv6 DNS Server
server; the additional records section contains RRs which relate to the query,
but are not strictly answers for the question.
zone "mahendra.com" {
type master;
file "mahendra.com.zone"
};
zone "kernel.org" {
type slave;
masters { 192.168.192.168; };
file "kernel.org.zone";
};
The file directive specifies the text file that holds the zone's database.
The name of the zone file is arbitrary be common examples include:
mahendra.com.zone
mahendra.com.db
Page 36
Building a Linux IPv6 DNS Server
db.mahendra.com
mahendra.com
Page 37
Building a Linux IPv6 DNS Server
Path setting for java's bin directory can be achieved by /etc/profile
configuration file by passing certain parameters.
Page 38
Building a Linux IPv6 DNS Server
5. SYSTEM IMPLEMENTATION
Page 39
Building a Linux IPv6 DNS Server
• GUI basedconfiguration – make xconfig, make gconfig
In our project the necessary files to build a new kernel are kept under the
loading.sh file.
Lookup Module
The main goal of this module is to check the status of the server by
the client. Initially the server is enabled by specifying a port number which
is greater than 1024 [i.e. it should not be a default port number as assigned
by ICANN].
Then all the clients are registered with the server in the same port
number that is assigned previously at the server side programs by clicking
Page 40
Building a Linux IPv6 DNS Server
on Register button .The client name and the port name are entered on their
preferred text boxes.
Successively any client system can be added in the network with the
server by checking the server status through lookup button. A clear
indication will be shown to the user regarding the server status whether it is
active or inactive.
Page 41
Building a Linux IPv6 DNS Server
• # Service named stop - The command indicates to stop the
named service in Linux network services.
• # Service named restart - The command indicates to restart the
named service in Linux network services.
• # Chkconfig named on - The command indicates to start the
named service while booting Linux.
In the control panel dialog box, we can activate the server through
start / restart buttons and deactivated through stop button. Additionally the
close button is used to exit from the control panel if the user clicks on it.
Page 42
Building a Linux IPv6 DNS Server
Page 43
Building a Linux IPv6 DNS Server
Tunneling. The principal function for this concept is encapsulating the IPv6
packets within IPv4 packets.
Page 44
Building a Linux IPv6 DNS Server
6. SOFTWARE TESTING
6.1 AN INTRODUCTION
Testing is done to make sure that all processes are executed properly
in order to avoid unprecedented errors and bugs under various
circumstances.
Unit Testing
Unit testing focuses verification effort on the smallest limit of
software design. Using the unit test plan prepared in the design phase of the
system, important control paths are tested to uncover the errors within the
module. This testing was carried out during the coding itself. In this testing
each module is going to be working satisfactorily as the expected output
from the module.
Integration Testing
Integration testing is the systematic technique for constructing the
program structure while at the same time conducting test to uncover errors
associated with the interface. The objective is to take tested modules and
Page 45
Building a Linux IPv6 DNS Server
build the program structure that has been dictated by design. All modules are
combined in this testing step. Then the entire program is tested as a whole. If
a set of errors is encountered correction is difficult because the isolation of
causes is complicated by vastness of the entire program. Using integrated
test plans prepared in the design phase of the system developed as a guide,
the integration was carried out. All the errors found in the system were
corrected for the next testing steps.
Validation Testing
At the end of the integration testing, software is completely assembled
as a package, interfacing errors have been uncovered and corrected and final
series of software validation testing begins. Validation testing can be defined
in many ways, but a simple definition is that validation succeeds then the
software functions in a manner that can be reasonably accepted by the user.
Software validation is achieved through a series of black box tests that
demonstrate conformity the requirements. Thus, the proposed system under
consideration has been tested by using validation testing and found to be
working satisfactory.
Output Testing
After performing the validation testing the next step is to perform the
output testing of the proposed system. Since no system could be useful if it
does not produce the required output in the specified format. The output
generated by the system under consideration is compared with the format
required by the user. Here the output format is considered in two ways. One
is onscreen and other is printed format. The output format on the screen is
found to be correct as the system design phase according to the user needs
Page 46
Building a Linux IPv6 DNS Server
for the hard copy also, the output comes out as a specified requirement by
the user. Hence, the output testing does not result in any correction in the
system.
Page 47
Building a Linux IPv6 DNS Server
• Initialization and termination errors.
Page 48
Building a Linux IPv6 DNS Server
Page 49
Building a Linux IPv6 DNS Server
7. CONCLUSION
Our Project would resolve both IPv4 and IPv6 names, since we have
created a dual stack which supports both kinds of name resolution. The
project also includes the tunneling mechanism through name resolution by
the code developed by the code developed in JAVA.
Though the system has been successfully working with the currently
developed modules, it is planned to upgrade the system to accommodate the
IPv6 name server too. These ideas are under consideration and ground work
for further development is on.
These are the Pointers that we have chosen IPV6 as academic Project.
• Long-term solution, Scalable, Reliable, Manageable
• Secure and High-performance IP networks.
Page 50
Building a Linux IPv6 DNS Server
8. REFERENCES
Books Referred
1. M.Beck, H.Bome, M, Dziadzka, U.Kunitz, R.Manus, D,Verwomer
“LINUX Kernal Internals” Addison Wesley Longman (Singapore )
Pvt. Ltd. Indian Branch 482 FIE , Delhi -110092, pp.54-123.
2. Craig Hunt “Linux Network Servers” BPB publications , B-14
connaught place, New Delhi-01, pp.67-78.
3. Kerry Cox “Red Hat Linux administrator’s guide” Prentice Hall of
India pte Ltd, New Delhi -01, pp.101-222.
4. Christopher Negus “Red Hat Linux 9 Bible” WILEY – dreamtech
India Pvt Ltd, New Delhi-01, pp.36-63.
5. Douglas E.Comer “Internetworking with TCP/IP” forth edition,
Pearson Education pte Ltd, New Delhi-92, pp.92-134.
Page 51
Building a Linux IPv6 DNS Server
Websites
1. www.ietf.org
2. www.6bone.net
3. www.linuxkernel.org
4. www.sourceforge.net
5. www.ipv6.org
6. www.linux.org
7. www.linuxquestions.org
8. www.desktoplinux.com
9. www.realvnc.com
10. www.redhat.com
Forums
1. www.IPv6forum.com
Blogs
1. www.blogger.com
FTP Sites
1. ftp://tsx-11.mit.edu/pub/linux
How To Guides
1. Linux IPv6 guide from tldp.org
2. Linux DNS guide from tldp.org
Page 52
Building a Linux IPv6 DNS Server
Page 53