Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

# Simulation report files
*reports*/*.txt
reports/
scenarios/
tmp_configs/

# Local experiment scripts
*.bat
*.py

# Javadocs
*.html
Expand Down
34 changes: 34 additions & 0 deletions src/core/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.Map;
import java.util.Set;

import routing.podc.ProofEntry;

/**
* A message that is created at a node or passed between nodes.
*/
Expand Down Expand Up @@ -49,6 +51,9 @@ public class Message implements Comparable<Message> {
/** Application ID of the application that created the message */
private String appID;

/** Proof-of-delivery chain appended at each forward hop (PoDC Phase 1). */
private List<ProofEntry> routeProof;

static {
reset();
DTNSim.registerForReset(Message.class.getCanonicalName());
Expand Down Expand Up @@ -77,6 +82,7 @@ public Message(DTNHost from, DTNHost to, String id, int size) {
this.requestMsg = null;
this.properties = null;
this.appID = null;
this.routeProof = new ArrayList<ProofEntry>();

Message.nextUniqueId++;
addNodeOnPath(from);
Expand Down Expand Up @@ -269,6 +275,10 @@ protected void copyFrom(Message m) {
updateProperty(key, m.getProperty(key));
}
}

this.routeProof = m.routeProof != null
? new ArrayList<ProofEntry>(m.routeProof)
: new ArrayList<ProofEntry>();
}

/**
Expand Down Expand Up @@ -360,4 +370,28 @@ public void setAppID(String appID) {
this.appID = appID;
}

/** Appends a proof entry to this message's delivery chain. */
public void addProof(ProofEntry entry) {
this.routeProof.add(entry);
}

/** Returns the live list of proof entries (source → receiver order). */
public List<ProofEntry> getRouteProof() {
return this.routeProof;
}

/** Number of proof entries currently in the chain. */
public int getProofLength() {
return this.routeProof.size();
}

/**
* Rough byte cost of the proof chain (for overhead metrics).
* Each entry: 64-byte Ed25519 signature + 44-byte X.509 public key
* + ~20 bytes (nodeId, timestamp, prevHash overhead) ≈ 128 bytes.
*/
public int getProofSizeEstimate() {
return this.routeProof.size() * 128;
}

}
Loading