Sie sind auf Seite 1von 30

Dynamic Control of Coding for

Progressive Packet Arrivals in DTNs

ABSTRACT

In Delay Tolerant Networks (DTNs) the core challenge is to cope with lack of persistent

connectivity and yet be able to deliver messages from source to destination. In particular, routing

schemes that leverage relays’ memory and mobility are a customary solution in order to improve

message delivery delay. When large files need to be transferred from source to destination, not

all packets may be available at the source prior to the first transmission. This motivates us to

study general packet arrivals at the source, derive performance analysis of replication based

routing policies and study their optimization under two hop routing. In particular, we determine

the conditions for optimality in terms of probability of successful delivery and mean delay and

we devise optimal policies, so-called piecewise-threshold policies. We account for linear block-

codes and rate less random linear coding to efficiently generate redundancy, as well as for an

energy constraint in the optimization. We numerically assess the higher efficiency of piecewise-

threshold policies compared with other policies by developing heuristic optimization of the

thresholds for all flavors of coding considered.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

1. PREAMBLE

1.1 GENERAL INTRODUCTION

What is networking?

Networking is the word basically relating to computers and their connectivity. It is very often

used in the world of computers and their use in different connections. The term networking

implies the link between two or more computers and their devices, with the vital purpose of

sharing the data stored in the computers, with each other. The networks between the computing

devices are very common these days due to the launch of various hardware and computer

software which aid in making the activity much more convenient to build and use.

Structure of Networking between the different computers


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

How networking works?

General Network Techniques - When computers communicate on a network, they send out data

packets without knowing if anyone is listening. Computers in a network all have a connection to

the network and that is called to be connected to a network bus. What one computer sends out

will reach all the other computers on the local network.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

Above diagrams show the clear idea about the networking functions

For the different computers to be able to distinguish between each other, every computer has a

unique ID called MAC-address (Media Access Control Address). This address is not only unique

on your network but unique for all devices that can be hooked up to a network. The MAC-

address is tied to the hardware and has nothing to do with IP-addresses. Since all computers on

the network receives everything that is sent out from all other computers the MAC-addresses is

primarily used by the computers to filter out incoming network traffic that is addressed to the

individual computer.

When a computer communicates with another computer on the network, it sends out both the

other computers MAC-address and the MAC-address of its own. In that way the receiving

computer will not only recognize that this packet is for me but also, who sent this data packet so

a return response can be sent to the sender.

On an Ethernet network as described here, all computers hear all network traffic since they are

connected to the same bus. This network structure is called multi-drop.

One problem with this network structure is that when you have, let say ten (10) computers on a

network and they communicate frequently and due to that they sends out there data packets

randomly, collisions occur when two or more computers sends data at the same time. When that

happens data gets corrupted and has to be resent. On a network that is heavy loaded even the

resent packets collide with other packets and have to be resent again. In reality this soon

becomes a bandwidth problem. If several computers communicate with each other at high speed

they may not be able to utilize more than 25% of the total network bandwidth since the rest of
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

the bandwidth is used for resending previously corrupted packets. The way to minimize this

problem is to use network switches.

Characteristics of Networking:

The following characteristics should be considered in network design and ongoing maintenance:

1) Availability is typically measured in a percentage based on the number of minutes that

exist in a year. Therefore, uptime would be the number of minutes the network is

available divided by the number of minutes in a year.

2) Cost includes the cost of the network components, their installation, and their ongoing

maintenance.

3) Reliability defines the reliability of the network components and the connectivity

between them. Mean time between failures (MTBF) is commonly used to measure

reliability.

4) Security includes the protection of the network components and the data they contain

and/or the data transmitted between them.

5) Speed includes how fast data is transmitted between network end points (the data rate).

6) Scalability defines how well the network can adapt to new growth, including new users,

applications, and network components.

7) Topology describes the physical cabling layout and the logical way data moves between

components.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

Types of Networks:

Organizations of different structures, sizes, and budgets need different types of networks.

Networks can be divided into one of two categories:

 peer-to-peer

 server-based networks

1. Peer-to-Peer Network:

A peer-to-peer network has no dedicated servers; instead, a number of workstations are

connected together for the purpose of sharing information or devices. Peer-to-peer networks are

designed to satisfy the networking needs of home networks or of small companies that do not

want to spend a lot of money on a dedicated server but still want to have the capability to share

information or devices like in school, college, cyber cafe

2. Server-Based Networks:

In server-based network data files that will be used by all of the users are stored on the one

