Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename project to "jpan" #43

Merged
merged 2 commits into from
Apr 17, 2024
Merged
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
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@



# SCION Java client
# JPAN - Java API for path aware networking with SCION

[![codecov](https://codecov.io/gh/netsec-ethz/scion-java-client/graph/badge.svg?token=3U8J50E4N5)](https://codecov.io/gh/netsec-ethz/scion-java-client)

Expand All @@ -11,7 +11,7 @@ It provides functionality similar to
[PAN (Go)](https://pkg.go.dev/github.com/netsec-ethz/scion-apps/pkg/pan) and
[scion-rs (Rust)](https://github.com/MystenLabs/scion-rs).

The following artifact contains the complete SCION Java client:
The following artifact contains the complete SCION Java implementation:
```xml
<dependency>
<groupId>org.scion</groupId>
Expand All @@ -30,15 +30,15 @@ The following artifact contains the complete SCION Java client:
- Many more

### WARNING
This client can directly connect to SCION **without dispatcher**.
JPAN can directly connect to SCION **without dispatcher**.

Currently (January 2024), the SCION system uses a "dispatcher" (a process that runs on endhosts,
listens on a fixed port (30041) and forwards any incoming SCION packets, after stripping the SCION
header, to local application).

This Java client cannot be used with a dispatcher.
The Java client can be used in one of the following ways:
- You can use the client stand-alone (without local SCION installation),
JPAN cannot be used with a dispatcher.
JPAN can be used in one of the following ways:
- You can use JPAN stand-alone (without local SCION installation),
however it must listen on port 30041 for incoming SCION packets because
SCION routers currently will forward data only to that port.
- If you need a local SCION installation (Go implementation),
Expand Down Expand Up @@ -113,10 +113,9 @@ try (DatagramChannel channel = DatagramChannel.open()) {

### Local installation

If you want to work on the SCION Java library or simply browse the code locally, you can
install it locally.
If you want to work on JPAN or simply browse the code locally, you can install it locally.

The SCION Java client is implemented as a
JPAN is available as a
[Maven artifact](https://central.sonatype.com/artifact/org.scion/scion-java-client).
Many IDEs comes with maven plugins. If you want to use Maven from the command line, you
can install it with `sudo apt install maven` (Ubuntu etc) or download it
Expand All @@ -133,10 +132,10 @@ mvn clean install

Some demos can be found in [src/test/java/org/scion/demo](src/test/java/org/scion/demo).

- `DatagramChannel` ping pong [client](src/test/java/org/scion/demo/PingPongChannelClient.java)
and [server](src/test/java/org/scion/demo/PingPongChannelServer.java)
- [SCMP echo](src/test/java/org/scion/demo/ScmpEchoDemo.java)
- [SCMP traceroute](src/test/java/org/scion/demo/ScmpTracerouteDemo.java)
- `DatagramChannel` ping pong [client](src/test/java/org/scion/jpan/demo/PingPongChannelClient.java)
and [server](src/test/java/org/scion/jpan/demo/PingPongChannelServer.java)
- [SCMP echo](src/test/java/org/scion/jpan/demo/ScmpEchoDemo.java)
- [SCMP traceroute](src/test/java/org/scion/jpan/demo/ScmpTracerouteDemo.java)


### General documentation
Expand Down Expand Up @@ -248,7 +247,7 @@ The following standard options are **not** supported:
## Configuration

### Bootstrapping / daemon
The SCION Java client can be used with a local daemon or in standalone mode (without daemon).
JPAN can be used with a local daemon or in standalone mode (without daemon).
The daemon is available if you have a [local installation of SCION](https://docs.scion.org/en/latest/dev/run.html).
Standalone mode will directly connect to a topology server and control server, in a properly
configured AS this should all happen automatically.
Expand Down Expand Up @@ -276,7 +275,7 @@ while the other options are skipped if no property or environment variable is de
| Bootstrap DNS NAPTR entry host name | `org.scion.test.useOsSearchDomains` | `SCION_USE_OS_SEARCH_DOMAINS` | true |

### DNS
The SCION Java client will check the OS default DNS server to resolve SCION addresses.
JPAN will check the OS default DNS server to resolve SCION addresses.
In addition, addresses can be specified in a `/etc/scion/hosts` file. The location of the hosts file
is configurable, see next section.

Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle/checkstyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport">
<property name="excludes" value="java.io,java.util,java.net,io.grpc,org.junit.jupiter.api.Assertions,org.scion.internal.ByteUtil,org.scion,org.scion.demo.inspector.ByteUtil,org.xbill.DNS"/>
<property name="excludes" value="java.io,java.util,java.net,io.grpc,org.junit.jupiter.api.Assertions,org.scion.jpan.internal,org.scion.jpan,org.scion.jpan.demo.inspector.ByteUtil,org.xbill.DNS"/>
<!-- <property name="severity" value="warning" />-->
</module>
<module name="NeedBraces"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.scion</groupId>
<artifactId>client</artifactId>
<artifactId>jpan</artifactId>
<version>0.1.1-ALPHA-SNAPSHOT</version>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.Closeable;
import java.io.IOException;
Expand All @@ -26,10 +26,10 @@
import java.util.Objects;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
import org.scion.internal.ExtensionHeader;
import org.scion.internal.InternalConstants;
import org.scion.internal.ScionHeaderParser;
import org.scion.internal.ScmpParser;
import org.scion.jpan.internal.ExtensionHeader;
import org.scion.jpan.internal.InternalConstants;
import org.scion.jpan.internal.ScionHeaderParser;
import org.scion.jpan.internal.ScmpParser;

abstract class AbstractDatagramChannel<C extends AbstractDatagramChannel<?>> implements Closeable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

public final class Constants {
public static final String PROPERTY_DAEMON = "org.scion.daemon";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.Closeable;
import java.io.IOException;
Expand All @@ -21,8 +21,8 @@
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.channels.NotYetConnectedException;
import org.scion.internal.InternalConstants;
import org.scion.internal.ScionHeaderParser;
import org.scion.jpan.internal.InternalConstants;
import org.scion.jpan.internal.ScionHeaderParser;

public class DatagramChannel extends AbstractDatagramChannel<DatagramChannel>
implements ByteChannel, Closeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion.internal;
package org.scion.jpan;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.net.*;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.UncheckedIOException;
import java.net.InetAddress;
Expand All @@ -21,7 +21,7 @@
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.scion.proto.daemon.Daemon;
import org.scion.jpan.proto.daemon.Daemon;

/**
* A RequestPath is a Path with additional meta information such as bandwidth, latency or geo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.net.InetSocketAddress;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.Closeable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.net.InetAddress;
import java.net.UnknownHostException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

public class ScionRuntimeException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;

import static org.scion.Constants.DEFAULT_DAEMON;
import static org.scion.Constants.DEFAULT_USE_OS_SEARCH_DOMAINS;
import static org.scion.Constants.ENV_BOOTSTRAP_HOST;
import static org.scion.Constants.ENV_BOOTSTRAP_NAPTR_NAME;
import static org.scion.Constants.ENV_BOOTSTRAP_TOPO_FILE;
import static org.scion.Constants.ENV_DAEMON;
import static org.scion.Constants.ENV_USE_OS_SEARCH_DOMAINS;
import static org.scion.Constants.PROPERTY_BOOTSTRAP_HOST;
import static org.scion.Constants.PROPERTY_BOOTSTRAP_NAPTR_NAME;
import static org.scion.Constants.PROPERTY_BOOTSTRAP_TOPO_FILE;
import static org.scion.Constants.PROPERTY_DAEMON;
import static org.scion.Constants.PROPERTY_USE_OS_SEARCH_DOMAINS;
package org.scion.jpan;

import static org.scion.jpan.Constants.DEFAULT_DAEMON;
import static org.scion.jpan.Constants.DEFAULT_USE_OS_SEARCH_DOMAINS;
import static org.scion.jpan.Constants.ENV_BOOTSTRAP_HOST;
import static org.scion.jpan.Constants.ENV_BOOTSTRAP_NAPTR_NAME;
import static org.scion.jpan.Constants.ENV_BOOTSTRAP_TOPO_FILE;
import static org.scion.jpan.Constants.ENV_DAEMON;
import static org.scion.jpan.Constants.ENV_USE_OS_SEARCH_DOMAINS;
import static org.scion.jpan.Constants.PROPERTY_BOOTSTRAP_HOST;
import static org.scion.jpan.Constants.PROPERTY_BOOTSTRAP_NAPTR_NAME;
import static org.scion.jpan.Constants.PROPERTY_BOOTSTRAP_TOPO_FILE;
import static org.scion.jpan.Constants.PROPERTY_DAEMON;
import static org.scion.jpan.Constants.PROPERTY_USE_OS_SEARCH_DOMAINS;

import io.grpc.*;
import java.io.IOException;
Expand All @@ -36,13 +36,13 @@
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import org.scion.internal.DNSHelper;
import org.scion.internal.HostsFileParser;
import org.scion.internal.ScionBootstrapper;
import org.scion.internal.Segments;
import org.scion.proto.control_plane.SegmentLookupServiceGrpc;
import org.scion.proto.daemon.Daemon;
import org.scion.proto.daemon.DaemonServiceGrpc;
import org.scion.jpan.internal.DNSHelper;
import org.scion.jpan.internal.HostsFileParser;
import org.scion.jpan.internal.ScionBootstrapper;
import org.scion.jpan.internal.Segments;
import org.scion.jpan.proto.control_plane.SegmentLookupServiceGrpc;
import org.scion.jpan.proto.daemon.Daemon;
import org.scion.jpan.proto.daemon.DaemonServiceGrpc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.net.SocketOption;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

/** Scion utility functions. */
public class ScionUtil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.IOException;
import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion;
package org.scion.jpan;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand All @@ -26,10 +26,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.function.Consumer;
import org.scion.internal.InternalConstants;
import org.scion.internal.PathHeaderParser;
import org.scion.internal.ScionHeaderParser;
import org.scion.internal.ScmpParser;
import org.scion.jpan.internal.InternalConstants;
import org.scion.jpan.internal.PathHeaderParser;
import org.scion.jpan.internal.ScionHeaderParser;
import org.scion.jpan.internal.ScmpParser;

public class ScmpChannel implements AutoCloseable {
private int timeOutMs = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion.internal;
package org.scion.jpan.internal;

public class ByteUtil {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion.internal;
package org.scion.jpan.internal;

import java.io.IOException;
import java.net.InetAddress;
import java.util.function.Function;
import org.scion.ScionRuntimeException;
import org.scion.jpan.ScionRuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xbill.DNS.AAAARecord;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package org.scion.internal;
package org.scion.jpan.internal;

import java.nio.ByteBuffer;

Expand Down
Loading