Welcome to Sly Technologies main repository! If you are interested in creating network applications, we have many of the tools you will need to quickly develop your products or complete projects on time. Incorporating our tried and tested libraries into your production environments and applications can help save both time and money.
Our SDKs are organized into a hierarchical structure that promotes modularity and reuse:
- jnet-platform - Core runtime and support functionality used by all SDKs
- Base APIs and utilities
- Packet Language (JNPL) for filter expressions
- System tables and configuration
- Common data structures and protocols
- Thread and memory management
Java wrapper and API for libpcap with high-level protocol support:
- Native libpcap integration
- Packet capture and transmission
- Protocol header access
- Live and offline capture
- IP reassembly
- Protocol services
Extensive protocol support including:
- TCP/IP protocol family
- Web protocols (HTTP, TLS)
- Telecom protocols
- Database protocols
- Microsoft protocols
- Media protocols (Voice/Video)
High-performance multi-CPU packet processing:
- Multi-CPU packet distribution
- Hardware acceleration support
- Zero-copy architecture
- Advanced stream processing
- High-speed packet capture
- In-line packet forwarding
- Traffic shaping
Napatech SmartNIC integration:
- SmartNIC hardware acceleration
- High-speed packet processing
- Hardware-assisted filtering
- Advanced NIC features
Intel DPDK integration:
- DPDK packet processing
- High-performance networking
- Poll-mode drivers
- Memory management
First, add the dependencies:
<dependency>
<groupId>com.slytechs.jnet.jnetpcap</groupId>
<artifactId>jnetpcap-api</artifactId>
<version>${jnetpcap.version}</version>
</dependency>
<dependency>
<groupId>com.slytechs.jnet.protocol</groupId>
<artifactId>protocol-tcpip</artifactId>
<version>${protocol.version}</version>
</dependency>
Smallest possible example:
try (var pcap = NetPcap.openOffline("capture.pcap")) {
pcap.loop(System.out::println);
}
Advanced example with protocol handling:
try (var pcap = NetPcap.openOffline("capture.pcap")) {
// Initialize protocol headers once for reuse
final Ethernet ethernet = new Ethernet();
final Ip4 ip4 = new Ip4();
final Tcp tcp = new Tcp();
final Http http = new Http();
// Configure packet formatting
pcap.setPacketFormatter(new PacketFormat());
pcap.loop(packet -> {
// Headers bind to packet's native memory
if (packet.hasHeader(ethernet))
System.out.println(ethernet);
if (packet.hasHeader(ip4))
System.out.println(ip4);
if (packet.hasHeader(tcp))
System.out.println(tcp);
if (packet.hasHeader(http))
System.out.println(http);
});
}
<dependency>
<groupId>com.slytechs.jnet.jnetworks</groupId>
<artifactId>jnetworks-api</artifactId>
<version>${jnetworks.version}</version>
</dependency>
Multi-CPU capture example with multiple buffers and streams:
try (PcapFramework framework = new PcapFramework(PcapFramework.VERSION)) {
// Configure multi-port setup with streams and buffers
try (Config config = framework.createConfig()) {
// Enable multiple ports
config.getPortsConfig()
.enablePorts(PortIds.portSet(0, 1, 2, 3))
.disablePorts(PortIds.portRange(4, 2));
// Configure receive streams
var rxSettings = new StreamSettings()
.setRxBufferCount(4) // Multiple receive buffers
.setRxStreamCount(4); // Multiple stream processors
// Setup streams with hash-based distribution
int[] streamIds = config.getBufferConfig()
.setupRxStreams(rxSettings);
// Configure TCP filtering with hash distribution
config.getNetworkConfig()
.assignFilter("tcp")
.priority(20)
.ids(streamIds)
.hash(HashMode.HASH_5_TUPLE_SORTED);
}
// Start capture with multiple processing threads
try (NetTransceiver capture = framework.createTransceiver()) {
// Fork stream processors (4 worker threads)
capture.forkRxStreams(stream -> {
RxPacket packet = new RxPacket();
long totalSize = 0;
while (stream.isActive()) {
if (stream.get(packet, 100))
continue;
totalSize += packet.length();
stream.release(packet);
}
System.out.printf("Stream processed %d bytes%n", totalSize);
}, 4);
// Fork buffer processors (2 worker threads)
capture.forkRxBuffers(buffer -> {
RxSegment segment = buffer.newSegment();
long totalSize = 0;
while (buffer.isActive()) {
if (buffer.get(segment, 100) || segment.isEmpty())
continue;
totalSize += segment.byteSize();
buffer.release(segment);
}
System.out.printf("Buffer processed %d bytes%n", totalSize);
}, 2);
// Start capture and wait
capture.startCapture();
capture.awaitCaptureStart();
capture.awaitCaptureStop();
}
}
Our modules are licensed as follows:
- jnetpcap-wrapper: Licensed under Apache v2 License
- All other modules: Licensed under Sly Technologies Free License
- 5 free developer installations
- One-time distribution license fee
- No royalties
- Commercial support available (1 or 5 year terms)
We specialize in high-performance network packet capture and analysis solutions for Java. Our libraries are tried and tested in production environments, helping developers save time and money.
- Phone: 1-315-930-0939 (US NY)
- Email: [email protected]
- Address: 224 Harrison Street, Syracuse, NY 13202 - USA
- Website: www.slytechs.com (contact form available)