Key Design Issues in Internet Servers: Functionality, Robustness, and Fault Tolerance
70 likes | 196 Vues
This lecture discusses essential design issues related to Internet servers, focusing on their functionality and ability to handle multiple concurrent clients. Key topics include maintaining client-specific state, reducing message sizes, ensuring fault tolerance, and implementing access control and data security. The discussion covers server socket calls, connection handling, and the importance of idempotent operations in a stateful server environment. The lecture emphasizes the need for robust servers to provide enhanced functionality while navigating the challenges of client reliability and network failures.
Key Design Issues in Internet Servers: Functionality, Robustness, and Fault Tolerance
E N D
Presentation Transcript
Internet and Intranet Protocols and Applications Lecture 4: Internet Servers Feb 15, 2000 Arthur P. Goldberg Clinical Associate Professor of Computer Science and Information Systems New York University artg@cs.nyu.edu
Server design issues • Functionality • Handle multiple clients concurrently • Maintaining client-specific state at a server (usually) • Reduce message sizes • Require fault-tolerance • Access control • Authenticate clients • Evaluate whether client is allowed access • Secure data • Robustness • Performance • Reliability
Server Socket Calls rc = bind(socket,(struct sockaddr *) localaddr, addrlen); • Specify local IP:port rc = listen(socket, queuelen); • TELL socket to queue up to queuelen REQUEST retcode=accept(socket, (struct sockaddr*) addr, (int *)addrlen); • wait until connection REQUEST arrives; return descriptor of new connected socket. [datatypes int unless otherwise specified]
Fork rc=fork(); • duplicate process; return 0 to child, child PID to parent.
Select #include <sys/types.h> #include <sys/time.h> int select (width, readfds, writefds, exceptfds, timeout); int width; fd_set *readfds, *writefds, *exceptfds; struct timeval *timeout; • wait for first fd in a set to become ready, or a timeout.
Precise description of stateful server challenge • Idempotent • An operation which can be applied multiple times and still produce the same result • Formally, operation O is idempotent iff • O( a ) = O( O( a ) ) • Example • Idempotent: x = z • Not idempotent: x = x +z • In a stateful server • Request operations must be idempotent, or • The server must recover from failures
Comer advice • If the network is unreliable or machines can crash then the server should be stateless • I disagree: I think we need to make stateful servers, because they provide greater functionality; therefore, they must be fault-tolerant