Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changes between Version 6 and Version 7 of ChapterNetworking

Show
Ignore:
Author:
JJR (IP: 207.194.36.253)
Timestamp:
04/09/07 01:57:38 (17 years ago)
Comment:

More stuff about networking -- must remember bibliography

Legend:

Unmodified
Added
Removed
Modified
  • ChapterNetworking

    v6 v7  
    33= An Introduction to Networking with Tango = 
    44 
    5 Network software development has earned the reputation for not only being a tedious pursuit but also having an alarmingly steep learning curve.  There are some significant reasons for why this is the case: one relates to its itimacy with C language structures, and another concerns its historical connection with Unix design
     5Network software development has earned the reputation for not only being a tedious pursuit but also having an alarmingly steep learning curve.  There are some significant reasons for why this is the case: one relates to its construction using C language structures, and another concerns its origins from Unix design history
    66 
    77Over the last few decades,  approaches to network programming were introduced using new programming paradigms.  Probably the most prominent of these approaches were adapted to use advanced features in languages like Java and C++ (for example: C++'s ACE network framework).  A higher level framework and more consistent programming model were intended to produce a less error-prone development cycle and simpler application construction. 
    88 
    9 Tango seeks to do much the same for the D language by delivering basic network interface components which act as building blocks for more complicated client or server software projects.   The design is intended to follow a model consistent with the rest of the Tango library, so that experience gained while using Tango in general translates to a shallow learning curve for network programming in particular.  D's object oriented features are adopted to create a framework for logical and concrete network communication.  
     9Tango seeks to do much the same for the D language by delivering several basic network interface components on which we can build more complicated client or server applications.   The design is intended to follow a model consistent with the rest of the library, thus providing a shallower learning curve for the whole.  The design of the individual components are also intended to be similar enough to original networking library models to ease the transition for skilled network software developers.  D's object oriented features are once again applied to create a framework for logical and concrete network communication.  
    1010 
    11 The design of the individual components are also intended to be similar enough to original networking library models to ease the transition for skilled network software developers.  For the beginner, much of the oddeties of low level C API's are eliminated; this means that learning can concentrate on the design details of the network programming task and less on specific interface anomalies. To accomodate differing levels of knowledge, this chapter will introduce some prequisite network programming details.   
     11== A History == 
    1212 
    13 == History == 
    14  
    15 Berkley Software Distribution Unix made it's imprint in networking history during the last few decades of the twentieth century.  BSD Unix, as the Unix operating system came to be called, was initially only an academic pursuit, but within a short time became a direct competitor with Bell Lab's System V Unix distribution.  Bell Lab's Unix was the original design of what became the most popular OS model of the last forty years.   
    16  
     13Berkley Software Distribution Unix made it's imprint in networking history during the last few decades of the twentieth century.  BSD Unix, as the academic-originating Unix operating system came to be called, was a direct competitor with Bell Lab's Unix distribution.  Bell Lab's Unix was the original design of what became the most popular OS model of the last half a century.   
    1714Each distribution eventually contributed the majority of the application programming interfaces we use today. Of particular importance was the contribution of networking protocols like TCP/IP.  While there have been many influences and contributions from many parties, platforms, and operating systems, this "protocol stack", as the the Unix software layers came to be called, remains the most prevalent.  
    1815 
    19 BSD's style of Unix ended up being adopted by a number of software industry leaders.  The two Unix distributions, BSD and Bell Lab's System V, had parted ways early on and were largely incompatible.  BSD managed to develop new programming interfaces that became readily adopted in many highly popular server products, the best example perhaps coming from Sun Microsystems ( SunOS ).  (citation) 
     16BSD's style of Unix ended up being adopted by a number of software industry leaders.  The two Unix distributions, BSD and Bell Lab's System V, had parted ways early on and were largely incompatible.  BSD managed to develop new programming interfaces that became readily adopted in many highly popular server products, the best example perhaps coming from Sun Microsystems ( SunOS ). 
     17    
     18One of the most important API's to surface from BSD came to be called BSD Sockets.  In short order BSD Sockets became practically a standard across many non-BSD Unix distributions as well.   
    2019 
    21 One of the most important API's to surface from BSD came to be called BSD Sockets.  BSD Sockets eventually spread to many non-BSD Unix distributions.  The purpose of BSD Sockets was to create a programming interface that conceptualized network connections in software and facilitated use of connectionless and connection-oriented communication protocols. The Socket concept was a high level rendition of network communication.  Years later, the BSD sockets library has become synonymous with network software development.  Prevalent operating systems like MS Windows, Mac OS X, and Linux now provide a compatible BSD Socket layer (citation)
     20The purpose of BSD Sockets was to create a programming interface that conceptualized a plug-in connection principle for software that communicated across a network.  The Socket concept was the high level rendition of network communication.  Years later, sockets have become synonymous with network software development, promoted even further by their ready adoption by the ever pervading Linux movement
    2221 
    23 The BSD Sockets library made its mark in industry; but despite this fact, network programming was still regarded as a specialty.  It was a field only for gurus.  Techniques and libraries involved were often so confusing and cryptic to apply that this view continued to proliferate unchecked.  C was just not conducive to clear and concise coding, a fact that threatened to be an unshakable stigma for a field whose history encompasses a period of well over 30 years. 
     22== All about Networking == 
     23 
     24The Tango network interface begins with the Socket. The Socket component in Tango is a class that thinly veils a BSD Socket.   Since the Tango Socket is merely a BSD Socket with a object oriented interface,  it follows that both share a common technical description.  Learning about the original socket design is the first step to learning to program a network application or library. 
     25 
     26But just before we discuss the Socket component, let us review some basics about networking in general. The first involves the definition of a computer network. 
     27 
     28Simply, a network is a collection of computers that communicate with each other through a transmission medium.  The communication mechanism must be managed like any other resource to prevent complete pandemonium amongst the connected computers, much like a group of children must be made to talk in turn in order for their speech to be intelligible. 
     29   
     30Even so, communication is usually managed on several levels using hardware and software protocols.  Some protocols help prioritize transmissions; others route the communication to the correct computer; still others help guarantee that connections are established and maintained between specific points. 
     31 
     32These protocols are rules that state how network components agree to communicate. They are integrated into hardware or software and are present in multiple levels of any network model. 
     33 
     34Networks have come into such prominence that eventually a standard model was designed to describe how to connect combinations of devices for communication. (Complete Encyclopedia of Networking, p 727).  The Open Systems Interconnection (OSI Reference Model) is a seven-layer model meant to demonstrate the functional layers of a network and the features available in each layer.   
     35 
     36A layer represents a high or low level contributer to the whole network model.  For example, a software application with its protocols represents the highest level Application Layer of the OSI (FTP and Telnet are application layer protocols); TCP and UDP protocols represent a middle layer called the Transport Layer; and the transmission line (wired or wireless) represents the the lowest layer called the Physical Layer. (Ibid. p 734) See the figure for a full view of the seven layer model. 
     37 
     38The OSI model acts as a guideline only, an abstract breakdown of how network systems operate.  Most networks systems with their operating system will implement most of these layers, but they won't be so clearly defined. Some layers may be logically merged for convenience; practicality wins out over theory in these cases. 
     39 
     40What the OSI model should indicate is that communication happens in layers.  The model helps us understand how network systems work: when we make a connection with another computer, there are several processes that go on, each playing an important part in carrying the payload (the packet) to the destination.  Each level generates overhead in carrying the payload; this overhead is generated in exchange for reliability or functional necessity to meet the final purpose.  Also realize that each layer at the destination sees its equivalent layer at the source.  This means that packets are passed down the layers at the source and back up the layers at the destination; the destination levels strip off the pertinent information designated for their specific layer until the packet is presented in its naked form to the Application Layer.  This process will be useful to understand when we discuss the Tango Socket later in this chapter. 
     41 
     42There are many physical layouts, hardware arrangements, and network types that are important for the network implementer to understand. But the application programmer's need not deal with these things in most cases.  So we will avoid going into any more abstract level details and move directly into what a description of the socket and how it fits into the network model from the programmer's perspective.  
    2443 
    2544== Sockets in Detail ==