The Client Server Model and Software Design

Similar documents
CS-461 Internetworking. Dr. Mohamed Aboutabl

The OSI Model. Open Systems Interconnection (OSI). Developed by the International Organization for Standardization (ISO).

ES623 Networked Embedded Systems

Chapter 2 Network Models 2.1

Chapter 2 Network Models 2.1

Network Models. Behrouz A. Forouzan Data communication and Networking Fourth edition

Network Model: Each layer has a specific function.

Defining Networks with the OSI Model. Module 2

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Data and Computer Communications. Chapter 2 Protocol Architecture, TCP/IP, and Internet-Based Applications

System Programming. Introduction to computer networks

Chapter -4 OSI Reference Model

Networking Applications

Overview of TCP/IP Overview of TCP/IP protocol: TCP/IP architectural models TCP protocol layers.

Chapter 3 Protocols and the TCP/IP Suite

TSIN02 - Internetworking

Layering in Networked computing. OSI Model TCP/IP Model Protocols at each layer

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

TSIN02 - Internetworking

Computer Communication & Networks / Data Communication & Computer Networks Week # 03

Computer Networks 1DV201

Introduction to Open System Interconnection Reference Model

OSI Model. Teran Subasinghe MBCS, Bsc.(Hons) in Computer Science - University of Greenwich, UK

Computer Networks (Introduction to TCP/IP Protocols)

Lecture-4. TCP/IP-Overview:

Computer Network : Lecture Notes Nepal Engineering College Compiled by: Junior Professor: Daya Ram Budhathoki Nepal Engineering college, Changunarayan

Copyleft 2005, Binnur Kurt. Objectives

Network Architecture Models

precise rules that govern communication between two parties TCP/IP: the basic Internet protocols IP: Internet protocol (bottom level)

Peer entities. Protocol Layering. Protocols. Example

What is a Network? TCP / IP. The ISO OSI Model. Protocols. The TCP/IP Protocol Suite. The TCP/IP Protocol Suite. Computer network.

TSIN02 - Internetworking

Communicating over the Network

CPS221 Lecture: Layered Network Architecture

The History and the layers of the OSI Model 30 - October

Lecture (02) Network Protocols and Standards

SUBJECT: DATA COMMUNICATION AND NETWORK SEMESTER: V SEMESTER COURSE: BCA SUBJECT TEACHER: Dr.K.Chitra Assistant Professor, Department of Computer

Layered Architecture

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Lecture 17 Overview. Last Lecture. Wide Area Networking (2) This Lecture. Internet Protocol (1) Source: chapters 2.2, 2.3,18.4, 19.1, 9.

The client-server model

b) Diverse forms of physical connection - all sorts of wired connections, wireless connections, fiber optics, etc.

Chapter 2. Communicating Over The Network. CCNA1-1 Chapter 2

Data Communication and Network. Introducing Networks

Introduction to Protocols

Chapter Two. The OSI Model

IP Address Assignment

UDP: Datagram Transport Service

Chapter 16 Networking

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER

OSI Transport Layer. objectives

TCP/IP THE TCP/IP ARCHITECTURE

Network Programming. Introduction to Sockets. Dr. Thaier Hayajneh. Process Layer. Network Layer. Berkeley API

ITEC 3800 Data Communication and Network. Introducing Networks

COMP750. Distributed Systems. Network Overview

Networking midterm. 5. As a data unit moves up from one protocol layer to another, control headers are:

TSIN02 - Internetworking

Guide to Networking Essentials, 6 th Edition. Chapter 5: Network Protocols

NT1210 Introduction to Networking. Unit 10

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

Chapter 2. Communicating Over The Network

Networking and Internetworking 1

Fundamentals of Networking. OSI & TCP/IP Model. Kuldeep Sonar 1

Packet Switching, Layer Models and Protocol Suites

Introduction. IP Datagrams. Internet Service Paradigm. Routers and Routing Tables. Datagram Forwarding. Example Internet and Conceptual Routing Table

Network Models. Presentation by Dr.S.Radha HOD / ECE SSN College of Engineering

Reference Models. 7.3 A Comparison of the OSI and TCP/IP Reference Models

ISO/OSI Model and Collision Domain NETWORK INFRASTRUCTURES NETKIT - LECTURE 1 MANUEL CAMPO, MARCO SPAZIANI

Data Communication & Computer Networks MCQ S

International Journal of Modern Engineering and Research Technology

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

