High-performance network packet capture and analysis for Java.
jNetPcap — libpcap bindings with protocol dissection:
<dependency>
<groupId>com.slytechs.sdk</groupId>
<artifactId>jnetpcap-sdk</artifactId>
<version>3.0.0</version>
</dependency>jNetWorks — 800Gbps capture with Napatech/DPDK backends:
<dependency>
<groupId>com.slytechs.sdk</groupId>
<artifactId>jnetworks-sdk</artifactId>
<version>3.0.0</version>
</dependency>| SDK | Purpose | Backends |
|---|---|---|
| jnetpcap-sdk | Packet capture, protocol dissection, transmission | libpcap |
| jnetworks-sdk | High-performance capture at scale | libpcap, DPDK, Napatech, AF_XDP |
Both SDKs share the same protocol stack and deliver processed packets — reassembled, decrypted, ready for analysis.
void main() throws PcapException {
// Allocate headers ONCE outside hot path
Ip4 ip4 = new Ip4();
Tcp tcp = new Tcp();
try (var pcap = NetPcap.openOffline("capture.pcap")) {
pcap.dispatch(Pcap.LOOP_INFINITE, packet -> {
// hasHeader() checks presence AND binds header
if (packet.hasHeader(ip4) && packet.hasHeader(tcp)) {
System.out.printf("%s:%d -> %s:%d%n",
ip4.src(), tcp.srcPort(),
ip4.dst(), tcp.dstPort());
}
});
}
}void main() throws PcapException {
Ip4 ip4 = new Ip4();
Tcp tcp = new Tcp();
try (var pcap = NetPcap.openLive("eth0")) {
pcap.setFilter("tcp port 443");
pcap.dispatch(1000, packet -> {
if (packet.hasHeader(ip4) && packet.hasHeader(tcp)) {
System.out.printf("TLS: %s:%d -> %s:%d%n",
ip4.src(), tcp.srcPort(),
ip4.dst(), tcp.dstPort());
}
});
}
}java --enable-native-access=com.slytechs.jnet.jnetpcap -jar myapp.jarAll modules share version 3.0.0 under com.slytechs.sdk:
| Module | Purpose |
|---|---|
sdk-common |
Memory management, buffers, utilities |
sdk-protocol-core |
Protocol dissection framework |
sdk-bom |
Version alignment (advanced users) |
| Module | Protocols |
|---|---|
sdk-protocol-tcpip |
Ethernet, IPv4/6, TCP, UDP, VLAN, MPLS, IPsec |
sdk-protocol-web |
HTTP, TLS, DNS, QUIC, WebSocket |
sdk-protocol-infra |
BGP, OSPF, STP, VRRP, LACP, LLDP |
| Module | Purpose |
|---|---|
jnetpcap-sdk |
Starter — pulls all jNetPcap dependencies |
jnetpcap-api |
High-level capture and analysis API |
jnetpcap-bindings |
Low-level libpcap FFM bindings |
| Module | Purpose |
|---|---|
jnetworks-sdk |
Starter — pulls all public jNetWorks dependencies |
jnetworks-api |
High-performance capture API |
jnetworks-pcap |
libpcap backend for jNetWorks |
Enterprise backends for high-speed capture available at maven.slytechs.com:
| Module | Hardware | Performance |
|---|---|---|
jnetworks-dpdk |
Intel DPDK | 400Gbps+ |
jnetworks-ntapi |
Napatech SmartNIC | 800Gbps |
jnetworks-afxdp |
Linux AF_XDP | 100Gbps+ |
<repository>
<id>slytechs</id>
<url>https://maven.slytechs.com/repository/maven-releases/</url>
</repository>| Platform | Library | Installation |
|---|---|---|
| Linux | libpcap | apt install libpcap-dev |
| macOS | libpcap | Pre-installed |
| Windows | Npcap | npcap.com |
- jnetpcap-sdk — Getting started, examples
- jnetpcap-api — Full API documentation
- Examples — Sample code
Apache 2.0 (Free)
- All modules on Maven Central
- Full protocol dissection
- IP fragment reassembly
- TCP stream reconstruction
- No limits
Commercial
- TLS/IPsec decryption
- Premium backends (DPDK, Napatech, AF_XDP)
- Priority support
Contact: [email protected]
| Channel | Use |
|---|---|
| Discussions | Questions, community help |
| Issues | Bug reports, feature requests |
| [email protected] | Commercial licensing |
High-performance network capture and analysis tools for Java. Our SDKs power security operations, network monitoring, and packet analysis at enterprise scale.
From the creator of jNetPcap (1M+ downloads)
Website: slytechs.com