server. With a server-based network, the network server stores a list of users who may use

network resources and usually holds the resources as well.

This will help by giving you a central point to set up permissions on the data files, and it will

give you a central point from which to back up all of the data in case data loss should occur.

Network Communications:

 Computer networks use signals to transmit data, and protocols are the languages computers

use to communicate.

 Protocols provide a variety of communications services to the computers on the network.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

 Local area networks connect computers using a shared, half-duplex, baseband medium, and

wide area networks link distant networks.

 Enterprise networks often consist of clients and servers on horizontal segments connected by a

common backbone, while peer-to-peer networks consist of a small number of computers on a

single LAN.

Advantages of Networking:

1. Easy Communication:

It is very easy to communicate through a network. People can communicate efficiently using a

network with a group of people. They can enjoy the benefit of emails, instant messaging,

telephony, video conferencing, chat rooms, etc.

2. Ability to Share Files, Data and Information:

This is one of the major advantages of networking computers. People can find and share

information and data because of networking. This is beneficial for large organizations to

maintain their data in an organized manner and facilitate access for desired people.

3. Sharing Hardware:

Another important advantage of networking is the ability to share hardware. For an example, a

printer can be shared among the users in a network so that there’s no need to have individual

printers for each and every computer in the company. This will significantly reduce the cost of

purchasing hardware.

4. Sharing Software:
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

Users can share software within the network easily. Networkable versions of software are

available at considerable savings compared to individually licensed version of the same software.

Therefore large companies can reduce the cost of buying software by networking their

computers.

5. Security:

Sensitive files and programs on a network can be password protected. Then those files can only

be accessed by the authorized users. This is another important advantage of networking when

there are concerns about security issues. Also each and every user has their own set of privileges

to prevent those accessing restricted files and programs.

6. Speed:

Sharing and transferring files within networks is very rapid, depending on the type of network.

This will save time while maintaining the integrity of files.

1.2 STATEMENT OF THE PROBLEM

In Delay Tolerant Networks (DTNs) the core challenge is to cope with lack of persistent

connectivity and yet be able to deliver messages from source to destination. Since many
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

relay nodes (and thus network resources) may be involved in ensuring successful delivery, it

becomes crucial to design efficient resource allocation and data storage protocols.

1.3 OBJECTIVE

The main objective of the project is derive performance analysis of replicationbased routing

policies and study their optimization under twohop routing. we determine the conditions for

optimality in terms of probability of successful delivery and mean delay and we devise optimal

policies, so-called piecewise-threshold policies.

1.4 SCOPE

In the basic scenario, the source has initially all the packets. Under this assumption it was shown

in [2] that the transmission policy has a threshold structure: it is optimal to use all opportunities

to spread packets till some time σ depending on the energy constraint, and then stop. This policy

resembles the well-known “Spray-and-Wait” policy [3]. In this work we assume a more general

arrival process of packets: they need not to be simultaneously available for transmission initially,

i.e., when forwarding starts, as assumed in [2]. This is the case when large multimedia files are

recorded at the source node (from, e.g., a cellular base station) that sends them out (in a DTN

fashion) without waiting for the whole file reception. Contributions. This paper focuses on

general packet arrivals at the source and two-hop routing.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

1.5 LIMITATIONS

For work-conserving policies (i.e., the source sends systematically before stopping completely),

we derive the conditions for optimality in terms of probability of successful delivery and mean

delay.

• In the case of non-overwriting, we prove that the best policies, in terms of delivery probability,

are piecewisethreshold. For the overwriting case, work-conserving policies are the best without

energy constraint, but are outperformed by piecewise-threshold policies when there is an energy

constraint.

• We extend the above analysis to the case where copies are coded packets, generated both with

linear blockcodes and rateless coding. We also account for an energy constraint in the

optimization.

• We illustrate numerically, in the non-overwriting case, the higher efficiency of piecewise-

threshold policies compared with work-conserving policies by developing a heuristic

optimization of the thresholds for all flavors of coding considered. As well, in the overwriting

case, we show that work-conserving policies are the best without any energy constraint.

1.6 REVIEW OF LITERATURE


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

1) Dynamic control of coding in delay tolerant networks

AUTHORS: E. Altman, F. De Pellegrini, and L. Sassatelli

We study replication mechanisms that include Reed-Solomon type codes as well as network

coding in order to improve the probability of successful delivery within a given time limit. We

propose an analytical approach to compute these and study the effect of coding on the

performance of the network while optimizing parameters that govern routing.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

2) Forward correction and Fountain codes in delay tolerant networks

