SCION Java examples
July 13, 2026 ยท View on GitHub
Send packet example
This is a simple example project that uses JPAN to send a packet to the SCION packet inspector.
To try out the example please download the stand-alone jar file through one of these options:
- download link to release section
wget https://github.com/netsec-ethz/scion-java-packet-example/releases/download/v0.5.0/packet-example-0.5.0.jar
Then execute it (requires Java 1.8 or later):
java -jar packet-example-0.5.0.jar
You can also send a custom message string with
java -jar packet-example-0.5.0.jar "A better message"
The message can be seen in the hex dump at the bottom of the SCION packet inspector page.
Other examples
The project contains other examples, but they do not come with an executable jar file:
Building your own executable jar
You can build your own executable jar file with
mvn clean package -Pcreate-executable-example
This creates a file packet-example-0.5.1-SNAPSHOT.jar in target/.
(Note, the scion-... jar file is not executable)
Troubleshooting
No DNS search domain found. Please check your /etc/resolv.conf or similar.
This happens, for example, on Windows when using a VPN. There are several solutions to this (aside from reconfiguring your system).
Solution #1: Provide search domain
This is useful if you have access to a search domain with a NAPTR record of the discovery server.
You can execute the jar with the following property (on example of a search domain is ethz.ch. but
it obviously works only when you are in that very domain):
java -Dorg.scion.dnsSearchDomains=<search domain> -jar packet-example-<version>.jar
Solution #2: Provide a discovery server
You can directly set the IP:port of the discovery server:
java -Dorg.scion.bootstrap.host=<IP of bootstrap server:8041> -jar packet-example-<version>.jar
Solution #3: Provide a topology file
If you have a topology file, you can do the following:
java -Dorg.scion.bootstrap.topoFile=<yourTopologyFile.json> -jar packet-example-<version>.jar