* [dpdk-users] PktGen Ethertype
@ 2017-05-09 8:55 James Bensley
2017-05-09 13:56 ` Wiles, Keith
0 siblings, 1 reply; 6+ messages in thread
From: James Bensley @ 2017-05-09 8:55 UTC (permalink / raw)
To: users
Hi All,
I hope this is a suitable place to ask, if not please point me at
somewhere more appropriate.
I've been reading through the Pktgen docs
(http://pktgen.readthedocs.io/en/latest/commands.html for example) and
I'm trying to find out if I can set the EtherType field in the layer 2
headers to any value I like. I can't seem to find anything on this.
I want to use some Lua scripts to generate traffic with every possible
EtherType (from 0x0000 to 0xFFFF) and send that through a switch and
test that all frames were received on the other side. Is there a
function like pktgen.set_eth_type() so I can wrap it in loop?
// Build an entire frame then just loop over the ethertype for each frame:
build_entire_frame_with_payload();
for (i = 0; i <= 0xFFFF; i++) {
pktgen.set_eth_type(i);
send_frame();
}
Cheers,
James.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] PktGen Ethertype
2017-05-09 8:55 [dpdk-users] PktGen Ethertype James Bensley
@ 2017-05-09 13:56 ` Wiles, Keith
2017-05-09 14:13 ` Paul Emmerich
2017-05-10 9:09 ` James Bensley
0 siblings, 2 replies; 6+ messages in thread
From: Wiles, Keith @ 2017-05-09 13:56 UTC (permalink / raw)
To: James Bensley; +Cc: users
> On May 9, 2017, at 3:55 AM, James Bensley <jwbensley@gmail.com> wrote:
>
> Hi All,
>
> I hope this is a suitable place to ask, if not please point me at
> somewhere more appropriate.
>
> I've been reading through the Pktgen docs
> (http://pktgen.readthedocs.io/en/latest/commands.html for example) and
> I'm trying to find out if I can set the EtherType field in the layer 2
> headers to any value I like. I can't seem to find anything on this.
>
> I want to use some Lua scripts to generate traffic with every possible
> EtherType (from 0x0000 to 0xFFFF) and send that through a switch and
> test that all frames were received on the other side. Is there a
> function like pktgen.set_eth_type() so I can wrap it in loop?
>
> // Build an entire frame then just loop over the ethertype for each frame:
>
> build_entire_frame_with_payload();
>
> for (i = 0; i <= 0xFFFF; i++) {
>
> pktgen.set_eth_type(i);
> send_frame();
> }
Yes this would be nice, but at this point pktgen is not able to do this type of feature.
This would be a nice feature for scripting, I have not had time to add that support :-(
The range command can allow you to adjust the type field and then send those in a burst. The problem is pktgen was designed to send packets at a high rate if needed and that means setting up the packets before hand. The number of packets being able to be setup before hand is 8192. The random command can adjust the ether type randomly for each packet with a performance hit. Maybe one of these would help. Also I am more then willing to take patches :-)
>
> Cheers,
> James.
Regards,
Keith
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] PktGen Ethertype
2017-05-09 13:56 ` Wiles, Keith
@ 2017-05-09 14:13 ` Paul Emmerich
2017-05-10 9:12 ` James Bensley
2017-05-10 9:09 ` James Bensley
1 sibling, 1 reply; 6+ messages in thread
From: Paul Emmerich @ 2017-05-09 14:13 UTC (permalink / raw)
To: James Bensley; +Cc: Wiles, Keith, users
Hi,
I usually don't hijack threads about pktgen with an ad for my packet generator. But I'll make an exception here (sorry) since that kind of weird packet modification requirements was one of the main reasons for me to build my own packet generator:
https://github.com/emmericp/MoonGen
MoonGen runs Lua code for each single packet that is sent out (instead of just configuring some existing logic in C), so modifying any field is easy.
Also, all fields in commonly used protocol stacks are exposed via sensible names and all these messy offsets are calculated automatically.
You can have a look at one of the example scripts to see packet modifications in action:
https://github.com/emmericp/MoonGen/blob/master/examples/l3-load-latency.lua
Basically, you can add
pkt.eth.type = <ethertype> (network byte order)
or
pkt.eth:setType(<ethertype>) (automatic byte order swap)
In the main loop at line 92 where it currently modifies the IP addresses.
This is still fast because we dynamically build and compile the necessary structs for the protocol stack.
You can also receive packets to find out which ethertypes are dropped (if any), an example of packet reception can be found in this example:
https://github.com/emmericp/MoonGen/blob/master/examples/quality-of-service-test.lua#L108
By default, we use the NIC's hardware counters for rx/tx stats (another important difference from pktgen which receives and drops packets by default).
Paul
> Wiles, Keith <keith.wiles@intel.com>:
>
>>
>> On May 9, 2017, at 3:55 AM, James Bensley <jwbensley@gmail.com> wrote:
>>
>> Hi All,
>>
>> I hope this is a suitable place to ask, if not please point me at
>> somewhere more appropriate.
>>
>> I've been reading through the Pktgen docs
>> (http://pktgen.readthedocs.io/en/latest/commands.html for example) and
>> I'm trying to find out if I can set the EtherType field in the layer 2
>> headers to any value I like. I can't seem to find anything on this.
>>
>> I want to use some Lua scripts to generate traffic with every possible
>> EtherType (from 0x0000 to 0xFFFF) and send that through a switch and
>> test that all frames were received on the other side. Is there a
>> function like pktgen.set_eth_type() so I can wrap it in loop?
>>
>> // Build an entire frame then just loop over the ethertype for each frame:
>>
>> build_entire_frame_with_payload();
>>
>> for (i = 0; i <= 0xFFFF; i++) {
>>
>> pktgen.set_eth_type(i);
>> send_frame();
>> }
>
> Yes this would be nice, but at this point pktgen is not able to do this type of feature.
> This would be a nice feature for scripting, I have not had time to add that support :-(
>
> The range command can allow you to adjust the type field and then send those in a burst. The problem is pktgen was designed to send packets at a high rate if needed and that means setting up the packets before hand. The number of packets being able to be setup before hand is 8192. The random command can adjust the ether type randomly for each packet with a performance hit. Maybe one of these would help. Also I am more then willing to take patches :-)
>
>>
>> Cheers,
>> James.
>
> Regards,
> Keith
--
Chair of Network Architectures and Services
Department of Informatics
TU München
Boltzmannstr. 3
85748 Garching bei München, Germany
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] PktGen Ethertype
2017-05-09 13:56 ` Wiles, Keith
2017-05-09 14:13 ` Paul Emmerich
@ 2017-05-10 9:09 ` James Bensley
2017-05-10 13:53 ` Wiles, Keith
1 sibling, 1 reply; 6+ messages in thread
From: James Bensley @ 2017-05-10 9:09 UTC (permalink / raw)
To: Wiles, Keith; +Cc: users
On 9 May 2017 at 14:56, Wiles, Keith <keith.wiles@intel.com> wrote:
Hi Keith!
> The range command can allow you to adjust the type field and then send those in a burst. The problem is pktgen was designed to send packets at a high rate if needed and that means setting up the packets before hand. The number of packets being able to be setup before hand is 8192. The random command can adjust the ether type randomly for each packet with a performance hit. Maybe one of these would help.
So it sounds like the range command is what I want then, if I can
systematically adjust the EtherType field (e.g. I can explicitly say
start at 0x0 and run to 0xFFFF) just with the caveat that I have to
send a burst of packet for each loop iteration?
If that is the case I don't mind, it will still get the job done of
testing every Ethertype through a DUT. Any chance I can lower the
burst size on the CLI to 64 packets for example to speed things up?
> Also I am more then willing to take patches :-)
Sure, I didn't want to spend hours testing to find out that I can't do
what I wanted to do which is why I asked here.
Sounds like it can be done so I'll have a poke around with the code
and see what I can do.
Thanks for your help it is greatly appreciated,
James.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] PktGen Ethertype
2017-05-09 14:13 ` Paul Emmerich
@ 2017-05-10 9:12 ` James Bensley
0 siblings, 0 replies; 6+ messages in thread
From: James Bensley @ 2017-05-10 9:12 UTC (permalink / raw)
To: users
On 9 May 2017 at 15:13, Paul Emmerich <emmericp@net.in.tum.de> wrote:
Hi Paul,
> https://github.com/emmericp/MoonGen
> You can have a look at one of the example scripts to see packet modifications in action:
>
> https://github.com/emmericp/MoonGen/blob/master/examples/l3-load-latency.lua
>
> Basically, you can add
>
> pkt.eth.type = <ethertype> (network byte order)
> or
> pkt.eth:setType(<ethertype>) (automatic byte order swap)
>
> In the main loop at line 92 where it currently modifies the IP addresses.
> This is still fast because we dynamically build and compile the necessary structs for the protocol stack.
>
> You can also receive packets to find out which ethertypes are dropped (if any), an example of packet reception can be found in this example:
> https://github.com/emmericp/MoonGen/blob/master/examples/quality-of-service-test.lua#L108
I've had my eye on MoonGen already and I was reading the doc's trying
to work out how to do the same with MoonGen and PtkGen. I was still
reading the MoonGen docs though so you've saved me some time!.
That last point about checking which packets were received is critical.
Thanks, I'll give this a go!
Cheers,
James.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] PktGen Ethertype
2017-05-10 9:09 ` James Bensley
@ 2017-05-10 13:53 ` Wiles, Keith
0 siblings, 0 replies; 6+ messages in thread
From: Wiles, Keith @ 2017-05-10 13:53 UTC (permalink / raw)
To: James Bensley; +Cc: users
> On May 10, 2017, at 4:09 AM, James Bensley <jwbensley@gmail.com> wrote:
>
> On 9 May 2017 at 14:56, Wiles, Keith <keith.wiles@intel.com> wrote:
>
> Hi Keith!
>
>> The range command can allow you to adjust the type field and then send those in a burst. The problem is pktgen was designed to send packets at a high rate if needed and that means setting up the packets before hand. The number of packets being able to be setup before hand is 8192. The random command can adjust the ether type randomly for each packet with a performance hit. Maybe one of these would help.
>
> So it sounds like the range command is what I want then, if I can
> systematically adjust the EtherType field (e.g. I can explicitly say
> start at 0x0 and run to 0xFFFF) just with the caveat that I have to
> send a burst of packet for each loop iteration?
You would need to set the range between 0-8191, then another loop with 8192-((2 * 8192) -1) and so forth in a lua script.
>
> If that is the case I don't mind, it will still get the job done of
> testing every Ethertype through a DUT. Any chance I can lower the
> burst size on the CLI to 64 packets for example to speed things up?
>
>> Also I am more then willing to take patches :-)
>
> Sure, I didn't want to spend hours testing to find out that I can't do
> what I wanted to do which is why I asked here.
>
> Sounds like it can be done so I'll have a poke around with the code
> and see what I can do.
>
> Thanks for your help it is greatly appreciated,
> James.
Regards,
Keith
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-05-10 13:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 8:55 [dpdk-users] PktGen Ethertype James Bensley
2017-05-09 13:56 ` Wiles, Keith
2017-05-09 14:13 ` Paul Emmerich
2017-05-10 9:12 ` James Bensley
2017-05-10 9:09 ` James Bensley
2017-05-10 13:53 ` Wiles, Keith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).