Intro To Network Flashcards
Network Introduction
Typical Network Setup
SOHO & Enterprise Network form mostly via Ethernet, Wireless
Networking model, architecture or blueprint
Defines a comprehensive set of documents, each document describes one small function required for a network
Network protocol
Set of logical rules that devices must follow to communicate
5 Layer TCP/IP Model
Application, Transport, Network, Data-link, Physical (ATNDP)
Physical Layer
Focuses on how to transmit bits over each individual link
Network Layer
Focuses on delivering data over the entire path from the original sending computer to the final destination computer
Example Protocols, Application? Transport? Internet? Data Link & Physical?
Application - HTTP, POP3, SMTP
Transport - TCP, UDP
Internet - IP, ICMP
Data Link & Physical - Ethernet, 802.11 (Wi-Fi)
Application Layer Purpose?
Provide services to the application software running on computer, does not define the application itself, but it defines services that applications need.
Eg. HTTP defines how web browsers can pull the contents of a webpage from a web server
HTTP Mechanism
A protocol which emphasizes the exchanged of messages between client and server to obtain webpages
HTTP Flows:
1. Open a TCP connection, the TCP connection is used to send a request, or several, and receive an answer. The client may open a new connection, reuse an existing connection or open several TCP connections to the servers
- Send an HTTP message: HTTP messages (before HTTP/2) are human readable. With HTTP/2, these simple messages are encapsulated in frames, making them impossible to read directly, but the principle remains the same. Eg.
GET / HTTP/1.1
Host: developer.mozilla.org
Accept-Language: fr
3. Read the response sent by the server, such as: HTTP/1.1 200 OK Date: Sat, 09 Oct 2010 14:28:02 GMT Server: Apache Last-Modified: Tue, 01 Dec 2009 20:18:22 GMT ETag: "51142bc1-7449-479b075b2891b" Accept-Ranges: bytes Content-Length: 29769 Content-Type: text/html
here comes the 29769 bytes of the requested web page)
- Close or reuse the connection for further request
If HTTP pipelining is activated, several requests can be sent without waiting for the first response to be fully received.
Types of HTTP messages
HTTP messages are how data is exchanged between a server and a client. Two types of messages; requests sent by the client to trigger an action on the server; responses the answer from the server
Encoded in ASCII, and span over multiple lines
HTTP Message Structure
- A start-line describing the requests to be implemented, or its status of whether successful or a failure. This start-line is always a single line.
- An optional set of HTTP headers specifying the request, or describing the body included in the message.
- A blank line indicating all meta-information for the request has been sent.
- An optional body containing data associated with the request (like content of an HTML form), or the document associated with a response. The presence of the body and its size is specified by the start-line and HTTP headers.
HTTP Requests
HTTP requests are messages sent by the client to initiate an action on the server
Start line contains:
1. HTTP method, a verb (GET, PUT or POST) or a noun (like HEAD or OPTIONS), that describes the action to be performed. For example, GET indicates that a resource should be fetched or POST means that data is pushed to the server
- The request target, usually a URL
POST / HTTP/1.1
GET /background.png HTTP/1.0
HEAD /test.html?query=alibaba HTTP/1.1
OPTIONS /anypage.html HTTP/1.0
- HTTP version, defines the structure of the remaining message, acting as an indictor of the expected version to use for the response
Headers:
HTTP headers from a request follow the same basic structure of an HTTP header, a case insensitive string followed by colon and a value whose structure depends upon the header.
Types of headers
- General headers, like Via, apply to the message as a whole
- Request headers like User-Agent, modify the request by specifying it further, by giving context (like Referer) or by conditionally restricting it (like If-None)
- Representation metadata headers, like content-length that describes the encoding and format of the message body (Only present if the message has a body)
Body:
Not all requests have one, requests fetching resources, like GET, HEAD, DELETE or OPTIONS usually dont need one. Mostly used in POST requests
Categories:
- Single resource bodies, consisting of one single file, defined by the two headers: Content-Type and Content-Length
- Multiple resource bodies, consisting of a multipart body, each containing a different bit of information, Typically associated with HTML Forms
HTTP Responses
Status line
1. Protocol version, usually HTTP/1.1
- Status code, indicating success or failure of the request. Common status code are 200, 404 or 302
- Status text, A brief, purely informational, textual description of the status code to help a human understand the HTTP message
Headers:
Similar to HTTP requests
Body:
- Not all responses have one: responses with a status code that sufficiently answers the request without the need for corresponding payload (201 Created or 204 No Content) usually dont
CCNA, HTTP
- To get the webpage from a server, Bob sends a message with an HTTP header. Protocols use headers as a place to put information used by that protocol
- Response from server than return a message beginning with an HTTP header which contains a return code (200). HTTP defines other return codes so that the server can tell the browser whether the request worked.
- Subsequent message are then sent from server to client without an HTTP header. HTTP transfer the data by sending multiple messages, each with a part of the file.
Transport Layer
Includes only a small amount of protocols
Commonly used protocol: TCP, UDP
Provide services to the application layer protocols