Download presentation
Presentation is loading. Please wait.
Published byColeen Haynes Modified over 8 years ago
1
Client-server communication Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall wenwen@asu.edu
2
Outline 1. Local Area Network (LAN) 2. Client-Server Model 3. Client-Server Communication 4. Socket 5. Summary
3
Local Area Network (LAN) Application: workstation Coverage: small area Speed: high Latency: low Endpoint: node
4
Local Area Network (LAN) Hub A central point for LAN Sends the data from one port to other ports Switch Moves data in the port from input to output Finds the destination port to create a connection between the ports. Concentrator or repeater Recreate the route for moving data Bridge: Connects two LANs Router Find the next point for sensing packet Connects different types of network
5
Local Area Network (LAN) Connection modes: Circuit-switching (virtual circuit network): Path: dedicated Bandwidth: constant & unvaried Packet: constant & unvaried Latency: constant Packet-switching (datagram network): Path: shared Bandwidth: variable Packet: variable Latency: variable
6
Client-server model The client-server model of computing is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients.* Request (Client) -response (Server) messaging pattern Communication protocol Schedule system Portal * "Distributed Application Architecture". Sun Microsystem. Retrieved 2009-06-16.
7
Client-server model Client & server Client: running on the local machine Server: running on the remote machine Client: application program runs only if needed Server: application program runs all time
8
Client-server model Protocols Client: Concurrency: multiple clients runs at the same time Alternatively: Another client can only run when the previous client finishes running Server: Concurrency: a server can process multiple requests at the same time Alternatively: a server can only process one request at the same time
9
Client-server model Layers (Open Systems Interconnection-OSI model)
10
Client-server model Layers (Open Systems Interconnection-OSI model) Layer 1 (Physical): Communication medium E.g. HSB, Wi-Fi Layer 2 (Data Link): Data organization Ethernet switch: including hosts & switches to define local area network (LAN) E.g. Ethernet MAC, Point - to - Point Protocol (PPP) Layer 3 (Network): Pass and routes E.g. Item Processing (IP)
11
Client-server model Layers (Open Systems Interconnection-OSI model) Layer 4 (Transport): Interface for end-to-end communication Data flow control Layer 5 (Session): Services to coordinate dialogue and manage data exchange Software implemented switch Manage multiple logical connections Keep track of who is talking: establish & end communications E.g. Hypertext Transfer Protocol (HTTP), Secure Sockets Layer (SSL)
12
Client-server model Layers (Open Systems Interconnection-OSI model) Layer 6 (Presentation): Data representation Concerned with the meaning of data bits Convert between machine representations E.g. JavaScript Object Notation (JSON), Extensible Markup Language (XML) Layer 7 (Application): Application management E.g. email (SMTP, POP, IMAP)
13
Client-server communication Addressing machines Each host has a unique MAC address (48 bits) E.g. Each host is given a unique IP address IP address is IPv4 (32-bit): e.g. IPv6 (128-bit): e.g.
14
Client-server communication Address translation Translation from domain name to IP address Domain Name System (DNS): e.g. www.asu.eduwww.asu.edu Translation from IP address to Ethernet Address Resolution Protocol (ARP)
15
Client-server communication Application Programming Interface (API) API provides an access to the network Core services of API provided by the operating system
16
Client-server communication Connection-oriented protocols Steps: Create connection Select protocol Access data Terminate connection API provides an access to the network Core services of API provided by the operating system
17
Client-server communication Connectionless protocols API provides an access to the network Core services of API provided by the operating system https://www.cs.rutgers.edu/~pxk/416/notes/content/15-net-intro-slides.pdf
18
Socket (network) Network socket A endpoint that establishes a communication between network input and network output
19
Socket (network) Structure of network socket Family: defines the protocol (IPv4, IPv6) Type: sets the exchange-type Protocol: Local address: fuses local IP and application port address Remote address: fuses remote IP and application port address Exchange-type: Stream: applies TCP Datagram: applies User Datagram Protocol (UDP) Raw: applies IP
20
Socket (network) Connectionless server (UDP) Blind server Repeat infinitely Client role: Create a socket Server roles: Create socket Receives a request Processes the user’s request Sends the response Destroy a socket
21
Socket (network) Connectionless server (UDP)
22
Socket (network) Connection oriented server Blind/passive server Repeat infinitely Parent-child server: after accepting the connection requests, server creates a child server to process the user’s request temporally Client role: Create a socket
23
Socket (network) Connection oriented server Server roles (Parent server): Create a socket Listens to the server’s request Create a child server Receives a request Processes the user’s request Sends the response Server roles (Child server): Reads the stream Processes the stream Writes the stream
24
Socket (network) Connection oriented server
25
Socket (network) Data structure sockaddr_in: sin_family: 16-bit protocol sin_port: 16-bit port number s_addr: 32-bit Internet address hostent: h_name: text address of host h_alias: alias names h_addrtype: address type h_length: address length h_addr_list: additional comments
26
Socket (network) Commands Socket: creates a socket gethostbyname: returns the host address by name gethostname: returns the host name connect: requests a connection bind: assigns an address and port number to a socket listen: server is ready for listening connection requests accept: accepts a connection request send: sends data to user recv: receives data from a socket close: closes a socket
27
Summary LAN: Hub, switch, concentrator (repeater), bridge, router Circuit-switching & packet-switching Client-server model: Client roles and server roles Protocols 7 layers Client-server communication Addressing machine, address translation, API Connection-oriented and connectionless protocols
28
Summary (cont.) Socket Connectionless server Connection-oriented server Data structure Commands
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.