From 15fbc5d603f9921d016886242c8423588f03aa8f Mon Sep 17 00:00:00 2001
From: Ryan Izard <rizard@g.clemson.edu>
Date: Mon, 28 Sep 2015 08:15:17 -0400
Subject: [PATCH] Patch load balancer to include source port in static flow
 pusher entry names. This will allow a single source host to have multiple
 connections load-balanced across multiple LB hosts.

---
 .../net/floodlightcontroller/loadbalancer/LoadBalancer.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
index e691cffae..aea41076a 100644
--- a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
+++ b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
@@ -512,7 +512,8 @@ public class LoadBalancer implements IFloodlightModule,
                fmb.setPriority(FlowModUtils.PRIORITY_MAX);
                
                if (inBound) {
-                   entryName = "inbound-vip-"+ member.vipId+"-client-"+client.ipAddress+"-port-"+client.targetPort
+                   entryName = "inbound-vip-"+ member.vipId+"-client-"+client.ipAddress
+                		   +"-srcport-"+client.srcPort+"-dstport-"+client.targetPort
                            +"-srcswitch-"+path.get(0).getNodeId()+"-sw-"+sw;
                    mb.setExact(MatchField.ETH_TYPE, EthType.IPv4)
                    .setExact(MatchField.IP_PROTO, client.nw_proto)
@@ -545,7 +546,8 @@ public class LoadBalancer implements IFloodlightModule,
                 	   actions.add(switchService.getSwitch(path.get(i+1).getNodeId()).getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE));
                    }
                } else {
-                   entryName = "outbound-vip-"+ member.vipId+"-client-"+client.ipAddress+"-port-"+client.targetPort
+                   entryName = "outbound-vip-"+ member.vipId+"-client-"+client.ipAddress
+                		   +"-srcport-"+client.srcPort+"-dstport-"+client.targetPort
                            +"-srcswitch-"+path.get(0).getNodeId()+"-sw-"+sw;
                    mb.setExact(MatchField.ETH_TYPE, EthType.IPv4)
                    .setExact(MatchField.IP_PROTO, client.nw_proto)
-- 
GitLab