AUTHORS: E. Altman and F. De Pellegrini

Delay-tolerant ad hoc networks leverage the mobility of relay nodes to compensate for lack of

permanent connectivity and thus enable communication between nodes that are out of range of

each other. To decrease delivery delay, the information to be delivered is replicated in the

network. Our objective in this paper is to study a class of replication mechanisms that include

coding in order to improve the probability of successful delivery within a given time limit. We

propose an analytical approach that allows to quantify tradeoffs between resources and

performance measures (energy and delay). We study the effect of coding on the performance of

the network while optimizing parameters that govern routing. Our results, based on fluid

approximations, are compared to simulations that validate the model.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

3) Efficient routing in intermittently connected mobile networks: the multi-copy case

AUTHORS: T. Spyropoulos, K. Psounis, and C. Raghavendra

Intermittently connected mobile networks are wireless networks where most of the time there

does not exist a complete path from the source to the destination. There are many real networks

that follow this model, for example, wildlife tracking sensor networks, military networks,

vehicular ad hoc networks, etc. In this context, conventional routing schemes fail, because they

try to establish complete end-to-end paths, before any data is sent.

To deal with such networks researchers have suggested to use flooding-based routing schemes.

While flooding-based schemes have a high probability of delivery, they waste a lot of energy and

suffer from severe contention which can significantly degrade their performance. Furthermore,

proposed efforts to reduce the overhead of flooding-based schemes have often been plagued by

large delays. With this in mind, we introduce a new family routing schemes that "spray" a few

message copies into the network, and then route each copy independently towards the

destination. We show that, if carefully designed, spray routing not only performs significantly

fewer transmissions per message, but also has lower average delivery delays than existing

schemes; furthermore, it is highly scalable and retains good performance under a large range of

scenarios.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

Finally, we use our theoretical framework proposed in our 2004 paper to analyze the

performance of spray routing. We also use this theory to show how to choose the number of

copies to be sprayed and how to optimally distribute these copies to relays.

4) Optimal monotone forwarding policies in delay tolerant mobile ad-hoc networks

AUTHORS: E. Altman, T. Bas¸ar, and F. De Pellegrini

In this paper we describe a framework for the optimal control of delay tolerant mobile ad hoc

networks where multiple classes of nodes co-exist. We specialize the description of the energy-

delay tradeoffs as an optimization problem based on a fluid approximation. We then adopt two

product forms to model message diffusion and show that optimal controls are of bang-bang type.

Under this general framework, we analyze some specific cases of interest for applications.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

5) Parity-based loss recovery for reliable multicast transmission

AUTHORS: J. Nonnenmacher, E. Biersack, and D. Towsley

We investigate how forward error correction (FEC) can be combined with automatic repeat

request (ARQ) to achieve scalable reliable multicast transmission. We consider the two scenarios

where FEC is introduced as a transparent layer underneath a reliable multicast layer that uses

ARQ, and where FEC and ARQ are both integrated into a single layer that uses the

retransmission of parity data to recover from the loss of original data packets. To evaluate the

performance improvements due to FEC, we consider different loss rates and different types of

loss behavior (spatially or temporally correlated loss, homogeneous or heterogeneous loss) for up

to 106 receivers. Our results show that introducing FEC as a transparent layer below ARQ can

improve multicast transmission efficiency and scalability. However, there are substantial

additional improvements when FEC and ARQ are integrated.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

2. SYSTEM ANALYSIS

2.1 EXISTING SYSTEM

SYSTEM ANALYSIS

EXISTING SYSTEM:

Delay Tolerant Networks (DTNs) leverage contacts between mobile nodes and sustain end-to-

end communication even between nodes that do not have end-to-end connectivity at any given

instant. In this context, contacts between DTN nodes may be rare, for instance due to low

densities of active nodes, so that the design of routing strategies is a core step to permit timely

delivery of information to a certain destination with high probability. When mobility is random,

i.e., cannot be known beforehand, this is obtained at the cost of many replicas of the original

information, a process which consumes energy and memory resources. Since many relay nodes

(and thus network resources) may be involved in ensuring successful delivery, it becomes crucial

to design efficient resource allocation and data storage protocols.

DISADVANTAGES OF EXISTING SYSTEM:

 The core challenge is to cope with lack of persistent connectivity and yet be able to

deliver messages from source to destination.

 The routing schemes that leverage relays’ memory and mobility are a customary solution

in order to improve message delivery delay.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

 When large files need to be transferred from source to destination, not all packets may be

