Windows Sockets Network Programming



Similar documents
TCP/IP Illustrated, Volume 2 The Implementation

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

CONNECTING WINDOWS XP PROFESSIONAL TO A NETWORK

Genetic Algorithms in Search, Optimization, and Machine Learning

Network Programming TDC 561

Chapter 11. User Datagram Protocol (UDP)

INSIDE SERVLETS. Server-Side Programming for the Java Platform. An Imprint of Addison Wesley Longman, Inc.

Network Layers. CSC358 - Introduction to Computer Networks

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

Networking. Sixth Edition. A Beginner's Guide BRUCE HALLBERG

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Writing Client/Server Programs in C Using Sockets (A Tutorial) Part I. Session Greg Granger grgran@sas. sas.com. SAS/C & C++ Support

Application. Transport. Network. Data Link. Physical. Network Layers. Goal

Detailed Table of Contents

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Computer Networks/DV2 Lab

Raritan Valley Community College Academic Course Outline. CISY Advanced Computer Networking

Limi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, Socket Programming

Financial Statement Analysis

Computer Networks CS321

LESSON Networking Fundamentals. Understand TCP/IP

Fundamentals of Symbian OS. Sockets. Copyright Symbian Software Ltd.

MATLAB/Simulink TCP/IP Communication

Internetworking Microsoft TCP/IP on Microsoft Windows NT 4.0

A network monitoring tool for student training

Network Models OSI vs. TCP/IP

Transport and Network Layer

Ethernet. Ethernet. Network Devices

Networking. Systems Design and. Development. CRC Press. Taylor & Francis Croup. Boca Raton London New York. CRC Press is an imprint of the

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Practical Intrusion Analysis

Network Security Essentials:

Network Security: A Practical Approach. Jan L. Harrington

Compensating the Sales Force

M06 (31-May-2001) Requirements and guidelines for distributed laboratories application migration WP 3

Cape Girardeau Career Center CISCO Networking Academy Bill Link, Instructor. 2.,,,, and are key services that ISPs can provide to all customers.

Session NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Data Communication Networks and Converged Networks

Operating Systems Design 16. Networking: Sockets

Audio Over IP. Building Pro AolP Systems. with Livewire. Skip Pizzi. Steve Church. Focal. Press ELSEVIER AMSTERDAM BOSTON HEIDELBERG LONDON

Kiwi SyslogGen. A Freeware Syslog message generator for Windows. by SolarWinds, Inc.

Building VPNs. Nam-Kee Tan. With IPSec and MPLS. McGraw-Hill CCIE #4307 S&

Building and Managing

Protocol Architecture

Slide 1 Introduction cnds@napier 1 Lecture 6 (Network Layer)

Module 1: Reviewing the Suite of TCP/IP Protocols

Concurrent Programming

Network Programming with Sockets. Process Management in UNIX

Internetworking and IP Address

Enterprise Java. Where, How, When (and When Not) to Apply Java in Client/Server Business Environments. Jeffrey Savit Sean Wilcox Bhuvana Jayaraman

ΕΠΛ 674: Εργαστήριο 5 Firewalls

presentation DAD Distributed Applications Development Cristian Toma

Introduction to Network Security Lab 1 - Wireshark

Configuring Channel Access. Jeff Hill

Network Communication

Objectives of Lecture. Network Architecture. Protocols. Contents

Cisco ASA, PIX, and FWSM Firewall Handbook

The Unified Software Development Process

CA CPT CICS Programmers Toolkit for TCP/IP r6.1

Firewall Design Principles

CONTENTS AT A GMi#p. Chapter I Ethical Hacking Basics I Chapter 2 Cryptography. Chapter 3 Reconnaissance: Information Gathering for the Ethical Hacker

Audio and Video for the Internet

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Cisco. A Beginner's Guide Fifth Edition ANTHONY T. VELTE TOBY J. VELTE. City Milan New Delhi Singapore Sydney Toronto. Mc Graw Hill Education

Industrial Communication Whitepaper. Principles of EtherNet/IP Communication

Lab 2. CS-335a. Fall 2012 Computer Science Department. Manolis Surligas

Generalised Socket Addresses for Unix Squeak

TCP/IP Protocol Suite. Marshal Miller Chris Chase

Management. Oracle Fusion Middleware. 11 g Architecture and. Oracle Press ORACLE. Stephen Lee Gangadhar Konduri. Mc Grauu Hill.

Table of Contents. Index. Search the text of TCP/IP Network Administration. Symbols A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

The OSI and TCP/IP Models. Lesson 2

Windows8 Internals, Sixth Edition, Part 1

CGHub Client Security Guide Documentation

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

Verteilte Systeme. ISO- Referenzmodell. 2. Transport Layer (Wdh) OSI- Modell = Open Systems Interconnection Referenzmodell!

Network Security. Windows 2012 Server. Securing Your Windows. Infrastructure. Network Systems and. Derrick Rountree. Richard Hicks, Technical Editor

ΕΠΛ 475: Εργαστήριο 9 Firewalls Τοίχοι πυρασφάλειας. University of Cyprus Department of Computer Science

Lab VI Capturing and monitoring the network traffic

DEC Networks and Architectures

Access Control: Firewalls (1)

The TCP/IP Reference Model

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. G.Bianchi, G.Neglia, V.Mancuso

Fundamentals of Mobile and Pervasive Computing

BASIC ANALYSIS OF TCP/IP NETWORKS

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

