public class OVXNetwork extends Network<OVXSwitch,OVXPort,OVXLink> implements Persistable
dpidMap, linkSet, neighborMap, neighborPortMap, switchSet
Constructor and Description |
---|
OVXNetwork(ArrayList<String> controllerUrls,
IPAddress network,
short mask)
Instantiates a virtual network, and assigns a unique tenant ID.
|
OVXNetwork(int tenantId,
ArrayList<String> controllerUrls,
IPAddress network,
short mask)
Instantiates a virtual network.
|
Modifier and Type | Method and Description |
---|---|
void |
addControllers(ArrayList<String> ctrlUrls) |
boolean |
boot()
Boots the virtual network by booting each virtual switch.
|
Host |
connectHost(long ovxDpid,
short ovxPort,
MACAddress mac)
Connects the host identified by unique MAC address
host ID to the given virtual switch port,
and returns the host instance.
|
Host |
connectHost(long ovxDpid,
short ovxPort,
MACAddress mac,
int hostId)
Connects the host identified by unique MAC address and
unique host ID to the given virtual switch port,
and returns the host instance.
|
OVXLink |
connectLink(long ovxSrcDpid,
short ovxSrcPort,
long ovxDstDpid,
short ovxDstPort,
String alg,
byte numBackups)
Creates virtual link between given virtual source port
and virtual destination port, creates a unique link ID,
creates its mapping to the physical
topology, and adds it to the topology.
|
OVXLink |
connectLink(long ovxSrcDpid,
short ovxSrcPort,
long ovxDstDpid,
short ovxDstPort,
String alg,
byte numBackups,
int linkId)
Creates virtual link, adds it to the topology, and returns the link instance.
|
SwitchRoute |
connectRoute(long ovxDpid,
short ovxSrcPort,
short ovxDstPort,
List<PhysicalLink> physicalLinks,
byte priority,
int... routeId) |
OVXPort |
createPort(long physicalDpid,
short portNumber,
short... vportNumber)
Creates a virtual port that is mapped to the given physical
switch DPID and port number, and set its virtual port number
if present.
|
OVXSwitch |
createSwitch(List<Long> dpids)
Creates a virtual switch that is mapped to the given list
of physical switch DPIDs.
|
OVXSwitch |
createSwitch(List<Long> dpids,
long switchId)
Creates a virtual switch that is mapped to the given list of
physical switch DPIDs and sets the virtual switch DPID.
|
void |
disconnectHost(int hostId) |
void |
disconnectLink(int linkId) |
void |
disconnectRoute(long ovxDpid,
int routeId) |
Set<String> |
getControllerUrls()
Gets the list of controller URLs.
|
Map<String,Object> |
getDBIndex() |
String |
getDBKey() |
String |
getDBName() |
Map<String,Object> |
getDBObject() |
OVXFlowManager |
getFlowManager() |
Host |
getHost(Integer hostId) |
Host |
getHost(OVXPort port) |
BitSetIndex |
getHostCounter()
Gets the current value of the host ID.
|
Collection<Host> |
getHosts() |
BitSetIndex |
getLinkCounter()
Gets the current value of the link ID.
|
List<OVXLink> |
getLinksById(Integer linkId) |
Set<OVXLink> |
getLinkSet() |
short |
getMask() |
String |
getName() |
IPAddress |
getNetwork()
Gets the network address space.
|
Integer |
getTenantId()
Gets the tenant ID.
|
void |
handleLLDP(OFMessage msg,
Switch sw)
Handles LLDP received from controller.
|
boolean |
isBooted() |
Integer |
nextIP() |
void |
register() |
void |
removeHost(Host host) |
boolean |
removeLink(OVXLink virtualLink)
Removes link to topology.
|
void |
removePort(long ovxDpid,
short ovxPort) |
void |
removeSwitch(long ovxDpid) |
boolean |
removeSwitch(OVXSwitch ovxSwitch)
Removes switch from topology.
|
static void |
reserveTenantId(Integer tenantId)
Reserves a unique tenant ID so it is guaranteed to be unique.
|
static void |
reset() |
void |
sendMsg(OFMessage msg,
OVXSendMsg from) |
OVXLink |
setLinkPath(int linkId,
List<PhysicalLink> physicalLinks,
byte priority)
Creates virtual link mapping to the physical topology.
|
RoutingAlgorithms |
setOVXBigSwitchRouting(long dpid,
String alg,
byte numBackups)
Sets the algorithm and number of backups for the
big switch routing.
|
void |
startPort(long ovxDpid,
short ovxPort) |
void |
startSwitch(long ovxDpid) |
void |
stop() |
void |
stopPort(long ovxDpid,
short ovxPort) |
void |
stopSwitch(long ovxDpid) |
void |
unregister() |
addLink, addSwitch, getLink, getLinks, getNeighborPort, getNeighbors, getSwitch, getSwitches
public OVXNetwork(int tenantId, ArrayList<String> controllerUrls, IPAddress network, short mask) throws IndexOutOfBoundException
tenantId
- the unique tenant IDcontrollerUrls
- the list of controller URLsnetwork
- the virtual network address spacemask
- the virtual network address space maskIndexOutOfBoundException
public OVXNetwork(ArrayList<String> controllerUrls, IPAddress network, short mask) throws IndexOutOfBoundException
controllerUrls
- the list of controller URLsnetwork
- the virtual network address spacemask
- the virtual network address space maskIndexOutOfBoundException
public Set<String> getControllerUrls()
public Integer getTenantId()
public IPAddress getNetwork()
public static void reserveTenantId(Integer tenantId) throws IndexOutOfBoundException, DuplicateIndexException
tenantId
- the tenant IDIndexOutOfBoundException
DuplicateIndexException
public BitSetIndex getLinkCounter()
public BitSetIndex getHostCounter()
public short getMask()
public OVXFlowManager getFlowManager()
public void register()
public boolean isBooted()
public Collection<Host> getHosts()
public void unregister()
public void stop()
public OVXSwitch createSwitch(List<Long> dpids, long switchId) throws IndexOutOfBoundException
dpids
- the list of physical switch DPIDsswitchId
- the virtual switch DPIDIndexOutOfBoundException
public OVXSwitch createSwitch(List<Long> dpids) throws IndexOutOfBoundException
dpids
- the list of physical switch DPIDIndexOutOfBoundException
public OVXPort createPort(long physicalDpid, short portNumber, short... vportNumber) throws IndexOutOfBoundException
physicalDpid
- the physical DPIDportNumber
- the physical port numbervportNumber
- the virtual port numberIndexOutOfBoundException
public RoutingAlgorithms setOVXBigSwitchRouting(long dpid, String alg, byte numBackups) throws RoutingAlgorithmException
dpid
- the virtual dpidalg
- the algorithmnumBackups
- the number of backupsRoutingAlgorithmException
public Host connectHost(long ovxDpid, short ovxPort, MACAddress mac, int hostId) throws IndexOutOfBoundException
ovxDpid
- the virtual switch IDovxPort
- the virtual port numbermac
- the MAC addresshostId
- the host IDIndexOutOfBoundException
public Host connectHost(long ovxDpid, short ovxPort, MACAddress mac) throws IndexOutOfBoundException
ovxDpid
- the virtual switch dpdiovxPort
- the virtual switch port numbermac
- the MAC addressIndexOutOfBoundException
public OVXLink connectLink(long ovxSrcDpid, short ovxSrcPort, long ovxDstDpid, short ovxDstPort, String alg, byte numBackups, int linkId) throws IndexOutOfBoundException, PortMappingException
ovxSrcDpid
- virtual source dpidovxSrcPort
- source port numberovxDstDpid
- virtual destination dpidovxDstPort
- destination port numberalg
- the routing algorithmnumBackups
- the number of backupslinkId
- the link IDIndexOutOfBoundException
PortMappingException
public OVXLink connectLink(long ovxSrcDpid, short ovxSrcPort, long ovxDstDpid, short ovxDstPort, String alg, byte numBackups) throws IndexOutOfBoundException, PortMappingException
ovxSrcDpid
- the virtual source DPIDovxSrcPort
- the virtual source portovxDstDpid
- the virtual destination DPIDovxDstPort
- the virtual destination DPIDalg
- the algorithmnumBackups
- the number of backupsIndexOutOfBoundException
PortMappingException
public OVXLink setLinkPath(int linkId, List<PhysicalLink> physicalLinks, byte priority) throws IndexOutOfBoundException
linkId
- the unique link IDphysicalLinks
- the list of physical linkspriority
- the priority valueIndexOutOfBoundException
public SwitchRoute connectRoute(long ovxDpid, short ovxSrcPort, short ovxDstPort, List<PhysicalLink> physicalLinks, byte priority, int... routeId) throws IndexOutOfBoundException
IndexOutOfBoundException
public void removeSwitch(long ovxDpid)
public void removePort(long ovxDpid, short ovxPort)
public void disconnectHost(int hostId)
public void disconnectLink(int linkId)
public void disconnectRoute(long ovxDpid, int routeId)
public void startSwitch(long ovxDpid)
public void startPort(long ovxDpid, short ovxPort)
public void stopSwitch(long ovxDpid)
public void stopPort(long ovxDpid, short ovxPort)
public boolean boot()
public void handleLLDP(OFMessage msg, Switch sw)
handleLLDP
in interface LLDPEventHandler
msg
- the OpenFlow messagesw
- the switchpublic void sendMsg(OFMessage msg, OVXSendMsg from)
sendMsg
in interface OVXSendMsg
public String getName()
getName
in interface OVXSendMsg
public Integer nextIP() throws IndexOutOfBoundException
IndexOutOfBoundException
public static void reset()
public Map<String,Object> getDBIndex()
getDBIndex
in interface Persistable
public String getDBKey()
getDBKey
in interface Persistable
public String getDBName()
getDBName
in interface Persistable
public Map<String,Object> getDBObject()
getDBObject
in interface Persistable
public boolean removeLink(OVXLink virtualLink)
Network
removeLink
in class Network<OVXSwitch,OVXPort,OVXLink>
virtualLink
- the linkpublic boolean removeSwitch(OVXSwitch ovxSwitch)
Network
removeSwitch
in class Network<OVXSwitch,OVXPort,OVXLink>
ovxSwitch
- the switchpublic void removeHost(Host host)
Copyright © 2015. All rights reserved.