How does the sender of a data packet know the IP address of the receiver?
Let's now take a look at our 2nd scenario. (Scenario 1)
Scenario 2 – Two hosts transferring data over the Internet
This scenario Host1 is a simply computer, while Host 2 is a web server. Even though we call Host2 a 'web server' it still is considered an actual 'host', with a specific purpose.
Host1 needs to contact SearchNetworking.com's Web server (Host2) in order to download a page from it and therefore must construct a packet that will request the Web page it needs.
Before the request packet can be sent, Host1 must find out the IP address of www.searchnetworking.com. Once this step is complete, it has all the required information to send its request and wait for the response.
As with every host connected to the Internet, Host1 has been configured to use a specific DNS server. This could be a DNS server located within Host1's office or simply its ISP's (Internet Service Provider) DNS server.
Host1 constructs a DNS request packet and sends it to its configured DNS server. In this packet, Host1 asks the DNS server to resolve www.searchnetworking.com to an IP address. As soon as the DNS server receives the request, it searches within its memory and database for a match, if it doesn't find one, it will proceed to ask another DNS server (this is called a recursive query) until the answer is found. When this process is complete, the original DNS server that received Host1's request will send a reply to Host1 containing the IP address it was after. In this example, the IP address will be 22.214.171.124.
Host1 has now obtain all the information it needs, so it proceeds to the next step, that is, to contact SearchNetworking.com's Web server and request the Web page it needs.
The request packet it sends to the Web server will contain the following information:
- Destination IP address (126.96.36.199)
- Host1's IP address (analyzed below)
- Application data (www request)
I've intentionally left out Host1's IP address because it will vary depending on the way Host1 is connected to the Internet.
If Host1 is directly connected via a modem, then the IP address field will be substituted with the one his ISP assigns to him:
In the case Host1 connects to the Internet through his office network, then it will contain his private IP address, that is, 192.168.0.10.
In this particular case, the 192.168.0.10 address will be replaced with a real (public) IP address by Host1's network gateway, which could be a router or other dialup device:
Depending on the complexity, the originating packet might be modified a few times until it reaches its destination. This is the case for the 2nd scenario.
On the other hand, scenario 1 looks at the big picture as simple as possible, where no alterations will occur.
Dig Deeper on Wireless LAN (WLAN)
Related Q&A from Chris Partsenidis
A half-duplex transmission could be considered a one-way street between sender and receiver. Full-duplex, on the other hand, enables two-way traffic ... Continue Reading
SFP ports enable Gigabit switches to connect to a wide variety of fiber and Ethernet cables in order to extend switching functionality throughout the... Continue Reading
A MAC address and an IP address each identify network devices, but they do the job at different levels. Explore the differences between the two and ... Continue Reading