LPC2300/LPC2400 TCP/IP Overview. TCP/IP and LPC2300/LPC2400 Family October 2007

Common Lisp Networking API Advantages and Disadvantages

VisuSniff: A Tool For The Visualization Of Network Traffic

Prefix COMP Course# 429 Title Computer Networks Units (3) 3 hours lecture per week 3 hours lecture per week

TCP/IP Programming. Joel Snyder, Opus1 Geoff Bryant, Process Software

UPPER LAYER SWITCHING

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

Address Resolution Protocol (ARP), Reverse ARP, Internet Protocol (IP)

Introduction To Computer Networking

Intrusion Detection, Packet Sniffing

Cross-Platform. Mac OS X ЧЯУ

WiFiPerf User Guide 1.5

8.2 The Internet Protocol

Transcription:

Windows Sockets Network Programming Bob Quinn Dave Shute TT ADDISON-WESLEY PUBLISHING COMPANY Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Seoul Milan Mexico City Taipei

Contents Foreword xiii Preface xv Chapter 1 Introduction to Windows Sockets 1 What Is Windows Sockets? 2 What Is Its History? 4 What Are Its Benefits? 5 What Is Its Future? 9 Conclusion 10 Chapter 2 Windows Sockets Concepts 11 The OSI Network Model 12 The WinSock Network Model 14 OSI Layers in WinSock 16 Modular Boxes 24 Services and Protocols 26 Protocols and APIs 28 Chapter 3 TCP/IP Protocol Services 31 What Is TCP/IP? 32 What Is Its History? 34 Transport Services 35 Network Services 41 Support Protocols and Services 44 What Is Its Future? 46 Chapter 4 Network Application Mechanics 47 Client-Server Model 47 Network Program Sketch 49 vii

WINDOWS SOCKETS NETWORK PROGRAMMING Open a Socket 50 Name the Socket 53 Associate with Another Socket 58 Send and Receive between Sockets 64 Close the Socket 70 Client and Server Sketches 73 Chapter 5 Operation Modes 75 What Are Operation Modes? 76 Blocking Mode 78 Nonblocking Mode 92 Asynchronous Mode 99 Performance Differences 117 Platform Differences 117 Blocking Is Real 117 Chapter 6 Socket States 121 What Are the Socket States? 122 What Are the Methods of Detection? 125 WSAAsyncSelect( ) 129 select* ) 159 Peeking at Data 168 Out-of-Band Data 171 The Listening State 174 Chapter 7 Sample Application and Library 177 Sample FTP Client 178 Sample Library 234 WinSockx.h 251 Chapter 8 Host Names and Addresses 257 Hostname and Address Resolution 258 Host Table, DNS, and NIS 272

CONTENTS IX Local Host Information 275 Addresses and Formatting 277 Protocol and Address Families 282 Chapter 9 Socket Information and Control 285 Socket Control 285 Socket Options 290 Blocking Hooks 310 Socket Names 313 Chapter 10 Support Routines 319 Startup and Cleanup 319 Byte Ordering 329 Service Names and Ports 331 Protocol Names and Numbers 341 Error Reporting 349 Chapter 11 DLLs over WinSock 353 Creating a New API 354 DLL Issues 358 Sample DLL 363 Chapter 12 Porting from BSD Sockets 385 Differences to Consider 386 Sixteen-bit Windows Considerations 393 Incidentals 396 Functions List 398 Chapter 13 Debugging 405 Problem Types 406 What Failed, and How Did It Fail? 408 Problem Qualification 408

WINDOWS SOCKETS NETWORK PROGRAMMING Installation Debugging 409 Network Debugging 410 Application Debugging 413 Debugging Tools 414 Chapter 14 Dos and Don'ts 427 Characterizing Your Application 427 Application Data Flow 428 Stream Algorithms 433 Datagram Algorithms 438 Good-News Code 440 Common Traps and Pitfalls 444 Chapter 15 Platforms 459 The WOSA Network Model 460 Thirty-two-bit WinSock 461 Other P/atforms 469 Chapter 16 Optional Features 471 Optional Standard Is an Oxymoron 472 Should You Use Optional Features? 472 Raw Sockets 474 Multicast 481 Loopback 491 Sharing Sockets 491 Optional Options 492 Sockets as File Handles 492 Expect Any Error Anywhere 493 Other Optional Features 493 Chapter 17 WinSock 2 495 Do You Need WinSock 2? 496 Overview of Features 497

CONTENTS XI Multiple Protocol Support 499 Overlapped I/O 506 Scatter and Gather 509 Quality of Service 510 Socket Groups 511 Multipoint and Multicast 513 Conditional Acceptance 515 Connect and Disconnect Data 516 Socket Sharing 517 Protocol-specific Additions 518 Appendix A TCP/IP Protocol Headers 521 Layering within TCP/IP Packets 521 ARP Header 522 IP Header 523 ICMP Header 525 IGMP Header 526^ TCP Header 527 UDP Header 529 Sample Dialogs 529 Appendix B Quick Reference 539 Structures 539 Functions 545 Macros 556 Appendix C Error Reference 565 Where to Get Error Values 566 What Errors to Expect 567 User-fixable Errors 567 Detailed Error Descriptions 569 Errors in Numerical Order 595

XH WINDOWS SOCKETS NETWORK PROGRAMMING Appendix D What You Need 599 Essential Files 599 Compile and Link Mechanics 601 Using Different WinSocks 602 Using Different Languages 604 Appendix E Information Sources 605 Internet Sources 605 Bibliography 612 Index 621