public static String push(Flow flow) throws IOException, JSONException {

		String warning = "Warning! Pushing a static flow entry that matches IP " +
                "fields without matching for IP payload (ether-type 2048) will cause " +
                "the switch to wildcard higher level fields.";
                
		String jsonResponse = "";
		URL url = new URL("http://" + IP
				+ ":8080/wm/staticflowentrypusher/json");
		URLConnection conn = url.openConnection();
		conn.setDoOutput(true);
		OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
		System.out.println(flow.serialize());
		wr.write(flow.serialize());
		wr.flush();

		// Get the response
		BufferedReader rd = new BufferedReader(new InputStreamReader(
				conn.getInputStream()));
		String line;
		while ((line = rd.readLine()) != null) {
			jsonResponse = jsonResponse.concat(line);
		}
		wr.close();
		rd.close();

		// Wrap the response
		JSONObject json = new JSONObject(jsonResponse);
		
		// Make sure the static flow pusher throws no errors
		if (json.getString("status").equals("Entry pushed") || json.getString("status").equals(warning)) {
			// Get actual flows, we pass null as first parameter to denote that we are not supplying a JSON object
			List<Flow> actualFlows = FloodlightProvider.getRealFlows(flow.getSwitch(), true);
			// Compare the flow you just pushed with those actually on the switch
			// If found, success message printed.
			for (Flow actualFlow : actualFlows) {
			    System.out.println("actual" + actualFlow.serialize());
			    System.out.println("flow" + flow.serialize());
				if (flow.equals(actualFlow)) {
					return "Flow successfully pushed down to switches";
				}
			}
			// If not found give user guidance
			return "Flow pushed but not recognized on any switches. It may have been dropped by the switch of modified by the static flow pusher on the controller." +
					" Check your controller log for more details.";
		} else {
			return json.getString("status");
		}
	}