A metamodeling approach for cross-layer optimization: A framework and application to Voice over WiFi