DPDK usage discussions
 help / color / Atom feed
* [dpdk-users] Unable to Forward the Packet after UDP Payload Modification
       [not found] <CAECt3bNi5=1f7NkQdswFJuGpJaO8pyAPUZJDxQnU8--0ZtYQEQ@mail.gmail.com>
@ 2019-06-27 17:30 ` satyavalli rama
  2019-06-28 15:38   ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: satyavalli rama @ 2019-06-27 17:30 UTC (permalink / raw)
  To: dev, users

Hi


With Scapy we are sending UDP Packets to ‘P0’ of DPDK - VM -1 as below

>>>sendp(Ether(src="52:00:00:00:00:4a",dst="50:00:00:00:00:8F")/IP(dst="20.20.20.20",proto=17)/UDP(sport=4009,dport=4019)/Raw(load=('Helllo Basha')), iface="ens9", loop=1, count=10, inter=1.0002)


I'm modifying MAC address in l2fwd_simple_forward (52:00:00:00:AB:CD)
and calling the below API after mac updation, in the ‘l2fwd’ DPDK
Sample application.

But I'm unable to receive the ‘Appended Data’ on the Destination Port.
P0 itself is dropping our packets...

Without Appending the Payload/Data we are able to see our packets on
the Destination Port.

Please let me know whether this issue is with respect to appending or
buffering or checksum related...

static void

pkt_modify(struct rte_mbuf *m, unsigned dest_portid)

{

struct ether_hdr *eth;

struct ipv4_hdr *ipv4;

struct udp_hdr *udp;

char *udpData;

int len = 0;

const char *mess = "Eureka";

char *newData = NULL;

eth = rte_pktmbuf_mtod(m, struct ether_hdr *);

ipv4 = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,sizeof(struct ether_hdr));

udp = rte_pktmbuf_mtod_offset(m, struct udp_hdr *, sizeof(struct
ether_hdr)+sizeof(struct ipv4_hdr));

len = m->data_len;

udpData = rte_pktmbuf_mtod_offset(m, char *, len);

newData = rte_pktmbuf_append(m, 6);

if (newData != NULL)

rte_memcpy(newData, mess, 6);


len = m->data_len;

udpData = rte_pktmbuf_mtod_offset(m, char *, sizeof(struct
ether_hdr)+sizeof(struct ipv4_hdr)+

sizeof(struct udp_hdr));

return ;

}


Please help me on figuring out this....

Thanks,

Satya Valli.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] Unable to Forward the Packet after UDP Payload Modification
  2019-06-27 17:30 ` [dpdk-users] Unable to Forward the Packet after UDP Payload Modification satyavalli rama
@ 2019-06-28 15:38   ` Stephen Hemminger
       [not found]     ` <CAECt3bN8-5iWrHkKq7HehA4rutQNtNYrMBeZ6NH9Prnwx9kMKg@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2019-06-28 15:38 UTC (permalink / raw)
  To: satyavalli rama; +Cc: dev, users

On Thu, 27 Jun 2019 23:00:35 +0530
satyavalli rama <satyavalli.rama@gmail.com> wrote:

> Hi
> 
> 
> With Scapy we are sending UDP Packets to ‘P0’ of DPDK - VM -1 as below
> 
> >>>sendp(Ether(src="52:00:00:00:00:4a",dst="50:00:00:00:00:8F")/IP(dst="20.20.20.20",proto=17)/UDP(sport=4009,dport=4019)/Raw(load=('Helllo Basha')), iface="ens9", loop=1, count=10, inter=1.0002)  
> 
> 
> I'm modifying MAC address in l2fwd_simple_forward (52:00:00:00:AB:CD)
> and calling the below API after mac updation, in the ‘l2fwd’ DPDK
> Sample application.
> 
> But I'm unable to receive the ‘Appended Data’ on the Destination Port.
> P0 itself is dropping our packets...
> 
> Without Appending the Payload/Data we are able to see our packets on
> the Destination Port.
> 
> Please let me know whether this issue is with respect to appending or
> buffering or checksum related...
> 
> static void
> 
> pkt_modify(struct rte_mbuf *m, unsigned dest_portid)
> 
> {
> 
> struct ether_hdr *eth;
> 
> struct ipv4_hdr *ipv4;
> 
> struct udp_hdr *udp;
> 
> char *udpData;
> 
> int len = 0;
> 
> const char *mess = "Eureka";
> 
> char *newData = NULL;
> 
> eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
> 
> ipv4 = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,sizeof(struct ether_hdr));
> 
> udp = rte_pktmbuf_mtod_offset(m, struct udp_hdr *, sizeof(struct
> ether_hdr)+sizeof(struct ipv4_hdr));
> 
> len = m->data_len;
> 
> udpData = rte_pktmbuf_mtod_offset(m, char *, len);
> 
> newData = rte_pktmbuf_append(m, 6);
> 
> if (newData != NULL)
> 
> rte_memcpy(newData, mess, 6);
> 
> 
> len = m->data_len;
> 
> udpData = rte_pktmbuf_mtod_offset(m, char *, sizeof(struct
> ether_hdr)+sizeof(struct ipv4_hdr)+
> 
> sizeof(struct udp_hdr));
> 
> return ;
> 
> }
> 
> 
> Please help me on figuring out this....
> 
> Thanks,
> 
> Satya Valli.

You aren't changing the ip header length or checksum.
So your message at the end just looks like additional L2 trailer.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] Unable to Forward the Packet after UDP Payload Modification
       [not found]           ` <CAECt3bO-PH3HGw6t8GWghri0hUpvZb-=eXEBZC7m6TY2W8r0+g@mail.gmail.com>
@ 2019-07-02  7:48             ` satyavalli rama
  0 siblings, 0 replies; 3+ messages in thread
