private void sendPacket(Ethernet eth) {
   List<Instruction> ins = treatmentBuilder().build().instructions();
   OFPort p = null;
   // TODO: support arbitrary list of treatments must be supported in ofPacketContext
   for (Instruction i : ins) {
     if (i.type() == Type.OUTPUT) {
       p = buildPort(((OutputInstruction) i).port());
       break; // for now...
     }
   }
   if (eth == null) {
     ofPktCtx.build(p);
   } else {
     ofPktCtx.build(eth, p);
   }
   ofPktCtx.send();
 }
    @Override
    public void handlePacket(OpenFlowPacketContext pktCtx) {
      DeviceId id = DeviceId.deviceId(Dpid.uri(pktCtx.dpid().value()));

      DefaultInboundPacket inPkt =
          new DefaultInboundPacket(
              new ConnectPoint(id, PortNumber.portNumber(pktCtx.inPort())),
              pktCtx.parsed(),
              ByteBuffer.wrap(pktCtx.unparsed()));

      DefaultOutboundPacket outPkt = null;
      if (!pktCtx.isBuffered()) {
        outPkt = new DefaultOutboundPacket(id, null, ByteBuffer.wrap(pktCtx.unparsed()));
      }

      OpenFlowCorePacketContext corePktCtx =
          new OpenFlowCorePacketContext(
              System.currentTimeMillis(), inPkt, outPkt, pktCtx.isHandled(), pktCtx);
      providerService.processPacket(corePktCtx);
    }