I wish to know how my packets travel from my computer to a web server. Please bear with the long post. I will pose lots of question in between and will upvote if you answer any one of them. I am connected to a LAN, where the router gives me the an IP address via DHCP. So, when I switch on my WiFi, I send a UDP broadcast to port 67. The DHCP server receives the broadcast and assigns me an IP address and the DNS server address. Am I correct so far? So now I open my browser and type say "www.cnn.com". Browser does a DNS lookup and finds the IP address of cnn.com. It then sends the packet to this address. The computer looks at the dest IP address and looks at its routing table. It sees that the dest IP addr is not on the LAN. So. it send the packet to the default gateway (my router). The router usually provides the DHCP service too.
Q1. The router is connected to my ISP and has a WAN IP and a LAN IP. Is this WAN IP globally visible? or is the router also part of a ISP LAN?
Assuming the router has a globally visible IP address. At this point, it should change the src IP address to its own WAN IP address. The router has a WAN MAC address too. Does it change the src MAC address too? I presume each subsequent router which does not have a globally visible IP address will change the src IP address to its own IP address. I am little confused about this.
Q2. Assuming somehow the packets reach the server and I receive a reply back. How does the LAN router know who this packet is for? Does it use NAT to find this out? Does it use MAC (if it did not change the MAC above)? When does ARP come into the picture?
I know there are two type of switches (Layer 2 and Layer 3). What kind of switches are the typical routers (Linksys etc.)?
I know I am asking too many questions and many/all of them might be noobish/dumb. But I really want to know the answers. Please point out if I missed anything in describing the system. I would appreciate if you can provide links to blogs/articles etc.