From: satyavalli rama @ 2019-07-02  7:48 UTC (permalink / raw)
  To: dev-request, users-request, dev, users

>
> I tried to create a completely new packet with my received mbuf, but still
>> I'm unable to forward packets with the appended payload, (Im able to
>> replace the RX payload but I'm unable to add or append additional payload
>> to the RX pkts)..
>>
>> If I'm changing IP Header Total Length or Checksum, the packets are not
>> getting transmitted..
>>
>> Kindly help me...
>>
>> Thanks
>> Satya
>>
>> On Mon, Jul 1, 2019, 11:08 satyavalli rama <satyavalli.rama@gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Sat, Jun 29, 2019, 14:07 satyavalli rama <satyavalli.rama@gmail.com>
>>> wrote:
>>>
>>>> I've modified a data of 12 bytes to the udp  payload, and the same ive
>>>> triednto add to the the IP header total length and udp dgram length, but
>>>> still packets are dropping or Not getting forwaded...
>>>> Plz help me..
>>>>
>>>> On Fri, Jun 28, 2019, 21:08 Stephen Hemminger <
>>>> stephen@networkplumber.org> wrote:
>>>>
>>>>> On Thu, 27 Jun 2019 23:00:35 +0530
>>>>> satyavalli rama <satyavalli.rama@gmail.com> wrote:
>>>>>
>>>>> > Hi
>>>>> >
>>>>> >
>>>>> > With Scapy we are sending UDP Packets to ‘P0’ of DPDK - VM -1 as
>>>>> below
>>>>> >
>>>>> >
>>>>> >>>sendp(Ether(src="52:00:00:00:00:4a",dst="50:00:00:00:00:8F")/IP(dst="20.20.20.20",proto=17)/UDP(sport=4009,dport=4019)/Raw(load=('Helllo
>>>>> Basha')), iface="ens9", loop=1, count=10, inter=1.0002)
>>>>> >
>>>>> >
>>>>> > I'm modifying MAC address in l2fwd_simple_forward (52:00:00:00:AB:CD)
>>>>> > and calling the below API after mac updation, in the ‘l2fwd’ DPDK
>>>>> > Sample application.
>>>>> >
>>>>> > But I'm unable to receive the ‘Appended Data’ on the Destination
>>>>> Port.
>>>>> > P0 itself is dropping our packets...
>>>>> >
>>>>> > Without Appending the Payload/Data we are able to see our packets on
>>>>> > the Destination Port.
>>>>> >
>>>>> > Please let me know whether this issue is with respect to appending or
>>>>> > buffering or checksum related...
>>>>> >
>>>>> > static void
>>>>> >
>>>>> > pkt_modify(struct rte_mbuf *m, unsigned dest_portid)
>>>>> >
>>>>> > {
>>>>> >
>>>>> > struct ether_hdr *eth;
>>>>> >
>>>>> > struct ipv4_hdr *ipv4;
>>>>> >
>>>>> > struct udp_hdr *udp;
>>>>> >
>>>>> > char *udpData;
>>>>> >
>>>>> > int len = 0;
>>>>> >
>>>>> > const char *mess = "Eureka";
>>>>> >
>>>>> > char *newData = NULL;
>>>>> >
>>>>> > eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
>>>>> >
>>>>> > ipv4 = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,sizeof(struct
>>>>> ether_hdr));
>>>>> >
>>>>> > udp = rte_pktmbuf_mtod_offset(m, struct udp_hdr *, sizeof(struct
>>>>> > ether_hdr)+sizeof(struct ipv4_hdr));
>>>>> >
>>>>> > len = m->data_len;
>>>>> >
>>>>> > udpData = rte_pktmbuf_mtod_offset(m, char *, len);
>>>>> >
>>>>> > newData = rte_pktmbuf_append(m, 6);
>>>>> >
>>>>> > if (newData != NULL)
>>>>> >
>>>>> > rte_memcpy(newData, mess, 6);
>>>>> >
>>>>> >
>>>>> > len = m->data_len;
>>>>> >
>>>>> > udpData = rte_pktmbuf_mtod_offset(m, char *, sizeof(struct
>>>>> > ether_hdr)+sizeof(struct ipv4_hdr)+
>>>>> >
>>>>> > sizeof(struct udp_hdr));
>>>>> >
>>>>> > return ;
>>>>> >
>>>>> > }
>>>>> >
>>>>> >
>>>>> > Please help me on figuring out this....
>>>>> >
>>>>> > Thanks,
>>>>> >
>>>>> > Satya Valli.
>>>>>
>>>>> You aren't changing the ip header length or checksum.
>>>>> So your message at the end just looks like additional L2 trailer.
>>>>>
>>>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAECt3bNi5=1f7NkQdswFJuGpJaO8pyAPUZJDxQnU8--0ZtYQEQ@mail.gmail.com>
2019-06-27 17:30 ` [dpdk-users] Unable to Forward the Packet after UDP Payload Modification satyavalli rama
2019-06-28 15:38   ` Stephen Hemminger
     [not found]     ` <CAECt3bN8-5iWrHkKq7HehA4rutQNtNYrMBeZ6NH9Prnwx9kMKg@mail.gmail.com>
     [not found]       ` <CAECt3bMgGdj9gFUjdEishJZrmsUJZNMY6sZqWmQ0xwCwuFMTtw@mail.gmail.com>
     [not found]         ` <CAECt3bNPGePU-p0=Wf5gZk7DTibhccx8bryNLVn3o2XqoZjSrw@mail.gmail.com>
     [not found]           ` <CAECt3bO-PH3HGw6t8GWghri0hUpvZb-=eXEBZC7m6TY2W8r0+g@mail.gmail.com>
2019-07-02  7:48             ` satyavalli rama

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox