• Tidak ada hasil yang ditemukan

BAB V KESIMPULAN DAN SARAN

5.2 Saran

Protocol Epidemic juga memiliki kebutuhan energi yang lebih besar. Lebih baik diadakan pengujian antara protocol Epidemic dengan konsep Energy Aware agar protocol Epidemic juga tidak terlalu boros akan penggunaan energi. Bisa dilihat bagaimana performa protocol Epidemic yang memiliki Energy Aware dibandingkan dengan yang biasa.

47

Daftar Pustaka

[1] Dr. Mazlan Abbas. Trends and Challenges in Delay Tolerant Network (DTN) or Mobile Opportunistic Network (OppNet), UTHM 2 April 2014. [2] A. Keranen, J. Ott, T. Karkkainen, “The ONE Simulator for DTN Protocol

Evaluation”, SIMUTools 2009, Rome, Italy, 2009.

[3] S.Jain, K.Fall, R.Patra. (2004). Routing in a Delay Tolerant Network. in Proc. of ACM SIGCOMM, Portland, OR pp.145-157.

[4] Patel.B., Dave.K., Pandya.V., “Spray And Wait Routing Protocol in Delay Tolerant Network” International Journal of Enggineering Technology and Advanced Engineering (IJETAE) ISSN: 225002459, ISO 9001:2008 Certified Journal, Vol.4 Issue 5, May 2004)

[5] Scott, J., Gass, R., Crowcroft, J., P., Diot., Chaintreau A., CRAWDAD dataset Cambridge/haggle (v. 2009 – 05 -29)

[6] Cabacas, R. A., Nakamura, H.& Ra, I-H., “Energy Consumption Analysis of Delay Tolerant Network Routing Protocols,” International Journal of Software Engineering and Its Applications, vol. 8 no.2, pp. 1-10,2010.

[7] T. Spyropoulos, K. Psounis, C.S. Raghavendra, “Spray and Wait: An Efficient Routing Scheme for Intermittenly Connected Mobile Networks”, IEEE ACM SIGCOMM Workshops on Delay-Tolerant Networking 2007. White Plains, New York, March 2007.

[8] Schiller, J., “Mobile Communication”, Great Britain: Biddles, 2003.

[9] H.Huang, Zhang.Z, Zhou.W, “Spray And Wait Routing Based on Position Prediction in Opportunistic Networks,” Department of Electrical Engineering and Informartion Science, University of Science and Technology of China. Hefei, China. ISBN: 978-1-61284-840-2, IEEE2011

48 LAMPIRAN

1. Default Setting Random Waypoint

Scenario.name = %epidemicRWP_node% Scenario.simulateConnections = true Scenario.updateInterval = 0.1 Scenario.endTime = 950400 btInterface.type = SimpleBroadcastInterface btInterface.transmitSpeed = 250k btInterface.transmitRange = 10 Scenario.nrofHostGroups = 1 highspeedInterface.type = SimpleBroadcastInterface highspeedInterface.transmitSpeed = 10M highspeedInterface.transmitRange = 10 Group.movementModel = RandomWaypoint Group.router = EpidemicRouter Group.bufferSize = 64M Group.waitTime = 0, 120 Group.nrofInterfaces = 1 Group.interface1 = btInterface Group.speed = 0, 2.5 Group.msgTtl = 1440 Group.initialEnergy = 44000 Group.scanEnergy = 0.05 Group.transmitEnergy = 2 Group.scanResponseEnergy = 0.05 Group.nrofHosts = [25; 50; 75; 100; 125] Group1.groupID = p Events.nrof = 1 Events1.class = MessageEventGenerator Events1.interval = 900, 920 Events1.size = 500k, 1M Events1.hosts = 0,24 Events1.prefix = M MovementModel.rngSeed = [56421; 51481;511401; 511411;544444] MovemetModel.worldSize = 2500, 2500 MovementModel.warmup = 1000

