In a large pot, bring the pork or chicken stock to a boil over medium-high heat. Add the pork ribs (if using), onion, and dried shrimp, letting everything simmer gently for about 15 minutes to allow the flavors to meld. Skim any foam from the surface to keep the broth clear.
Add the shrimp paste, fish sauce, and salt to the broth, stirring well to blend the seasoning. The shrimp paste gives Bún Riêu its distinctive aroma and taste, but adjust to your preference if you prefer a milder flavour.
In a mixing bowl, combine the fresh crab meat with the eggs, fish sauce, and pepper. Stir well to make a smooth mixture. If fresh crab meat isn’t available, you can use a jar of canned crab paste, but adjust the seasoning as it may be more intense.
Reduce the heat to low, then gently pour spoonful’s of the crab mixture into the simmering broth. Allow the mixture to set for a few minutes without stirring, letting it form into tender, fluffy pieces.
Add the chopped tomatoes to the broth, and continue simmering until the tomatoes soften, about 10 minutes. The tomatoes will release a slight tanginess that balances the broth's richness.
Prepare the rice noodles by cooking them according to package instructions or rinsing them briefly in hot water. Drain and set aside, ready for serving.
Add the fried tofu cubes to the broth, allowing them to soak up the flavors for a few minutes. Taste the broth and adjust seasoning with salt or fish sauce if needed.
To serve, place a generous portion of noodles in each bowl, then ladle the hot broth, crab mixture, and tofu over the noodles. Garnish with fresh herbs, bean sprouts, and chili slices as desired. Serve with lime wedges and extra chili paste on the side to allow guests to adjust to taste.