A little later this week, you will be learning your first web framework! Before we begin, let's address several language-agnostic concepts that apply to the internet in general.
Because we are learning to build web applications in this Java unit, it is important that we take the time to understand what we mean when we say the internet.
First, let's talk about the Internet.
When we use the term Internet, we refer to millions of networks that are connected to allow devices (computers, laptops, tablets, phones, etc) to communicate with one another and access content.
Similar to the address of your home, the device you use to browse the Internet also has an address called an Internet Protocol address, or IP address for short. This address is assigned by an Internet Service Provider (ISP) (e.g. Comcast, CentruryLink, Verizon).
Similarly, the server for a website you visit also has an IP address. IP addresses are represented with a set of four groups of numbers separated by periods, like this:
You may also see an additional number after an IP Address that's separated from the others by a colon
:, like this:
This additional number is a port number. A port number is like an apartment number or box number after your mailing or home address. It indicates an even more specific location that information will travel to at the particular address.
To recap, we've covered two addresses so far: your device's address and a website's address. Next, let's walk through how your address and the website's address interact when you visit a website on your device.
In order to access a website, you must make a request from a client. The client is usually a web browser like Chrome, Firefox, Safari, or Internet Explorer, but it could be anything that facilitates your interaction with the web and web addresses. A request usually consists of entering a web address in the browser's URL bar, clicking a link, or submitting a form, but it could be anything that triggers a navigational change to a new location on the internet.
When you create a request, the client constructs a message. This message must be formatted using a strict set of rules, or protocol, known as Hypertext Transfer Protocol (HTTP).
Part of this message includes the web address that you are sending your request to. For example, when we click a link to visit this area of the website, the web address
https://www.learnhowtoprogram.com/courses is included.
Hypertext Transfer Protocol (HTTP) can be compared to the formatting rules of addressing an envelope. You can't place the address just anywhere or format the address in any manner you please. There is a protocol for what information is required (street address, city, state, zip), the format it is written in, and where these pieces of information are placed on the envelope. Deviation from this protocol will result in your message, or "letter", not reaching its intended destination.
HTTP has similar standards. It requires certain kinds of information to be placed and formatted in a specific manner in order for the client to reach its destination. For instance, when the request message for
https://www.learnhowtoprogram.com/courses leaves the client, the ISP is the first stop on the round trip to collect the Learn How To Program web content from the server where it is stored.
Before the location of the server can be found, the IP address must be identified using the web address provided in the client's request message. This is the job of Domain Naming System (DNS) servers.
There are hundreds of DNS servers that house databases with the single purpose of resolving web addresses to IP addresses. In our example, a DNS server matches
https://www.learnhowtoprogram.com/courses to the IP address:
220.127.116.11:443. Once resolved to an IP address, your request message is sent to its identified destination,
18.104.22.168:443, which is the server that contains our Learn How To Program website.
The web server receives the message and determines the resource that is being located or acted upon in the request. In our example, the request to view
https://www.learnhowtoprogram.com/courses will gather the resource for displaying the main
Courses page. This resource is an an HTML document. Depending on the website, other resources such as images, stylesheets, scripts and videos may need to be gathered.
When the content is collected, a response is sent to the client. The client interprets the response and the
https://www.learnhowtoprogram.com/courses main page displayed in your browser window.
When you interact again with the site by clicking a link or navigating to a different area, the whole process begins again.
Although you're probably most familiar with making web requests through your web browser, know that any program can actually be a web client. Examples include a program installed on your computer that automatically checks for and downloads updates, an app running on your tablet and even a web server making a request to another web server. Each of these must use the same HTTP protocol.
Client: A computer program that sends a request to another program for data or services (e.g., a web browser is a client that sends requests to a web server).
Server or Web Server: A computer program or device that uses HTTP to distribute information to a client.
Internet Protocol (IP) Address: A set of numbers separated by periods that uniquely identifies a device on the Internet.
Port number: Part of the addressing information used to identify the sender/receiver of requests at an IP address (e.g., 43 is the port number with this IP address: 22.214.171.124:43).
Internet Service Provider (ISP): A company that provides access to the Internet and assigns an IP address to the connecting device.
Hypertext Transfer Protocol (HTTP): A protocol that defines how requests are formatted, transmitted and processed between web clients and web servers.
Domain Naming System (DNS) Servers: The "address book" of the Internet; servers that maintain all domain names and translate them to Internet Protocol (IP) addresses.
Web Resource: The target of a web address; Examples of web resources include files, documents, images, videos, stylesheets, scripts.
To further explore any of these concepts, visit the following articles linked in this lesson: