Test2 Flashcards
Internet Protocol Stack (TCP/IP)
konzeptuelles Model und set von Kommunkiations Protokollen, welche im Internet benutzt werden
- Application Layer, HTTP (Prozess zu Prozess)
- Transport Layer, TCP (Host zu Host)
- Internet Layer, IP
- Link Layer, LAN
Sichere und idempotente Operation
Sichere: ändert state gar nicht (GET)
Idempotente: ändert state absolut -> mehrmaliges ausführen der gleichen Operation hat gleiches Ergebnis wie einmaliges ausführen (PUT, DELETE)
HTTPS
HTTP + TLS zusätziche Protokoll Ebene -> Transport Layer Security - designed um Kommunikations-Sicherheit zu bieten - Verschlüsselung ist transparent
Protocol or network stacks
architectural patterns for network designs
- enable data transmission through communication networks
- Consist of individual protocols
- Protocols can be considered layers of the stack
- Each protocol interacts only with the immediate above or below protocols
- Lowest protocol interacts with communication hardware
- Topmost protocol interacts with user
Open Systems Interconnection (OSI) Model
Konzept Model, welches Kommunikations Funktionen standartisiert, ohne zugrunde liegende Struktur und Technologie zu beachten Application L Presentation L Session L Transport L Network L Data Link L Physical L
Internet Protocol (IP)
Kern Protokoll des Internets
- Verbindungslos
- für packet-switch Netzwerke
- best effort delivery
- Hosts werden über eindeutige (IP-) Adressen identifiziert
- unterteilt in unterschiedliche Netze
IPv4 : 32-Bit e.g. 130.149.7.201
IPv6: 128-Bit e.g. 2607:f8b0:4004:0815:0000:0000:0000:2003
Transmission Control Protocol (TCP)
Stellt host-to-host Verbindung
reliable, ordered, and error-checked delivery of a stream of bytes zwischen apps die auf hosts laufen, welche über ein IP Netz kommunizieren
benutzt Ports zum identifizieren
Hypertext Transfer Protocol (HTTP)
request-response aplication layer protocol for client-server communication
- HTTP client establishes TCP connection to particular port on host
- HTTP server listening on that port waits for client to send a request
- upon receiving request, server sends back status line e.g. HTTP/1.1 200 OK
HTTP status codes
1xx: Informtional
2xx: Success
3xx: Redirection
4xx: Client Error
5xx: Server Error
Ressource Identification
URI-Uniform Resource Identifiers: reference identifying an abstract or physical resource
can be URL, URN oder both
-> ://?
URL-Uniform Resource Locators: subset of URIs that identifies resources by their primary access mechanism (e.g. network location), is physical address of a ressource
-> transport://user:password@host:port/path[?search][#fragmentid]
URN: identify a resource independent of its primary storage location, logical address of a resource
CRUD Resource Lifecycle
resource Created with POST
Read with GET
Updatet with PUT and
Deleted with DELETE
Domain Name System (DNS=
hirachisches, dezentrales Namensgebungs System für Resourcen im Internet
übersetzt lesbare Domains (e.g. tu-berlin.de) zu IP Adressen
HTML
vorhersschende markup language für web pages
beschreibt die Struktur der Text-basierten Informationen eines Dokuments
In tags geschreiben
CSS
stylesheet language
-> definiert Farbe, Fonts, Layout, etc.
designed um Dokument Präsentation und Inhalt zu trennen
Document Object Model (DOM)
Iinterface für HTML
HTML Dokument wird wie ein Baum behandelt, jeder Knoten ein Objekt der Teil des Dokuments repräsentiert
definiert:
- HTML elements als obkects
- properties der Elemente
- methods um auf Elemente zuzugreifen
- events für alle Elemente
auf HTML DOM kann mit JavaScript zugegriffen werden
Browser Page Rendering
Browser zeigt nicht HTml tags und scripts, sondern interpretiert und zeigt deren Inhalt
CSS Dokumente werden mit HTML vom Browser verlinkt
Offline Web applications
Work offline with a locally deployed application on a local database, and synchronize when going online again
JavaScript Pro-Con
Pro:
- Dynamic: JavaScript kann user Aktionen erkennen (keystroke)
- Usability: da JS im Browser läuft, kann es schnell auf User Aktionen reagieren
- Distribution: von allen modernen Browsern unterstützt, viele development tool/frameworks existieren
Con:
- Debugging: schwieriger da dynamic typing und Logik sowohl auf Server und Cient Seite
- Security: Klartext in Browser zugänglich für Hacker
- Performance: Fat Clients mit viel Code müssen geladen werden, Problem bei mobile devices
- Cross-browser incompatibilities: mehrmaliges Testen und unterschiedliche Versionen von Code für verschiedene browser
JQuery
Einfachere DOM travesierung
unterstüzt event-handling und Ajax
- Tag Selector: $(‘some-tag-name’)
- Class Selector: $(‘.some-class’)
- ID Selector: $(’#some-id’)
AJAX
Asynchronous JavaScript and XML
Gruppe von Web-Dev Technken um interaktive Web-Anwendungen zu kreieren
ermöglicht Datenaustausch Website-Server ohne neuladen der Websiite
- XML, (X)HTML and CSSto render information
- DOM(Document Object Model) to interact with the information
- JavaScriptto glue everything together
- XMLHttpRequest (XHR) object to retrieve data asynchronously from the Web server
Asynchronous Processing in AJAX
- Kick off an HTTP request performed in background via XMLHttpRequestobject
- XMLHttpRequestasynchronously contacts server and retrieves data 3.Server retrieves data and sends it backCan take any amount of time
- Event listener used to detect when the XMLHttpRequestfinished retrieving dataListens for changes in “readyState” variable
- Callback into JavaScript code
AJAX Pro-Con
Pro:
- Seamless HTML integration: muss nicht in HTML integriert werden
- Standards-based cross-browser support: funktioniert in fast jedem Browser, kein plug-in benötigt
- Backend agnostic: funktioniert mit jedem HTTP-kompatiblem Backend
Con:
- Performance: Server Aufrufe können steigen, viele feine asynchrone Aufrufe
- Security: Cross-origin resource sharing (CORS) prohibited
REpresentational State Transfer (REST)
- “abstract architecture” of the Web
- constraint-based design
- Resource Identification
- Name everythingthat you want to talk about
- identified by URI’s - Uniform Interface
- same small set of operations (verbs, e.g. HTTP) applies to a large set of resources (nouns)
- Verbs are universal
- > No need to learn about functions - Self-Describing Messages
- Resources are abstract entities, resources are never exchanged or otherwise processed directly
- All interactions use resource representations
- Data format of a representation is known as a media type - Hypermedia as the Engine of Application State
- Resource representations contain links to identified resources
- applications navigateinstead of calling
- Application statealso is represented as a resource - Stateless Interaction
- move state to clients or resources
- Every request happens in complete isolation, all information required for the server to fulfil the request are included in the request
-> scalability, mashup-ability, usability, accessibility
Cookies
frequently used mechanism for managing state by the client
The ideal RESTful cookie is never sent to the server