Leftddr
Leftddr

Reputation: 79

How to send packet another server using dpdk?

My question is how to send packet another Physical Server from my Computer using dpdk.

I already watched example code rxtx_callbacks and i want to use this code. but there is no place to enter a specific ip and port to another server.

how i can send packets to places on a server using dpdk with specified ip and port? and how i can receive packets using dpdk?

Is l3fwd correct or is this another concept?

help me

Upvotes: 1

Views: 3367

Answers (1)

Vipin Varghese
Vipin Varghese

Reputation: 4798

DPDK is an open-source library that allows one to bypass Kernel and ETH-IP-TCP stack to send packets from userspace directly on NIC or other custom hardware. There are multiple examples and projects like pktgen and TREX which uses to generate user-defined packets (desired MAC address, VLAN, IP and TCP-UDP) payload.

For the queries

  1. how i can send packets to places on a server using dpdk with specified ip and port?

[Answer] make use of DPDK PKTGEN as an easy way to generate. Other examples are pcap based burst replay and trex.

But the easiest way to generate and send traffic is using scapy with DPDK sample application skeleton. Following are the steps required to achieve the same.

  • Install DPDK to desired platform (preferably Linux)
  • build the DPDK example skeleton found in path [dpdk root folder]/examples/skeleton
  • bind a physical NIC (if traffic needs to be send out of server) with userspace drivers like igb_uio, uio_pci_generic or vfio-pci
  • start the application with options '-l 1 --vdev=net_tap0,iface=scapyEth'. this will create TAP interface with name scapyEth.
  • using scapy now create your custom packet with desired MAC, VLAN, IP and Port numbers.

and how i can receive packets using dpdk?

[Answer] on receiver side run DPDK application like testpmd, l2fwd, or skeleton if packets needs to received by Userspace DPDK application or any Linux sockets can receive the UDP packets.

Note: easiest way to check whether packets are received is to run tcpudmp. example tcpdump -eni eth1 -Q in (where eth1 is physical interface on Reciever Server.

Note: Since the request how i can send packets to places on a server is not clear

  1. Using DPDK one can send packets through a physical interface using dedicated NIC, FPGA and wireless devices
  2. DPDK can send packets among applications using memif interface
  3. DPDK can send packets between VM using virtio and vhost
  4. DPDK can send and receive packets to kernel, where Kernel routing stack and ARP table determine which kernel interface will forward the packets.

Upvotes: 4

Related Questions