kohler / click

The Click modular router: fast modular packet processing and analysis
Other
734 stars 324 forks source link

Flow based Load Balancer #495

Open p4pe opened 2 years ago

p4pe commented 2 years ago

Hello everyone, I want to create a flow-based load balancer. LB

Which elements should I use to be able to implement this functionality?

Thank you

tbarbette commented 2 years ago

IPRewriter, like a NAT, with something like RoundRobinIPMapper for pattern

p4pe commented 2 years ago

Hello @tbarbette thank you for your response.

Sorry for the late reply.

To be more precise, I would like to implement something like ECMP protocol. I don't know if this can be done with Click. In my example, the VNF1 and VNF2 are simply forwarding the traffic to sink. ECMP

Thank you!

tbarbette commented 2 years ago

Remember ECMP is per-packet, so you would break flows and VNFs would see part of multiple flows, so they can't run NAT etc. But if you don't want something flow-aware, then you can simply use RoundRobinSwitch that will forward packets in a RR fashion.

tbarbette commented 2 years ago

To be flow-aware, but independent of load, you have HashSwitch. To do RoundRobin you need the aforementioned solution.

Tom

p4pe commented 2 years ago

Hello Tom,

Today I saw the RoundRobinSwitch element, thank you for the confirmation.

So I can have:

in1::FromDevice()
in2:FromeDevice()

out::ToDevice
out1::ToDevice

lb::RoundRobinSwitch

And the inputs of the lb will be the in1 and in2 (after they passed from IPClassifier, etc..)

Am I right?

tbarbette commented 2 years ago

Yes, with the usual Queue etc

xt1234567 commented 2 years ago

Hello Tom,

Today I saw the RoundRobinSwitch element, thank you for the confirmation.

So I can have:

in1::FromDevice()
in2:FromeDevice()

out::ToDevice
out1::ToDevice

lb::RoundRobinSwitch

And the inputs of the lb will be the in1 and in2 (after they passed from IPClassifier, etc..)

Am I right?

Hello , I also want to create a per-packet load balancer, but it was a little difficult for me to implement it ,can you share the .click file? Thank you very much in advance. my email is 17305690709@163.com