94d9f50b92e69954369f2a5c78e27dd1.ppt
- Количество слайдов: 16
Naming in Distributed Systems: Part II Lecture # 6
Overview l l l Pure Name: Only Identifies Impure Name: Guides within a context Telephone numbers: – l MAC numbers: – l l Impure Names Pure Names DNS Description-based Names Name Discovery Name Binding
Naming Examples l l DNS Names as Path Names Root. yahoo n 2 n 1 k 1 Root. n 1. k 1. lums
Closure in Naming l Names – closed under composition Using a root l Absolute – Vs. Relative Paths Context l DNS – Mailto: zahoor (from within lums) l Directory – Working directory
Name Resolution l DNS – Terminology Iterative vs. Recursive l Essentially State management in resolution – Caching – Communication Cost –
Iterative cs. lums. edu. pk root cs. lums. edu. pk cs. lums. edu Client-side Name Resolver pk cs. lums. edu cs. lums edu cs lums IP # CS www. lums. edu. pk IP number cs
Recursive cs. lums. edu. pk root IP # cs cs. lums. edu Client-side Name Resolver cs. lums pk cs. lums edu IP # CS www. lums. edu. pk IP number cs lums cs
Recursive vs iterative l State l Caching l Communication latency
Description-based Names l Address – {(service, printer), (type, color), (manufacturer, HP)} l Who – entities by their attributes decides what “type” means Is it “color” or “colour” l Schemas l XML DTD: RDF etc.
Discovery of Names l Closure: How to do name/find the directory service? – – l l l DNS Servers Peer-to-peer lookup Discovery vs Advertisements Discovery: Synchronous Advertisement: Asynchronous – – How often do you advertise How often do you do discover?
Binding of Names l Early – vs late binding Early binding: l Statically-bound variables l Conventional: Lookup, Bind, Route l Late-binding INS: Bind when routing – So. NS: Bind when connecting –
Service-oriented Network Sockets l Description-based – Service discovery based on vague descriptions l Late-binding – -- at a connection level To handle the dynamic nature of the system l Periodic – Naming discovery architecture To give application control over network session
So. NS Naming: Constraint Language • A service-specification contains a set of constraints on the properties required in an ideal resource • So. NS Constraint Language • Range Comparisons • <, >, = • Weighted Constraints • Composite Constraints ( and (= service display) (> ( size 15 30 ) 2 ) (= color yes) (or (> video-streams 1) (= load 0)))
So. NS Evaluator l Simple – and Responsive Default policy can be replaced int connect(int fd, struct sockaddr * a ddr) (or (> (a 1 2)1) (and (< (b 0 9)2) (= (c 9)1 )) . 5 or > range: [12] attr: a weight: 1 Attribute Value a b c and < range: [09] attr: b weight: 2 0 = range: [09] attr: c weight: 1 1. 5 3 10 > range: [12] attr: a weight: 1 and. 66 < range: [0 9] attr: b weight: 2 0 = range: [09] attr: c weight: 1
API: Follow-me-video int main(int argc, char ** argv) { struct sockaddr_sons sasons; int agility = 5, hyst = 3; sockfd = socket(AF_GONS, SOCK_STREAM, 0); setsockopt(sockfd, SOL_SOCKET, SO_PROBE_PERIOD, &agility, opt_sz); setsockopt(sockfd, SOL_SOCKET, SO_HYSTERESIS, &hyst, opt_sz); charopt = “(= service display) (= media mpeg 1) (and (> xresolution 800 1600) (> yresolution 640 1280)) (> displaysize 15 30) (< distance)”; sasons. sin_family = AF_GONS; memcpy(sasons. query, charopt, strlen(charopt)); connect(sockfd, (struct sockaddr *) &sasons, sizeof(struct sockaddr_sons)); //. . . read and write using standard socket // calls. . . close(sockfd); return 0; }
Our Popular Toy Application
94d9f50b92e69954369f2a5c78e27dd1.ppt