06/02/ Local & Metropolitan Area Networks 0. INTRODUCTION. 1. History and Future of TCP/IP ACOE322

UNIT 1. Advantages of Computer Networks

Architectures of Communication Subsystems

Chapter 09 Network Protocols

The Transmission Control Protocol (TCP)

Need For Protocol Architecture

CMPE 80N: Introduction to Networking and the Internet

Layered Architecture

OSI Reference Model. Computer Networks lab ECOM Prepared By : Eng. Motaz Murtaja Eng. Ola Abd Elatief

TCP/IP Overview. Basic Networking Concepts. 09/14/11 Basic TCP/IP Networking 1

Networking interview questions

Part VI. Appendixes. Appendix A OSI Model and Internet Protocols Appendix B About the CD

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

03 The Internet Model and TCP/IP

Chapter 12 Network Protocols

Solved MCQ of Computer networking. Set-1

ECE 4400:427/527 - Computer Networks Spring 2017

Data and Computer Communications

Interconnecting Networks with TCP/IP

MEBS Utilities services M.Sc.(Eng) in building services Faculty of Engineering University of Hong Kong

CS3600 SYSTEMS AND NETWORKS

Networking Models OSI Model Created by International Organization Standardization

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

Chapter 7. Local Area Network Communications Protocols

Network Reference Models

Need For Protocol Architecture

CS 640: Introduction to Computer Networks. Today s Lecture. Page 1

ECE4110 Internetwork Programming. Introduction and Overview

CCNA 1 v3.11 Module 11 TCP/IP Transport and Application Layers

Transcription:

The Client Server Model and Software Design Prof. Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Taipei, TAIWAN MCSE Lab, NTUT, TAIWAN 1

Introduction Short review for OSI model Peer-to-peer communication Client-server paradigm NTUT, TAIWAN 2

Layering Divide a task into pieces and then solve each piece independently (or nearly so). Establishing a well-defined interface between layers makes porting easier. Major Advantages: Code Reuse Extensibility NTUT, TAIWAN 3

Layering Example: Federal Express Letter in envelope, address on outside FedX guy adds addressing information, barcode. Local office drives to airport and delivers to hub. Sent via airplane to nearest city. Delivered to right office Delivered to right person NTUT, TAIWAN 4

FedX Layers Letter Addressed Envelope Letter Addressed Envelope NTUT, TAIWAN 5

Layered Software Systems Network software Operating systems Windowing systems NTUT, TAIWAN 6

Unix is a Layered System Applications Libraries System Calls Kernel NTUT, TAIWAN 7

OSI Reference Model The International Standards Organization (ISO) proposal for the standardization of the various protocols used in computer networks (specifically those networks used to connect open systems) is called the Open Systems Interconnection Reference Model (1984), or simply the OSI model. NTUT, TAIWAN 8

OSI Model Although the OSI model is a just a model (not a specification), it is generally regarded as the most complete model (as well it should be - nearly all of the popular network protocol suites in use today were developed before the OSI model was defined). NTUT, TAIWAN 9

OSI <-> Network Software Although this course is about network programming (and not about networking in general), an understanding of a complete network model is essential. NTUT, TAIWAN 10

OSI 7 Layer Model: 7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 Data-Link 1 Physical High level protocols Low level protocols NTUT, TAIWAN 11

Simplified Network Model Process Process Transport Network Interface Protocols Peer-to-peer Protocols Transport Network Data Link Data Link NTUT, TAIWAN 12

What s a Protocol? An agreed upon convention for communication. both endpoints need to understand the protocol. Protocols must be formally defined and unambiguous! We will study lots of existing protocols and perhaps develop a few of our own. NTUT, TAIWAN 13

Process Process Interface and Interface Protocols Transport Transport Peer-to-peer Network Peer-to-peer Protocols Network Protocols Data Link Data Link Interface protocols describe the communication between layers on the same endpoint. Peer-to-peer protocols describe communication between peers at the same layer. NTUT, TAIWAN 14

Physical Layer Coordinates the functions required to transmit a bit stream over a physical medium Concerns Physical characteristics of interfaces and medium Representation of bits Data rate (Transmission rate): bits/sec Synchronization of bits NTUT, TAIWAN 15

Physical Layer Line configuration Point-to-point Multipoint Physical topology mesh, star, ring, or bus. Transmission mode simplex, half-duplex, or full-duplex NTUT, TAIWAN 16

Physical Layer NTUT, TAIWAN 17

Data Link Layer Transforms the physical layer to a reliable link Makes the physical layer appear error free to upper layer Responsible for Framing frames Physical addressing (physical address) Header defines the sender and/or receiver Receiver is the device connected to the next NTUT, TAIWAN 18

Data Link Layer Flow control Error control Access control Multi-home: computer having two or more NICs NTUT, TAIWAN 19

Data Link Layer NTUT, TAIWAN 20

Node-to-node Delivery NTUT, TAIWAN 21

Network Layer Responsible for the source-to-destination delivery of a packet Responsibilities: Logical addressing (IP address) Routing NTUT, TAIWAN 22

Network Layer NTUT, TAIWAN 23

End-to-end Delivery NTUT, TAIWAN 24

Transport Layer Source-to-destination (end-to-end) delivery of the entire message Functions include: Service-point addressing (port) Segmentation and reassembly Connection control connectionless v.s. connection-oriented Flow control Error control NTUT, TAIWAN 25

Transport Layer NTUT, TAIWAN 26

Reliable end-to-end delivery of a message NTUT, TAIWAN 27

Session Layer Network dialog controller establishes, maintains, and synchronizes the interaction between communicating systems Functions include: Dialog control Synchronization (checkpoint) NTUT, TAIWAN 28

Session Layer NTUT, TAIWAN 29

Presentation Layer Concerned with the syntax an semantics of the information exchanged between two systems Responsibilities include Translation Encryption Compression NTUT, TAIWAN 30

Presentation Layer NTUT, TAIWAN 31

Application Layer Interface for users to access the network Services include Network virtual terminal File transfer, access, and management (FTAM) Mail services Directory services NTUT, TAIWAN 32

Application Layer NTUT, TAIWAN 33

Summary of Layers NTUT, TAIWAN 34

TCP/IP Protocol Suite Physical Layer Data link Layer Network Layer Transport Layer Application Layer Correspond to OSI model Last three layers in OSI No specific protocol defined in physical and data link layers in TCP/IP NTUT, TAIWAN 35

TCP/IP and OSI model NTUT, TAIWAN 36

Network Layer Internetwork layer Support IP: Internetworking Protocol ARP: Address Resolution Protocol RARP: Reverse Address Resolution Protocol ICMP: Internet Control Message Protocol IGMP: Internet Group Message protocol NTUT, TAIWAN 37

Internetworking Protocol (IP) Transmission mechanism Datagram: data unit to be sent in IP Unreliable and connectionless Best-effort delivery service Host-to-host protocol NTUT, TAIWAN 38

Transport Layer TCP and UDP: delivery of a message from a process to another process User Datagram Protocol (UDP) Transmission Control Protocol (TCP) NTUT, TAIWAN 39

TCP/IP Provides basic mechanisms used to transfer data Allows a programmer to establish communication between applications Provides peer-to-peer communication One organizational method to use TCP/IP is the client-server paradigm NTUT, TAIWAN 40

Motivation Scenario: A user tries to start two programs on separate machines and have them communicate. Program 1 starts Program 2 starts Send message to its peer No connection can be set up No response; exit Not running; Refuse NTUT, TAIWAN 41

Client-Server Model One side in any pair of communicating application must start execution and wait for the other side to contact it. Since the client-server model places responsibility for rendezvous problem on application, TCP/IP does not need to provide mechanisms that automatically create a running program when a message arrives. Instead, a program must be waiting to accept communication before any request arrive. NTUT, TAIWAN 42

Terminology and Concepts Clients and Servers Privilege and Complexity Standard v.s. Nonstandard Client Software Parameterization of Clients Connectionless v.s. Connection-oriented Servers Stateless v.s. Stateful Servers Identifying a Client NTUT, TAIWAN 43

Clients and Servers Client * An application that initiates peer-topeer communication, e.g. web browser * Easier to build than servers * System privileges usually unnecessary Server Program that waits for incoming communication requests from a client NTUT, TAIWAN 44

Privilege and Complexity Server software often needs to access to objects that OS protects Server can not rely on the usual OS check since its privilege status allow to access any file Security issues: Authentication Authorization Data Security Privacy Protection NTUT, TAIWAN 45

Privilege and Complexity The combination of special privileges and concurrent operation usually makes servers more difficult to design and implementation NTUT, TAIWAN 46

Standard v.s. Nonstandard Client Software Standard application services Defined by TCP/IP Assigned well-known, universally recognized protocol port Non-standard application services All other services which is not standard Or, locally-defined application services NTUT, TAIWAN 47

