pkts | Pure java based pcap library capable of reading and writing | Learning library

 by   aboutsip Java Version: Current License: MIT

kandi X-RAY | pkts Summary

kandi X-RAY | pkts Summary

pkts is a Java library typically used in Tutorial, Learning, Kafka applications. pkts has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. However pkts has 33 bugs. You can download it from GitHub, Maven. is a pure java library for reading and writing pcaps. It's primary purpose is to manipulate/analyze existing pcaps, allowing you to build various tools around pcaps. For full documentation, please see

            kandi-support Support

              pkts has a low active ecosystem.
              It has 150 star(s) with 75 fork(s). There are 16 watchers for this library.
              It had no major release in the last 6 months.
              There are 21 open issues and 19 have been closed. On average issues are closed in 131 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of pkts is current.

            kandi-Quality Quality

              pkts has 33 bugs (1 blocker, 2 critical, 17 major, 13 minor) and 966 code smells.

            kandi-Security Security

              pkts has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pkts code analysis shows 0 unresolved vulnerabilities.
              There are 89 security hotspots that need review.

            kandi-License License

              pkts is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pkts releases are not available. You will need to build from source code and install.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 25202 lines of code, 2895 functions and 269 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pkts and discovered the below as its top functions. This is intended to give you an instant insight into pkts implemented functionality, and help decide if they suit your requirements.
            • Create a copy of this instance
            • Gets the phone uri
            • Consumes an address - spec
            • Parse an IP address - address - link - address - name - value pair
            • Consumes a Via header
            • Expect the next SIP 2 byte to expect
            • Returns the number of bytes in the given buffer
            • Consumes a quoted - string
            • Get the raw IPv4 address
            • Serialize this URI to a given destination
            • Read line
            • Main entry point to the pcap
            • Reads the next header from the buffer
            • Read a number of bytes from the underlying stream
            • Creates a dummy header for this capture
            • Compares two TelURI objects
            • Runs the example program
            • Reads a number of bytes from the stream
            • Register a stream listener
            • Main entry point
            • Process header values
            • Consumes a sent - by message
            • Compares two SIP URIs
            • Builds a SIP message
            • Is SDP
            • Main method
            Get all kandi verified functions for this library.

            pkts Key Features

            No Key Features are available at this moment for pkts.

            pkts Examples and Code Snippets

            No Code Snippets are available at this moment for pkts.

            Community Discussions


            eBPF: 'bpf_map_update()' returns the 'invalid indirect read from stack' error
            Asked 2022-Mar-22 at 22:28

            I have an eBPF program with the following map definitions:



            Answered 2022-Mar-22 at 22:28

            The verifier complains because your code is trying to read uninitialised data from the stack, in particular in your variable val.

            If we look at your code:



            Fail to curl webserver on port 80 (using Nginx)
            Asked 2021-Dec-26 at 01:09

            I am unable to connect to my webserver on port 80 when not in localhost, on a debian 9 with nginx 1.14.2. I curl the IPv6 address with



            Answered 2021-Dec-26 at 01:09

            It appears I'm just a bit stupid and really not used to webserver configuration, I missed the configuration of my server, it fell on the default nginx server, which is sadly only listening on port 80 on IPv4. Just another dumb mistake, warm thanks for @Petros, who set me om the right tracks.



            Cannot use testpmd to send pkts to VM in qemu process though virtio
            Asked 2021-Nov-23 at 13:30

            I'm trying to test vhost-user/virtio-net. I used testpmd to send pkts (in txonly mode) to qemu VM. But all pkts were droped showed by testpmd. here is my environment:



            Answered 2021-Nov-23 at 13:30

            Looks like it has either DPDK or NUMA backed page issue. The same is working with DPDK version 19.11 LTS and 20.11 LTS.

            • DPDK application: rm /tmp/sock0; sudo ./build/l2fwd --legacy-mem -l 1-2 --no-pci --vdev=net_vhost0,iface=/tmp/sock0 --vdev=net_tap0 -m 1024 -- -p 3 -T 1 --no-mac-updating

            • QEMU: taskset -c 4-9 qemu-system-x86_64 -cpu host -enable-kvm -m 1024 -smp 4,sockets=1,cores=4,threads=1 \ -object memory-backend-file,id=mem,size=1024M,mem-path=/mnt/huge,share=on \ -numa node,memdev=mem,nodeid=0 -mem-prealloc \ -name test \ -no-reboot \ -vnc none \ -nographic \ -net user,hostfwd=tcp::10023-:22 -net nic \ -chardev socket,id=charnet0,path=/tmp/sock0 \ -netdev type=vhost-user,chardev=charnet0,queues=1,id=hostnet0 \ -device virtio-net-pci,mq=on,vectors=18,netdev=hostnet0,id=net0,mac=fa:16:3e:52:30:73 \ -hda [disk name]

            Once the VM is booted, you can login via ssh port 10023.



            How to modify scapy packet payload
            Asked 2021-Oct-28 at 11:34

            I have a python file that declares sets of packets to be sent through a system that modifies the payload and sends them back. A script imports the packets from the python file, sends and receives them and needs to be able to predict what the modified packets will look like when they come back.

            My question is, how can I produce packets with modified payload from the list of packets read from the file?

            The input file defines packets with variable length headers, something like:



            Answered 2021-Oct-28 at 11:34

            You can use load in order to access Raw bytes:



            Running F-stack DPDK executable - Unsupported Rx multi queue mode 1
            Asked 2021-Oct-16 at 19:38

            I have a C++ program which does lots of stuff, but most importantly it is setup to use F-Stack, which is built on DPDK:



            Answered 2021-Sep-09 at 13:08

            The reason for the error is because of the check for virtio PMD in function virtio_dev_configure file [dpdk root folder]drivers/net/virtio/virtio_ethdev.c. This can be due to the current Fstack enables RSS for better flow distribution over its port-queue pair.

            There 2 possible solution to fix the problem is to

            1. find the configuration parameter in f-stack.conf to disable RSS or
            2. change the FSTACK port configuration logic not to use RSS (by editing code).

            File: lib/ff_dpdk_if.c edit: line 627 from port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS; to port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE; and rebuild the fstack

            Note: if you use physical NIC RSS is supported in most of cases. hence there will be no error there.



            pktgen cannot send packet in ovs dpdk scenario
            Asked 2021-Sep-24 at 02:53

            The test setup is: pktgen send packet to vhost-user1 port, then ovs forward it vhost-user2, then testpmd received it from vhost-user2.

            The problem is: pktgen can not send any packets, testpmd received no packet also, I don't know what's the problem. Needs some help, thanks in advance!



            Answered 2021-Sep-24 at 02:53

            If the goal is to have packet transfer between Pktgen and testpmd that is connected by OVS-DPDK one has to use net_vhost and virtio_user pair.



            DPDK 20.11 - IPv4 Fragmentation - indirect pool gets exhausted
            Asked 2021-Jul-20 at 02:55

            I m trying to fragmentation an IPv4 packet using the below logic:



            Answered 2021-Jul-20 at 02:55

            DPDK API rte_ipv4_fragment_packet is used under both testpmd and DPDK example ip_fragementation. These are also included under the DPDK test suite which is run for each release too.

            Based on the internal test and proper use of API for example Ip_fragementation the issue is not been able to reproduce. Hence the API leaking memory pool buffers are highly unlikely other than some special corner case (which is yet to be found).

            Based on the code snippet analysis following could be the cause of mempool exhaust

            1. fail to free direct buffer after fragmentation
            2. fail to free one or more fragments from the indirect buffer when tx_burst fails.

            [EDIT-1] based on the email update and comments, there is indeed no problem with DPDK API rte_ipv4_fragment_packet. The issue is from Application logic, with new behaviour as

            1. DPDK BOND PMD leads to mempool exhaustion with current code snippet
            2. DPDK BOND PMD has no issues with DPDK example with rte_ipv4_fragment_packet
            3. DPDK i40e PMD has an issue with the current code snippet
            4. DPDK i40e PMD has no issue with dpdk example rte_ipv4_fragment_packet

            Hence the issue is with sample code snippet and usage and not DPDK API.



            Is there a way to configure Docker's embedded DNS server's upstream nameserver's port?
            Asked 2021-Apr-27 at 01:18
            General context

            Docker daemon comes with an embedded DNS server. It resolves local Docker swarm and network records and forwards queries for external records to an upstream nameserver configured with --dns 1.

            Docs say you can set an IP address for this upstream nameserver with --dns=[IP_ADDRESS...]. The default port used is 53.

            My question

            Can I configure the port used as well?

            My host's /etc/docker/daemon.json shows "dns": [""],. Is there a way for me to specify something like "dns": [""], so that dockerd always knows to forward DNS queries to port 53?

            My use case

            In my case, is the IP of a localhost bridge interface. I run a local DNS caching server on this host. So DNS queries sent to work. But dockerd forwards queries originating from containers connected to user-defined bridge networks (created with docker network create) to non-standard ports it picks. See terminal output below.

            Detailed terminal output and debugging info

            "toogle" is a Docker container connected to a Docker network I created with docker network create. is another loopback address. DNS queries originating from within Docker containers connected to user-defined Docker networks are destined for this IP.

            Is Docker's embedded DNS server actually running?

            DNS queries are routed by toogle's firewall rules this way.



            Answered 2021-Apr-27 at 01:18

            I don't think there's a way to do this. I also misread the output. Docker daemon was forwarding to port 53.

            read udp> i/o timeout



            scrape docker metrics from inside container
            Asked 2021-Apr-15 at 21:20

            I am trying to scrape docker metrics from inside a container. I have seen the creator of Prometheus doing it this way see video here. I am not able to reproduce it.


            I have exposed docker metrics page via json config.



            Answered 2021-Apr-03 at 10:53

            So turns out issues was indeed iptables. The default policy for the INPUT chain in this case is DROP. Since the container is now trying to reach the host system itself, its traffic will come through the input chain.

            So I added 2 simple rules for now, that will allow all traffic in the INPUT chain from docker0 and docker_gwbridge.



            dpdk testpmd packet forwarding huge amount of packet drop with fm10420 NIC (fm10k)
            Asked 2020-Dec-16 at 14:06

            I am trying to determine the amount of resources required to forward 20Mp/s using DPDK. I'm using two FM10420 100G Dual NIC adapters to generate and forward traffic. Since I have only one server for testing, I'm generating packets using pktgen on host computer and forward them with testpmd on a virtual machine. My setup looks like this,

            However, when I run both testpmd and pktgen, I can see there is huge amount of packet drop. Following are the results captured after 60 seconds of generating and forwarding packets.




            Answered 2020-Dec-16 at 14:06

            There are multiple factors which affect performance for NIC PMD. Some of them are listed below

            1. cpu core isolation to explicitly make user-space threads to sole user of CPU core time
            2. Kernel watchdog timer callback reduction
            3. disable Transparent Huge page (especially with 1GB)
            4. firmware of NIC
            5. DPDK version
            6. vector code for RX-TX
            7. PCIe lane (direct attach to CPU give higher performance than south bridge)
            8. CPU clock frequency
            9. DDIO ability of NIC
            10. Traffic pattern (with RSS on RX-queue or FLow DIrector)
            11. Resoruce Director for preventing cache posioning.

            I highly recommend @Anuradha to check FM10K PMD capacity, BIOS, and using smap_affinity, isol_cpu, rcu_callback etc.

            Note: I have been able to achieve 29 Mpps (64B) packets using single core and DPDK example skeleton with X710 NIC.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install pkts

            You can download it from GitHub, Maven.
            You can use pkts like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the pkts component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer For Gradle installation, please refer .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone aboutsip/pkts

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link