C-4 User’s Reference Guide
When the Netopia R5000 Series Router receives this IP packet from the WWW server, the Netopia R5000 Series Router replaces the destination IP address with 192.168.5.2, the address for Workstation A. The port is changed back to 400, the IP packet checksum is recalculated, and the IP packet is sent to Workstation A on the Netopia R5000 Series Router’s LAN interface.
The reasons for the IP address changes are obvious from the preceding diagram, but what is not so obvious is why the TCP or UDP source ports need to be changed as well. These are changed and maintained in an internal table so the Netopia R5000 Series Router can determine which host on the local LAN interface sent the IP packet and what host the response from the WAN interface is going to go to on the LAN interface. This becomes especially important when two or more hosts on the LAN interface are accessing the same type of service on the Internet, like a WWW server (port 80), for example.
Now look at how two hosts on the LAN interface accessing the same WWW server on the Internet will work:
|
| Netopia Router |
|
WWW Server | ISP Router | LAN: 192.168.5.1 | Workstations |
163.176.4.32 | 200.1.1.1 | WAN: 200.1.1.40 | A & B |
ISP Router to WWW Src IP: 200.1.1.40
Dst IP: 163.176.4.32
Src Port: 5001
Dst Port: 80
ISP Router to WWW Src IP: 200.1.1.40
Dst IP: 163.176.4.32
Src Port: 5002
Dst Port: 80
WWW to ISP Router
Src IP: 163.176.4.32
Dst IP: 200.1.1.40
Src Port: 80
Dst Port: 5002
WWW to ISP Router
Src IP: 163.176.4.32
Dst IP: 200.1.1.40
Src Port: 80
Dst Port: 5001
Router
Netopia to ISP Router
Src IP: 200.1.1.40
Dst IP: 163.176.4.32
Src Port: 5001
Dst Port: 80
Netopia to ISP Router
Src IP: 200.1.1.40
Dst IP: 163.176.4.32
Src Port: 5002
Dst Port: 80
ISP Router to Netopia
Src IP: 163.176.4.32
Dst IP: 200.1.1.40
Src Port: 80
Dst Port: 5002
ISP Router to Netopia
Src IP: 163.176.4.32
Dst IP: 200.1.1.40
Src Port: 80
Dst Port: 5001
Netopia
Wkstn A to Netopia
Src IP: 192.168.5.2
Dst IP: 163.176.4.32
Src Port: 400
Dst Port: 80
Wkstn B to Netopia
Src IP: 192.168.5.3
Dst IP: 163.176.4.32
Src Port: 400
Dst Port: 80
Netopia to Wkstn B
Src IP: 163.176.4.32
Dst IP: 192.168.5.3
Src Port: 80
Dst Port: 400
Netopia to Wkstn A
Src IP: 163.176.4.32
Dst IP: 192.168.5.2
Src Port: 80
Dst Port: 400