Chapter 2: Socket Programming Chapter goal: a Program interface to rotocol Socket API Socket programming model 哈工大计算机学院李全龙 Network Application Development Socket Programming
哈工大计算机学院 李全龙 Network Application Development Socket Programming 1 Chapter 2: Socket Programming Chapter goal: Program interface to protocol Socket API Socket programming model
Chapter 2: Socket Programming Chapter goal: Program interface to protocol Socket API Socket programming model 哈工大计算机学院李全龙 Network Application Development Socket Programming 2
哈工大计算机学院 李全龙 Network Application Development Socket Programming 2 Chapter 2: Socket Programming Chapter goal: Program interface to protocol Socket API Socket programming model
Interacting with Protocol Software Client or server uses transport protocols Protocol software inside os Applications outside os Mechanism needed to bridge the two Called Application Program Interface (API) 哈工大计算机学院李全龙 Network Application Development Socket Programming 3
哈工大计算机学院 李全龙 Network Application Development Socket Programming 3 Interacting with Protocol Software Client or server uses transport protocols Protocol software inside OS Applications outside OS Mechanism needed to bridge the two Called Application Program Interface (API)
mosely specified protocol software interface TCP/IP protocol software is part of the computer' s system software TCP/IP was designed to operate in a multi-vendor environment TCP/IP does not define details of aPf The interface between TCP/IP and applications that use it has been loosely specified TCP/IP standards do not specify the details of how application software interfaces with TCP/IP protocol software hey only suggest the required functionality, and allow system designers to choose the details when creating an API 哈工大计算机学院李全龙 Network Application Development Socket Programming 4
哈工大计算机学院 李全龙 Network Application Development Socket Programming 4 Loosely specified protocol software interface TCP/IP protocol software is part of the computer’s system software. TCP/IP was designed to operate in a multi-vendor environment. TCP/IP does not define details of API The interface between TCP/IP and applications that use it has been loosely specified. TCP/IP standards do not specify the details of how application software interfaces with TCP/IP protocol software They only suggest the required functionality, and allow system designers to choose the details when creating an API
Advantages and disadvantages of Loose specification Advantages: Flexibility and tolerance Different os select own implementation Disadvantages: Designers can make the interface details different for each OS Less portable across machines In practice, only a few aPIs have been developed for use with TCP /IP Berkeley UNIX: socket interface, or sockets nAT&T, System V UNIX:工 Windows: windows sockets interface, WINSOCK 哈工大计算机学院李全龙 Network Application Development Socket Programming 5
哈工大计算机学院 李全龙 Network Application Development Socket Programming 5 Advantages and disadvantages of Loose specification Advantages: Flexibility and tolerance. Different OS select own implementation. Disadvantages: Designers can make the interface details different for each OS. Less portable across machines. In practice, only a few APIs have been developed for use with TCP/IP. Berkeley UNIX: socket interface, or sockets AT&T, System V UNIX: TLI Windows: windows sockets interface, WINSOCK