Total members 11895 |It is currently Sun Dec 22, 2024 9:19 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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




Author:
Newbie
User avatar Posts: 3
Have thanks: 0 time

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);
}
}
}


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

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


Author:
Newbie
User avatar Posts: 3
Have thanks: 0 time
Post new topic Reply to topic  [ 3 posts ] 

  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     -  
 Algorithms code in java     -  
 java code for chat     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com