I'm currently doing my FYP project. My project is to create a secured network that does not allow me to access to internet. I've created a webpage with 4 DNS queries and i used JPCAP to capture the DNS packets. But i cant figure out why it took longer time to capture a webpage with 4 DNS queries and again its a secured network. It should be faster than internet right? below is the jpcap code. I really need a kind soul to help me here.

package dnstest3;

import java.io.*;
import java.net.InetAddress;
import jpcap.NetworkInterface;
import jpcap.JpcapCaptor;
import jpcap.packet.IPPacket;
import jpcap.packet.TCPPacket;
import jpcap.packet.UDPPacket;
import jpcap.packet.Packet;
import jpcap.NetworkInterfaceAddress;
import jpcap.JpcapWriter;
import jpcap.JpcapSender;
import jpcap.packet.EthernetPacket;
import jpcap.*;
import java.net.*;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class DnsTest3 {

* @param args the command line arguments
static {
java.security.Security.setProperty("networkaddress .cache.ttl" , "86400");

public static void main(String[] args) {

try {
//Obtain the list of network interfaces
NetworkInterface[] devices = JpcapCaptor.getDeviceList();

// set interface that you want to open.
int interfaceNo = 0; //default use Interface 0
int maxNoPkt = 40;

Packet pkt = new Packet();

//for each network interface
for (int i = 0; i < devices.length; i++) {

//print out its name and description
System.out.println(i+": "+ devices[i].name + "(" + devices[i].description+")");
// Select interface; save interface number into interfaceNo
System.out.println("Please select interface to capture packets.");

// Read the user input into the interfaceNo
DataInputStream ds = new DataInputStream(System.in);
interfaceNo = Integer.parseInt(ds.readLine());

//Open an interface with openDevice(NetworkInterface interface, int snaplen, boolean promics, int to_ms)
JpcapCaptor captor = JpcapCaptor.openDevice(devices[interfaceNo], 65535, false, 0);

//set a filter to only capture UDP port 53
captor.setFilter("udp", true);

if(devices[0]==null) {
System.out.println("No devices!!");
else {
System.out.println("At least 1 device!");

//open a URL connection with the url of "www.bindtest.com"
try {
Desktop desktop = java.awt.Desktop.getDesktop();
URI oURL = new URI("http://www.bindtest.com");
} catch (Exception e) {
//print out the stack trace

//capture i amount of packet
for(int i=0;i< maxNoPkt ;i++){
pkt = captor.getPacket();
UDPPacket p = (UDPPacket)pkt;
int destPort = p.dst_port;
if(destPort == 53){
String myData = new String(pkt.data);
//compare the query to see if it www.bindtest.com
String url1 = "wwwbindtestcom";
int url1Length = url1.length();
int myDataLength = myData.length();
myData = myData.substring((myDataLength - 5 - url1Length), (myDataLength - 5));
//System.out.println("\ni="+i + (InetAddress.getByName("dota2lounge.com")).getHost Address());
//pre-emptive DNS Query done here---------------------------------------------
//Capture dns queries for www.bindtest.com
i+= (maxNoPkt + 1) ; //Get out of for loop; end packet capturing
System.out.println("It works!");

//close the captor after capturing

catch (IOException e){
System.out.println("IO Exception");