49 Report.nrofReports = 2 Report.warmup = 0 Report.reportDir = [newf/epiRWP/NODE/25; newf/epiRWP/NODE/50; newf/epiRWP/NODE/75; newf/epiRWP/NODE/100; newf/epiRWP/NODE/125] Report.report1 = EnergyEvolution Report.report2 = MessageStatsReport SprayAndWaitRouter.nrofCopies = 5 SprayAndWaitRouter.binaryMode = true 2. Default Setting Real Human Trace

Scenario.name = %L_Source% Scenario.simulateConnections = false Scenario.updateInterval = 0.1 Scenario.endTime = 950400 btInterface.type = SimpleBroadcastInterface btInterface.transmitSpeed = 250k btInterface.transmitRange = 10 Scenario.nrofHostGroups = 1 Group.movementModel = StationaryMovement Group.nodeLocation = 0,1 Group.router = SprayAndWaitRouter Group.bufferSize = 64M Group.waitTime = 0, 120 Group.nrofInterfaces = 1 Group.interface1 = btInterface Group.speed = 0, 2.5 Group.msgTtl = 1440 Group.groupID = n Group.nrofHosts = 36 Group.initialEnergy = 44000 Group.scanEnergy = 0.05 Group.transmitEnergy = 2 Group.scanResponseEnergy = 0.05 Events.nrof = 2 Events1.class = StandardEventReader Events1.filePath = Haggle4-Cam-Imote.csv Events2.class = MessageEventGenerator Events2.interval = 900, 920 Events2.size = 500k,1M Events2.hosts = 1,1 Events2.tohosts = 35,35 Events2.prefix = M MovementModel.rngSeed = [1 ; 2; 3; 4; 5] MovementModel.worldSize = 1000, 1000 MovementModel.warmup = 1000 Report.nrofReports = 2

50 Report.warmup = 0 Report.reportDir = [TTLBaru/sourceRHT/L/5; TTLBaru/sourceRHT/L/7; TTLBaru/sourceRHT/L/9; TTLBaru/sourceRHT/L/11; TTLBaru/sourceRHT/L/13] Report.report1 = MessageStatsReport Report.report2 = EnergyEvolution #ProphetRouter.secondsInTimeUnit = 30 SprayAndWaitRouter.nrofCopies = [5;7;9;11;13] SprayAndWaitRouter.binaryMode = false 3. Epidemic Routing /*

* Copyright 2010 Aalto University, ComNet

* Released under GPLv3. See LICENSE.txt for details. */

package routing; import core.Settings; /**

* Epidemic message router with drop-oldest buffer and only single transferring

* connections at a time. */

