First and foremost, make sure the 4S and 3GS are on the same network. If they are, see what IP address you are getting on the 4S. To do so, go to Settings->Wi-Fi, then tap on the blue > symbol to the right of the network name. If the IP starts with 169.254, a.k.a. a self assigned IP, you are not actually joined to the network. Some newer routers may accept incorrect passwords and will show you are on the network when you are not. If you are getting a self-assigned IP, try renewing the lease. You should also try forgetting the network and rejoining. You can follow that up with resetting the network settings, and restarting the iPhone.