Afghanistan and Pakistan have entered an open war after months of tensions and clashes over militant groups.