def unblock(self, ip):
     msg = of.ofp_packet_out()
     action = of.ofp_action_output(port=of.OFPP_CONTROLLER)
     msg.actions.append(action)
     match = of.ofp_match()
     match.nw_src = IPAddr(ip)
     #match.nw_dst = IPAddr(ip[1])
     msg.command = of.OFPFC_DELETE
     msg.match = match
     print self.colours["WHITE"] + "unblocking ", ip + self.colours["END"]
     for connection in core.openflow.connections:
         connection.send(msg)
 def unblock(self, ip):
     msg = of.ofp_packet_out()
     action = of.ofp_action_output(port=of.OFPP_CONTROLLER)
     msg.actions.append(action)
     match = of.ofp_match()
     match.nw_src = IPAddr(ip)
     # match.nw_dst = IPAddr(ip[1])
     msg.command = of.OFPFC_DELETE
     msg.match = match
     print self.colours["WHITE"] + "unblocking ", ip + self.colours["END"]
     for connection in core.openflow.connections:
         connection.send(msg)
 def sendLatencyEthernetPacket(self,outPort,switch):
     ether = pkt.ethernet()
     ether.type = 0001 #arbitary type
     ether.dst = EthAddr("ff:ff:ff:ff:ff:ff")
     ether.src = EthAddr("01:02:03:04:05:06")
     
     msg = of.ofp_packet_out()
     action = of.ofp_action_output(port=outPort)
     msg.actions.append(action)
     
     self.timeStamp= time.time()
     msg.data = ether
     switch.send(msg)
    def sendLatencyEthernetPacket(self, outPort, switch):
        ether = pkt.ethernet()
        ether.type = 0001  #arbitary type
        ether.dst = EthAddr("ff:ff:ff:ff:ff:ff")
        ether.src = EthAddr("01:02:03:04:05:06")

        msg = of.ofp_packet_out()
        action = of.ofp_action_output(port=outPort)
        msg.actions.append(action)

        self.timeStamp = time.time()
        msg.data = ether
        switch.send(msg)
 def sendLatencyEthernetPacket(self,outPort,switch):
     ether = pkt.ethernet()
     #effective_ethertype
     ether.type = 0001 #arbitary type, taken from paper
     ether.dst = EthAddr("ff:ff:ff:ff:ff:ff")
     ether.src = EthAddr("01:02:03:04:05:06")
     msg = of.ofp_packet_out()
     action = of.ofp_action_output(port=outPort)
     msg.actions.append(action)
     self.timeStamp= time.time()
     #timeStamp = time.time()
     #ether.payload = timeStamp
     msg.data = ether
     print "sending ethernet packet"
     switch.send(msg)
     "put time stamp in etherpacket. this is working, just need to add payload"