available at the source prior to the first transmission.

2.2 PROPOSED SYSTEM

This paper focuses on general packet arrivals at the source and two-hop routing. We distinguish

two cases: when the source can overwrite its own packets in the relay nodes, and when it cannot.

The contributions are fourfold:

 For work-conserving policies (i.e., the source sends systematically before stopping

completely), we derive the conditions for optimality in terms of probability of successful

delivery and mean delay.

 In the case of non-overwriting, we prove that the best policies, in terms of delivery

probability, are piecewisethreshold. For the overwriting case, work-conserving policies

are the best without energy constraint, but are outperformed by piecewise-threshold

policies when there is an energy constraint.

 We extend the above analysis to the case where copies are coded packets, generated both

with linear blockcodes and rateless coding. We also account for an energy constraint in

the optimization.

 We illustrate numerically, in the non-overwriting case, the higher efficiency of

piecewise-threshold policies compared with work-conserving policies by developing a

heuristic optimization of the thresholds for all flavors of coding considered. As well, in

the overwriting case, we show that work-conserving policies are the best without any

energy constraint.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

ADVANTAGES OF PROPOSED SYSTEM:

 In DTNs the framework is different since the challenge is to overcome frequent

disconnections. Papers propose a technique to erasure code a file and distribute the

generated code-blocks over a large number of relays in DTNs, so as to increase the

efficiency of DTNs under uncertain mobility patterns.

 The performance gain of the coding scheme is compared with simple replication. The

benefit of coding is assessed by extensive simulations and for different routing protocols,

including two hop routing.

 The paper addresses the design of stateless routing protocols based on network coding,

under intermittent end-to end connectivity, and the advantage over plain probabilistic

routing is proven.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

3. SYSTEM ENVIRONMENT

Software Environment

Java Technology

Java technology is both a programming language and a platform.

The Java Programming Language

The Java programming language is a high-level language that can be characterized by all

of the following buzzwords:

 Simple

 Architecture neutral

 Object oriented

 Portable

 Distributed

 High performance

 Interpreted

 Multithreaded
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

 Robust

 Dynamic

 Secure

With most programming languages, you either compile or interpret a program so that you

can run it on your computer. The Java programming language is unusual in that a program is

both compiled and interpreted. With the compiler, first you translate a program into an

intermediate language called Java byte codes —the platform-independent codes interpreted by

the interpreter on the Java platform. The interpreter parses and runs each Java byte code

instruction on the computer. Compilation happens just once; interpretation occurs each time the

program is executed. The following figure illustrates how this works.

You can think of Java byte codes as the machine code instructions for the Java Virtual

Machine (Java VM). Every Java interpreter, whether it’s a development tool or a Web browser

that can run applets, is an implementation of the Java VM. Java byte codes help make “write

once, run anywhere” possible. You can compile your program into byte codes on any platform

that has a Java compiler. The byte codes can then be run on any implementation of the Java VM.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

That means that as long as a computer has a Java VM, the same program written in the Java

programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

The Java Platform

A platform is the hardware or software environment in which a program runs.

We’ve already mentioned some of the most popular platforms like Windows 2000,

Linux, Solaris, and MacOS. Most platforms can be described as a combination of the

operating system and hardware. The Java platform differs from most other platforms in

that it’s a software-only platform that runs on top of other hardware-based platforms.

The Java platform has two components:

 The Java Virtual Machine (Java VM)

 The Java Application Programming Interface (Java API)

You’ve already been introduced to the Java VM. It’s the base for the Java platform

and is ported onto various hardware-based platforms.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

The Java API is a large collection of ready-made software components that provide

many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is

grouped into libraries of related classes and interfaces; these libraries are known as

packages. The next section, What Can Java Technology Do? Highlights what

functionality some of the packages in the Java API provide.

The following figure depicts a program that’s running on the Java platform. As the

figure shows, the Java API and the virtual machine insulate the program from the

hardware.

Native code is code that after you compile it, the compiled code runs on a specific

hardware platform. As a platform-independent environment, the Java platform can be a

bit slower than native code. However, smart compilers, well-tuned interpreters, and just-

in-time byte code compilers can bring performance close to that of native code without

threatening portability.

What Can Java Technology Do?

The most common types of programs written in the Java programming language are

applets and applications. If you’ve surfed the Web, you’re probably already familiar with

applets. An applet is a program that adheres to certain conventions that allow it to run

within a Java-enabled browser.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

However, the Java programming language is not just for writing cute, entertaining applets

