Question: Getting the desired output so far.

The program prompts user to search for a word.

user enters it and the program reads the file and gives the output.

'ashwin: 2'

Now i want it to ignore case sensitive. For example, "Ashwin" and "ashwin" both shall return 2, as it contains two ashwin`s in the text file.

```
def word_count():
    file = "test.txt"
    word = input("Enter word to be searched:")
    k = 0

    with open(file, 'r') as f:
        for line in f:
            words = line.split()
            for i in words:
                if i == word:
                    k = k + 1
    print(word + ": " + str(k))

word_count()

```

Answer: 
There is a huge difference between DPDK and Netfilter hooks. When using `Netfilter` / hooking `NF_IP_PRE_ROUTING` you hijack the packet flow and **copy** packets form kernel space to user space. This copy causes a large overhead.

When using `DPDK` you're actually mapping you network card's packet buffers to a userspace memory area. Meaning that instead of the kernel getting an interrupt from the NIC, then passing it through all its queues until it reaches `NF_IP_PRE_ROUTING` which in turn will copy the packer to userland upon request, `DPDK` offers you the possibility to access the mapped packet buffers **directly** from userspace, bypassing all meta-handling by the kernel, effectively improving performance (at the cost of code complexity and security).
There are a variety of techniques to grab raw packets and deliver them to a userspace application. The devil as usual in the details.

If all we need is to deliver packets to a userspace application -- there is no difference what solution to use. Libpcap, or tun/taps, or Netfilter, or pf-ring, or whatever. All will do just fine.

But if we need to process 100 million packets per second (~30 CPU cycles per packet on 3GHz) -- I don't think we have other options at the moment but DPDK. Google for "DPDK performance report" and have a look.

DPDK is a framework which works well on many platforms (x86, ARM, POWER etc) and supports many NICs. There is no need to write a driver, the support for the most popular NICs is already there.

There is also a support to manage CPU cores, huge pages, memory buffers, encryption, IP fragmentation etc etc. All designed to be able to forward 100 Mpps. If we need that performance...