コード例 #1
0
ファイル: IPTransition.py プロジェクト: richardzeng1/cs244
def actionInstallMicroflow(packet, replica):
    Globals.INSTALLLOG.write("***Microflow " + ip_to_str(packet.next.srcip) +
                             " to replica " + str(replica) + '\n')
    for i in range(0, Globals.NUMREPLICAS):
        if Globals.REPLICAS[i]['no'] == replica:
            (flow, defaultActions, rewriteActions) = IPs.get_microflow_dstrule(
                packet, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'],
                replica)
            Multipath.install_replica_flow(flow, Globals.SOFT_TIMEOUT,
                                           openflow.OFP_FLOW_PERMANENT,
                                           defaultActions, None,
                                           openflow.OFP_DEFAULT_PRIORITY + 10,
                                           0, None, replica, rewriteActions)
コード例 #2
0
ファイル: IPTransition.py プロジェクト: richardzeng1/cs244
def actionInstallRule(rule):
    Globals.INSTALLLOG.write("***Installing Rule: " + str(rule) + '\n')
    for i in range(0, Globals.NUMREPLICAS):
        if Globals.REPLICAS[i]['no'] == rule['replica']:
            (flow, defaultActions,
             rewriteActions) = IPs.get_forwarding_dstrule(
                 ipstr_to_int(rule['ip']), rule['wild'], Globals.VIP,
                 Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'],
                 Globals.REPLICAS[i]['port'])
            Multipath.install_replica_flow(flow, openflow.OFP_FLOW_PERMANENT,
                                           openflow.OFP_FLOW_PERMANENT,
                                           defaultActions, None,
                                           openflow.OFP_DEFAULT_PRIORITY, 0,
                                           None, rule['replica'],
                                           rewriteActions)
コード例 #3
0
def actionInstallRule(rule):
    Globals.INSTALLLOG.write("***Installing Rule: " + str(rule) + '\n')
    for i in range(0, Globals.NUMREPLICAS):
        if Globals.REPLICAS[i]['no'] == rule['replica']:
            (flow, defaultActions, rewriteActions) = IPs.get_forwarding_dstrule(ipstr_to_int(rule['ip']), rule['wild'], Globals.VIP, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'], Globals.REPLICAS[i]['port'])
	    Multipath.install_replica_flow(flow, openflow.OFP_FLOW_PERMANENT, openflow.OFP_FLOW_PERMANENT, defaultActions, None, openflow.OFP_DEFAULT_PRIORITY, 0, None, rule['replica'], rewriteActions)
コード例 #4
0
def actionInstallMicroflow(packet, replica):
    Globals.INSTALLLOG.write("***Microflow " + ip_to_str(packet.next.srcip) + " to replica " + str(replica) + '\n')
    for i in range(0, Globals.NUMREPLICAS):
        if Globals.REPLICAS[i]['no'] == replica:
            (flow, defaultActions, rewriteActions) = IPs.get_microflow_dstrule(packet, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'], replica)
	    Multipath.install_replica_flow(flow, Globals.SOFT_TIMEOUT, openflow.OFP_FLOW_PERMANENT, defaultActions, None, openflow.OFP_DEFAULT_PRIORITY + 10, 0, None, replica, rewriteActions)