SLIDE 1 TDDD82 Secure Mobile Systems Lecture 1: Introductjon and Distributed Systems Models
Mikael Asplund Real-tjme Systems Laboratory Department of Computer and Informatjon Science Linköping University
Based on slides by Simin Nadjm-Tehrani
SLIDE 2 Module overview
- 3hp
- Some parts that strongly relate to your projects
- Distributed systems, dependability, quality-
- f-service
- General CS knowledge: concurrent
programming
- Processes, resource sharing, deadlocks
SLIDE 3 Lecture organisation
- Lecture 1: Distributed systems (intro)
- Lecture 2-4:Processes
– All concurrency related topics, including synchronisation, mutual exclusion, deadlocks
- Lecture 5: Dependability
- Lecture 6: Quality of Service
SLIDE 4
Distributed systems
SLIDE 5 Reading
- Chapter 2 of Coulouris, Dollimore, and
Kindberg
SLIDE 6
Examples
SLIDE 7 Common in all these?
Distributed model of computjng:
- Multjple processes
- Disjoint address spaces
- Inter-process communicatjon
- Collectjve goal
SLIDE 8
Distributed Systems
A collectjon of independent computers that appears to its users as a single coherent system
SLIDE 9 Networking vs. Distributed systems
- “Networking” treats the internal mechanisms for
inter-process communicatjon:
–
Routjng
–
Error control (reliable transmission)
–
Flow control (low level treatment of overloads)
- “Distributed computjng” treats the applicatjon view of
the architecture for communicatjon and cooperatjon
SLIDE 10
- Basic aspects afgectjng design
- Distributed systems architectures and models
This lecture
SLIDE 11 Why is it hard to get it right?
- Variatjons in workload, connectjvity, mobility,
requirements
- Heterogeneity in systems environment, hardware,
- peratjng systems, and networks
- Consequences of tjming and failure issues
- Security threats, and distributed atuacks
SLIDE 12 Overview
- Architectural models
- Interactjon models
- Faults and failures
SLIDE 13
- Placement of processes and data across a network of
computers
- Patuerns of communicatjon to achieve functjonal and
extra(non)-functjonal propertjes
- Challenges: Scalability, interoperability
Architectural models
SLIDE 14
- Placement of processes and data across a network of
computers
- Patuerns of communicatjon to achieve functjonal and
extra(non)-functjonal propertjes
- Challenges: Scalability, interoperability
Architectural models
What are these?
SLIDE 15 System requirements
–
Describe the main objectjves of the system, also referred to as “correct service”
- Extra-functjonal requirements
–
Also called non-functjonal propertjes
–
Cover other requirements than those relatjng to main functjon, for example expressing the frequency and severity of acceptable service failures
- Example non-functjonal requirements
–
Timeliness, availability, energy effjciency
SLIDE 16 Scalability
16
- Allow the system to become bigger without
negatjvely afgectjng performance
– Size: Adding more resources and users – Geographic: Dispersed across locatjons – Administratjve: Spanning multjple administratjve
domains
SLIDE 17 Architectural roles
– Client implements the user interface – Server(s) has most of the functjonality
- Computatjon, data
- E.g.: Web
- Peer-to-peer (P2P)
– Each component is symmetric in functjonality – Peer: Combinatjon of server-client – No “well-known” centralized server
– Combinatjon of the two
SLIDE 18 System organisatjon
– Most functjonality is in a single unit
– Functjonality is spread across multjple units
SLIDE 19 Types of distributjon
– Logically difgerent components on difgerent machines – e.g., multjtjered architectures
– Multjple logically equivalent parts – Potentjally operatjng on difgerent data
SLIDE 20 Physical two-tjred architectures
Alternatjve client-server organizatjons (a) – (e). 1-29
20
SLIDE 21 Exaple of horizontal distributjon
An example of horizontal distributjon of a Web service. 1-31
21
SLIDE 22 A taxonomy of architectural models
Distributed systems Peer-to-peer Client-server Decentralised & horizontally distributed Centralised Decentralised Horizontally distributed Vertically distributed Vertically distributed
Hybrid
...
distributed
SLIDE 23
Interactjon
Interaction models
SLIDE 24
What affects timing in a distributed system?
SLIDE 25
Latency
SLIDE 26 Baspresentation LiU 2011-02-17
28
reference time t Timestamp of clock C C’(t)=1 (Perfect clock) C ’ ( t ) < 1 ( s l
c l
k ) C’(t) > 1 (fast clock)
Clock drift
SLIDE 27 Baspresentation LiU 2011-02-17
29
reference time t Timestamp of clock C C’(t)=1 (Perfect clock) C ’ ( t ) < 1 ( s l
c l
k ) C’(t) > 1 (fast clock)
Clock drift
Real clock
SLIDE 28 Two interactjon models
– No relatjon between computatjon rate at difgerent
nodes, No bound on message exchange delay, Clock drifu rates are arbitrary
– Bounded message exchange delay, Related processing
rates at difgerent nodes, Clock drifu rates bounded
SLIDE 29
– Local clocks can be used to implement tjmeouts – Lack of response from another node can be interpreted as
detectjon of failure
– Hard to guarantee!
– In the absence of global (synchronised) tjme one cannot
relate clocks at difgerent nodes
– How can events be ordered?
Implicatjons
SLIDE 30
Why do we need ordering?
SLIDE 31
When order matuers
SLIDE 32
Another problem: global state
P1 P2 P3 Time m2 m3 m1
SLIDE 33
Another problem: global state
P1 P2 P3 Time m1 m2 m3
SLIDE 34 Causal ordering
– Antjsymmetrical – Transitjve – Irrefmexive
- Also known as: ”the happened-before relatjon”
- Rules:
– send(m) → receive(m) – e1 → e2 if e1 and e2 are local events on the same machine and e1
- ccurred before e2 according to the local tjme
– Transitjve closure
SLIDE 35
Consistent cuts (using partjal order)
P1 P2 P3 Time m1 m2 m3 If e2 is afuer the cut and e1 before the cut, then e2 → e1
SLIDE 36
Consistent cuts (using partjal order)
P1 P2 P3 Time m1 m2 m3 If e2 is afuer the cut and e1 before the cut, then e2 → e1
SLIDE 37
Consistent cuts (using partjal order)
P1 P2 P3 Time m1 m2 m3 Consistent! If e2 is afuer the cut and e1 before the cut, then e2 → e1
SLIDE 38
Consistent cuts (using partjal order)
P1 P2 P3 Time m1 m2 m3 If e2 is afuer the cut and e1 before the cut, then e2 → e1 Consistent!
SLIDE 39
Consistent cuts (using partjal order)
P1 P2 P3 Time m1 m2 m3 If e2 is afuer the cut and e1 before the cut, then e2 → e1 Consistent! Inconsistent!
SLIDE 40 Lamport tjmestamps
- Timestamps should follow the partjal event ordering
- A → B => C(A) < C(B)
- Not vice versa!
- Timestamps always increase
- Lamport’s Algorithm:
- Each processor i maintains a logical clock Ci
- Whenever an event occurs locally, Ci = Ci+1
- When i sends message to j, piggyback Ci
- When j receives message from i
- Cj = max(Ci, Cj)+1
SLIDE 41
Failure
Faults and failures
SLIDE 42
- We will look into more detail into failure and related
notjons in lecture 5
- For now...
- Distributed systems can fail in nodes or channels
- Node/channel failures:
– Crash – Omission – tjming – Byzantjne (arbitrary)
Failure models