The Application Layer Flashcards
(37 cards)
What is the application layer?
the application layer is not theapplication itself, but rather a set of protocols which provide communication services to applications.
What do application layer protocols focus on?
Application layer protocols rely on the protocols at the layers below them to ensure that a message gets to where it is supposed to, and focus instead on the structure of that message and the data that it should contain.
What are the protocols used at the application layer?
There are a wide number of different application layer protocols for different use cases including HTTP, SMTP, FTP, etc.
What is a URI?
Uniform Resource Identifier(URI), is a string of characters which identifies a particular resource.
What is HTTP?
Hypertext Transfer Protocol(HTTP) is the set of rules which provide uniformity to the way resources on the web are transferred between applications.
What model of communication does HTTP use?
HTTP follows a simple model where a client makes arequestto a server and waits for aresponse. Hence, it’s referred to as arequest response protocol
What is DNS?
The Domain Name System provides a way to look up unknown server IP addresses.
What steps does DNS use?
- Enter a URL likehttp://www.google.cominto your web browser’s address bar.
- The browser creates an HTTP request, which is packaged up and sent to your device’s network interface.
- If your device already has a record of the IP address for the domain name in its DNS cache, it will use this cached address. If the IP address isn’t cached, a DNS request will be made to the Domain Name System to obtain the IP address for the domain.
- The packaged-up HTTP request then goes over the Internet where it is directed to the server with the matching IP address.
- The remote server accepts the request and sends a response over the Internet back to your network interface which hands it to your browser.
- Finally, the browser displays the response in the form of a web page.
What does it mean for a protocol to be stateless?
A protocol is said to bestatelesswhen it’s designed in such a way that each request/response pair is completely independent of the previous one. HTTP is a stateless protocol.
What affect is caused by HTTP being stateless?
Because of HTTPs statelessness, it is challenging to build stateful web applications
What is a url?
Uniform Resource Locator orURL, is the most frequently used part of the general concept of a Uniform Resource Identifier orURI, which specifies how resources are located.
What are the components of the URL:
HTTP://www.example.com:88/home?item=book
-
http
: Thescheme. It always comes before the colon and two forward slashes and tells the web client how to access the resource. In this case it tells the web client to use HTTP to make a request. -
www.example.com
: Thehost. It tells the client where the resource is hosted or located. -
:88
: Theportor port number. It is only required if you want to use a port other than the default. -
/home
: Thepath. It shows what local resource is being requested. This part of the URL is optional. -
?item=book
: Thequery string, which is made up ofquery parameters. It is used to send data to the server. This part of the URL is also optional.
What are query strings?
It is used to send data to the server as part of the URL
What is URL encoding?
URLs are designed to accept only certain characters in the standard 128-characterASCII character set. Reserved or unsafe ASCII characters have to be encoded.
URL encoding replaces these non-conforming characters with a%
symbol followed by two hexadecimal digits that represent the equivalent UTF-8 character.
What are the limitations of query strings?
- Query strings have a maximum length. Therefore, if you have a lot of data to pass on, you will not be able to do so with query strings.
- The name/value pairs used in query strings are visible in the URL. For this reason, passing sensitive information like username or password to the server in this manner is not recommended.
- Space and special characters like
&
cannot be used with query strings. They must be URL encoded, which we’ll talk about next.
When must characters be URL encoded?
- They have no corresponding character within the standard ASCII character set. Note that this means all extended ASCII characters as well as 2-, 3-, and 4-byte UTF-8 characters.
- The use of the character is unsafe since it may be misinterpreted or modified by some systems. For example,
%
is unsafe since it is used to encode other characters. Other unsafe characters include spaces, quotation marks, the#
character,<
and>
,{
and}
,[
and]
, and~
, among others. - The character is reserved for special use within the URL scheme. Some characters are reserved for a special meaning; their presence in a URL serves a specific purpose. Characters such as
/
,?
,:
,@
, and&
are all reserved and must be encoded. For example&
is reserved for use as a query string delimiter.:
is also reserved to delimit host/port components and user/password.
What are the 2 main HTTP request methods?
GET & POST
What is a GET request used for?
- GET requests are used to retrieve a resource, and most links are GETs.
- The response from a GET request can be anything, but if it’s HTML and that HTML references other resources, your browser will automatically request those referenced resources. A pure HTTP tool will not.
What is an HTTP POST request used for?
POST
is used when you want to initiate some action on the server, or send data to a server.
TheHTTPbody contains the data that is being transmitted in an HTTP message and is optional. You can think of the body as the letter enclosed in an envelope, to be posted.
What are HTTP headers?
HTTP headers allow the client and the server to send additional information during the HTTP request/response cycle. Headers are colon-separated name-value pairs that are sent in plain text. For example, when you click a button to submit a form, Your browser issues an initialPOSTrequest, gets a response with aLocationheader, then issues another request without any action from you, then displays the response from that second request.
What is a response status code?
Thestatus codeis a three-digit number that the server sends back after receiving a request signifying the status of the request.
What is response code 302?
this happens when the resource has been moved
What is response code 404
resource not found
What is response code 500?
Internal server error