1 / 49

Welcome to UFCEKP-20-2 Client Server Programming

Learn about network basics, protocols, and the TCP/IP protocol suite in client-server programming. Understand connection-oriented and connectionless communication.

lawless
Download Presentation

Welcome to UFCEKP-20-2 Client Server Programming

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. Welcome to UFCEKP-20-2Client Server Programming Jin Sa http://www.cems.uwe.ac.uk/~jsa/ClientServer07/ Julia Dawson http://squanderette.co.uk/ufcekp/ Client-Server Programming

  2. Books • “Java Network Programming”, 3rd edition, by Elliotte Rusty Harold, published by O‘Reilly • "Distributed Computing" M L Liu   • “Distributed Systems Concepts and Design”, 4th edition, by Coulouris, Dollimore and Kindberg, published by Addison Wesley. Client-Server Programming

  3. Delivery and Assessment • One lecture and one practical per week • Assessment consists of one exam and one assignment. Assignment hand-in date is in the second semester. Client-Server Programming

  4. Contents – semester 1 plan Client-Server Programming

  5. Contents – semester 2 plan Client-Server Programming

  6. General idea of the module Client server concepts Java knowledge required to do client server programming Protocol Basic network concepts Some basic client server programming mechanisms, e.g. socket, datagram, RMI Basic java, thread/ concurrency, gui Smtp,http, user defined Some client server applications, e.g. day time, echo, “knock-knock”, Email Client-Server Programming

  7. Block 1: Basic Network Concepts Client-Server Programming

  8. Outline of block 1 • Network basics • Types of networks • Protocols • Network architecture • TCP/IP protocols suite • Connection-oriented and connectionless communications • Network resources • Identification of network resources • Addressing an Internet host • Addressing a process running on a host • Addressing a Wed document Client-Server Programming

  9. Distributed system • In Coulouris et al “We define a distributed system as one in which hardware or software components located at networked computers communicate and coordinate their actions only by passing messages.” • Examples are internet, intranet, technology based on mobile devices Client-Server Programming

  10. Network Basics Client-Server Programming

  11. A typical intranet Client-Server Programming

  12. Portable and handheld devices in a distributed system Client-Server Programming

  13. Some types of network • Local area networks (LAN), e.g. Ethernet • Wide area network (WAN) • Internetwork, e.g. Internet • Wireless local area network (WLAN), e.g. WiFi Client-Server Programming

  14. Network standards and protocols • On public networks such as the Internet, it is necessary for a common set of rules to be specified for the exchange of data. • Such rules, called protocols, specify such matters as the formatting and semantics of data, flow control, error correction. Client-Server Programming

  15. Protocols • In the context of communications, a protocol is a set of rules that must be observed by the participants. • In communications involving computers, protocols must be formally defined and precisely implemented. For each protocol, there must be rules that specify the followings: • How is the data exchanged encoded? • How are events (sending , receiving) synchronized so that the participants can send and receive in a coordinated order? Client-Server Programming

  16. Network architecture • Network hardware transfers electronic signals,which represent a bit stream, between two devices. • Modern day network applications require an application programming interface (API) which masks the underlying complexities of data transmission. • A layered network architecture allows the functionalities needed to mask the complexities to be provided incrementally, layer by layer. • Actual implementation of the functionalities may not be clearly divided by layer. Client-Server Programming

  17. Network architecture The division of the layers is conceptual: the implementation of the functionalities need not be clearly divided. The conceptual division serves at least two useful purposes : • it allows protocols to be specified systematically 2. it allows programs to be written in terms of logical data flow Client-Server Programming

  18. Protocol layers in the ISO model Client-Server Programming

  19. The TCP/IP protocol suite • The Transmission Control Protocol/Internet Protocol suite is a set of network protocols which supports the following network architecture. • It is currently the protocol suite employed on the Internet. • Java’s network classes are based on the TCP/IP protocol Client-Server Programming

  20. The TCP/IP protocol suite • The Internet layer implements the Internet Protocol, which provides the functionalities for allowing data to be transmitted between any two hosts on the Internet, e.g. Internet protocol • The Transport layer delivers the transmitted data to a specific process running on an Internet host, e.g. TCP, UDP • The Application layer supports the programming interface used for building a program, e.g. FTP, HTTP Client-Server Programming

  21. Connection-oriented and connectionless communication Client-Server Programming

  22. In class example Using connection-oriented communication, it takes 50 seconds to establish a connection, after which a packet of up to 10 characters can be sent in 1.0 seconds over the connection, in either direction. Using connectionless communication, a packet of up to 10 characters can be sent in 1.2 seconds. Suppose A and B exchange messages on this network. A initiates the communication by sending B a message of 200 characters, which are partitioned into 20 packets. In reply, B sends a message of 50 characters, which are partitioned into 5 packets. Client-Server Programming

  23. Example -- cont Work out how long the session between A and B last using connection-oriented communication. Work out how long the session between A and B last using connectionless communication. Client-Server Programming

  24. Example -- cont Time for connection-oriented: ConnectionTime + time for A to send + time for B to send = 50 + 1.0 * 20 + 1.0 * 5 = 75 seconds Time for connectionless: Time for A to send + time for B to send = 1.2 * 20 + 1.2 * 5 =30 seconds Client-Server Programming

  25. Example -- cont Now suppose A sends B a message of 3000 characters, which are partitioned into 300 packets. In reply, B sends a message of 50 characters, which are partitioned into 5 packets. Work out which form of communication takes less time. Client-Server Programming

  26. Example -- cont Time for connection-oriented: ConnectionTime + time for A to send + time for B to send = 50 + 1.0 * 300 + 1.0 * 5 = 355 seconds Time for connectionless: Time for A to send + time for B to send = 1.2 * 300 + 1.2 * 5 =366 seconds Client-Server Programming

  27. Network resources • Network resources are resources available to the participants of a distributed computing community. • Network resources include hardware such as computers and equipment, and software such as processes, email mailboxes, files, web documents. • An important class of network resources is network services such as the World Wide Web and file transfer (FTP), which are provided by specific processes running on computers. Client-Server Programming

  28. Identification of network resources One of the key challenges in distributed computing is the unique identification of resources available on the network, such as hosts and web documents. • Addressing an Internet Host • Addressing a process running on a host • Addressing web contents: URL Client-Server Programming

  29. Addressing an Internet Host Client-Server Programming

  30. The Internet topology • The internet consists of an hierarchy of networks, interconnected via a network backbone. • Each network has a unique network address. • Computers, or hosts, are connected to a network. Each host has a unique ID within its network. • Each process running on a host is associated with zero or more ports. A port isa logical entity for data transmission. Client-Server Programming

  31. The Internet topology Client-Server Programming

  32. The Internet addressing scheme • In IP version 4, each address is 32 bit long. • The address space accommodates 232 (4.3 billion)addresses in total. • Addresses are divided into 5 classes (A through E) Client-Server Programming

  33. The Internet address scheme • For human readability, Internet addresses are written in a dotted decimal notation: nnn.nnn.nnn.nnn, where each nnn group is a decimal value in the range of 0 through 255 Client-Server Programming

  34. Example 1: Suppose the dotted-decimal notation for a particular Internet address is129.65.24.50. The 32-bit binary expansion of the notation is as follows: Client-Server Programming

  35. Example 1 - continued Since the leading bit sequence is 10, the address is a Class B address. Within the class, the network portion is identified by the remaining bits in the first two bytes, that is, 00000101000001, and the host portion is the values in the last two bytes, or 0001100000110010. For convenience, the binary prefix for class identification is often included as part of the network portion of the address, so that we would say that this particular address is at network 129.65 and then at host address 24.50 on that network. Client-Server Programming

  36. Example 2 (skip) Given the address 224.0.0.1, one can expand it as follows: The binary prefix of 1110 signifies that this is class D, or multicast, address. Data packets sent to this address should therefore be delivered to the multicast group 0000000000000000000000000001. Client-Server Programming

  37. IP version 6 addressing scheme • Each address is 128-bit long. Client-Server Programming

  38. The Domain Name System (DNS) For user friendliness, each Internet address is mapped to a symbolic name, using the DNS, e.g., www.cems.uwe.ac.uk www.cs.bris.ac.uk Client-Server Programming

  39. The Domain Name System . For network applications, a domain name must be mapped to its corresponding Internet address. . Processes known as domain name system servers provide the mapping service, based on a distributed database of the mapping scheme. Client-Server Programming

  40. Name lookup and resolution • If a domain name is used to address a host, its corresponding IP address must be obtained for the lower-layer network software. • The mapping, or name resolution, must be maintained in some registry. • For runtime name resolution, a network service is needed. Client-Server Programming

  41. Addressing a process running on a host Client-Server Programming

  42. Logical ports Client-Server Programming

  43. Identifying processes with ports • Domain names (or its corresponding IP addresses) locate computers (hosts) • The logical entity port is used to identify a process running on a host • In the transport layer, both TCP and UDP use ports on each host for dispatching data to processes • A process that wishes to exchange data with another process must be assigned a port • To send data to a process associated with port p on host H, an applicatin programm must address the data to (H,p) in the code. Client-Server Programming

  44. Well-known ports Client-Server Programming

  45. Addressing a Web Document Client-Server Programming

  46. The Uniform Resource Identifier (URI) • Resources to be shared on a network need to be uniquely identifiable. • On the Internet, a URI is a character string which allows a resource to be located. • There are two types of URIs: • URL (Uniform Resource Locator) points to a specific resource at a specific location • URN (Uniform Resource Name) points to a specific resource at a nonspecific location. Client-Server Programming

  47. URL A URL has the format of: protocol://host address[:port]/ directory path/file name#section Client-Server Programming

  48. A sample URL: • http://www.cems.uwe.ac.uk/~jsa/Internetics/overall.html#intro • Some conventions: • Port 80 is the default port for http • ~fred by convetion is in a subdirectory of public_html of user fred’s home directory • Path name ends with a directory refers to the file index.html in that directory section name protocol host name directory name file name Client-Server Programming

  49. Review questions • Explain the concept of connection-oriented communication and connectionless communication • Understand the concept of network resources • Explain Internet addressing scheme • Understand the concept of domain names • Understand URL • Understand how to address Internet host; how to address a running process; how to address a web document Client-Server Programming

More Related