O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Network programming in .NET

Book Description

The purpose of this book is to provide tools to design and implement network-orientated applications in .NET. It is also a guide for software designers to choose the best and most efficient way to implement mission critical solutions. The book addresses real-world issues facing professional developers, such as using third-party components as opposed in-house development. It differentiates itself from existing .NET publications because it is aimed at experienced professionals and concentrates on practical, ready-to-use information. The book is written in two languages C# and VB.NET, and covers never-before published information on Telephony in .NET and packet-level networking.

This is the second book in the Digital Press Software Development Series.

· Coverage of lower level protocols allows implementation of performance-centric applications
· Demonstrates the feasibility of developing telephony solutions in-house rather than outsourcing
· Written in VB.NET and C# to assist readers working in either language
· Coverage of Email, FTP and the WWW allows implementation of applications in all three areas

Table of Contents

  1. Copyright
    1. Dedication
  2. Related Titles from Digital Press
  3. Preface
    1. Who should read this book?
    2. What hardware and software do you need?
    3. How this book is organized
      1. Part I: Basic network applications
      2. Part II: Network application design
      3. Part III: Specialized networking topics
    4. Conventions used in this book
      1. Typographical conventions
      2. Code
    5. Further information
  4. Acknowledgments
  5. 1. Understanding the Internet and Network Programming
    1. 1.1. Introduction
    2. 1.2. Why network programming in .NET?
    3. 1.3. What can a network program do?
    4. 1.4. IP addresses
    5. 1.5. The network stack
    6. 1.6. Ports
    7. 1.7. Internet standards
    8. 1.8. What is .NET?
    9. 1.9. Getting started
    10. 1.10. Using Visual Studio .NET
    11. 1.11. Using the .NET SDK
      1. 1.11.1. Compiling with Visual Basic.NET
      2. 1.11.2. Compiling with C#
      3. 1.11.3. Testing the application
    12. 1.12. Conclusion
  6. 2. I/O in the .NET Framework
    1. 2.1. Introduction
    2. 2.2. Streams
      1. 2.2.1. Streams for files
      2. 2.2.2. Encoding data
      3. 2.2.3. Binary and text streams
      4. 2.2.4. Serialization
        1. Serializing to binary
        2. Shallow serialization
      5. 2.2.5. Writing a database to a stream
        1. Database programming overview
        2. Creating a database
        3. Dataset serialization
    3. 2.3. Conclusion
  7. 3. Working with Sockets
    1. 3.1. Introduction
    2. 3.2. What is a socket?
    3. 3.3. Creating a simple “hello world” application
      1. 3.3.1. Writing a simple UDP client
      2. 3.3.2. Writing a simple UDP server
    4. 3.4. Using TCP/IP to transfer files
      1. 3.4.1. Writing a simple TCP/IP client
      2. 3.4.2. Writing a simple TCP/IP server
    5. 3.5. Debugging network code
    6. 3.6. Socket-level networking in .NET
    7. 3.7. Conclusion
  8. 4. HTTP: Communicating with Web Servers
    1. 4.1. Introduction
      1. 4.1.1. Data mining
    2. 4.2. HTTP
      1. 4.2.1. The HTTP request
      2. 4.2.2. The HTTP response
      3. 4.2.3. MIME types
      4. 4.2.4. System.Web
      5. 4.2.5. Posting data
      6. 4.2.6. A note on cookies
      7. 4.2.7. A WYSIWYG editor
    3. 4.3. Web servers
      1. 4.3.1. Implementing a Web server
    4. 4.4. System.Net.HttpWebListener
    5. 4.5. Mobile Web browsers
      1. 4.5.1. Mobile Web SDK
    6. 4.6. Conclusion
  9. 5. SMTP and POP3: Communicating with email Servers
    1. 5.1. Introduction
    2. 5.2. Sending an email
    3. 5.3. SMTP
      1. 5.3.1. Implementing SMTP
        1. Example: Complaints department SMTP server
    4. 5.4. Post office protocol 3
      1. 5.4.1. Implementing POP3
        1. Example: POP3 client SPAM filter
    5. 5.5. System.Web.Mail
      1. 5.5.1. Attachments
      2. 5.5.2. Images
    6. 5.6. Mail application programming interface
      1. 5.6.1. Accessing the address book
      2. 5.6.2. IMAP
      3. 5.6.3. Network news transfer protocol
    7. 5.7. Conclusion
  10. 6. FTP: Communicating with File Servers
    1. 6.1. Background
    2. 6.2. Microsoft file sharing
    3. 6.3. Netware file sharing
    4. 6.4. An overview of FTP
      1. 6.4.1. How FTP uses ports
      2. 6.4.2. The FTP handshake
      3. 6.4.3. Navigating folders
      4. 6.4.4. FTP command reference
      5. 6.4.5. Implementing FTP
      6. 6.4.6. Implementing FTP with the Internet Transfer Control
      7. 6.4.7. A more substantial implementation of FTP
      8. 6.4.8. FTP support in .NET 2.0
    5. 6.5. Conclusion
  11. 7. Securing a Network: Firewalls, Proxy Servers, and Routers
    1. 7.1. Introduction
      1. 7.1.1. Building a network from scratch
        1. Choosing a topology
        2. Setting up a network
        3. How to set up a virtual private network
    2. 7.2. Building an enterprise network
      1. 7.2.1. Routers
      2. 7.2.2. Firewalls
        1. Proxies
        2. Network address translators
    3. 7.3. Tunneling out of an enterprise network
      1. Proxy tunneling
      2. Firewall tunneling
    4. 7.4. Avoiding the networking pitfalls
      1. Port conflict
      2. Dynamic IP addresses
      3. 7.4.1. Firewall tunneling
        1. Peer-to-peer architecture
    5. 7.5. Conclusion
  12. 8. Protecting Data: Encryption
    1. 8.1. Introduction
    2. 8.2. Cryptanalysis
    3. 8.3. Terminology
    4. 8.4. Asymmetric encryption
    5. 8.5. Using RSA as asymmetric encryption
    6. 8.6. Symmetric encryption
      1. 8.6.1. Using 3DES as symmetric encryption
    7. 8.7. Piracy protection
    8. 8.8. Conclusion
  13. 9. Controlling User Access: Authentication and Authorization
    1. 9.1. Introduction
    2. 9.2. Authentication techniques
      1. 9.2.1. IIS authentication
    3. 9.3. Microsoft .NET Passport authentication
    4. 9.4. Hashing information
      1. 9.4.1. Hashing algorithms
      2. 9.4.2. Using SHA
    5. 9.5. SSL
    6. 9.6. Certificates
    7. 9.7. Server certificates
    8. 9.8. Client certificates
      1. 9.8.1. Microsoft Certificate Services
      2. 9.8.2. Reading certificates
    9. 9.9. Permissions in .NET
    10. 9.10. Financial network security
      1. 9.10.1. X.25
      2. 9.10.2. ISO 8730
      3. 9.10.3. SWIFT
      4. 9.10.4. Corporate transactions
    11. 9.11. Conclusion
  14. 10. Programming for Scalability
    1. 10.1. Introduction
    2. 10.2. Case study: The Google search engine
    3. 10.3. Replication and redundancy
    4. 10.4. Scalable network applications
    5. 10.5. Future proofing
    6. 10.6. Thread pooling
      1. 10.6.1. Implementing a thread pool
    7. 10.7. Avoiding deadlocks
    8. 10.8. Load balancing
    9. 10.9. Conclusion
  15. 11. Optimizing Bandwidth Utilization
    1. 11.1. Introduction
    2. 11.2. Tricks and tips to increase performance
      1. 11.2.1. Caching
      2. 11.2.2. Keep-alive connections
      3. 11.2.3. Progressive downloads
      4. 11.2.4. Tweaking settings
    3. 11.3. Multicast UDP
      1. 11.3.1. Multicast basics
      2. 11.3.2. Multicast routing
      3. 11.3.3. Implementing multicast
    4. 11.4. Data compression
    5. 11.5. Lossless compression
      1. 11.5.1. Implementing ZIP compression
    6. 11.6. Lossy compression
      1. 11.6.1. Audio compression
      2. 11.6.2. Image compression
      3. 11.6.3. Video compression
    7. 11.7. Conclusion
  16. 12. Ping, DNS, and WHOIS: Monitoring your Network
    1. 12.1. Introduction
    2. 12.2. DNS
      1. 12.2.1. Implementing DNS MX
    3. 12.3. Ping
    4. 12.4. WHOIS
      1. 12.4.1. Telnet
    5. 12.5. Other members of the TCP/IP suite
      1. 12.5.1. ARP
      2. 12.5.2. RIP
      3. 12.5.3. OSPF
      4. 12.5.4. BGP/EGP
      5. 12.5.5. SNMP
      6. 12.5.6. PPP
    6. 12.6. WMI
      1. 12.6.1. Reading WMI data
      2. 12.6.2. Leveraging WMI
    7. 12.7. Conclusion
  17. 13. Analyzing Network Packets
    1. 13.1. Introduction
    2. 13.2. IP-level network tapping
      1. 13.2.1. Interpreting raw network data
      2. 13.2.2. IP packets in detail
      3. 13.2.3. ICMP packets in detail
      4. 13.2.4. TCP/IP packets in detail
      5. 13.2.5. UDP packets in detail
      6. 13.2.6. DNS packets in detail
    3. 13.3. Layer 2 network tapping
      1. 13.3.1. Using rvPacket and WinPCap
      2. 13.3.2. Using PacketX and WinPCap
    4. 13.4. Physical network tapping
    5. 13.5. Conclusion
  18. 14. Adding Digital Telephony
    1. 14.1. Introduction
    2. 14.2. Basic telephony
    3. 14.3. Listening for incoming phone calls
    4. 14.4. DTMF tones
    5. 14.5. Audio playback
      1. 14.5.1. Audio playback over TAPI
    6. 14.6. Conclusion
  19. 15. Message Queues
    1. 15.1. Introduction
    2. 15.2. MSMQ
    3. 15.3. Implementing a message queue
      1. 15.3.1. Queuing complex objects
      2. 15.3.2. Transactions
      3. 15.3.3. Acknowledgments
    4. 15.4. Timeouts
    5. 15.5. Journal
    6. 15.6. Queued Components
    7. 15.7. Security
    8. 15.8. Scalability
    9. 15.9. Performance issues
    10. 15.10. Conclusion
  20. 16. IPv6: Programming for the Next-generation Internet
    1. 16.1. Introduction
    2. 16.2. What is IPv6?
    3. 16.3. The history of IPv6
    4. 16.4. So what changes?
    5. 16.5. IPv6 naming conventions
    6. 16.6. Installing IPv6
      1. 16.6.1. Auto configuration
    7. 16.7. Using IPv6 utilities
      1. 16.7.1. IPv6
      2. 16.7.2. NETSH
      3. 16.7.3. Ping6
      4. 16.7.4. Tracert6
      5. 16.7.5. IPSec6
      6. 16.7.6. Windows 2000 specific
    8. 16.8. IPv6 routing
      1. 16.8.1. Route determination process
      2. 16.8.2. Administering the IPv6 routing table
      3. 16.8.3. IPv6 routing advertisements
    9. 16.9. IPv6 coexistence
      1. 16.9.1. The 6to4 protocol
      2. 16.9.2. The ISATAP protocol
      3. 16.9.3. The 6over4 protocol
    10. 16.10. IPv6 in .NET
    11. 16.11. Conclusion
  21. 17. Web Services and Remoting
    1. 17.1. Introduction
    2. 17.2. Creating a Web service
      1. 17.2.1. Deploying a Web service
    3. 17.3. Using a Web service
    4. 17.4. Asynchronous calls to Web services
      1. 17.4.1. Wait handles
      2. 17.4.2. Callbacks
    5. 17.5. Interoperability
    6. 17.6. Performance
    7. 17.7. Security
    8. 17.8. Web services enhancements
      1. 17.8.1. Web service extensions: Attachments
      2. 17.8.2. Web service extensions: Routing
      3. 17.8.3. A word on Project Hailstorm (MyServices)
    9. 17.9. .NET remoting
      1. 17.9.1. How remoting works
      2. 17.9.2. Implementing remoting
      3. 17.9.3. Asynchronous use of remote objects
      4. 17.9.4. Deployment of a remoting service
      5. 17.9.5. Configuration
      6. 17.9.6. Hosting remote objects within IIS
      7. 17.9.7. Hosting remote objects within a Windows service
      8. 17.9.8. Distributed garbage collection
    10. 17.10. Conclusion