Subject: One Question

From: [email-masked]
Date: Tue, 20 Apr 2004 13:34:33 +0530

Hi,
First of all sorry for asking non relevent question but somehow it belongs to
IP. So hopefully I will get a reply for this question.
Actually long back when I just started the work on IP then i came across one
problem. As for my company we have IP addresses in our LAN and we have one entry
for default IP address which is used if our destination IP address doesnt match
with anyone in our ARP cache. Now router decides whether this IP address belongs
to outer world or not based upon its net address and routes it accordingly.
Now the question was if the source IP address remains same as my host address in
LAN or it is replaced by router's IP address. If it remains the same then it
gives a logical picture and packet can travel from destination to source(reverse
path). But if it is replaced by router's address then how can packets come to
source address. According to my understanding source IP address doesnt change
and it works in a unique fashion. But it this is the case then why we give only
one IP address to corporates. We give it because we dont want to use so many
IP addresses for a corporate and IP addresses are limited.
Even this is one of the reason we are going towards IPv6.

Please give me some clear picture of this.
Thanks and excuse me of non relevent question. But this is the place where I can
get best answer.

Regards
Tarun Sharma

---

From: [email-masked]
Date: Tue, 20 Apr 2004 16:18:32 +0530

This is what is written in RFC for NAT(1631). Which is confusing me. 

   For instance, in the example of figure 2, both stubs A and B 
   internally use class A address 10.0.0.0. Stub A's NAT is assigned the 
   class C address 198.76.29.0, and Stub B's NAT is assigned the class C 
   address 198.76.28.0. The class C addresses are globally unique no 
   other NAT boxes can use them. 

                                       \ | / 
                                     +---------------+ 
                                     |Regional Router| 
                                     +---------------+ 
                                   WAN |           | WAN 
                                       |           | 
                   Stub A .............|....   ....|............ Stub B 
                                       |           | 
                     {s=198.76.29.7,^  |           |  v{s=198.76.29.7, 
                      d=198.76.28.4}^  |           |  v d=198.76.28.4} 
                       +-----------------+       +-----------------+ 
                       |Stub Router w/NAT|       |Stub Router w/NAT| 
                       +-----------------+       +-----------------+ 
                             |                         | 
                             |  LAN               LAN  | 
                       -------------             ------------- 
                                 |                 | 
               {s=10.33.96.5, ^  |                 |  v{s=198.76.29.7, 
                d=198.76.28.4}^ +--+             +--+ v d=10.81.13.22} 
                                |--|             |--| 
                               /____\           /____\ 
                             10.33.96.5       10.81.13.22 

                     Figure 2: Basic NAT Operation 

   When stub A host 10.33.96.5 wishes to send a packet to stub B host 
   10.81.13.22, it uses the globally unique address 198.76.28.4 as 
   destination, and sends the packet to it's primary router. The stub 
   router has a static route for net 198.76.0.0 so the packet is 
   forwarded to the WAN-link. However, NAT translates the source address 
   10.33.96.5 of the IP header with the globally unique 198.76.29.7 

Now I am bit more confused. Suppose I am sitting in A network and I want to communicate with the host in B network. Now if my
IP address is 10.33.96.5, and the other's address is 10.81.13.22. Now what would be my destination address in my packet. 10.81.13.22 or
198.76.28.4. Now if i use class C address then How will that router know that for which of its host this packet belongs. There could be
N host in that LAN. I dont know the solution to this problem 

regards 
-tarun