本文整理汇总了Java中net.floodlightcontroller.devicemanager.internal.AttachmentPoint.getSw方法的典型用法代码示例。如果您正苦于以下问题:Java AttachmentPoint.getSw方法的具体用法?Java AttachmentPoint.getSw怎么用?Java AttachmentPoint.getSw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.devicemanager.internal.AttachmentPoint
的用法示例。
在下文中一共展示了AttachmentPoint.getSw方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeMember
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
public void removeMember(String memberIP, AttachmentPoint ap) {
logger.info("Group:"+this.groupIP + " removeMember: " + memberIP);
AttachmentPoint pap = groupMembers.get(memberIP);
if (pap != null &&
pap.getPort().getPortNumber() == ap.getPort().getPortNumber() &&
pap.getSw() == ap.getSw()) {
groupMembers.remove(memberIP);
if (sourceIP != null)
mcTree.removeMemberFromTheTree(ap);
logger.info("Group:"+this.groupIP + " member with IP {} removed successfully", memberIP);
if (groupMembers.size() == 0) {
/* TODO: */
}
} else {
logger.error("Attachment point mismatch with member " +
"with IP {} while removing", memberIP);
}
}
示例2: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
public void removeMemberFromTheTree(AttachmentPoint ap) {
/* Remove flow from edge switch */
DatapathId dSWId = ap.getSw();
IOFSwitch dSW = switchService.getSwitch(dSWId);
HashSet<OFPort> nps;
Route r = pathsForDestinations.get(ap.getSw().getLong());
if (r == null)
return;
NodePortTuple from = null;
List<NodePortTuple> path = r.getPath();
ListIterator<NodePortTuple> it = path.listIterator(path.size());
while (it.hasPrevious()) {
from = it.previous();
dSWId = from.getNodeId();
dSW = switchService.getSwitch(dSWId);
nps = memberPorts.get(dSWId.getLong());
if (nps == null) {
logger.info("RemoveMemberFromTheTree: unexpected null nps");
return;
}
nps.remove(from.getPortId());
if (nps.size() != 0) {
sendOFGroupModDelMemberMsg(dSW, from.getPortId());
/* switch has downstream member other than one removed*/
break;
}
memberPorts.remove(dSWId.getLong());
if (dSWId.getLong() == sourceAP.getSw().getLong())
sendOFFlowModDropMulticastStream(dSW, false);
else
sendOFFlowModDelForGroup(dSW);
pushOFDeleteGroup(dSW);
if (it.hasPrevious())
from = it.previous();
}
pathsForDestinations.remove(ap.getSw().getLong());
}
示例3: pushQoSFlowForTreePath
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
private void pushQoSFlowForTreePath(Path p, AttachmentPoint destAp, long bandwidth) {
ArrayList<Link> pathLinks = p.getPathLinks();
addLinkUtilsToMap(pathLinks, bandwidth);
Link l = null;
HashSet<OFPort> ports = null;
for (Iterator<Link> it = pathLinks.iterator(); it.hasNext();){
Link uplink = it.next();
treeUpink.put(uplink.getDst().getLong(), uplink);
}
if (p.getPathLength() != 0) {
super.sendOFGroupAddMsg(destAp.getSw(), destAp.getPort(), bandwidth);
ports = new HashSet<>();
ports.add(destAp.getPort());
memberPorts.put(destAp.getSw().getLong(), ports);
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 1 " + destAp.getSw().toString() );
}
Iterator<Link> iter = pathLinks.iterator();
int size = pathLinks.size();
for (int i = 0; i < size-1; i++) {
l = iter.next();
super.sendOFGroupAddMsg(l.getSrc(), l.getSrcPort(), bandwidth);
ports = new HashSet<>();
ports.add(l.getSrcPort());
memberPorts.put(l.getSrc().getLong(), ports);
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 2 " + l.getSrc().toString());
}
OFPort ofp = p.getEndNodePort();
HashSet<OFPort> mems = memberPorts.get(p.getEndNodeId().getLong());
if (mems == null) {
mems = new HashSet<>();
super.sendOFGroupAddMsg(p.getEndNodeId(), ofp, bandwidth);
memberPorts.put(p.getEndNodeId().getLong(), mems);
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 3 " + p.getEndNodeId().toString());
} else {
super.sendOFGroupModAddMemberMsg(p.getEndNodeId(), ofp, bandwidth);
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group member add " + p.getEndNodeId().toString());
}
mems.add(ofp);
}
示例4: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
@Override
public void removeMemberFromTheTree(AttachmentPoint ap) {
// short pbranchNodeShortNumber = 0;
IOFSwitch nodeSW = null;
ArrayList<DatapathId> deleteDpIds = new ArrayList<>();
ArrayList<Link> links = new ArrayList<>();
DatapathId nodeId = ap.getSw();
OFPort memberPort = ap.getPort();
HashSet<OFPort> memPorts = null;
Link upl = null;
/* node id can not be null, it should be at least srcAP id*/
while(nodeId.getLong() != sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(nodeId.getLong());
// pbranchNodeShortNumber = memberPort.getShortPortNumber();
memPorts.remove(memberPort);
if (memPorts.size() != 0) {
break;
}
if(upl != null)
links.add(upl);
deleteDpIds.add(nodeId);
upl = treeUpink.get(nodeId.getLong());
nodeId = upl.getSrc();
memberPort = upl.getSrcPort();
}
removeLinkUtilsToMap(links, this.multicastGroup.bandwidth);
String dids = "[";
int l = ap.getSw().toString().length();
for (ListIterator<DatapathId> itr = deleteDpIds.listIterator() ; itr.hasNext() ;) {
DatapathId d = itr.next();
dids += d.toString().substring(l-2) + ", ";
}
if (nodeId.getLong() != ap.getSw().getLong()) {
dids += nodeId.toString().substring(l-2);
}
dids += " ]";
logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP + " Delete Path " + dids);
nodeSW = switchService.getSwitch(nodeId);
if (nodeId.getLong() == sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(sourceAP.getSw().getLong());
memPorts.remove(memberPort);
if (memPorts.size() == 0) {
sendOFFlowModDropMulticastStream(nodeSW, false);
pushOFDeleteGroup(nodeSW);
memberPorts.remove(sourceAP.getSw().getLong());
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Flow deleted 1 from datapath id " + sourceAP.getSw().toString());
} else{
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Member deleted 1 from datapath id " + sourceAP.getSw().toString());
}
} else {
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Member deleted 2 from datapath id " + nodeId.toString());
}
ListIterator<DatapathId> iter = deleteDpIds.listIterator(deleteDpIds.size());
for ( ;iter.hasPrevious();) {
nodeId= iter.previous();
nodeSW = switchService.getSwitch(nodeId);
sendOFFlowModDelForGroup(nodeSW);
pushOFDeleteGroup(nodeSW);
treeUpink.remove(nodeId.getLong());
memberPorts.remove(nodeId.getLong());
// logger.info("QoSLBMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Flow deleted 2 from datapath id " + nodeId.toString());
}
}
示例5: pushQoSFlowForTreePath
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
private void pushQoSFlowForTreePath(Path p, AttachmentPoint destAp, long bandwidth) {
ArrayList<Link> pathLinks = p.getPathLinks();
Link l = null;
HashSet<OFPort> ports = null;
for (Iterator<Link> it = pathLinks.iterator(); it.hasNext();){
Link uplink = it.next();
treeUpink.put(uplink.getDst().getLong(), uplink);
}
if (p.getPathLength() != 0) {
super.sendOFGroupAddMsg(destAp.getSw(), destAp.getPort(), bandwidth);
ports = new HashSet<>();
ports.add(destAp.getPort());
memberPorts.put(destAp.getSw().getLong(), ports);
// logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP+ " group add 1 " + destAp.getSw().toString() );
}
Iterator<Link> iter = pathLinks.iterator();
int size = pathLinks.size();
for (int i = 0; i < size-1; i++) {
l = iter.next();
super.sendOFGroupAddMsg(l.getSrc(), l.getSrcPort(), bandwidth);
ports = new HashSet<>();
ports.add(l.getSrcPort());
memberPorts.put(l.getSrc().getLong(), ports);
// logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP+ " group add 2 " + l.getSrc().toString());
}
OFPort ofp = p.getEndNodePort();
HashSet<OFPort> mems = memberPorts.get(p.getEndNodeId().getLong());
if (mems == null) {
mems = new HashSet<>();
super.sendOFGroupAddMsg(p.getEndNodeId(), ofp, bandwidth);
memberPorts.put(p.getEndNodeId().getLong(), mems);
// logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP+ " group add 3 " + p.getEndNodeId().toString());
} else {
super.sendOFGroupModAddMemberMsg(p.getEndNodeId(), ofp, bandwidth);
// logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP+ " group member add " + p.getEndNodeId().toString());
}
mems.add(ofp);
}
示例6: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
@Override
public void removeMemberFromTheTree(AttachmentPoint ap) {
IOFSwitch nodeSW = null;
ArrayList<DatapathId> deleteDpIds = new ArrayList<>();
DatapathId nodeId = ap.getSw();
OFPort memberPort = ap.getPort();
ArrayList<Link> links = new ArrayList<>();
HashSet<OFPort> memPorts = null;
Link upl = null;
/* node id can not be null, it should be at least srcAP id*/
while(nodeId.getLong() != sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(nodeId.getLong());
memPorts.remove(memberPort);
if (memPorts.size() != 0) {
break;
}
if(upl != null)
links.add(upl);
deleteDpIds.add(nodeId);
upl = treeUpink.get(nodeId.getLong());
nodeId = upl.getSrc();
memberPort = upl.getSrcPort();
}
removeLinkUtilsToMap(links, this.multicastGroup.bandwidth);
String dids = "[";
int l = ap.getSw().toString().length();
for (ListIterator<DatapathId> itr = deleteDpIds.listIterator() ; itr.hasNext() ;) {
DatapathId d = itr.next();
dids += d.toString().substring(l-2) + ", ";
}
if (nodeId.getLong() != ap.getSw().getLong()) {
dids += nodeId.toString().substring(l-2);
}
dids += " ]";
logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP + " Delete Path " + dids);
nodeSW = switchService.getSwitch(nodeId);
if (nodeId.getLong() == sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(sourceAP.getSw().getLong());
memPorts.remove(memberPort);
if (memPorts.size() == 0) {
sendOFFlowModDropMulticastStream(nodeSW, false);
pushOFDeleteGroup(nodeSW);
memberPorts.remove(sourceAP.getSw().getLong());
logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 1 from datapath id " + sourceAP.getSw().toString());
} else{
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 1 from datapath id " + sourceAP.getSw().toString());
}
} else {
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 2 from datapath id " + nodeId.toString());
}
ListIterator<DatapathId> iter = deleteDpIds.listIterator(deleteDpIds.size());
for ( ;iter.hasPrevious();) {
nodeId= iter.previous();
nodeSW = switchService.getSwitch(nodeId);
sendOFFlowModDelForGroup(nodeSW);
pushOFDeleteGroup(nodeSW);
treeUpink.remove(nodeId.getLong());
memberPorts.remove(nodeId.getLong());
logger.info("ShortestPathTreeLB:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 2 from datapath id " + nodeId.toString());
}
}
示例7: pushQoSFlowForTreePath
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
private void pushQoSFlowForTreePath(Path p, AttachmentPoint destAp, long bandwidth) {
ArrayList<Link> pathLinks = p.getPathLinks();
Link l = null;
HashSet<OFPort> ports = null;
for (Iterator<Link> it = pathLinks.iterator(); it.hasNext();){
Link uplink = it.next();
treeUpink.put(uplink.getDst().getLong(), uplink);
}
if (p.getPathLength() != 0) {
super.sendOFGroupAddMsg(destAp.getSw(), destAp.getPort(), bandwidth);
ports = new HashSet<>();
ports.add(destAp.getPort());
memberPorts.put(destAp.getSw().getLong(), ports);
// logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP+ " group add 1 " + destAp.getSw().toString() );
}
Iterator<Link> iter = pathLinks.iterator();
int size = pathLinks.size();
for (int i = 0; i < size-1; i++) {
l = iter.next();
super.sendOFGroupAddMsg(l.getSrc(), l.getSrcPort(), bandwidth);
ports = new HashSet<>();
ports.add(l.getSrcPort());
memberPorts.put(l.getSrc().getLong(), ports);
// logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP+ " group add 2 " + l.getSrc().toString());
}
OFPort ofp = p.getEndNodePort();
HashSet<OFPort> mems = memberPorts.get(p.getEndNodeId().getLong());
if (mems == null) {
mems = new HashSet<>();
super.sendOFGroupAddMsg(p.getEndNodeId(), ofp, bandwidth);
memberPorts.put(p.getEndNodeId().getLong(), mems);
// logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP+ " group add 3 " + p.getEndNodeId().toString());
} else {
super.sendOFGroupModAddMemberMsg(p.getEndNodeId(), ofp, bandwidth);
// logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP+ " group member add " + p.getEndNodeId().toString());
}
mems.add(ofp);
}
示例8: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
@Override
public void removeMemberFromTheTree(AttachmentPoint ap) {
IOFSwitch nodeSW = null;
ArrayList<DatapathId> deleteDpIds = new ArrayList<>();
DatapathId nodeId = ap.getSw();
OFPort memberPort = ap.getPort();
ArrayList<Link> links = new ArrayList<>();
HashSet<OFPort> memPorts = null;
Link upl = null;
/* node id can not be null, it should be at least srcAP id*/
while(nodeId.getLong() != sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(nodeId.getLong());
memPorts.remove(memberPort);
if (memPorts.size() != 0) {
break;
}
if(upl != null)
links.add(upl);
deleteDpIds.add(nodeId);
upl = treeUpink.get(nodeId.getLong());
nodeId = upl.getSrc();
memberPort = upl.getSrcPort();
}
removeLinkUtilsToMap(links, this.multicastGroup.bandwidth);
String dids = "[";
int l = ap.getSw().toString().length();
for (ListIterator<DatapathId> itr = deleteDpIds.listIterator() ; itr.hasNext() ;) {
DatapathId d = itr.next();
dids += d.toString().substring(l-2) + ", ";
}
if (nodeId.getLong() != ap.getSw().getLong()) {
dids += nodeId.toString().substring(l-2);
}
dids += " ]";
logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP + " Delete Path " + dids);
nodeSW = switchService.getSwitch(nodeId);
if (nodeId.getLong() == sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(sourceAP.getSw().getLong());
memPorts.remove(memberPort);
if (memPorts.size() == 0) {
sendOFFlowModDropMulticastStream(nodeSW, false);
pushOFDeleteGroup(nodeSW);
memberPorts.remove(sourceAP.getSw().getLong());
logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 1 from datapath id " + sourceAP.getSw().toString());
} else{
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 1 from datapath id " + sourceAP.getSw().toString());
}
} else {
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 2 from datapath id " + nodeId.toString());
}
ListIterator<DatapathId> iter = deleteDpIds.listIterator(deleteDpIds.size());
for ( ;iter.hasPrevious();) {
nodeId= iter.previous();
nodeSW = switchService.getSwitch(nodeId);
sendOFFlowModDelForGroup(nodeSW);
pushOFDeleteGroup(nodeSW);
treeUpink.remove(nodeId.getLong());
memberPorts.remove(nodeId.getLong());
logger.info("DynamicGreedySteinerTree:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 2 from datapath id " + nodeId.toString());
}
}
示例9: pushQoSFlowForTreePath
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
private void pushQoSFlowForTreePath(Path p, AttachmentPoint destAp, long bandwidth) {
ArrayList<Link> pathLinks = p.getPathLinks();
addLinkUtilsToMap(pathLinks, bandwidth);
Link l = null;
HashSet<OFPort> ports = null;
for (Iterator<Link> it = pathLinks.iterator(); it.hasNext();){
Link uplink = it.next();
treeUpink.put(uplink.getDst().getLong(), uplink);
}
if (p.getPathLength() != 0) {
super.sendOFGroupAddMsg(destAp.getSw(), destAp.getPort(), bandwidth);
ports = new HashSet<>();
ports.add(destAp.getPort());
memberPorts.put(destAp.getSw().getLong(), ports);
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 1 " + destAp.getSw().toString() );
}
Iterator<Link> iter = pathLinks.iterator();
int size = pathLinks.size();
for (int i = 0; i < size-1; i++) {
l = iter.next();
super.sendOFGroupAddMsg(l.getSrc(), l.getSrcPort(), bandwidth);
ports = new HashSet<>();
ports.add(l.getSrcPort());
memberPorts.put(l.getSrc().getLong(), ports);
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 2 " + l.getSrc().toString());
}
OFPort ofp = p.getEndNodePort();
HashSet<OFPort> mems = memberPorts.get(p.getEndNodeId().getLong());
if (mems == null) {
mems = new HashSet<>();
super.sendOFGroupAddMsg(p.getEndNodeId(), ofp, bandwidth);
memberPorts.put(p.getEndNodeId().getLong(), mems);
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 3 " + p.getEndNodeId().toString());
} else {
super.sendOFGroupModAddMemberMsg(p.getEndNodeId(), ofp, bandwidth);
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP+ " group member add " + p.getEndNodeId().toString());
}
mems.add(ofp);
}
示例10: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
@Override
public void removeMemberFromTheTree(AttachmentPoint ap) {
// short pbranchNodeShortNumber = 0;
IOFSwitch nodeSW = null;
ArrayList<DatapathId> deleteDpIds = new ArrayList<>();
ArrayList<Link> links = new ArrayList<>();
DatapathId nodeId = ap.getSw();
OFPort memberPort = ap.getPort();
HashSet<OFPort> memPorts = null;
Link upl = null;
/* node id can not be null, it should be at least srcAP id*/
while(nodeId.getLong() != sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(nodeId.getLong());
// pbranchNodeShortNumber = memberPort.getShortPortNumber();
memPorts.remove(memberPort);
if (memPorts.size() != 0) {
break;
}
if(upl != null)
links.add(upl);
deleteDpIds.add(nodeId);
upl = treeUpink.get(nodeId.getLong());
nodeId = upl.getSrc();
memberPort = upl.getSrcPort();
}
removeLinkUtilsToMap(links, this.multicastGroup.bandwidth);
String dids = "[";
int l = ap.getSw().toString().length();
for (ListIterator<DatapathId> itr = deleteDpIds.listIterator() ; itr.hasNext() ;) {
DatapathId d = itr.next();
dids += d.toString().substring(l-2) + ", ";
}
if (nodeId.getLong() != ap.getSw().getLong()) {
dids += nodeId.toString().substring(l-2);
}
dids += " ]";
logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP + " Delete Path " + dids);
nodeSW = switchService.getSwitch(nodeId);
if (nodeId.getLong() == sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(sourceAP.getSw().getLong());
memPorts.remove(memberPort);
if (memPorts.size() == 0) {
sendOFFlowModDropMulticastStream(nodeSW, false);
pushOFDeleteGroup(nodeSW);
memberPorts.remove(sourceAP.getSw().getLong());
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Flow deleted 1 from datapath id " + sourceAP.getSw().toString());
} else{
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Member deleted 1 from datapath id " + sourceAP.getSw().toString());
}
} else {
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Member deleted 2 from datapath id " + nodeId.toString());
}
ListIterator<DatapathId> iter = deleteDpIds.listIterator(deleteDpIds.size());
for ( ;iter.hasPrevious();) {
nodeId= iter.previous();
nodeSW = switchService.getSwitch(nodeId);
sendOFFlowModDelForGroup(nodeSW);
pushOFDeleteGroup(nodeSW);
treeUpink.remove(nodeId.getLong());
memberPorts.remove(nodeId.getLong());
// logger.info("QoSLBNBCMulticastTree:Group:"+this.multicastGroup.groupIP +
// " Group Flow deleted 2 from datapath id " + nodeId.toString());
}
}
示例11: pushQoSFlowForTreePath
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
private void pushQoSFlowForTreePath(Path p, AttachmentPoint destAp, long bandwidth) {
ArrayList<Link> pathLinks = p.getPathLinks();
Link l = null;
HashSet<OFPort> ports = null;
for (Iterator<Link> it = pathLinks.iterator(); it.hasNext();){
Link uplink = it.next();
treeUpink.put(uplink.getDst().getLong(), uplink);
}
if (p.getPathLength() != 0) {
super.sendOFGroupAddMsg(destAp.getSw(), destAp.getPort(), bandwidth);
ports = new HashSet<>();
ports.add(destAp.getPort());
memberPorts.put(destAp.getSw().getLong(), ports);
// logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 1 " + destAp.getSw().toString() );
}
Iterator<Link> iter = pathLinks.iterator();
int size = pathLinks.size();
for (int i = 0; i < size-1; i++) {
l = iter.next();
super.sendOFGroupAddMsg(l.getSrc(), l.getSrcPort(), bandwidth);
ports = new HashSet<>();
ports.add(l.getSrcPort());
memberPorts.put(l.getSrc().getLong(), ports);
// logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 2 " + l.getSrc().toString());
}
OFPort ofp = p.getEndNodePort();
HashSet<OFPort> mems = memberPorts.get(p.getEndNodeId().getLong());
if (mems == null) {
mems = new HashSet<>();
super.sendOFGroupAddMsg(p.getEndNodeId(), ofp, bandwidth);
memberPorts.put(p.getEndNodeId().getLong(), mems);
// logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group add 3 " + p.getEndNodeId().toString());
} else {
super.sendOFGroupModAddMemberMsg(p.getEndNodeId(), ofp, bandwidth);
// logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP+ " group member add " + p.getEndNodeId().toString());
}
mems.add(ofp);
}
示例12: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
@Override
public void removeMemberFromTheTree(AttachmentPoint ap) {
IOFSwitch nodeSW = null;
ArrayList<DatapathId> deleteDpIds = new ArrayList<>();
DatapathId nodeId = ap.getSw();
OFPort memberPort = ap.getPort();
ArrayList<Link> links = new ArrayList<>();
HashSet<OFPort> memPorts = null;
Link upl = null;
/* node id can not be null, it should be at least srcAP id*/
while(nodeId.getLong() != sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(nodeId.getLong());
memPorts.remove(memberPort);
if (memPorts.size() != 0) {
break;
}
if(upl != null)
links.add(upl);
deleteDpIds.add(nodeId);
upl = treeUpink.get(nodeId.getLong());
nodeId = upl.getSrc();
memberPort = upl.getSrcPort();
}
removeLinkUtilsToMap(links, this.multicastGroup.bandwidth);
String dids = "[";
int l = ap.getSw().toString().length();
for (ListIterator<DatapathId> itr = deleteDpIds.listIterator() ; itr.hasNext() ;) {
DatapathId d = itr.next();
dids += d.toString().substring(l-2) + ", ";
}
if (nodeId.getLong() != ap.getSw().getLong()) {
dids += nodeId.toString().substring(l-2);
}
dids += " ]";
logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP + " Delete Path " + dids);
nodeSW = switchService.getSwitch(nodeId);
if (nodeId.getLong() == sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(sourceAP.getSw().getLong());
memPorts.remove(memberPort);
if (memPorts.size() == 0) {
sendOFFlowModDropMulticastStream(nodeSW, false);
pushOFDeleteGroup(nodeSW);
memberPorts.remove(sourceAP.getSw().getLong());
logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 1 from datapath id " + sourceAP.getSw().toString());
} else{
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 1 from datapath id " + sourceAP.getSw().toString());
}
} else {
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 2 from datapath id " + nodeId.toString());
}
ListIterator<DatapathId> iter = deleteDpIds.listIterator(deleteDpIds.size());
for ( ;iter.hasPrevious();) {
nodeId= iter.previous();
nodeSW = switchService.getSwitch(nodeId);
sendOFFlowModDelForGroup(nodeSW);
pushOFDeleteGroup(nodeSW);
treeUpink.remove(nodeId.getLong());
memberPorts.remove(nodeId.getLong());
logger.info("LBMulticastTree:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 2 from datapath id " + nodeId.toString());
}
}
示例13: pushQoSFlowForTreePath
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
private void pushQoSFlowForTreePath(Path p, AttachmentPoint destAp, long bandwidth) {
ArrayList<Link> pathLinks = p.getPathLinks();
Link l = null;
HashSet<OFPort> ports = null;
for (Iterator<Link> it = pathLinks.iterator(); it.hasNext();){
Link uplink = it.next();
treeUpink.put(uplink.getDst().getLong(), uplink);
}
if (p.getPathLength() != 0) {
super.sendOFGroupAddMsg(destAp.getSw(), destAp.getPort(), bandwidth);
ports = new HashSet<>();
ports.add(destAp.getPort());
memberPorts.put(destAp.getSw().getLong(), ports);
// logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP+ " group add 1 " + destAp.getSw().toString() );
}
Iterator<Link> iter = pathLinks.iterator();
int size = pathLinks.size();
for (int i = 0; i < size-1; i++) {
l = iter.next();
super.sendOFGroupAddMsg(l.getSrc(), l.getSrcPort(), bandwidth);
ports = new HashSet<>();
ports.add(l.getSrcPort());
memberPorts.put(l.getSrc().getLong(), ports);
// logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP+ " group add 2 " + l.getSrc().toString());
}
OFPort ofp = p.getEndNodePort();
HashSet<OFPort> mems = memberPorts.get(p.getEndNodeId().getLong());
if (mems == null) {
mems = new HashSet<>();
super.sendOFGroupAddMsg(p.getEndNodeId(), ofp, bandwidth);
memberPorts.put(p.getEndNodeId().getLong(), mems);
// logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP+ " group add 3 " + p.getEndNodeId().toString());
} else {
super.sendOFGroupModAddMemberMsg(p.getEndNodeId(), ofp, bandwidth);
// logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP+ " group member add " + p.getEndNodeId().toString());
}
mems.add(ofp);
}
示例14: removeMemberFromTheTree
import net.floodlightcontroller.devicemanager.internal.AttachmentPoint; //导入方法依赖的package包/类
@Override
public void removeMemberFromTheTree(AttachmentPoint ap) {
IOFSwitch nodeSW = null;
ArrayList<DatapathId> deleteDpIds = new ArrayList<>();
DatapathId nodeId = ap.getSw();
OFPort memberPort = ap.getPort();
ArrayList<Link> links = new ArrayList<>();
HashSet<OFPort> memPorts = null;
Link upl = null;
/* node id can not be null, it should be at least srcAP id*/
while(nodeId.getLong() != sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(nodeId.getLong());
memPorts.remove(memberPort);
if (memPorts.size() != 0) {
break;
}
if(upl != null)
links.add(upl);
deleteDpIds.add(nodeId);
upl = treeUpink.get(nodeId.getLong());
nodeId = upl.getSrc();
memberPort = upl.getSrcPort();
}
removeLinkUtilsToMap(links, this.multicastGroup.bandwidth);
String dids = "[";
int l = ap.getSw().toString().length();
for (ListIterator<DatapathId> itr = deleteDpIds.listIterator() ; itr.hasNext() ;) {
DatapathId d = itr.next();
dids += d.toString().substring(l-2) + ", ";
}
if (nodeId.getLong() != ap.getSw().getLong()) {
dids += nodeId.toString().substring(l-2);
}
dids += " ]";
logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP + " Delete Path " + dids);
nodeSW = switchService.getSwitch(nodeId);
if (nodeId.getLong() == sourceAP.getSw().getLong()) {
memPorts = memberPorts.get(sourceAP.getSw().getLong());
memPorts.remove(memberPort);
if (memPorts.size() == 0) {
sendOFFlowModDropMulticastStream(nodeSW, false);
pushOFDeleteGroup(nodeSW);
memberPorts.remove(sourceAP.getSw().getLong());
logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 1 from datapath id " + sourceAP.getSw().toString());
} else{
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 1 from datapath id " + sourceAP.getSw().toString());
}
} else {
sendOFGroupModDelMemberMsg(nodeSW, memberPort);
logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP +
" Group Member deleted 2 from datapath id " + nodeId.toString());
}
ListIterator<DatapathId> iter = deleteDpIds.listIterator(deleteDpIds.size());
for ( ;iter.hasPrevious();) {
nodeId= iter.previous();
nodeSW = switchService.getSwitch(nodeId);
sendOFFlowModDelForGroup(nodeSW);
pushOFDeleteGroup(nodeSW);
treeUpink.remove(nodeId.getLong());
memberPorts.remove(nodeId.getLong());
logger.info("DSTWithNBC:Group:"+this.multicastGroup.groupIP +
" Group Flow deleted 2 from datapath id " + nodeId.toString());
}
}