public class EpidemicRouter extends ActiveRouter { /**

* Constructor. Creates a new message router based on the settings in

* the given Settings object. * @param s The settings object */

public EpidemicRouter(Settings s) { super(s);

//TODO: read&use epidemic router specific settings (if any)

} /**

* Copy constructor.

* @param r The router prototype where setting values are copied from

*/

protected EpidemicRouter(EpidemicRouter r) { super(r);

//TODO: copy epidemic settings here (if any)

51 @Override

public void update() { super.update();

if (isTransferring() || !canStartTransfer()) {

return; // transferring, don't try other connections yet

}

// Try first the messages that can be delivered to final recipient

if (exchangeDeliverableMessages() != null) {

return; // started a transfer, don't try others (yet)

}

// then try any/all message to any/all connection

this.tryAllMessagesToAllConnections(); }

@Override

public EpidemicRouter replicate() { return new EpidemicRouter(this); }

}

4. Spray And Wait Routing /*

* Copyright 2010 Aalto University, ComNet

* Released under GPLv3. See LICENSE.txt for details. */ package routing; import java.util.ArrayList; import java.util.List; import core.Connection; import core.DTNHost; import core.Message; import core.Settings; /**

* Implementation of Spray and wait router as depicted in

* <I>Spray and Wait: An Efficient Routing Scheme for Intermittently

52

* Connected Mobile Networks</I> by Thrasyvoulos Spyropoulus et al.

* */

public class SprayAndWaitRouter extends ActiveRouter { /** identifier for the initial number of copies setting ({@value})*/

public static final String NROF_COPIES = "nrofCopies";

/** identifier for the binary-mode setting ({@value})*/

public static final String BINARY_MODE = "binaryMode";

/** SprayAndWait router's settings name space ({@value})*/

public static final String SPRAYANDWAIT_NS = "SprayAndWaitRouter";

/** Message property key */

public static final String MSG_COUNT_PROPERTY = SPRAYANDWAIT_NS + "." +

"copies";

protected int initialNrofCopies; protected boolean isBinary;

public SprayAndWaitRouter(Settings s) { super(s);

Settings snwSettings = new Settings(SPRAYANDWAIT_NS); initialNrofCopies = snwSettings.getInt(NROF_COPIES); isBinary = snwSettings.getBoolean( BINARY_MODE); } /** * Copy constructor.

* @param r The router prototype where setting values are copied from

*/ protected SprayAndWaitRouter(SprayAndWaitRouter r) { super(r); this.initialNrofCopies = r.initialNrofCopies; this.isBinary = r.isBinary; } @Override

53

public int receiveMessage(Message m, DTNHost from) {

return super.receiveMessage(m, from); }

@Override

public Message messageTransferred(String id, DTNHost from) {

Message msg = super.messageTransferred(id, from);

Integer nrofCopies =

(Integer)msg.getProperty(MSG_COUNT_PROPERTY); assert nrofCopies != null : "Not a SnW message: " + msg;

if (isBinary) {

/* in binary S'n'W the receiving node gets ceil(n/2) copies */

nrofCopies = (int)Math.ceil(nrofCopies/2.0);

} else {

/* in standard S'n'W the receiving node gets only single copy */

nrofCopies = 1; } msg.updateProperty(MSG_COUNT_PROPERTY, nrofCopies); return msg; } @Override

public boolean createNewMessage(Message msg) { makeRoomForNewMessage(msg.getSize()); msg.setTtl(this.msgTtl); msg.addProperty(MSG_COUNT_PROPERTY, new Integer(initialNrofCopies)); addToMessages(msg, true); return true; } @Override

public void update() { super.update();

if (!canStartTransfer() || isTransferring()) {

return; // nothing to transfer or is currently transferring

54 }

/* try messages that could be delivered to final recipient */

if (exchangeDeliverableMessages() != null) {

return; }

/* create a list of SAWMessages that have copies left to distribute */

@SuppressWarnings(value = "unchecked") List<Message> copiesLeft =

sortByQueueMode(getMessagesWithCopiesLeft()); if (copiesLeft.size() > 0) {

/* try to send those messages */ this.tryMessagesToConnections(copiesLeft, getConnections());

} }

/**

* Creates and returns a list of messages this router is currently

* carrying and still has copies left to distribute (nrof copies > 1).

* @return A list of messages that have copies left

*/

protected List<Message> getMessagesWithCopiesLeft() {

List<Message> list = new ArrayList<Message>();

for (Message m : getMessageCollection()) { Integer nrofCopies =

(Integer)m.getProperty(MSG_COUNT_PROPERTY);

assert nrofCopies != null : "SnW message " + m + " didn't have " +

"nrof copies property!"; if (nrofCopies > 1) { list.add(m); } } return list; } /**

55

* Called just before a transfer is finalized (by * {@link ActiveRouter#update()}).

* Reduces the number of copies we have left for a message.

* In binary Spray and Wait, sending host is left with floor(n/2) copies,

* but in standard mode, nrof copies left is reduced by one.

*/

@Override

protected void transferDone(Connection con) { Integer nrofCopies;

String msgId = con.getMessage().getId(); /* get this router's copy of the message */ Message msg = getMessage(msgId);

if (msg == null) { // message has been dropped from the buffer after..

return; // ..start of transfer -> no need to reduce amount of copies

}

/* reduce the amount of copies left */ nrofCopies = (Integer)msg.getProperty(MSG_COUNT_PROPERTY); if (isBinary) { nrofCopies /= 2; } else { nrofCopies--; } msg.updateProperty(MSG_COUNT_PROPERTY, nrofCopies); } @Override

public SprayAndWaitRouter replicate() { return new SprayAndWaitRouter(this); }

Dokumen terkait