Web Technology Flashcards
1
Q
internet
A
- physical connect of all the computers that are joined together across the world
2
Q
world wide web
A
- the web pages (html pages) stored and shared on the internet
- just one type of data on the internet
- distinct from emails, instant message, ftp, etc.
3
Q
buffer
A
- temporary holding place for data
- data is usually being moved from one place to another
- intentionally limited in size
4
Q
URL
A
- naming scheme for web addresses
8 parts
- protocol/schema
- subdomain
- domain name
- top-level domain
- port
- path
- query
- fragment/anchor
5
Q
doctype
A
- a tag added to the top of an HTML document
- is not itself html, but instruction to browser
- used to indicate which version of HTML is being used
- HTML 5:
*
6
Q
stream
A
- pieces of data are delivered over time
- together, they comprise one item
- ex: video
7
Q
pipe
A
- mechanism for sending data from one stream to another
8
Q
environment variables
A
- global variables specific to the environment (server) where code resides
- different servers have different environment variables based on their settings
9
Q
serialize
A
- convert an object into a structured text format
- this format can be sorted in a file or transferred across the internet
- ex: converting to JSON, csv, XML, etc.
10
Q
character set
A
- a mapping of characters to numbers
- ex: ascii
11
Q
code point
A
- the number used to represent a letter in a particular character set
12
Q
character encoding
A
- the number of bits used to represent a code point in a character set
- ex: UTF-8 uses 8 bits to represent unicode
13
Q
tcp/ip
A
- also know as internet protocol suite
- term for common protocols used in internet communcation
- tcp/ip often groups together because they are so interconnected
- routable protocol
4 Layers
[4] Application
- defines how information is structured
- http/ftp/smtp
[3] Transport
- oversees the connection
- tcp/udp
[2] Internet
- responsible for addressing, packaging and routing
- IP (et al.)
[1] Network Access Layer
- hardware
- ethernet, wifi, etc.
14
Q
ip (address)
A
- internet protocol
- protocol defining how computers are named on the internet
- ip addresses
- store information about the address of the device itself, and the subnet it belongs to
15
Q
private ip address
A
- internal private address defined within a private network
- home or business generally shares one public ip address
- within the network, each device receives a private ip address
- there are ranges of IP addresses designated for private IPs (192.168.X.Y)
- these are never given out on the public internet
16
Q
sockets
A
- an endpoint in a two-way connection between two computers on a network
- pairing of a specific IP and port
17
Q
routable/non-routable protocol
A
- routable protocol
- network protocol in which data can be passed between subnetworks (thorugh a router)
- allows a newtork can be divided in multiple subnetworks
- non-routable protocol
- data cannot pass through a router
- data can only be shared within a subnet
18
Q
transport protocols
A
- tcp/udp
- protocol that defines how information is sent over the internet (how computers communicate)
- distinct from http, ftp etc, which defines how the information is structured
- operating systems have the ability to use tcp/udp
- protocols also allow one computer to forge mutliple connections (using separate ports)
Works by:
- spliting information into pieces (packets)
- sending individual packets between computers
19
Q
TCP
A
- Transmission Control Protocol
- the preeminent transport protocol for the internet
- connection based (requires connection to be established before data can be sent)
- 3-way handshake
- allows for delivery acknowledgement
- tcp will arrange packets in order (packets are numbered)
- provides error detection
- bigger overhead than udp
- resends data when package goes missing
- provides congestion-control
- delay transmission of data when network is congested
- but this might be a problem for real-time communication as tcp might delay transmission intentionally
- use when
- data loss can’t be tolerated
- data needs to be inorder
- require delivery acknowledgements
20
Q
UDP
A
- User Datagram Protocol
- a transport layer protocol, similar to TCP
- lightweight, but less reliable
- has smaller packet size
- connectionless (don’t have to create a connection first)
- does not arrange packets in order
- has error-detection, but does not try to recover when error occurs
- no compensation for lost packages
- use when:
- some loss can be tolerated
- ex: video conferencing
- also, local networks (less risky)
21
Q
HTTP
A
- hypertext transfer protocol
- protocol for structuring data
- stateless, every request is indepdent of previous requests
- aquire state through sessions/cookies
Consists of:
- Request line/Status line
- GET file_name HTTP/version
- Headers
- name/value pairs
- [space]
- Body (html, image, file, css, JSON)
22
Q
HTTP persistence
A
- also called HTTP keep-alive, or HTTP connection reuse
- when a single TCP connection is kept open, and used for multiple requests/responses
- as opposed to creating a new connection every time a new request is made
- often used in conjunction wtih pipelining
- persistent connections + pipelining is defult in HTTP 1.1
23
Q
HTTP pipelining
A
- when multiple HTTP requests are sent via the same connection, at the same time, without waiting for responses
- especially useful for high latency connections (like satellite internet)
- often used in conjunction with HTTP persistence
- persistent connections + pipelining is defult in HTTP 1.1
24
Q
MIME Type
A
- Multipurpose Internet Mail Extensions
- standard for specifying type of data being sent
- originally for specifycing kind of attachment in email
- included in an http request via the ‘Content-Type’ header
-
Examples:
- applicaiton/json
- text/html
- image/jpeg
25
Q
port
A
- when computer receives a packet, port indicates which application a computer should send a packet to
- Can assign an application to any port we want
- ex:
- http requests use port 80
- https uses port 443
26
Q
port forwarding
A
- configuring a router in order to make a computer in the subnet accessible to from the internet
- port forwarding redirects traffic requests through admissable ports to a specific computer in local network
- ex: router will forward incoming traffic on port 80 to a specific server/computer
- useful to circumvent default gateways that set up firewalls on incoming connections
27
Q
dhcp
A
- Dynamic Host Configuration Protocol
- dynamically assigns basic network information to each computer in subnet
- assigns ip address
- assigns subnet mask
- assign default gateway
- assign DNS servers
- usually built into small home/business router
- keeps track of which computer has which IP address
- gives each comptuer a lease time
- lease on how long computer is allowed to “own” IP address
28
Q
NAT
A
- Network Address Translation
- remaps private IPs in a subnet to the public IP of the default gateway while packet in en route
- when information arrives from outside to default gateway, NAT knows which internal client to send response to
- removes the need for every device to need a unique IP
29
Q
visiting a website
A
12 Steps
- Type in domain name
- Browser does domain name lookup using DNS resolution
- Browser translates human-readable name into an IP
- Client creates a connection to server using 3-way handshake
- Send HTTP request with a command (get this file) in the form of packets (virtual envelope)
- To: destination IP address
- From: sender’s IP address
- Computer sends packet to default gateway, then it starts travelling from router to router
- Might go through as many as 30 routers
- Google get envelope
- Sees message, and looks for requested file (index.html/index.php)
- Makes a new envelope with file, flips to/from
- Client gets envelope with HTML/CSS/JS
- Browser interprets it
- Large institution and ISP have DNS servers
- Harvard does
- Optimum does
- If institution (small college campus) doesn’t have address in DNS server
- Hierarchy of DNS system
- From local DNS server, maybe on a campus
- To an ISP
- If no one in hierarchy of DNS knows, there are route servers
- Route servers are distributed across continents
- They know who to ask
- Large institution and ISP have DNS servers
- Once computer figures out where to send request, it constructs HTTP message
- ISP has default gateway (aka router)
- Routers know how to get from A-B, or know who to send it to next
2.
- Routers know how to get from A-B, or know who to send it to next
- ISP has default gateway (aka router)
- Looks in internal network for IP address
- Gives request to default gateway, which sends it on its way
Sends packets in groups
Groups get progressively larger
30
Q
3-way handshake
A
- method used in TCP/IP to create a connection between a client/host and a server
3 steps
- The client requests a connection by sending a SYN (synchronize) message to the server
- The server acknowledges this request by sending SYN-ACK (acknowledge) back to the client
- The client responds with an ACK, and the connection is established
31
Q
root servers
A
- authoritative servers administered by IANA (Internet Assigned Numbers Authority)
- hold dns information about top-level domains (.com, .org, .uk)
32
Q
dns
A
- Domain Name System/Servers
- system that maps domain names to ip addresses
- configured within computer, a router, and on ISP servers
- when website is visited, IP is usually cached locally DNS caches IP
- if website IP isn’t cached upon request, resolves IP using DNS resolution
33
Q
dns resolution/hierarchy
A
- process by which DNS is resolved
Steps
- Computer checks hosts file and browser’s DNS cache
- Then request is sent to default gateway, which checks its cache
- Then request is sent to dns resolver, usually ISP; also checks its cache
- Resolver sends request to root DNS server, who responds to resolver with IP of top-level DNS server
- Resolver sends request to top-level DNS server, which responds to resolver with IP of nameservers for the particular website
- Resolver sends request to nameserver, which response with IP for the particular website
- Resolver sends response to client
34
Q
router
A
- a network device that connects subnetworks to other subnetworks
35
Q
default gatway
A
- router that connects your subnetwork to the larger internet
36
Q
subnet mask
A
- number that tells you what part of ip address is network identifier, and which part is device identifier
- a bitmask where 1s indicate parts of IP corresponding to network, and 0s indicate part corresponding to device
- when mask is applied to IP address using bitwise AND, return the routing prefix
37
Q
hub
A
- network device that connects mutliple computers
- replicates all incoming bits of data for each interface indiscriminately
- wasteful with bandwidth
- individual client will ignore packet if it’s not addressed to it
38
Q
switch
A
- a network device that distributes data to different computers within the same subnet
- like hub, but sends data directly to right computer
- home routers usually have built in switches
39
Q
OSI model
A
- Open Systems Interconnection model
- standardizes communication between networks
- just a model that describes how networks should work
- ordered by levels of abstraction
- (from bottom) Please Do Not Take Salami Pizza Away
7 Layers
- Physical
- Hardware, all the physical stuff (cables, etc.)
- Data link
- Layer where packets are encoded/decoded into bits
- Network
- Handles routing
- Determines if packet has arrived, or sends it to next router
- IP
- Transport
- Evaluates incoming/outgoing data
- Ex: request timing, delivery acknowledgements, error-checking etc.
- TCP/UDP
- Session
- Manages connection between client and server
- Presentation
- Layer where operating system is on
- Converts data from application to network format
- May configure data (compress, encrypt)
- Application
- Layer that user is actually interacting with
- Email, Chrome, Network printers, etc.
40
Q
idempotent
A
- an operation, the result of which doesn’t change by doing it mutliple times
- especially in the context of HTTP methods
- ex: absolute value, GET, PUT, DELETE, but not POST
41
Q
cookie
A
- small piece of data associated with a particular website stored in the browser
- used to remember stateful data and record browsing behavior
- a single key, value pair, but you can fudge it by putting more data in the value
- must be <4KB, (in practice, much smaller)
- browers imposes limit of 20 cookies per website
- a single cookie is only linked to 1 domain
- accessible from any window
- works with older browsers (HTML4)
- cookie is stored on browser and server
- cookie information is sent to server with every request
- delete by setting to a past date
- use cases:
- authentication
- other information that both browser and server need
Steps
- User visits website
- Server sends back data and cookie
- Client stores cookie
- Next time, client requests data with cookie
42
Q
localstorage
A
- special storage object built into window
- used, like cookies, to track state
- has higher capacity than cookies (10mb)
- consists of key, value pairs
- only works with HTML5
- never expires, but can removed by client
- only stored in browser, not on server
- useful for storing larger amounts of data on client side
43
Q
sessionstorage
A
- special storage objet buil into window
- has higher capacity than cookies (5mb)
- very similar to local storage, except that it’s tied to the tab
- consists of key, value pairs
- only works with HTML5
- only accessible from tab of creation
- expires on tab close
- only stored in browser
44
Q
user agent
A
- a string that gets passed along to a website via an HTTP header
- used to optimize experience for the user
- consists of
- browser/version
- device details
- operating system
- platform used by browser