public void writeTo(int sock, String data, String IP, int port) throws LowLinkException, TransportLayerException{
    	
        String dest = null;
        
		if(!IPV4Address.isValidIp(IP)){
			Vector<String> addrs = ((ApplicationLayerDevice)mParentStack.getParentNode()).resolve(IP);
			if(addrs.size()>0){
				dest = addrs.get(0);
			}
		}
		else{
			dest = IP;
		}
        
		if(dest != null){
	        (sockTable.get(sock)).dst_IP = dest;
	        (sockTable.get(sock)).dst_port = port;
	        (sockTable.get(sock)).open_state = true;
	        mParentStack.UDP().sendUDPPacket(sock, dest, port, data);
		}
    }