sdnfv / openNetVM

A high performance container-based NFV platform from GW and UCR.
http://sdnfv.github.io/onvm/
Other
263 stars 135 forks source link

nf_router parameters #237

Open khaledshahine opened 4 years ago

khaledshahine commented 4 years ago

nf_router

I want to know what's the parameter next to the IP in the nf_router (route.conf file) refer to ?

kevindweb commented 4 years ago

I've never worked with the NF router, but here is what I found in the nf_router.c. It references a struct called fwd_nf here that takes in the IP address (like 11.0.0.17) and the NF destination number (to fill meta->destination). I hope this helps, and we should probably write some documentation on this.

koolzz commented 4 years ago

I've never worked with the NF router, but here is what I found in the nf_router.c. It references a struct called fwd_nf here that takes in the IP address (like 11.0.0.17) and the NF destination number (to fill meta->destination). I hope this helps, and we should probably write some documentation on this.

Yeah that's right, it's the service is of the NF to forward to

twood02 commented 4 years ago

@khaledshahine - please let us know if you have other questions. Also, we would be grateful if you can make a pull request to add a line to the Readme.md file documenting the file format.

Yongeverhuang commented 4 years ago

In my test result, nf_router forward flow by Destination IP, and the action is next NF to forward. Like this [Destination IP,Next NF]. But it could not set multiple next NFs, i also want someone gives some suggestiones.

twood02 commented 4 years ago

But it could not set multiple next NFs, i also want someone gives some suggestiones.

Can you clarify what you are trying to do? Are you trying to send from the router to one of several NF replicas? The easiest way to do that is to start all the NFs with the same service ID. Then ONVM will automatically load balance across them.

Yongeverhuang commented 4 years ago

But it could not set multiple next NFs, i also want someone gives some suggestiones.

Can you clarify what you are trying to do? Are you trying to send from the router to one of several NF replicas? The easiest way to do that is to start all the NFs with the same service ID. Then ONVM will automatically load balance across them.

Not that way, multiple next NFs means a service chain. Just like this : [SFC : 2(service id) 3 4 5 ]. But flows need to go through 2 5 3. nf_router first forward flows to 2, but could not set after 2 will be forward to 5, because nf 2 set the default action is forward to 3. I also try to use NF (flow table ) .but it could not run....NF (flow table )README.md doesn't give me help.

twood02 commented 4 years ago

OK, in that case you will want to use to use the FlowDirector API (https://github.com/sdnfv/openNetVM/blob/master/onvm/onvm_nflib/onvm_flow_dir.h). This lets you specify a service chain (a list of actions, like TO_NF 2, TO_NF 3, TO_NF 4, OUT_PORT 2) to be applied to all packets in a flow. Once a rule is set for a flow, the ONVM Manager's RX thread will apply the first action (in this example, sending to NF 2), and then every other NF in the chain should use the ONVM_NF_ACTION_NEXT option to specify that the packet should follow the preconfigured flow rule.

You are right that currently the flow_table example is not very helpful and its documentation is missing many key parts. We are trying to improve this for the next release.

To see the basics of maintaining per_flow state, we suggest you look at the flow_tracker example instead. This tracks the number of packets that have arrived for each flow, but you could extend it to act as a load balancer that sets up a service chain using the flow director API when the first packet in a flow arrives.

Yongeverhuang commented 4 years ago

@twood02 I have an expectation whether it is possible to control the service chain flow tables by connecting the SDN controller. I seem to this mentioned in NFVnice, but I can’t understand the way it is deployed. May i get the guide for this form the team member? Thanks a lot.

twood02 commented 4 years ago

@Yongeverhuang in NFVNice we didn't want the SDN lookup cost to influence results, so the flow chain rules were defined with the FlowDirector API mentioned above. If you need an SDN controller to provide the rules, then you will have to look at the flow_table example. But unfortunately it doesn't have very much documentation right now. If you are trying to use it you will need to run an SDN controller (we used POX) and configure it to respond with packet output actions.

I think this is a sample script that we used with the SDN controller. It might be useful to get you started https://gist.github.com/twood02/94edcde051a0a4c0b361c0bc688616d4 (This file is 6 years old so I may be misremembering what it was used for)

If you have more issues with using an SDN controller or the FlowDirector API, please make a separate Issue.

Also, it would be helpful if you filled out this short user survey for us so that we can have a better idea of how people are using OpenNetVM and what parts we need to improve. Thanks