for the Web. The general-purpose, high-level Java programming language is also a

powerful software platform. Using the generous API, you can write many types of

programs.

An application is a standalone program that runs directly on the Java platform. A special

kind of application known as a server serves and supports clients on a network. Examples

of servers are Web servers, proxy servers, mail servers, and print servers. Another

specialized program is a servlet. A servlet can almost be thought of as an applet that runs

on the server side. Java Servlets are a popular choice for building interactive web

applications, replacing the use of CGI scripts. Servlets are similar to applets in that they

are runtime extensions of applications. Instead of working in browsers, though, servlets

run within Java Web servers, configuring or tailoring the server.

How does the API support all these kinds of programs? It does so with packages of

software components that provides a wide range of functionality. Every full

implementation of the Java platform gives you the following features:

 The essentials: Objects, strings, threads, numbers, input and output, data

structures, system properties, date and time, and so on.

 Applets: The set of conventions used by applets.

 Networking: URLs, TCP (Transmission Control Protocol), UDP (User Data gram

Protocol) sockets, and IP (Internet Protocol) addresses.

 Internationalization: Help for writing programs that can be localized for users

worldwide. Programs can automatically adapt to specific locales and be displayed

in the appropriate language.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

 Security: Both low level and high level, including electronic signatures, public

and private key management, access control, and certificates.

 Software components: Known as JavaBeansTM, can plug into existing component

architectures.

 Object serialization: Allows lightweight persistence and communication via

Remote Method Invocation (RMI).

 Java Database Connectivity (JDBCTM): Provides uniform access to a wide range

of relational databases.

The Java platform also has APIs for 2D and 3D graphics, accessibility, servers,

collaboration, telephony, speech, animation, and more. The following figure depicts what

is included in the Java 2 SDK.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

How Will Java Technology Change My Life?

We can’t promise you fame, fortune, or even a job if you learn the Java programming

language. Still, it is likely to make your programs better and requires less effort than

other languages. We believe that Java technology will help you do the following:

 Get started quickly: Although the Java programming language is a powerful

object-oriented language, it’s easy to learn, especially for programmers already

familiar with C or C++.

 Write less code: Comparisons of program metrics (class counts, method counts,

and so on) suggest that a program written in the Java programming language can

be four times smaller than the same program in C++.

 Write better code: The Java programming language encourages good coding

practices, and its garbage collection helps you avoid memory leaks. Its object

orientation, its JavaBeans component architecture, and its wide-ranging, easily

extendible API let you reuse other people’s tested code and introduce fewer bugs.

 Develop programs more quickly: Your development time may be as much as

twice as fast versus writing the same program in C++. Why? You write fewer

lines of code and it is a simpler programming language than C++.

 Avoid platform dependencies with 100% Pure Java: You can keep your program

portable by avoiding the use of libraries written in other languages. The 100%

Pure JavaTM Product Certification Program has a repository of historical process

manuals, white papers, brochures, and similar materials online.


Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

 Write once, run anywhere: Because 100% Pure Java programs are compiled into

machine-independent byte codes, they run consistently on any Java platform.

 Distribute software more easily: You can upgrade applets easily from a central

server. Applets take advantage of the feature of allowing new classes to be loaded

“on the fly,” without recompiling the entire program.

ODBC

Microsoft Open Database Connectivity (ODBC) is a standard programming interface for

application developers and database systems providers. Before ODBC became a de facto

standard for Windows programs to interface with database systems, programmers had to use

proprietary languages for each database they wanted to connect to. Now, ODBC has made the

choice of the database system almost irrelevant from a coding perspective, which is as it should

be. Application developers have much more important things to worry about than the syntax that

is needed to port their program from one database to another when business needs suddenly

change.

Through the ODBC Administrator in Control Panel, you can specify the particular

database that is associated with a data source that an ODBC application program is written to

use. Think of an ODBC data source as a door with a name on it. Each door will lead you to a

particular database. For example, the data source named Sales Figures might be a SQL Server

database, whereas the Accounts Payable data source could refer to an Access database. The

physical database referred to by a data source can reside anywhere on the LAN.

The ODBC system files are not installed on your system by Windows 95. Rather, they

are installed when you setup a separate database application, such as SQL Server Client or

Visual Basic 4.0. When the ODBC icon is installed in Control Panel, it uses a file called
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

ODBCINST.DLL. It is also possible to administer your ODBC data sources through a stand-

alone program called ODBCADM.EXE. There is a 16-bit and a 32-bit version of this program

and each maintains a separate list of ODBC data sources.

