MC714: Sistemas Distribu´ ıdos
- Prof. Lucas Wanner
MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de - - PowerPoint PPT Presentation
MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de Computac ao, Unicamp Comunicac ao Aula 5: Revis ao e Programac ao com Sockets Aula 6: Troca de Mensagens e Multicast Aula 7: Chamada de Procedimento
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 2 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 3 / 52
Runtime system Runtime system Hardware Operating system Hardware Operating system Operating system Operating system Applications Virtual machine monitor (a) (b) Runtime system Application
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 4 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 5 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 6 / 52
Logical switch (possibly multiple) Application/compute servers Distributed file/database system Client requests Dispatched request First tier Second tier Third tier
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 7 / 52
Switch
Server Server Request Request (handed off) Response Logically a single TCP connection
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 8 / 52
Before execution After execution Client Server Client Server Client-Server code state resource code state* resource Remote Evaluation code → state resource → code state* resource Code-on-Demand state resource ← code code state* resource ← Mobile Agents code state resource → resource resource → code state* resource Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 9 / 52
1
2
3
4
5
10 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 11 / 52
Physical Data link Network Transport Session Application Presentation Application protocol Presentation protocol Session protocol Transport protocol Network protocol Data link protocol Physical protocol Network 1 2 3 4 5 7 6
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 12 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 13 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 14 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 15 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 16 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 17 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 18 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 19 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 20 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 21 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 22 / 52
23 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 24 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 25 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 26 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 27 / 52
28 / 52
29 / 52
30 / 52
31 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 32 / 52
1
2
3
4
5
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 33 / 52
A B D C Ra Rb Rd Rc Internet Router End host Overlay network
7 5 1 1 1 1 30 40
Re
20
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 34 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 35 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 36 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 37 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 38 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 39 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 40 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 41 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 42 / 52
Call local procedure and return results Call remote procedure Return from call Client Request Reply Server Time Wait for result
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 43 / 52
Implementation
Client OS Server OS Client machine Server machine Client stub Client process Server process
procedure
message
message
local call to "add"
across the network
hands message to server stub Server stub
k = add(i,j) k = add(i,j) proc: "add" int: val(i) int: val(j) proc: "add" int: val(i) int: val(j) proc: "add" int: val(i) int: val(j) 1
2
3
4
5
6
7
8
9
10 Client stub unpacks result and returns to the
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 44 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 45 / 52
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 46 / 52
Call local procedure Call remote procedure Return from call Request Accept request Wait for acceptance Call local procedure and return results Call remote procedure Return from call Client Client Request Reply Server Server Time Time Wait for result (a) (b)
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 47 / 52
Call local procedure Call remote procedure Return from call Client Request Accept request Server Time Wait for acceptance Interrupt client Return results Acknowledge Call client with
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 48 / 52
C compiler Uuidgen IDL compiler C compiler C compiler Linker Linker C compiler Server stub
Server
Runtime library Server binary Client binary Runtime library Client stub
Client
Client stub Client code Header Server stub Interface definition file Server code #include #include
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 49 / 52
Endpoint table Server DCE daemon Client
Directory server Server machine Client machine Directory machine
Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 50 / 52
1
2
3
4
5
6
7
8
51 / 52
8
9
10 Uma union em C permite que um campo de uma estrutura guarde uma de v´
11 O que ´
52 / 52