台北科技大学:《计算机网络》(英文版) NP04 16 Client Software Design

Client Software Design Algorithms and Issues Chuan-Ming liu Computer Science and Information Engineering Spring 2004, NTUt TAIWAN CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 1 Client Software Design Algorithms and Issues Chuan-Ming Liu Computer Science and Information Engineering Spring 2004, NTUT TAIWAN

Client Software Design a How applications become clients by initiating communication a How applications use TCP or UDP protocols to contact a server How they use socket calls to interact with the protocols CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 2 Client Software Design ◼ How applications become clients by initiating communication ◼ How applications use TCP or UDP protocols to contact a server ◼ How they use socket calls to interact with the protocols

Learning algorithms Instead of Details Learn know-what instead of know -how first a After knowing what to do, finding out how to do is straightforward CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 3 Learning Algorithms Instead of Details ◼ Learn know-what instead of know-how first ◼ After knowing what to do, finding out how to do is straightforward

Client Architecture a Client applications are simpler than server applications No concurrent interaction Most client software executes as a conventional application a Dont need to enforce protection CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 4 Client Architecture ◼ Client applications are simpler than server applications ◼ No concurrent interaction ◼ Most client software executes as a conventional application ◼ Don’t need to enforce protection

Identifying servers location Have the server 's domain name or ip address as constants when program is compiled a Using address makes client software faster and less dependent on local computing environment no flexibility Using a generic name for the server and an alias to the domain name system for that name Improvement Obtain information from stable storage Can not execute program unless the file is available CSIE NTUT Taiwan 5
CSIE, NTUT, Taiwan 5 Identifying Server’s location ◼ Have the server’s domain name or IP address as constants when program is compiled ◼ Using address makes client software faster and less dependent on local computing environment – no flexibility ◼ Using a generic name for the server and an alias to the domain name system for that name – improvement ◼ Obtain information from stable storage ◼ Can not execute program unless the file is available

Identifying servers location a Use a separate protocol to find a server Works in a small. local environment The dynamic property makes additional complexity and broadcast traffic on network Ask users to identify Avoid unnecessary complexity Makes the client software general Eliminates dependency ■ Most flexible Approach taken depends on services CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 6 Identifying Server’s location ◼ Use a separate protocol to find a server ◼ Works in a small, local environment ◼ The dynamic property makes additional complexity and broadcast traffic on network ◼ Ask users to identify ◼ Avoid unnecessary complexity ◼ Makes the client software general ◼ Eliminates dependency ◼ Most flexible ◼ Approach taken depends on services

Parsing an Address Argument a Specify arguments on command line when invoking a client program Each argument consists of a character string a Client uses an argument's syntax to interpret Its meaning ■ Example: Domain name: csie ntut. edu. tw IP address:140.124.180.1 CSIE NTUT Taiwan 7
CSIE, NTUT, Taiwan 7 Parsing an Address Argument ◼ Specify arguments on command line when invoking a client program ◼ Each argument consists of a character string ◼ Client uses an argument’s syntax to interpret its meaning ◼ Example: ◼ Domain name: csie.ntut.edu.tw ◼ IP address: 140.124.180.1

Parsing an Address Argument a Additional information beyond the servers machine, or IP address can also be specified Example: (two arguments) cSie ntut. edu. tw smtp Csie ntut. edu. tw: smtp a Keep consistency with the local system CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 8 Parsing an Address Argument ◼ Additional information beyond the server’s machine, or IP address can also be specified ◼ Example: (two arguments) ◼ csie.ntut.edu.tw smtp ◼ Csie.ntut.edu.tw:smtp ◼ Keep consistency with the local system

Looking up a Domain Name a Client needs to specify the address of a server a There are two forms in address argument ■ Domain name IP address(dotted decimal a Converting IP address to 32-bit binary representation is trivial Converting from a domain name require more effort CSIE NTUT Taiwan
CSIE, NTUT, Taiwan 9 Looking up a Domain Name ◼ Client needs to specify the address of a server ◼ There are two forms in address argument ◼ Domain name ◼ IP address (dotted decimal) ◼ Converting IP address to 32-bit binary representation is trivial ◼ Converting from a domain name require more effort

Looking up a Domain Name a Socket APi includes library routines, inet addr and gethostbyname to perform the conversion ■ inet addr; Takes dotted decimal address(in AScID and returns the ip address in binary a gethostbyname Takes the domain name and returns the address of a hostnet structure containing the Ip address in binary CSIE NTUT Taiwan 10
CSIE, NTUT, Taiwan 10 Looking up a Domain Name ◼ Socket API includes library routines, inet_addr and gethostbyname to perform the conversion ◼ inet_addr: Takes dotted decimal address (in ASCII) and returns the IP address in binary ◼ gethostbyname: Takes the domain name and returns the address of a hostnet structure containing the IP address in binary
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 台北科技大学:《计算机网络》(英文版) NP04 16 Socket API.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 15 Client Server model.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 12 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 11 Introduction.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 1 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 0 Network Programming.ppt
- 哈尔滨工业大学:《网络应用开发》英文版 网络开发与应用实验指导书.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter6-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter5.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter5-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter4.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter4-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter3.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter3-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter2.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter2-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter1new.pdf
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi proto.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi services.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex con.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 18.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 2 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 20(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 20.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 21(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 22(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 23(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 24(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 27 Mobile ip discussion overview.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 28 Real-Time Transport protocol.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 3 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 4 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 5 Subnetting.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 8 Internet Protocol (IP).ppt
- 《计算机图形学》课程教学资源:第3章 图形的基本运算.ppt