From a programming perspective, the beauty of ODBC is that the application can be

written to use the same set of function calls to interface with any data source, regardless of the

database vendor. The source code of the application doesn’t change whether it talks to Oracle or

SQL Server. We only mention these two as an example. There are ODBC drivers available for

several dozen popular database systems. Even Excel spreadsheets and plain text files can be

turned into data sources. The operating system uses the Registry information written by ODBC

Administrator to determine which low-level ODBC drivers are needed to talk to the data source

(such as the interface to Oracle or SQL Server). The loading of the ODBC drivers is transparent

to the ODBC application program. In a client/server environment, the ODBC API even handles

many of the network issues for the application programmer.

The advantages of this scheme are so numerous that you are probably thinking there must

be some catch. The only disadvantage of ODBC is that it isn’t as efficient as talking directly to

the native database interface. ODBC has had many detractors make the charge that it is too slow.

Microsoft has always claimed that the critical factor in performance is the quality of the driver

software that is used. In our humble opinion, this is true. The availability of good ODBC drivers

has improved a great deal recently. And anyway, the criticism about performance is somewhat

analogous to those who said that compilers would never match the speed of pure assembly

language. Maybe not, but the compiler (or ODBC) gives you the opportunity to write cleaner

programs, which means you finish sooner. Meanwhile, computers get faster every year.
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

JDBC

In an effort to set an independent database standard API for Java; Sun Microsystems

developed Java Database Connectivity, or JDBC. JDBC offers a generic SQL database access

mechanism that provides a consistent interface to a variety of RDBMSs. This consistent interface

is achieved through the use of “plug-in” database connectivity modules, or drivers. If a database

vendor wishes to have JDBC support, he or she must provide the driver for each platform that the

database and Java run on.

To gain a wider acceptance of JDBC, Sun based JDBC’s framework on ODBC. As you

discovered earlier in this chapter, ODBC has widespread support on a variety of platforms.

Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market much faster than

developing a completely new connectivity solution.

JDBC was announced in March of 1996. It was released for a 90 day public review that

ended June 8, 1996. Because of user input, the final JDBC v1.0 specification was released soon

after.

The remainder of this section will cover enough information about JDBC for you to know what it

is about and how to use it effectively. This is by no means a complete overview of JDBC. That

would fill an entire book.

JDBC Goals

Few software packages are designed without goals in mind. JDBC is one that, because of

its many goals, drove the development of the API. These goals, in conjunction with early
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

reviewer feedback, have finalized the JDBC class library into a solid framework for building

database applications in Java.

The goals that were set for JDBC are important. They will give you some insight as to why

certain classes and functionalities behave the way they do. The eight design goals for JDBC are

as follows:

1. SQL Level API

The designers felt that their main goal was to define a SQL interface for Java. Although

not the lowest database interface level possible, it is at a low enough level for higher-level

tools and APIs to be created. Conversely, it is at a high enough level for application

programmers to use it confidently. Attaining this goal allows for future tool vendors to

“generate” JDBC code and to hide many of JDBC’s complexities from the end user.

2. SQL Conformance

SQL syntax varies as you move from database vendor to database vendor. In an effort to

support a wide variety of vendors, JDBC will allow any query statement to be passed through

it to the underlying database driver. This allows the connectivity module to handle non-

standard functionality in a manner that is suitable for its users.

3. JDBC must be implemental on top of common database interfaces

The JDBC SQL API must “sit” on top of other common SQL level APIs. This goal

allows JDBC to use existing ODBC level drivers by the use of a software interface. This

interface would translate JDBC calls to ODBC and vice versa.

4. Provide a Java interface that is consistent with the rest of the Java system
Dynamic Control of Coding for
Progressive Packet Arrivals in DTNs

Because of Java’s acceptance in the user community thus far, the designers feel that they

should not stray from the current design of the core Java system.

5. Keep it simple

This goal probably appears in all software design goal listings. JDBC is no exception.

Sun felt that the design of JDBC should be very simple, allowing for only one method of

completing a task per mechanism. Allowing duplicate functionality only serves to confuse

the users of the API.

6. Use strong, static typing wherever possible

Strong typing allows for more error checking to be done at compile time; also, less error

appear at runtime.

7. Keep the common cases simple

Because more often than not, the usual SQL calls used by the programmer are simple

SELECT’s, INSERT’s, DELETE’s and UPDATE’s, these queries should be simple to

perform with JDBC. However, more complex SQL statements should also be possible.

Das könnte Ihnen auch gefallen