Section 1

Preview this deck

General Headers

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (42)

Section 1

(42 cards)

General Headers

Front

May be shared by requests and responses - Cache-control - Date - Transfer-Encoding (chunking to stream large data files in multiple requests / responses) - Connection etc...

Back

OSI - Presentation Layer

Front

OSI L6 - Prepares data being transferred in a format the recipient can understand (ASCII, JPEG, PNG, MPEG, OGG, MIDI) - Encryption / Decryption commonly occur here (SSH S/MIME, SSL/TLS [not purely in pres layer]) - Serialization and deserialization occur here

Back

AJAX

Front

Asynchronous JavaScript and XML

Back

OSI - Session

Front

OSI L5 - Manages setup and teardown of connections (simplex: one way, half-duplex: same conn, on at a time, full duplex: simultaneous two-way) - Masks transport errors from higher OSI levels, including tx/rx sync errors, conn recovery - Sessions help group multiple transport streams belonging to one app so they can be combined and synced at the endpoint

Back

OSI Model

Front

Open Systems Interconnection Model Way to characterize and organize (standardize) telecommunications / computer networks independent of the underlying structure and technology

Back

HTTP -Connections *states *persistence * identification -port -client ID

Front

-Stateless connections -1.0 - single transaction, 1.1 persistent connection until client sends Connection:close header - HTTP usually port 80, HTTPS 443 - Connection identified by <source-IP, source-port> and <destination-IP, destination-port> - client IDd by address, port tuple

Back

OSI - Data-Link

Front

OSI L2 - Frames - Handles problems that occur as a result of bit transmission errors - Ensures data flows at a pace that doesn't overwhelm devices on tx and rx - Permits transmission of data to l3 for addressing and routing - Switches work here

Back

Tools to Monitor Traffic

Front

Fiddler, Charles, Chrome / Webkit Inspector, curl, tcpdump, tshark

Back

TCP

Front

Transmission Control Protocol The TCP stack divides the file into packets, numbers them and then forwards them individually to the IP layer for delivery, handles retransmission of dropped or garbled packets as well as acknowledgement of all packets

Back

Purchasing a domain name

Front

Someone purchases the name, the registrar of the authoritative name servers notifies the registry to update the TLD servers about the update.

Back

OSI - Network

Front

OSI L3 - Packets - Moves data into and through other networks, adds address info and routes data packets - IP works on this level (v4 and v6), also IPX, SPX, ICMP - Network layer can support connection-oriented or connectionless networks, but one network cannot be both - routers work here

Back

HTTP Request Methods (verbs)

Front

GET, HEAD (retrieval only, should be "safe") PUT, POST, DELETE, PATCH (potentially "unsafe") OPTIONS, TRACE, CONNECT

Back

HTTP Connection (client)

Front

- Resolve IP address from host name through DNS - Establish connection with server - Wait for response - Close connection

Back

JQXHR

Front

JQuery XML HTTP Request

Back

OSI - Physical

Front

OSI L1 - (bits) - Defines bits - Determines data rate - Ensures tx / rx devices are synced - Determines direction of transmissions (simplex, half duplex, full-duplex) - Determines how devices are connected to tx medium

Back

Entity Headers

Front

Request or response headers including meta-data about the content (message-body = entity) - Allow Content-Encoding | Content-Language | Content-MD5 | Expires | Last-Modified, etc... - Some Content-* headers are required for message bodies - Fun Fact: Expires: <one year in future> means 'never expires'

Back

OSI - Application Layer

Front

OSI L7, not necessarily the app, but set of services an app can use to comm over n/w - Ensures receiver is identified, can be reached, ready for data - Protocols include DNS (Stateless), HTTP (Stateless), FTP (stateful) - may enable auth through procurement of token - makes sure communication interfaces exist (wi-fi or ethernet)

Back

HTTP Connection (server)

Front

- Establish socket to listen on port 80 (default) - Receive request and parse message - Process response - Add response headers - Send response to client - Close connection if Connection:close header is received

Back

Track Users (in place of login)

Front

- request headers (From, Referer [sic], User-Agent) - Client IP - Fat URL - Cookies (popular, non-intrusive) * server uses Set-Cookie with key/value pairs sep by ;. Can restrict to [domain] and [path] and make persistent with Expires. - Client makes sure to only send [domain] and [path] specific cookies in request with Cookie: name=value header

Back

How can a stateful connection be built on stateless protocol like HTTP?

Front

Cookies, hidden form fields (POST), DOM storage, fat URLs can all transmit info about the client to the server

Back

How are purchases handled if HTTP is stateless?

Front

Some state must be maintained serverside for continuity of experience. This is maintained independent of the protocol.

Back

IPS - Application

Front

IPS L4, handles all process-to-process communication functions - session establishment, maintenance and termination, character code translations, data conversion, compression and encryption, remote access, network management and electronic messaging - DHCP, DNS, LDAP, IMAP, POP, SSH, Telnet, etc operate here

Back

DNS

Front

Service that maps names to IP addresses

Back

General HTTP Request Format

Front

- <start-line> method (i.e. get /logo.gif HTTP/1.1 - <message-header> maybe general and/or request / response-specific headers, entity headers - CRLF (required) - <message body> technically not limited by HTTP, but servers / browsers may

Back

General HTTP Response Format

Front

- <start-line> HTTP/1.1 200 OK - <message-header> maybe general and/or request / response-specific headers, entity headers - CRLF (required) - <message body> technically not limited by HTTP, but servers / browsers may

Back

IPS - Transport

Front

- IPS L3: message segmentation, acknowledgement, traffic control, session multiplexing, error detection and correction (resends), and message reordering - TCP, UDP, SCTP (Stream Control Transmission Protocol - "next-gen TCP intended to improve telephone connections over internet), RSVP - Resource Reservation Protocol (allows channels to be reserved for multicast of video or other high-bandwidth messages)

Back

IP Suite

Front

Client-Server model, multiple clients per server. 4 layer model to represent communication across networks / internet. - Also known as DoD model as it was developed from research at DARPA

Back

UDP

Front

User Datagram Protocol UDP sends datagrams, is considered best-effort communication Where TCP provides error and flow control, UDP does not. UDP is considered connectionless because it doesn't require a virtual circuit to be established before data transfer.

Back

HTTP Request Format

Front

- Request-line = METHOD [space] URI [space] HTTP-Version CRLF body like GET /articles/http-basics HTTP/1.1 Host: www.articles.com (Required in HTTP/1.1) Connection: keep-alive (breaks connectionless convention, but not stateless) Cache-Control: no-cache (HTTP/1.1, client & server) Pragma: no-cache (HTTP/1.0 client only) Accept: text/HTML, application/json... If- headers (-match, -modified-since) will only return an entity as per conditions, otherwise, server will send back 304 Not Modified

Back

type www.google.com into address bar - what happens?

Front

High Level: 1. The browser looks up the IP address for the domain name via DNS (browser cache / OS / DNS) 2. The browser sends a HTTP request to the server 3. The server sends back a HTTP response 4. The browser begins rendering the HTML 5. The browser sends requests for additional objects embedded in HTML (images, css, JavaScript) and repeats steps 3-5. 6. Once the page is loaded, the browser sends further async requests as needed.

Back

IPS - Internet

Front

IPS L2: Functions include traffic routing, traffic control, fragmentation, and logical addressing - IP (v4 and v6), ICMP (Internet Control Message Protocol [reports errors and device unavailability]), IPsec

Back

URI (types and definitions)

Front

URL - Uniform Resource Locator (address) -ftp://this.is.a/thing.txt -http://www.ietf.org/frc/rfc2396.txt mailto:jon.doe@sample.com URN - Uniform Resource Name (name - surprise...) urn:oasis:names:specification:docbook:dtd:xml:4.1.2 urn:isbn:0-486-27557-4 Both URLs and URNs are URIs

Back

set a cookie from a JS script

Front

function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays 24 60 60 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; }

Back

API Auth Methods

Front

- Basic (app passes info to server) - Key (user provided a key on first auth that is used for future auth) - OAuth (allows users account info to be used by third party to gen a token without exposing password) - Machine Auth can take place using certs or through auth keys submitted by device

Back

HTTP Response Format

Front

- <status-line> = HTTP Version [space] Status-Code [space] Reason-Phrase (Human readable version of status code) - Response-Header = Accept-Ranges | Age (time in s since message was generated on server) | ETag (MD5 hash of entity) | Retry-After | Location (used when sending a URL to redirect client), etc...

Back

OSI - Transport

Front

OSI L4 - Ensures reliable arrival of messages cross-network, w/ err checking and flow control - TCP (ports 0-65535 [2^16 unsigned]) is the most common connection-oriented transport-level protocol today - UDP (also ports 0-65535) is a popular connectionless protocol at this level - Transport layer may provide: *same order delivery, data integrity, flow control, congestion avoidance, multiplexing (multiple signal over a shared medium like cable tv channels over one wire)

Back

HTTP Transaction (High level msg format)

Front

Request: - Method (get / put / post, etc) - Headers - Body Response - Status Code - Headers - Body

Back

HTTP Status Codes

Front

1xx - Informational 2xx - Success 3xx - Redirection 4xx - Client Error 5xx - Server error

Back

DNS Process

Front

- Request from client (browser) sent to OS for domain name. if not cached, - OS queries Resolving Name Server, if not cached, - RNS takes the URL request to a root name server, if not cached, - Root server redirects to a TLD name server, if not cached, - TLD server redirects to authoritative NS which maps the name to an IP, mapping is sent back to OS, cached, to client, cached.

Back

IPS - Data Link

Front

IPS L1: - PPP, MAC, Ethernet, DSL, ISDN - This includes frame physical network functions like modulation, line coding and bit synchronization, frame synchronization and error detection, and LLC and MAC sublayer functions.

Back

Authentication factors

Front

In stateless protocols like IP, this can be achieved through a token from the server Factors may include - Knowledge (password / PIN) - Possession (token, app, etc) - Inherence (biometrics) - Location (GPS / network request) - Time

Back

HTML Parser

Front

Tokenize HTML from server, create DOM tree - Script, link, style tags will halt parser (link and style could also halt JS) - While paused, parser will look ahead to fetch images, styles, scripts, etc - fetched depending on where they are inserted in the DOM

Back