private void sendICMP(int type, byte[] data, String src) 
			throws IOException {
		byte[] ipUDP = new byte[28];
		
		for (int i = 0; i < ipUDP.length; i++) {
			ipUDP[i] = data[i];
		}
		
		InetAddress sender = findMatch(src); 
		
		InetAddress virtSrc = InetAddress.getByName(src);
		
		IP_Header ipHeader = new IP_Header(1);
		ipHeader.setDestination(virtSrc);
		ipHeader.setSource(routerAddresses.get(0));
		ipHeader.setDataSize(36);
		String ipBits = ipHeader.getBitString();
		
		byte[] ipBytes = new byte[20];
		
		/* Converts the bit strings into bytes and adds them
		 * to the byte array. */
		for (int i = 0; i < ipBytes.length; i++) {
			int start = i * 8;
			int end = start + 8;
			
			String octet = ipBits.substring(start, end);
			
			ipBytes[i] = (byte) Integer.parseInt(octet, 2);
		}
		
		ICMP_Header icmp = new ICMP_Header(type);
		byte[] icmpBytes = icmp.getBytes(ipUDP);
		icmpBytes = icmp.getBytes(ipUDP); // Need this twice!
				
		byte[] packetBytes = new byte[ipBytes.length + icmpBytes.length];
		
		for (int i = 0; i < ipBytes.length; i++) {
			packetBytes[i] = ipBytes[i];
		}
		
		for (int i = 0; i < icmpBytes.length; i++) {
			packetBytes[i + ipBytes.length] = icmpBytes[i];
		}
		
		DatagramPacket sendPkt = new DatagramPacket(packetBytes, 
				packetBytes.length, sender, PORT);
		
		routerSocket.send(sendPkt);
		
		System.out.println("Sent ICMP type " + type + " to " + src);
	}