3

When I capture packets using the packet analyser wireshark while visiting http://en.wikipedia.org/wiki/Hydrogen I can see packets that use the HTTP protocol (e.g.a GET request). My Get request uses 4 protocols: Ethernet II, IPv4, TCP and HTTP. For the IPv4 I can see my own local IPv4 address of my pc as the source, for the destination I see the IPv4 address 91.198.174.225. When I go to this address in my browser I get to some wikipedia related website that says'wiki does not exist'. Why am I not seeing the Hydrogen article when I go to that ip address?

0

3 Answers 3

9

Most probably because wikipedia is running virtual hosts; the server 91.198.174.225 has multiple hostnames.
For example fr.wikipedia.org has the same IP address. A big machine can have hundreds of virtual hosts, limited by CPU, memory and bandwidth for that machine


Web browsers add a Host: header to the request, which is the hostname from the URL you type in. The webserver will serve a different 'virtual server' including different pages depending on the Host: header of the request. When you go to the server using the IP address, you send the IP address as the Host:. The webserver has a base configuration for that request, but likely not the one you expect.

3

It is routine for multiple web sites to be served from the same IP address. Using the IP address in the URL is not enough for these sites. You must provide the proper domain name, which your browser will put into an HTTP Host header which tells the server which website you want.

1

While your requests are identical at the TCP layer and below, they differ on the HTTP layer. You will notice, that in your first request the Host field in the header contains the hostname that was found in your original URI while the request with the IP address instead of the hostname has an Header field which is empty or contains only the IP address. See RFC 2616 for technical details.

Without the Host field there would be no possibility for the server to know to which host the request was directed. This would not allow using multiple hostnames (with different websites) on one IP address. Mass web hosting would be inefficient because it would require dedicated IP addresses for each hostname. The concept of virtual hosts solves this problem by using the Host header field to distinguish requests to different hostnames and allows an unlimited number of hostnames on one IP address and serve different content on each of them. Wikipedia probably uses this to serve the different language editions from the one server that you asked. Without the hostname your request lacks the information, which language is requested.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .