Char onion and ginger in a dry pot over medium heat for 3–5 minutes.
Toast spices (cinnamon, cloves, star anise, coriander) in the pot until fragrant.
Add carrots, mushrooms, soy sauce, and broth. Bring to a boil and simmer 30–45 minutes.
Strain the broth. Adjust seasoning with salt or more soy sauce.
Cook noodles according to package instructions. Drain and set aside.
Pan-fry tofu in oil until golden and crisp.
Assemble bowls with noodles, tofu, bean sprouts, herbs, and lime.
Pour hot broth over bowls and serve immediately with optional sauces.