Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Implement L2fwd #4

Closed
wants to merge 13 commits into from
Closed

[wip] Implement L2fwd #4

wants to merge 13 commits into from

Conversation

dpino
Copy link
Owner

@dpino dpino commented Feb 24, 2016

I made this temporary PR to discuss implementation of L2Fwd.

I want to make the L2Fwd a two-way forwarder as suggested by Nikolay (and actually that's how DPDK's l2fwd seems to work) . My setting environment is the following (arrow means NICs are wired with one another).

0000:04:00.0 <-> 0000:05:00.0
0000:04:00.1 <-> 0000:05:00.1

I blast packets on 0000:04:00.0. I create a l2fwd between 0000:05:00.0 and 0000:04:00.1, which forwards packets received in the former NIC to the latter. Packets are received in 0000:04:00.1 but when I try to send back the packets from 0000:04:00.1 to 0000:05:00.0 the link reports 0 packets transmitted:

link report:
           5,493,356 sent on nic1.tx -> l2fwd1.input (loss rate: 0%)
           5,493,356 sent on l2fwd1.output -> nic2.rx (loss rate: 0%)
                   0 sent on nic2.tx -> l2fwd2.input (loss rate: 0%)
                   0 sent on l2fwd2.output -> nic1.rx (loss rate: 0%)

What I noticed is that packets received in 0000:04:00.1 are actually transmitted to 0000:05:00.1 (because cards are wired together). I made a custom app that listens on 0000:05:00.1 and it reports received packets:

link report:
           2,841,169 sent on nic.tx -> sink.rx (loss rate: 0%)
load: time: 3.00s  fps: 1,507,050 fpGbps: 5.747 fpb: 10  bpp: 467  sleep: 0   us

After this observation, I think a deployment of a l2fwd involves 4 NICs:

  • A traffic generator that sends packets to a NIC. For instance, packeblaster blasts packets into 04:00.0.
  • A l2fwd app forwards packets received in 05:00.0 to 04:00.1.
  • A second l2fwd sends packets received in 05:00.1 back to 05:00.0, so packets arrive to their point of origin, 04:00.0.

I think that's what the diagram at http://dpdk.org/doc/guides/sample_app_ug/l2_forward_real_virtual.html explains. Comments? Thoughts?

On the other hand, I'm not sure what's the the best command interface for this app. Should we request the user to introduce 3 PCI addresses? Spare the use of packetblaster, generate packets on our own and request 4 PCIs?

@dpino
Copy link
Owner Author

dpino commented Feb 24, 2016

More or less I'm convinced this is the way to go. Use of packetblaster + l2fwd involves 4 ports (NICs). I will update the upstream PR with more changes. I think I will send a patch to the packetblaster too so it can report on received packets (as it's a two-way forwarder packets will eventually get back to the port of the packetblaster, completing the whole loop).

* L2Fwd app is not necessary.
* Drop support of tap interfaces (packetblaster can only blast packets
to a PCI device).
- Remove reset() method in LoadGen.
- Remove unnecessary prefix 'pci'.
dpino pushed a commit that referenced this pull request May 17, 2016
…pport. (#4)

Add ingress, egress and hairpin counters, with preliminary testing support
@dpino dpino closed this Jun 30, 2017
dpino pushed a commit that referenced this pull request Apr 17, 2018
CONDUCT.md: Add simple code of conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant