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

Changes between Version 15 and Version 16 of ChapterNetworking

Show
Ignore:
Author:
JJR (IP: 207.194.36.61)
Timestamp:
12/01/07 21:04:20 (13 years ago)
Comment:

Fix and updates; more on socket

Legend:

Unmodified
Added
Removed
Modified
  • ChapterNetworking

    v15 v16  
    1313In the early days of UNIX (circa 1977), it was Berkley Software Distribution's UNIX that made some critical contributions to the field of network API's.  BSD UNIX (as the academic-born UNIX operating system came to be called) was a direct competitor with AT&T Bell Lab's UNIX distribution.  Bell Lab's UNIX was the original design for what became the most popular OS model of the last half a century. Both UNIX designs eventually contributed important network protocols and interfaces that are in common use today.  The Internet is the most obvious example of the UNIX influence.  
    1414 
    15 Already a luminary in business and academics, BSD UNIX exploded in popularity when Sun released its own derivative called SunOS.  Unfortunately, this only widened the divergence of the two UNIX styles -- BSD and Bell Lab's -- which were distinctly incompatible for a number of years. However, later versions of these two operating systems shared more in common.  Bell Lab's final major release, called System V, merged features and tools from the ever popular BSD UNIX. The shared features made the two operating systems more independently useful but did little to improve cross-compatibility. (citation) 
     15Already a luminary in business and academics, BSD UNIX exploded in popularity when Sun released its own derivative called SunOS.  Unfortunately, this only widened the divergence of the two UNIX styles -- BSD and Bell Lab's -- which were distinctly incompatible for a number of years. However, later versions of these two operating systems shared more in common, significantly blurring the line between the two systems:  specifically, Bell Lab's final major release, called System V, merged features and tools from the ever popular BSD UNIX.  Nevertheless, the shared features made the two operating systems more independently useful but did little to improve cross-compatibility. (citation) 
    1616 
    17 While in the process of enriching the distribution, BSD managed to invent several innovative programming interfaces.  In the network programming sector, one of the most important of these became known as "BSD Sockets."  In short order, BSD Sockets was practically a standard across many UNIX-derivative distributions. Ironically, the purpose of the socket API was to create a "simple" programming interface for interprocess communication, specifically oriented to network operation.  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.  Despite incompatible implementations sprouting across old and new operating systems, still the sockets API has managed to gain an increasingly universal audience.  
     17While in the process of enriching the distribution, BSD managed to invent several innovative programming interfaces.  In the network programming sector, one of the most important of these became known as "BSD Sockets."  In short order, BSD Sockets was practically a standard across many UNIX-derivative distributions. The socket concept was the high level rendition of network communication.  Years later, sockets have become a defacto standard in practically every modern operating system. 
    1818 
    1919== All about Networking == 
    3535Each 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 in the next section. 
    3636 
    37 == Tango Socket == 
     37== tango.net.Socket == 
    3838 
    39 The socket is our fundamental network component and the basis for many higher level Tango network objects. In Tango this class represents a BSD Socket equivalent. The major difference is that Tango sockets are cross-platform: whether we use them on Apple OS X, MS Windows, or Linux, the interface remains the same.  Learning the details of Socket class, therefore, is the first step to learning to program a network application or library
     39In Tango this class represents a BSD Socket equivalent. In that sense, it is a low level network interface in Tango: despite simplifying the interface of the BSD Socket in general, using it still requires a descent knowledge of the BSD mechanism.  For a more thorough discussion of network sockets, see the references at the end of this chapter.  Later, this chapter will introduce high level network interfaces that eliminate much of the hassle of working with low-level sockets
    4040 
    41 Like the name implies, a socket is a medium for connecting one entity to another.  The entities involved are always processes (software running on an operating system) that may exist on local or distributed network nodes (computers).  Each process must create a socket in order to establish a communication portal.  From the application perspective, the location of the communicating nodes is unimportant so long as the nodes are members of an operational network.  This is because lower level mechanisms, not visible to the application, take care of details important to actual delivery of the information submitted to the sockets.  For these reasons, sockets are really just a generic mechanism for interprocess communication (often known as IPC).  (CLEANUP) 
     41Like the name implies, a socket is a medium for connecting one entity to another.  The entities involved are always processes (software running on an operating system) that may exist on local or distributed network nodes (computers).  Each process must create a socket in order to establish a communication portal.  From the application perspective, the location of the communicating nodes is unimportant so long as the nodes are members of an operational network.  Since the socket interface facilitates a form of distributed communication, the mechanism is often referred to as interprocess communication (IPC). 
    4242 
    4343A data collection that is sent or received in this model is called a packet.  A packet contains useful information that one processes delivers to another for further processing.  Examples of packets would be anything from email's sent out on the Internet to web pages being downloaded from a distant server. 
    4444Though packets may be almost any size, practicality in network communication design dictates that information transferred must be broken up into smaller parts before transmission.  While the application may see the received web page as a whole, lower level layers will usually partition large payloads into smaller.  These packets are sections of the whole transmitted in designated byte sizes.(CLEANUP) 
    45  
    46 == More on Networking == 
    47  
    48 An excellent guide to low-level socket programming is right [http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html here] 
    4945 
    5046== More than Sockets == 
    6460== Graphs == 
    6561 
    66 Uri represents Internet URLS: 
    67  
    68 [[Image(source:/trunk/doc/images/Uri.gif)]]  
    69  
    7062This is the internet equivalent of !FileConduit: 
    7163 
    7466== References ==  
    7567 
    76 http://www.coe.berkeley.edu/labnotes/history_unix.html 
     68A history: http://www.coe.berkeley.edu/labnotes/history_unix.html 
     69 
     70An excellent guide to low-level socket programming is right [http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html here] 
     71