Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Java Code for DTN routing protocol NECTAR for evalutaion

Thu Jan 03, 2013 11:35 pm

Hello,

I am working on a project where i have to evaluate a DTN routing protocol called NECTAR in "one simulator"..
I need a java code for routing package of NECTAR, Can anyone help me please! will be much appreciated :| ..
Thanks



Re: Java Code for DTN routing protocol NECTAR for evalutaion

Fri Jan 04, 2013 9:12 pm

Is these links help you
Code:
http://irg.cs.ohiou.edu/ocp/bundling.html
http://www.codeforge.com/article/142062


Anyway you will need to deal with sockets and streams :
Here is a code hints to connect to a router
java code
import java.io.*;
import java.net.*;

public class ConnectToRouter {

public static void main(String args[]) {
try {
// start a connection
Socket clientSocket1 = new Socket("hostname", 23);
System.out.println("Client1: " + clientSocket1);
// User defined Method

getPage(clientSocket1);
} catch (UnknownHostException uhe) {
System.out.println("UnknownHostException: " + uhe);
} catch (IOException ioe) {
System.err.println("IOException: " + ioe);
}
}

public static void getPage(Socket socketObj) {
try {
// Acquire the input and output streams
DataOutputStream dataOutBound = new DataOutputStream(
socketObj.getOutputStream());
BufferedReader dataInBound = new BufferedReader(
new InputStreamReader(socketObj.getInputStream()));
dataOutBound.writeBytes("login");
dataOutBound.writeBytes("\n");
// waits until its is the time to enter
try { Thread.sleep(5000); } catch (InterruptedException ie) { }
dataOutBound.writeBytes("password");


// wait for response...
String responseLine;
while ((responseLine = dataInBound.readLine()) != null) {
// Display each line to the console
System.out.println(responseLine);
}
// Clean up
dataOutBound.close();
dataInBound.close();
socketObj.close();
} catch (IOException ioe) {
System.out.println("IOException: " + ioe);
}
}
}


Re: Java Code for DTN routing protocol NECTAR for evalutaion

Tue Jan 08, 2013 9:06 pm

Thank you for your reply, but i am sorry to say that i dont need this code, code i need which i can run in one simulator for protocol evaluation. Can you find that sort of code for me please.

Regards

Post a reply
  Related Posts  to : Java Code for DTN routing protocol NECTAR for evalutaion
 Java code for DTN Protocol NECTAR evaluation-one simulator     -  
 Source Code for protocol     -  
 Parse URL in java get Protocol,File,Reference,Host and Port     -  
 protocol     -  
 TCP Transmission Control Protocol     -  
 User Datagram Protocol or UDP     -  
 VOIP Voice-Over-Internet Protocol     -  
 Client-Server-Data-datagram socket UDP protocol     -  
 GamePLay java code ( please help )     -  
 Algorithms code in java     -