|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.floodlightcontroller.loadbalancer.LoadBalancer
public class LoadBalancer
A simple load balancer module for ping, tcp, and udp flows. This module is accessed via a REST API defined close to the OpenStack Quantum LBaaS (Load-balancer-as-a-Service) v1.0 API proposal. Since the proposal has not been final, no efforts have yet been made to confirm compatibility at this time. Limitations: - client records and static flows not purged after use, will exhaust switch flow tables over time - round robin policy among servers based on connections, not traffic volume - health monitoring feature not implemented yet
| Nested Class Summary | |
|---|---|
class |
LoadBalancer.IPClient
|
| Nested classes/interfaces inherited from interface net.floodlightcontroller.core.IListener |
|---|
IListener.Command |
| Field Summary | |
|---|---|
protected java.util.HashMap<LoadBalancer.IPClient,LBMember> |
clientToMember
|
java.util.Comparator<SwitchPort> |
clusterIdComparator
|
protected ICounterStoreService |
counterStore
|
protected IDeviceService |
deviceManager
|
protected IFloodlightProviderService |
floodlightProvider
|
protected static java.lang.String |
LB_ETHER_TYPE
|
protected static int |
LB_PRIORITY
|
protected static org.slf4j.Logger |
log
|
protected java.util.HashMap<java.lang.Integer,java.lang.String> |
memberIpToId
|
protected java.util.HashMap<java.lang.String,LBMember> |
members
|
protected OFMessageDamper |
messageDamper
|
protected static int |
OFMESSAGE_DAMPER_CAPACITY
|
protected static int |
OFMESSAGE_DAMPER_TIMEOUT
|
protected java.util.HashMap<java.lang.String,LBPool> |
pools
|
protected IRestApiService |
restApi
|
protected IRoutingService |
routingEngine
|
protected IStaticFlowEntryPusherService |
sfp
|
protected ITopologyService |
topology
|
protected java.util.HashMap<java.lang.Integer,java.lang.String> |
vipIpToId
|
protected java.util.HashMap<java.lang.Integer,MACAddress> |
vipIpToMac
|
protected java.util.HashMap<java.lang.String,LBVip> |
vips
|
| Constructor Summary | |
|---|---|
LoadBalancer()
|
|
| Method Summary | |
|---|---|
LBMember |
createMember(LBMember member)
Create and return a new member. |
LBMonitor |
createMonitor(LBMonitor monitor)
Create and return a new monitor. |
LBPool |
createPool(LBPool pool)
Create and return a new pool. |
LBVip |
createVip(LBVip vip)
Create and return a new Vip. |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleDependencies()
Get a list of Modules that this module depends on. |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleServices()
Return the list of interfaces that this module implements. |
java.lang.String |
getName()
The name assigned to this listener |
java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> |
getServiceImpls()
Instantiate (as needed) and return objects that implement each of the services exported by this module. |
void |
init(FloodlightModuleContext context)
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized. |
boolean |
isCallbackOrderingPostreq(OFType type,
java.lang.String name)
Check if the module called name is a callback ordering post-requisite for this module. |
boolean |
isCallbackOrderingPrereq(OFType type,
java.lang.String name)
Check if the module called name is a callback ordering prerequisite for this module. |
java.util.Collection<LBMember> |
listMember(java.lang.String memberId)
List selected member by its ID. |
java.util.Collection<LBMember> |
listMembers()
List all current members. |
java.util.Collection<LBMember> |
listMembersByPool(java.lang.String poolId)
List all members in a specified pool. |
java.util.Collection<LBMonitor> |
listMonitor(java.lang.String monitorId)
List selected monitor by its ID. |
java.util.Collection<LBMonitor> |
listMonitors()
List all current monitors. |
java.util.Collection<LBPool> |
listPool(java.lang.String poolId)
List selected pool by its ID. |
java.util.Collection<LBPool> |
listPools()
List all current pools. |
java.util.Collection<LBVip> |
listVip(java.lang.String vipId)
List selected Vip by its ID. |
java.util.Collection<LBVip> |
listVips()
List all current Vips. |
static void |
parseActionString(OFFlowMod flowMod,
java.lang.String actionstr,
org.slf4j.Logger log)
Parses OFFlowMod actions from strings. |
protected void |
pushBidirectionalVipRoutes(IOFSwitch sw,
OFPacketIn pi,
FloodlightContext cntx,
LoadBalancer.IPClient client,
LBMember member)
used to find and push in-bound and out-bound routes using StaticFlowEntryPusher |
void |
pushPacket(IPacket packet,
IOFSwitch sw,
int bufferId,
int inPort,
int outPort,
FloodlightContext cntx,
boolean flush)
used to push any packet - borrowed routine from Forwarding |
void |
pushStaticVipRoute(boolean inBound,
Route route,
LoadBalancer.IPClient client,
LBMember member,
long pinSwitch)
used to push given route using static flow entry pusher |
IListener.Command |
receive(IOFSwitch sw,
OFMessage msg,
FloodlightContext cntx)
This is the method Floodlight uses to call listeners with OpenFlow messages |
int |
removeMember(java.lang.String memberId)
Remove an existing member. |
int |
removeMonitor(java.lang.String monitorId)
Remove an existing monitor. |
int |
removePool(java.lang.String poolId)
Remove an existing pool. |
int |
removeVip(java.lang.String vipId)
Remove an existing Vip. |
void |
startUp(FloodlightModuleContext context)
This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads. |
LBMember |
updateMember(LBMember member)
Update and return an existing member. |
LBMonitor |
updateMonitor(LBMonitor monitor)
Update and return an existing monitor. |
LBPool |
updatePool(LBPool pool)
Update and return an existing pool. |
LBVip |
updateVip(LBVip vip)
Update and return an existing Vip. |
protected void |
vipProxyArpReply(IOFSwitch sw,
OFPacketIn pi,
FloodlightContext cntx,
java.lang.String vipId)
used to send proxy Arp for load balanced service requests |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.slf4j.Logger log
protected IFloodlightProviderService floodlightProvider
protected IRestApiService restApi
protected ICounterStoreService counterStore
protected OFMessageDamper messageDamper
protected IDeviceService deviceManager
protected IRoutingService routingEngine
protected ITopologyService topology
protected IStaticFlowEntryPusherService sfp
protected java.util.HashMap<java.lang.String,LBVip> vips
protected java.util.HashMap<java.lang.String,LBPool> pools
protected java.util.HashMap<java.lang.String,LBMember> members
protected java.util.HashMap<java.lang.Integer,java.lang.String> vipIpToId
protected java.util.HashMap<java.lang.Integer,MACAddress> vipIpToMac
protected java.util.HashMap<java.lang.Integer,java.lang.String> memberIpToId
protected java.util.HashMap<LoadBalancer.IPClient,LBMember> clientToMember
protected static int OFMESSAGE_DAMPER_CAPACITY
protected static int OFMESSAGE_DAMPER_TIMEOUT
protected static java.lang.String LB_ETHER_TYPE
protected static int LB_PRIORITY
public java.util.Comparator<SwitchPort> clusterIdComparator
| Constructor Detail |
|---|
public LoadBalancer()
| Method Detail |
|---|
public java.lang.String getName()
IListener
getName in interface IListener<OFType>
public boolean isCallbackOrderingPrereq(OFType type,
java.lang.String name)
IListener
isCallbackOrderingPrereq in interface IListener<OFType>type - the object type to which this appliesname - the name of the module
public boolean isCallbackOrderingPostreq(OFType type,
java.lang.String name)
IListener
isCallbackOrderingPostreq in interface IListener<OFType>type - the object type to which this appliesname - the name of the module
public IListener.Command receive(IOFSwitch sw,
OFMessage msg,
FloodlightContext cntx)
IOFMessageListener
receive in interface IOFMessageListenersw - the OpenFlow switch that sent this messagemsg - the messagecntx - a Floodlight message context object you can use to pass
information between listeners
protected void vipProxyArpReply(IOFSwitch sw,
OFPacketIn pi,
FloodlightContext cntx,
java.lang.String vipId)
IOFSwitch - swOFPacketIn - piFloodlightContext - cntxString - vipId
public void pushPacket(IPacket packet,
IOFSwitch sw,
int bufferId,
int inPort,
int outPort,
FloodlightContext cntx,
boolean flush)
OFPacketIn - piIOFSwitch - swint - bufferIdint - inPortint - outPortFloodlightContext - cntxboolean - flush
protected void pushBidirectionalVipRoutes(IOFSwitch sw,
OFPacketIn pi,
FloodlightContext cntx,
LoadBalancer.IPClient client,
LBMember member)
IOFSwitch - swOFPacketIn - piFloodlightContext - cntxIPClient - clientLBMember - member
public void pushStaticVipRoute(boolean inBound,
Route route,
LoadBalancer.IPClient client,
LBMember member,
long pinSwitch)
boolean - inBoundRoute - routeIPClient - clientLBMember - memberlong - pinSwitchpublic java.util.Collection<LBVip> listVips()
ILoadBalancerService
listVips in interface ILoadBalancerServicepublic java.util.Collection<LBVip> listVip(java.lang.String vipId)
ILoadBalancerService
listVip in interface ILoadBalancerServicevipId - Id of requested Vippublic LBVip createVip(LBVip vip)
ILoadBalancerService
createVip in interface ILoadBalancerServicepublic LBVip updateVip(LBVip vip)
ILoadBalancerService
updateVip in interface ILoadBalancerServicepublic int removeVip(java.lang.String vipId)
ILoadBalancerService
removeVip in interface ILoadBalancerServicepublic java.util.Collection<LBPool> listPools()
ILoadBalancerService
listPools in interface ILoadBalancerServicepublic java.util.Collection<LBPool> listPool(java.lang.String poolId)
ILoadBalancerService
listPool in interface ILoadBalancerServicepoolId - Id of requested poolpublic LBPool createPool(LBPool pool)
ILoadBalancerService
createPool in interface ILoadBalancerServicepublic LBPool updatePool(LBPool pool)
ILoadBalancerService
updatePool in interface ILoadBalancerServicepublic int removePool(java.lang.String poolId)
ILoadBalancerService
removePool in interface ILoadBalancerServicepublic java.util.Collection<LBMember> listMembers()
ILoadBalancerService
listMembers in interface ILoadBalancerServicepublic java.util.Collection<LBMember> listMember(java.lang.String memberId)
ILoadBalancerService
listMember in interface ILoadBalancerServicememberId - Id of requested memberpublic java.util.Collection<LBMember> listMembersByPool(java.lang.String poolId)
ILoadBalancerService
listMembersByPool in interface ILoadBalancerServicepublic LBMember createMember(LBMember member)
ILoadBalancerService
createMember in interface ILoadBalancerServicepublic LBMember updateMember(LBMember member)
ILoadBalancerService
updateMember in interface ILoadBalancerServicepublic int removeMember(java.lang.String memberId)
ILoadBalancerService
removeMember in interface ILoadBalancerServicepublic java.util.Collection<LBMonitor> listMonitors()
ILoadBalancerService
listMonitors in interface ILoadBalancerServicepublic java.util.Collection<LBMonitor> listMonitor(java.lang.String monitorId)
ILoadBalancerService
listMonitor in interface ILoadBalancerServicemonitorId - Id of requested monitorpublic LBMonitor createMonitor(LBMonitor monitor)
ILoadBalancerService
createMonitor in interface ILoadBalancerServicepublic LBMonitor updateMonitor(LBMonitor monitor)
ILoadBalancerService
updateMonitor in interface ILoadBalancerServicepublic int removeMonitor(java.lang.String monitorId)
ILoadBalancerService
removeMonitor in interface ILoadBalancerServicepublic java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
IFloodlightModule
getModuleServices in interface IFloodlightModulepublic java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
IFloodlightModule
getServiceImpls in interface IFloodlightModulepublic java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
IFloodlightModule
getModuleDependencies in interface IFloodlightModule
public void init(FloodlightModuleContext context)
throws FloodlightModuleException
IFloodlightModule
init in interface IFloodlightModuleFloodlightModuleExceptionpublic void startUp(FloodlightModuleContext context)
IFloodlightModule
startUp in interface IFloodlightModule
public static void parseActionString(OFFlowMod flowMod,
java.lang.String actionstr,
org.slf4j.Logger log)
flowMod - The OFFlowMod to set the actions foractionstr - The string containing all the actionslog - A logger to log for errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||