Windows Network Programming ms-help://MS.MSDNQTR.2004JAN.1033/winsock/winsock/windows_sockets_start_page_2.htm 井民全.

Slides:



Advertisements
Similar presentations
Three types of remote process invocation
Advertisements

© 2003 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Performance Measurements of a User-Space.
1 Pertemuan 9 Windows Socket ( WinSock ) Matakuliah: H0483 – Network Programming Tahun: 2008 Versi: 2.0.
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
计算机系 信息处理实验室 Lecture 16 Networking
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Windows Sockets Purpose Windows Sockets 2 (Winsock) enables programmers to create advanced internet, intranet, and other network-capable applications to.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
Introduction to Systems Architecture Kieran Mathieson.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Socket Addresses. Domains Internet domains –familiar with these Unix domains –for processes communicating on the same hosts –not sure of widespread use.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
WNT Client/Server SDK Tony Vaccaro CS699 Project Presentation.
1 I/O Management in Representative Operating Systems.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
VSP Video Station Protocol Presented by : Mittelman Dana Ben-Hamo Revital Ariel Tal Instructor : Sela Guy Presented by : Mittelman Dana Ben-Hamo Revital.
Network Programming Eddie Aronovich mail:
SLAC asyn class, Day 1, August 26, 2010 Example asyn driver Modbus Mark Rivers, Marty Kraimer, Eric Norum University of Chicago Advanced Photon Source.
Socket Programming References: redKlyde ’ s tutorial set Winsock2 for games (gamedev.net)
Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Windows 2000 Networking Computing Department, Lancaster University, UK.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
LWIP TCP/IP Stack 김백규.
LWIP TCP/IP Stack 김백규.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Sockets The Standard Network Programming API Agenda Evolution Evolution API Components (Sockets/Winsock) API Components (Sockets/Winsock) Protocol Configuration.
SPREAD TOOLKIT High performance messaging middleware Presented by Sayantam Dey Vipin Mehta.
CSP Implementing a network 1 Implementing a network Lecturer: Smilen Dimitrov Cross-sensorial processing – MED7.
Windows XP. History Windows XP is based on the NT kernel developed in 1988 Windows XP is based on the NT kernel developed in 1988 XP was originally sold.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
Network Programming Eddie Aronovich mail:
Minimizing Communication Latency to Maximize Network Communication Throughput over InfiniBand Design and Implementation of MPICH-2 over InfiniBand with.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
OS2014 PROJECT 2 Supplemental Information. Outline Sequence Diagram of Project 2 Kernel Modules Kernel Sockets Work Queues Synchronization.
1 WNT Low Level Network Interfaces Tutorial NT015 Copyright, 1997 ©Mentec Inc Paul Fix Mentec Inc.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
Protocols COM211 Communications and Networks CDA College Olga Pelekanou
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 5.
1 Network Communications A Brief Introduction. 2 Network Communications.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Sockets A popular API for client-server interaction.
2007/11/16 Dinh Trong Thuy RTLab
Tiny http client and server
Last Class: Introduction
LWIP TCP/IP Stack 김백규.
Chapter 3: Windows7 Part 4.
Interacting With Protocol Software
WEB API.
CS703 - Advanced Operating Systems
27.
Chapter 2: The Linux System Part 5
Student: Popa Andrei-Sebastian
Introduction to Networking & TCP/IP
Chapter 3 Socket API © Bobby Hoggard, Department of Computer Science, East Carolina University These slides may not be used or duplicated without permission.
(Authentication / Authorization)
Windows sockets Iveta LenčiauskaitE.
Exceptions and networking
Presentation transcript:

Windows Network Programming ms-help://MS.MSDNQTR.2004JAN.1033/winsock/winsock/windows_sockets_start_page_2.htm 井民全

Introduction Purpose Purpose Create advanced Internet, intranet, and other network- capable applications Create advanced Internet, intranet, and other network- capable applications provided network capabilities of multicasting and Quality of Service (QOS) provided network capabilities of multicasting and Quality of Service (QOS) Following the WOSA Model Following the WOSA Model Windows Open System Architecture (WOSA) Windows Open System Architecture (WOSA) the interfaces for connecting front-end applications with back-end services the interfaces for connecting front-end applications with back-end services WOSA defines an abstraction layer to heterogeneous computing resources through the WOSA set of APIs WOSA defines an abstraction layer to heterogeneous computing resources through the WOSA set of APIs

Winsock defines a standard service provider interface (SPI) between API. (from WS2.dll) Winsock defines a standard service provider interface (SPI) between API. (from WS2.dll)

Winsock Programming Considerations The major feature changed from Winsock 1 The major feature changed from Winsock 1 FeaturesDescription Socket handles A socket handle can be used as file handle. Simultaneous access to multiple transport protocols Application can simultaneous access to a number of installed transport protocols Protocol-independent name resolution * Server can register its exists within the namespaces * Client can find the service within a namespace and obtain information ReadFile, WriteFile, etc.

Overlapped I/O with scatter/gather IO Ex: the header components can be automatically split off into separate buffer, leaving the message body pure Protocol-independent multicast and multipoint

Scatter-gather I/O Before NT4.0 SP2, Before NT4.0 SP2, all data access for disk had to be in a contiguous area of memory all data access for disk had to be in a contiguous area of memory Scatter-gather I/O allows a read/write to transfer data in to or out of discontiguous area of memory. Scatter-gather I/O allows a read/write to transfer data in to or out of discontiguous area of memory. Windows 2000 support scatter-gather I/O Windows 2000 support scatter-gather I/O If a read transferred in 64 KB of data, the request had to specify the address of a contiguous area of 64 KB

Asynchronous I/O an AP requests a read/write operation from OS immediately returns control to the AP. an AP requests a read/write operation from OS immediately returns control to the AP. the AP can then perform addition work and later test to see if read/write has completed. the AP can then perform addition work and later test to see if read/write has completed. the operating system do not return control to the AP until the read/write completes. Synchronous I/O

Overlapped I/O Overlapped send and receive calls return immediately. Overlapped send and receive calls return immediately. Return value = 0 Return value = 0 I/O operation completed immediately and the corresponding completion indication has already occurred. I/O operation completed immediately and the corresponding completion indication has already occurred. Return value =WSA_IO_PENDING Return value =WSA_IO_PENDING the overlapped operation has been successfully initiated. the overlapped operation has been successfully initiated. a subsequent indication will be provided when a subsequent indication will be provided when send buffer have been consumed send buffer have been consumed receive buffer are filled receive buffer are filled associated event object has been signaled, or the completion routine has called. Any other error code indicates ERROR

Overlapped I/O Both send and receive operation can be overlapped. Both send and receive operation can be overlapped. The receive functions can be invoked multiple times to post receive buffer in preparation for incoming data. Read The send functions can be invoked multiple times to queue up multiple buffers to be sent. Write

Winsock and the OSI Model Winsock operates at the session layer interface to the transport layer Winsock operates at the session layer interface to the transport layer ms-help://MS.MSDNQTR.2004JAN.1033/wcecomm/html/_wcesdk_Windows_Networking_and_the_OSI_Model.htm

Create a Basic Winsock Application Link to the Winsock library file, WS2_32.lib Link to the Winsock library file, WS2_32.lib 1 2

WSAStartup Initiates use of WS2_32.dll by a process Initiates use of WS2_32.dll by a process [in] Highest version of WinSock support Ex: MAKEWORD(2,2) [out] receive the detail of WinSock implementation Return Value: return zero if successful

socket function Cause a socket descriptor and located related resource to a specific transport-service provider Cause a socket descriptor and located related resource to a specific transport-service provider Winsock will utilize the first available service provider. Winsock will utilize the first available service provider. overlapped attribute is default overlapped attribute is default You can use WSASocket to create nonoverlapped socket You can use WSASocket to create nonoverlapped socket All functions allow overlapped operation also support nonoverlapped usage on an overlapped socket All functions allow overlapped operation also support nonoverlapped usage on an overlapped socket WSASend, WSARecv, WSASendTo, WSARecvFrom, WSAIoctl