[...]... Conclusion 11 Optimizing Bandwidth Utilization 11 .1 Introduction 11 .2 Tricks and tips to increase performance 11 .2 .1 Caching 11 .2.2 Keep-alive connections 11 .2.3 Progressive downloads 11 .2.4 Tweaking settings 11 .3 Multicast UDP 11 .3 .1 Multicast basics 11 .3.2 Multicast routing 11 .3.3 Implementing multicast 11 .4 Data compression 11 .5 Lossless compression 11 .5 .1 Implementing ZIP compression 11 .6 Lossy... suite 12 .5 .1 ARP 12 .5.2 RIP 12 .5.3 OSPF 12 .5.4 BGP/EGP 12 .5.5 SNMP 12 .5.6 PPP 12 .6 WMI 12 .6 .1 Reading WMI data 12 .6.2 Leveraging WMI 12 .7 Conclusion 13 Analyzing Network Packets 13 .1 Introduction 13 .2 IP-level network tapping 13 .2 .1 Interpreting raw network data 13 .2.2 IP packets in detail 13 .2.3 ICMP packets in detail 13 .2.4 TCP/IP packets in detail 13 .2.5 UDP packets in detail 13 .2.6 DNS packets in. .. packets in detail 13 .3 Layer 2 network tapping 13 .3 .1 Using rvPacket and WinPCap 13 .3.2 Using PacketX and WinPCap 13 .4 Physical network tapping 13 .5 Conclusion 14 Adding Digital Telephony 14 .1 14.2 14 .3 14 .4 14 .5 Introduction Basic telephony Listening for incoming phone calls DTMF tones Audio playback 14 .5 .1 Audio playback over TAPI 14 .6 Conclusion 15 Message Queues 15 .1 Introduction 15 .2 MSMQ 327 327... compression 11 .6 .1 Audio compression 11 .6.2 Image compression 11 .6.3 Video compression 11 .7 Conclusion 12 Ping, DNS, and WHOIS: Monitoring your Network 12 .1 Introduction 12 .2 DNS 12 .2 .1 Implementing DNS MX 12 .3 Ping 12 .4 WHOIS 12 .4 .1 Telnet 2 51 2 51 2 51 253 254 255 256 258 2 61 262 272 275 275 275 276 277 278 278 282 282 283 284 289 290 2 91 296 296 298 302 303 305 305 305 306 314 3 21 326 Contents xii Contents 12 .5... 3 51 352 354 354 360 366 376 379 379 380 382 399 4 01 413 417 419 419 420 Contents xiii 15 .3 Implementing a message queue 15 .3 .1 Queuing complex objects 15 .3.2 Transactions 15 .3.3 Acknowledgments 15 .4 Timeouts 15 .5 Journal 15 .6 Queued Components 15 .7 Security 15 .8 Scalability 15 .9 Performance issues 15 .10 Conclusion 16 IPv6: Programming for the Next-generation Internet 16 .1 16.2 16 .3 16 .4 16 .5 16 .6 Introduction... IPv6 naming conventions Installing IPv6 16 .6 .1 Auto configuration 16 .7 Using IPv6 utilities 16 .7 .1 IPv6 16 .7.2 NETSH 16 .7.3 Ping6 16 .7.4 Tracert6 16 .7.5 IPSec6 16 .7.6 Windows 2000 specific 16 .8 IPv6 routing 16 .8 .1 Route determination process 16 .8.2 Administering the IPv6 routing table 16 .8.3 IPv6 routing advertisements 16 .9 IPv6 coexistence 16 .9 .1 The 6to4 protocol 16 .9.2 The ISATAP protocol 16 .9.3 The... protocol 16 .10 IPv6 in NET 16 .11 Conclusion 17 Web Services and Remoting 17 .1 Introduction 17 .2 Creating a Web service 420 427 435 437 439 4 41 443 447 449 4 51 452 453 453 453 454 455 456 457 457 458 458 459 459 460 4 61 463 464 465 466 468 469 469 4 71 473 473 479 4 81 4 81 4 81 Contents xiv Contents 17 .2 .1 Deploying a Web service 17 .3 Using a Web service 17 .4 Asynchronous calls to Web services 17 .4 .1 Wait handles... 212 212 213 218 218 224 225 227 227 227 228 230 232 234 234 236 236 238 239 240 2 41 244 246 247 247 248 248 249 Contents xi 10 Programming for Scalability 10 .1 10.2 10 .3 10 .4 10 .5 10 .6 Introduction Case study: The Google search engine Replication and redundancy Scalable network applications Future proofing Thread pooling 10 .6 .1 Implementing a thread pool 10 .7 Avoiding deadlocks 10 .8 Load balancing 10 .9... Configuration 17 .9.6 Hosting remote objects within IIS 17 .9.7 Hosting remote objects within a Windows service 17 .9.8 Distributed garbage collection 17 .10 Conclusion Index 485 486 489 490 4 91 493 494 495 497 498 500 500 500 5 01 502 506 508 509 510 511 515 518 519 Preface This book will help you develop network applications with NET, using either the C# or VB.NET programming language It covers everything you... being so supportive of me for the past twenty-three years xix This page intentionally left blank 1 Understanding the Internet and Network Programming 1. 1 Introduction This book will help you develop network applications with NET, using either the C# (pronounced C-sharp) or VB.NET programming language It is broken up into three distinct sections: networking basics, distributed application design, and . stack 6 1. 6 Ports 7 1. 7 Internet standards 7 1. 8 What is .NET? 9 1. 9 Getting started 11 1. 10 Using Visual Studio .NET 12 1. 11 Using the .NET SDK 16 1. 11. 1 Compiling with Visual Basic .NET 19 1. 11. 2. Acknowledgments xix 1 Understanding the Internet and Network Programming 1 1. 1 Introduction 1 1.2 Why network programming in .NET? 2 1. 3 What can a network program do? 2 1. 4 IP addresses 3 1. 5 The network. 4 71 16.9.3 The 6over4 protocol 473 16 .10 IPv6 in .NET 473 16 .11 Conclusion 479 17 Web Services and Remoting 4 81 17 .1 Introduction 4 81 17.2 Creating a Web service 4 81 xiv Contents 17 .2.1