Monday, February 16, 2009

Simple but Interesting NAT question - Good to know for interview :-)

Around an year back I have been asked a question in interview - hey If a packet is coming to router for both NAT and Routing purpose than what will router do first - Routing & then Natting or Natting then Routing ?

Hmmm...interesting one...Isn't it

I said Routing first and then Natting.
Let me explain why...See if a packet is coming to router on which it has to perform both routing and natting functions than in that case routing function will take precedence. Reason is if a packet is not supposed to be forwarded after routing check than why would router perform Nat function first and later will drop packet because no routing is found for destination subnets. I mean if router will perform Natting first than we are just increasing it's over head. Simple if we are not going to route a packet than we need not to perform Natting on it first.

Best Regards,
Deepak Arora

No comments: