1 / 22

Computer Networks

Computer Networks . Boots Cassel Villanova University. Client - Server Computing. Direction of initiation determines which side is which Client initiates Server responds Same system may be client and server. Parameterization of clients . Parameter specifies machine where server resides

jett
Télécharger la présentation

Computer Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Networks Boots Cassel Villanova University

  2. Client - Server Computing • Direction of initiation determines which side is which • Client initiates • Server responds • Same system may be client and server

  3. Parameterization of clients • Parameter specifies machine where server resides • Optional parameter specifies the port where the server listens • Include the port number parameter in defining clients • Especially useful for testing new versions

  4. Addressing • Specify the machine • name gets converted to IP address • Specify the port number • Which running process to connect to.

  5. How do you know • Which machine • you have to know the name or the IP address of the partner • Names get converted by a Domain Name Service • Which port • Common services have assigned port numbers • telnet = 23, http = 80, etc.

  6. Domain Name Service • Structure of Internet Names • gadget.netlab.csc.villanova.edu • Lookup in order from right to left • netlab and csc are both entries in the villanova DNS, so that lookup can go directly from villanova to netlab without using the csc DNS • That is always an option in configuring the servers

  7. DNS - Christie’s table • ; Addresses for the canonical names • ; • localhost.netlab.csc.villanova.edu. IN A 127.0.0.1 • christie.netlab.csc.villanova.edu. IN A 153.104.203.200 • doyle.netlab.csc.villanova.edu. IN A 153.104.203.210 • gadget.netlab.csc.villanova.edu. IN A 153.104.203.42 • missmarple.netlab.csc.villanova.edu. IN A 153.104.203.7 • lordpeter.netlab.csc.villanova.edu. IN A 153.104.203.41 • poirot.netlab.csc.villanova.edu. IN A 153.104.203.148 • koko.netlab.csc.villanova.edu. IN A 153.104.203.45 • sherlock.netlab.csc.villanova.edu. IN A 153.104.203.44 • cadfael.netlab.csc.villanova.edu. IN A 153.104.203.43 • columbo.netlab.csc.villanova.edu. IN A 153.104.203.46 • weber.netlab.csc.villanova.edu. IN A 153.104.203.205 • matlock.netlab.csc.villanova.edu. IN A 153.104.203.203 • samspade.netlab.csc.villanova.edu. IN A 153.104.203.204 • poe.netlab.csc.villanova.edu. IN A 153.104.203.50

  8. Port number usage • Some implementations do not allow the user to specify a port number • uses the protocol’s reserved number only • Allowing a port number to be specified makes it easier to test the implementation • allow the “real” version to run while testing a different version

  9. Server • Usually runs in privileged condition • needs to access protected resources • be careful about what access it gives to clients • Responsibilities • Authenticate client identity • Enforce authorization restrictions • Data protection: security and privacy • Protection: system resources from abuse

  10. Connectionless vs Connection-oriented • Directly related to the choice of transport protocol • UDP: connectionless • TCP: connection-oriented • Can build connection-oriented client/server application over a connectionless transport layer • Silly to do the converse

  11. Server state • Stateless server • no memory of past interaction • each request must be fully qualified • Stateful server • records state information • reduces needed content in subsequent messages • depends on reliable network communication • vulnerable to system failures, reboots

  12. Idempotent operations • An operation that always yields the same result, regardless of repetition or missing prior steps • READ or WRITE, without automatic increment of pointer • not idempotent - increment, add amount to total, etc.

  13. Concurrent processes • Multiprogramming • Apparent simultaneous execution • Multiprocessing • Real simultaneous execution

  14. Server Concurrency • Need to serve requests from multiple clients • Process • Fundamental unit of computation • Address space plus at least one thread of execution • instruction pointer tells where in the process the thread is currently executing

  15. Threads • Similar to a process except • a thread is owned by a process • a thread may share common resources belonging to a process • A thread has a private copy of local variables

  16. Concurrent processes • In a uniprocessor system • Each process gets a slice of the CPU time in turn • All appear to run at the same time • If each process has only one thread of execution, that process shares the CPU with other processes on a time sharing plan • If a process has more than one thread, the CPU time is divided among the threads. • OS varies: divide time among all threads or divide among processes and multiple threads share the time allotted to their parent process • In a multiprocessor system, each process or thread may be allocated a separate CPU

  17. Threads in servers • A process may respond to client requests by spawning a separate thread for each client • Clients appear to be served simultaneously but actually receive intermingled slices of the CPU time.

  18. Unix concurrency • Different operating systems handle concurrency in idfferent ways • unix: fork() creates an exact copy of the calling process and continues execution from exactly the same place in the code. • Copy includes the stack showing function calls, local and global variables • Original and forked process continue from the same point in execution • One distinction: fork returns a value: new process returns 0, original returns non zero value

  19. Unix concurrency example Sum = 0; pid = fork(); if (pid != 0 ) { /* original */ printf (“The original process\n”); }else { /* the new process */ printf (“The new process\n”);

  20. Concurrency in Windows • _beginthread • parameter specifies what is to be executed • Not necessarily executing the same code as the calling process

  21. Sockets • A de facto standard interface to TCP/IP protocols • Defined in BSD unix • Adapted by other operating systems

  22. Initiating concurrent subprocesses • Windows: • _beginthread • parameter specifies what to execute as thread • unix • fork • new process is a copy of the initiating process • pid identifies each

More Related