Standard v.s. Nonstandard Client Software Be aware of the standard when outside the local environment Standard application service examples Remote login, TELNET protocol E-mail client, SMTP or POP protocol File transfer client, FTP protocol Web browser, HTTP protocol NTUT, TAIWAN 48

Standard v.s. Nonstandard Client Software Non-standard application service examples Music or video transfer Voice communication Distributed database access NTUT, TAIWAN 49

Parameterization of Clients Generality for client software e.g. TELNET protocol using port number Fully parameterized client application allows more input parameters NTUT, TAIWAN 50

Parameterization of Clients When designing client application, include parameters that allow the user to fully specify the destination machine and port number. NTUT, TAIWAN 51

Connectionless v.s. Connection-Oriented Servers TCP/IP provides two types of interaction between client and server: Connectionless style UDP Connection-oriented style The distinction is critical TCP NTUT, TAIWAN 52

Connection-Oriented Servers TCP: * full reliability * verifying the data arrives * automatically retransmits segments * checksum over the data * data arriving in order * no duplicated packets * control the flow * reporting the underlying network problem to sender NTUT, TAIWAN 53

Connectionless Servers UDP * no guarantees about reliable delivery * software contains code to detect and correct errors occurred by transmission * work well when the underlying network running well * aware of testing when using UDP NTUT, TAIWAN 54

Connectionless v.s. Connection-Oriented Servers TCP is preferable to UDP TCP simplifies programming TCP relieves the programmers of responsibility for detecting and correcting errors Adding reliability to UDP is a nontrivial work NTUT, TAIWAN 55

Connectionless v.s. Connection-Oriented Servers Application programs use UDP only if Application protocol specifies the UDP must be used Application protocol relies on hardware broadcast or multicast for delivery Overhead for reliability is unnecessary NTUT, TAIWAN 56

Stateless v.s. Stateful Servers State information A server maintains about the status of ongoing interaction with clients Servers that do not keep any state information are called stateless servers; otherwise, called stateful servers. NTUT, TAIWAN 57

Stateless v.s. Stateful Servers Keeping a small amount of information in a server can reduce the size of messages that the client and server exchange and allow the server to response quickly The point for statefulness is efficiency The motivation for statelessness lies in protocol reliability NTUT, TAIWAN 58

Stateless File Server Example Item op name pos size data Description Operation (read or write) Name of the file Position in the file Number of bytes to transfer Present only in write operation message File server disk Waits for client to access client stores or extracts data from the server NTUT, TAIWAN 59

Stateful File Server Example Item op name pos size data Description Operation (read or write) Name of the file Position in the file Number of bytes to transfer Present only in write operation reads File server disk Waits for client to access client stores or extracts data from the server NTUT, TAIWAN 60

Stateful File Server Example Client File Name Current Position Last Operation 1 test.program.c 0 read 2 tcp.book.text 456 read 3 dept.budget.txt 38 write 4 teris.txt 125 read State information table NTUT, TAIWAN 61

Identifying a Client Stateful servers use two general approaches to identify clients Endpoints Handles Endpoint identification Operate automatically Relies on transport protocol, not application protocol Endpoint information may change NTUT, TAIWAN 62

Identifying a Client server using the endpoint information to look up the state table Transport protocol IP address and port number NTUT, TAIWAN 63

Identifying a Client Handles remains constant across multiple transport connections A small integer Independent of the underlying transport protocol Change of transport connection does not invalidate handles Visibility to the application drawback NTUT, TAIWAN 64

Identifying a Client Back to stateful server Can not retain state forever and application protocol requires termination Using endpoint identification can be confused by a crash NTUT, TAIWAN 65

Identifying a Client The point of state is efficient Reducing the amount of data transferred Intuitive design Difficulty Maintain the correctness when delay, duplication allowed State information may be incorrect when computer restarts NTUT, TAIWAN 66

Identifying a Client In general, in a real internet, where machines crash and reboot, and messages can be lost, delayed, duplicated, or delivered out of order, stateful designs lead to complex application protocols that are difficult to design, understand, and implement correctly. NTUT, TAIWAN 67

Statelessness is a Protocol Issues Statelessness or not centers on the application protocol more than implementation The issue of statelessness focuses on whether the application protocol assumes the responsibility for reliable delivery Idempotent design issue for statelessness operation always has the same result NTUT, TAIWAN 68

Servers as Clients Programs do not fit exactly into the definition of client or server time server client Internet file server Avoid circular dependencies among servers NTUT, TAIWAN 69