Application Layer
The Application Layer is the topmost layer of the Internet Protocol and is focused on providing services to the applications that we use. There are many different protocols that are used on the application layer: HTTP, HTTPS, FTP, SMTP, DNS, IRC to name a few. We will be focusing on HTTP and HTTPS.
HTTP
HTTP (Hyper Text Transfer Protocol) is the major protocol responsible for providing us with the World Wide Web which perhaps unsurprisingly is one of (if not THE) greatest uses of the Internet. The purpose of HTTP is to connect a user to a server that hosts web content, create a connection, then send requests back and forth between the client (the computer that you are using to browse the web) and the server (computer somewhere out in the wilds of the Internet).
|
A typical scenario using HTTP will go something like this:
Task:
a) Make your own notes of the main parts of the process above.
b) Study your notes and try to rewrite them from memory. Adjust until you are confident with this.
- You look up a web address in your browser. If you have been there before then your local cache will probably have the IP address for it, otherwise it will ask a Domain Name System (DNS) server to provide it to you. All web addresses are linked to a unique IP address, DNS servers keep a record of these and provide them to us.
- Once your browser has the IP address it will initiate a TCP connection (covered in future lessons) to establish a reliable connection.
- When the connection is established, the browser sends an HTTP request to the server asking for the desired content (web page, video, image)
- The server processes the request and sends back the content in an HTTP response. The response includes the data necessary to render it properly.
- The client receives the content and renders it in the browser.
Task:
a) Make your own notes of the main parts of the process above.
b) Study your notes and try to rewrite them from memory. Adjust until you are confident with this.
HTTP requests
There are a number of different methods that HTTP uses to request data, we are going to focus on five of them:
|
These methods send, receive and change data. When talking about HTTP requests we sometimes term them as "safe" or "unsafe" - this merely refers to whether or not they will (or might) change the state of the server. Of the above methods only GET is considered safe as it is simply receiving data, all of the rest have the potential to change the state of the server.
Task:
Take notes for each of the above status codes. Memorise your notes. Write them out.
Task:
Take notes for each of the above status codes. Memorise your notes. Write them out.
Spend some time going through these resources, then do the activities below:
CS Field Guide
Khan Academy - HTTP
Read this page at geeks for geeks until the PATCH & DELETE requests
Tasks:
1) In 150 words, write about what HTTP requests happen when you go to YouTube and request a video. Hint: it might be helpful to check out the "Network" tab in Developer Tools (right click and go inspect, or press F12) and see what is there.
2) For each of the following, identify which HTTP request you feel would be best for these scenarios AND give a short explanation why:
CS Field Guide
Khan Academy - HTTP
Read this page at geeks for geeks until the PATCH & DELETE requests
Tasks:
1) In 150 words, write about what HTTP requests happen when you go to YouTube and request a video. Hint: it might be helpful to check out the "Network" tab in Developer Tools (right click and go inspect, or press F12) and see what is there.
2) For each of the following, identify which HTTP request you feel would be best for these scenarios AND give a short explanation why:
- Retrieving a web page
- Submitting a login form
- Search for products on Temu
- Updating user profile information
- Adding an item to a shopping cart
- Retrieving a list of orders
- Deleting a user account
- Uploading a file
- Voting on a poll
- Getting weather data
- Sending a message in discord
- Removing an item from your cart