Download presentation
1
By Ali Bagherinia 4 Distributed System
معماری نرم افزار DS: اگر به لحاظ کامپوننت های نرم افزاری به آن نگاه شود، عبارت است از قطعات پیچیده ای که برروی ماشین های مختلف سازمان دهی شده اند. پس Distributed system needs Organization → Architecture معماری نرم افزار چگونگی سازمان دهی نرم افزاری کامپوننت ها سبک معماری (َArchitecture style) معماری سیستم (System Architecture) By Ali Bagherinia 4 Distributed System
2
By Ali Bagherinia 4 Distributed System Dr JabEhdari
سبک معماری برگرفته از دید منطقی (به صورت logic همه کامپوننت ها در یک محدوده قرار می گیرند) است. چگونگی قرار گرفتن و ارتباط کامپوننت ها را بیان می کند. بعبارتی تعداد کامپوننت ها و چگونگی ارتباط آنها را بیان می کند. By Ali Bagherinia 4 Distributed System Dr JabEhdari
3
By Ali Bagherinia 4 Distributed System Dr JabEhdari
انواع سبک های معماری Layered Architecture Object based Architecture Data centered Architecture Event based Architecture By Ali Bagherinia 4 Distributed System Dr JabEhdari
4
By Ali Bagherinia 4 Distributed System Dr JabEhdari
معماری سیستم مفهومی است عام و برای هر سیستمی قابل کاربرد است. از دیدگاه سیستمی نگاه می کند و پیاده سازی نهایی را بیان می کند. برگرفته از دیدگاه فیزیکی (آن چیزی که در واقع هست، چه کامپوننتی برروی چه ماشینی قرار می گیرد). در مورد معماری سیستم می توان از هرکدام از سبک های معماری مذکور استفاده کرد. By Ali Bagherinia 4 Distributed System Dr JabEhdari
5
By Ali Bagherinia 4 Distributed System Dr JabEhdari
انواع معماری سیستم 1 - متمرکز (توزیع عمودی): یک کامپوننت مرکزی است که خدمات را ارایه می کند. توزیع شدگی بالا به پایین (vertical distribution) نمونه: Client/Server 2- غیر متمرکز (توزیع افقی): همه چیز پخش است، کامپوننت ها خیلی باهم متفاوت نیستند. توزیع شدگی افقی (horizontal distribution) - پراسس ها یکسان هستند و می توانند در صورت لزوم client و یا server باشند (servent). هر کدام می توانند در صورت لزوم بخشی از کار را انجام دهند، یا اینکه هر کدام می توانند مساوی کار معدل را انجام دهند. نمونه: Peer2peer 3- ترکیبی By Ali Bagherinia 4 Distributed System Dr JabEhdari
6
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Peer to Peer همه کامپوننت ها (پراسس ها) از لحاظ ارتباط متقارن (symmetric) هستند (بر خلاف C/S). پراسس ها servent هستند. همه پراسس ها معادل بوده و هیچکدام نقش خاصی را ندارند که دیگری نتواند انجام دهد. ارتباطی که پراسس ها با یکدیگر دارند را شبکه فوقانی (overlay network ) گویند. دیگر یک نقطه شکست (server) وجود ندارد. By Ali Bagherinia 4 Distributed System Dr JabEhdari
7
By Ali Bagherinia 4 Distributed System Dr JabEhdari
What is P2P? “the sharing of computer resources and services by direct exchange of information” By Ali Bagherinia 4 Distributed System Dr JabEhdari
8
What is P2P? “P2P is a class of applications that take advantage of resources – storage, cycles, content, human presence – available at the edges of the Internet. Because accessing these decentralized resources means operating in an environment of unstable and unpredictable IP addresses P2P nodes must operate outside the DNS system and have significant, or total autonomy from central servers” By Ali Bagherinia 4 Distributed System Dr JabEhdari
9
What is P2P? A distributed system architecture No centralized control
Typically many nodes, but unreliable and heterogeneous Nodes are symmetric in function Take advantage of distributed, shared resources (bandwidth, CPU, storage) on peer-nodes Fault-tolerant, self-organizing Operate in dynamic environment, frequent join and leave is the norm Internet By Ali Bagherinia 4 Distributed System Dr JabEhdari
10
What is P2P? Various definitions seem to agree on sharing of resources
direct communication between equals (peers) no centralized control By Ali Bagherinia 4 Distributed System Dr JabEhdari
11
What is a peer? “…an entity with capabilities similar to other entities in the system.” What is wrong with this definition? By Ali Bagherinia 4 Distributed System Dr JabEhdari
12
Client/Server Limitations
Scalability is hard to achieve Presents a single point of failure Requires administration Unused resources at the network edge P2P systems try to address these limitations By Ali Bagherinia 4 Distributed System Dr JabEhdari
13
P2P Architecture All nodes are both clients and servers Node
Provide and consume data Any node can initiate a connection No centralized data source “The ultimate form of democracy on the Internet” “The ultimate threat to copy-right protection on the Internet” Node Internet * Content from By Ali Bagherinia 4 Distributed System Dr JabEhdari
14
By Ali Bagherinia 4 Distributed System Dr JabEhdari
انواع شبکه فوقانی 1- ساخت یافته (structured) 2- غیر ساخت یافته (non- structured) By Ali Bagherinia 4 Distributed System Dr JabEhdari
15
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Structured p-to-p Based on Distributed Hash Table Data itme: assign a random key Node: assign a random number Scheme for assign data item to node: deterministic Look up (request for data item on the node→ routing ): deterministic scheme By Ali Bagherinia 4 Distributed System Dr JabEhdari
16
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Peer2peerانواع Structured P2P Chord CAN Unstructured P2P Gnutella By Ali Bagherinia 4 Distributed System Dr JabEhdari
17
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Chord یک شبکه فوقانی با ساختار منطقی حلقه دارد. Random number for node Random number for data item انتساب یک data item با کلید k به یک گره: از گرهی با شماره k نگاه کرده و k را اولین گرهی که پیدا شد، انتساب می دهیم. assign(data item k){ succecor(k)=id ≥k } یک گره ممکن است در بردارنده چندین data item باشد. By Ali Bagherinia 4 Distributed System Dr JabEhdari
18
By Ali Bagherinia 4 Distributed System Dr JabEhdari
chord By Ali Bagherinia 4 Distributed System Dr JabEhdari
19
Chord State and Lookup (1)
Basic Chord: each node knows only 2 other nodes on the ring Successor Predecessor (for ring management) Lookup is achieved by forwarding requests around the ring through successor pointers Requires O(N) hops m=6 2m-1 0 N1 N56 N8 K54 lookup(K54) N51 N14 N48 N42 N21 N38 N32 By Ali Bagherinia 4 Distributed System Dr JabEhdari
20
Chord State and Lookup (2)
Finger table Each node knows m other nodes on the ring Successors: finger i of n points to node at n+2i (or successor) Predecessor (for ring management) O(log N) state per node Lookup is achieved by following closest preceding fingers, then successor O(log N) hops N8+1 N14 N8+2 N14 m=6 N8+4 N14 2m-1 0 N8+8 N21 N1 N8+16 N32 N8+32 N42 N56 lookup(K54) N8 K54 +1 +2 N51 +4 N14 N48 +8 +16 +32 N42 N21 N38 N32 By Ali Bagherinia 4 Distributed System Dr JabEhdari
21
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Lookup Lookup(data item key){ succecor(key) } Data itemی با کلید key در کدام node هست، که بدانجا ارتباط پیدا کنیم. By Ali Bagherinia 4 Distributed System Dr JabEhdari
22
Membership management
مدیریت عضویت یعنی اینکه گره ها چگونه در شبکه فوقانی سازماندهی می شوند؟ که شامل دو عمل join (نود جدیدی می خواهد وارد حلقه شود) و leave می باشد. Join 1- generate a random number id 2- look up (id)→ successor (id) 3- contact to successor (id) & predecessor (id) 4- insert id between them (successor (id) & predecessor (id)) 4- data item(s) transferred from successor (id) to id By Ali Bagherinia 4 Distributed System Dr JabEhdari
23
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Leave 1- Id node informs successor (id) & predecessor (id) for leaving 2- transfer data items from id to successor (id) By Ali Bagherinia 4 Distributed System Dr JabEhdari
24
CAN ( Content Addressable Network)
فضا به تعداد nodeها تقسیم می شود. همانند chord گره ها و data itemها دارای id و key منحصربفرد هستند. در هر ناحیه (مستطیل) نقطه مرکز ناحیه با مختصات (x,y) به عنوان node در نظر گرفته شده که (x,y) همان id گره می باشد. هر data itemی که مختصاتش (کلیدش) در ناحیه بیفتد به آن node (مرکز مستطیل) منتسب می شود. مثال: در شکل data itemی با کلید (0.15, 0.25) به گره (0.2, 0.3) منتسب می شود. By Ali Bagherinia 4 Distributed System Dr JabEhdari
25
By Ali Bagherinia 4 Distributed System Dr JabEhdari
26
Membership mangement in CAN
Join 1- pick an arbitrary point p for node id 2- look up( p)→ find a region with Q center 3- split the region to segment 4- p finds data items by asking Q By Ali Bagherinia 4 Distributed System Dr JabEhdari
27
عمل ترک کردن دشوارتر از join می باشد.
Leave عمل ترک کردن دشوارتر از join می باشد. 1- region (of leaved node) assign to one of the its neighbors 2- a background process periodically reapportioned entire space By Ali Bagherinia 4 Distributed System Dr JabEhdari
28
CAN (Berkeley) Cartesian space (d-dimensional)
Space wraps up: d-torus Incrementally split space between nodes that join Node (cell) responsible for key k is determined by hashing k for each dimension d=2 hx(k) insert(k,data) 1 2 1 1 4 3 2 1 2 3 hy(k) retrieve(k) By Ali Bagherinia 4 Distributed System Dr JabEhdari
29
CAN State and Lookup Multiple choices: we can route around failures
A node A only maintains state for its immediate neighbors (N, S, E, W) 2d neighbors per node Messages are routed to neighbor that minimizes Cartesian distance More dimensions means faster the routing but also more state (dN1/d)/4 hops on average Multiple choices: we can route around failures d=2 B N W A E S By Ali Bagherinia 4 Distributed System Dr JabEhdari
30
By Ali Bagherinia 4 Distributed System Dr JabEhdari
Unstructured p-to-p طرح ساخت شبکه فوقانی قطعی نیست بلکه الگوریتم های آن random می باشند. هر node لازم نیست تمام شبکه را بشناسد، بلکه تعدادی (cتا) از همسایه های خودش را می شناسد (partial view). شبکه فوقانی بسیارشبیه شبکه Graph random می شود. هر node دارای جدولی با cمدخل بوده که هر مدخل دربردارنده idهمسایه و age (ageبیشتر یعنی ارجاع کمتر (قدیمی تر)) بوده که بر اساس age مرتب می شود. برای اینکه partial view درست باشد (ممکن است nodeهایی رفته و nodeهایی آمده باشند) nodeها می بایست بطور مرتب اطلاعات خود (مدخل های جداولشان) را ردوبدل نمایند. - هر گره c/2+1 از مدخل بالایی اش را ارسال می کند. cتا مدخلش را مرتب کرده - c/2+1 مدخل پایینی اش را حذف می کند By Ali Bagherinia 4 Distributed System Dr JabEhdari
31
By Ali Bagherinia 4 Distributed System Dr JabEhdari
که با هر exchangeی age یک واحد افزایش می یابد. اگر به هر کدام از data itemها مراجعه شود ageش صفر می شود. برای exchange بهتر است نود ترکیب push و pull باشد وگرنه شبکه فوقانی به صورت جزیره جزیره (nodeها بدون ارتباط) می شود. By Ali Bagherinia 4 Distributed System Dr JabEhdari
32
Membership management in unstru..
Join گره جدید با یکی از nodeهای شبکه (well known access point) به صورت تصادفی تماس گرفته و لیست همسایه هایش را بدست آورده و خودش را را در لیست آن گره وارد می کند. Leave خیلی ساده،هیچ کاری لازم نیست انجام دهد، زیرا به آن دیگر مراجعه نشده و ageش به تدریج زیاد شده و بتدریج از لیست ها discard می شود. By Ali Bagherinia 4 Distributed System Dr JabEhdari
33
P2P Network Characteristics
Clients are also servers and routers Nodes contribute content, storage, memory, CPU Nodes are autonomous (no administrative authority) Network is dynamic: nodes enter and leave the network “frequently” Nodes collaborate directly with each other (not through well-known servers) Nodes have widely varying capabilities By Ali Bagherinia 4 Distributed System Dr JabEhdari
34
ترکیب overlay networkها
Two layered approach Super peers By Ali Bagherinia 4 Distributed System Dr JabEhdari
35
P2P Applications File sharing (Napster, Gnutella, Kazaa)
Multiplayer games (Unreal Tournament, DOOM) Collaborative applications (ICQ, shared whiteboard) Distributed computation Ad-hoc networks By Ali Bagherinia 4 Distributed System Dr JabEhdari
36
P2P Goals and Benefits Efficient use of resources Scalability
Unused bandwidth, storage, processing power at the “edge of the network” Scalability No central information, communication and computation bottleneck Aggregate resources grow naturally with utilization Reliability Replicas Geographic distribution No single point of failure Ease of administration Nodes self-organize Built-in fault tolerance, replication, and load balancing Increased autonomy Anonymity – Privacy not easy in a centralized system Dynamism highly dynamic environment ad-hoc communication and collaboration By Ali Bagherinia 4 Distributed System Dr JabEhdari
37
P2P Goals/Benefits Cost sharing Resource aggregation
Improved scalability/reliability Increased autonomy Anonymity/privacy Dynamism Ad-hoc communication By Ali Bagherinia 4 Distributed System Dr JabEhdari
38
P2P Challenges Decentralization Scalability and Performance Anonymity
Fairness Dynamism Security Transparency Fault Resilience and Robustness By Ali Bagherinia 4 Distributed System Dr JabEhdari
39
Popular file sharing P2P Systems
Napster, Gnutella, Kazaa, Freenet Large scale sharing of files. User A makes files (music, video, etc.) on their computer available to others User B connects to the network, searches for files and downloads files directly from user A Issues of copyright infringement By Ali Bagherinia 4 Distributed System Dr JabEhdari
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.