- Community Home
- >
- Networking
- >
- Software Defined Networking
- >
- Re: How to send the FlowMod message to Controller ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2014 11:57 PM
09-10-2014 11:57 PM
How to send the FlowMod message to Controller !!!
HI, sdnindia! I found Below codes (see dashed line )are userd to send FlowMode message in this forum. But codes don't work in my PC, when i called function "SendFlowMode" ,it doesn't work, and it returns null to me. Below codes are My send FlowMod message codes :
"
DataPathId dpid=DataPathId.valueof("00:03:9c:b6:54:cb:c6:80");
ControllerService cs =new ControllerServiceAdapter();
MessageFuture mf=cs.sendFlowMod(flow,dpid); // flow already created and i'm sure it correct, created flowmod // message codes are from HP VAN SDN Controller Programming Guide.pdf on Page 27-29.
// when i run the codes, the statement "System.out.println(mf)" output null in Eclipse Console.
"
By the way, other functions such as getAllDataPathInfo(), getDataPathInfo(DataPathId dpid); they all return null .i use HP-2920 switch, and Contrlloer version is 2.0 , API document and hp-sdn-sdk version are both 2.0!!!
/-------------------------------------------------------------------------------
Below are the steps to send the FlowMod message
// Construct OfmMutableFlowMod
OfmMutableFlowMod mod = (OfmMutableFlowMod) MessageFactory .create(pv, MessageType.FLOW_MOD);
// Assemble the match fields
// Add the values to flow mod
//Convert to Immutable
OfmFlowMod flow = (OfmFlowMod)mod.toImmutable();
…
//Call the method
cs.sendFlowMod(flow, dpInfo.dpid()); // Here dpInfo is of type DataPathInfo and cs is of type ControllerService
-------------------------------------------------------------------------------------------------------------------/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2014 11:47 PM
09-18-2014 11:47 PM
Re: How to send the FlowMod message to Controller !!!
Hello Yuanxiance,
Since sendFlowMod() function is returning null so please check if the argument for this function i.e. flow as well as dpid have proper values.Also getAllDataPathInfo(), getDataPathInfo(DataPathId dpid) functions are returning null so it looks like dpid is not having some proper value.
As per Programming guide page 31 you can use
private ControllerService cs = ...;
You can have private static ControllerService mControllerService; in your class and initialize that member and call sendFlowMod function.
If you still face the issue please share the code for flow creation and for dpid initialization.
Thanks,
HP SDN Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2014 07:55 PM
09-25-2014 07:55 PM
Re: How to send the FlowMod message to Controller !!!
Hi,sdnindia!
I want to know this statement "private ControllerService cs = ...;" mean. In Programming guide page 31, How to understand "it is assumed that a reference to the controller service implementation has been stored in the field cs" , Can you give some example codes to help me ? How to initialize it's member? In my class ,i initialize ControllerService by invoke ControllerServiceAdapter constructor! i use statement
"ControllerService cs = new ControllerServiceAdapter() "; Below codes in main function, when i run i can't get DataPathInfo,
"00:03:9c:b6:54:cb:c6:80 " this string i got from https://localhost:8443/sdn/ui , The "OpenFlow Monitor" module give all switch's Data Path Id. Hope you give some advice as soon as possible! Thanks ...
--------------------------------------------------------------------
DataPathId dpid=DataPathId.valueof("00:03:9c:b6:54:cb:c6:80");
ControllerService cs =new ControllerServiceAdapter();
System.out.println(cs.getDataPathInfo(dpid)); //return NULL, what's the problem?
--------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2014 11:36 PM
09-28-2014 11:36 PM
Re: How to send the FlowMod message to Controller !!!
Hello harcy,
In some class(for e.g. OfMonitorComponent as in below ) there can be a data member cs of type ControllerService and some function for e.g. bindControllerService which initialize the data member cs as below-
public class OfMonitorComponent implements OfMonitor {
…
private volatile ControllerService cs;
…
protected void bindControllerService(ControllerService service) {
cs = service;
}
..
}
In your code cs.getDataPathInfo(dpid) is returning NULL so please make sure both cs and dpid have soem value.
Please try as per above code snippets and let us know if this solve your problem or you still face the issue.
Thanks,
HP SDN Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2015 06:18 AM
03-02-2015 06:18 AM
Re: How to send the FlowMod message to Controller !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2015 07:23 AM
07-13-2015 07:23 AM
Re: How to send the FlowMod message to Controller !!!
Try compiling and deploying the attached application. It is a very minimal application that activates and deactivates the controllerservice object. After deploying the application on the controller try to put some traffic across the network, then post the related lines from the log located at /opt/sdn/virgo/serviceability/logs/log.log. Note, you will need sudo access to get to the log.