StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Socket Programming - BSD UNIX by Bill Joy - Case Study Example

Cite this document
Summary
The paper "Socket Programming - BSD UNIX by Bill Joy" highlights that sockets are identified in a unique manner by port number, end-to-end protocol and internet address. Upon socket creation, it is therefore imperative to use a valid port number and IP address that match it…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER92.9% of users find it useful
Socket Programming - BSD UNIX by Bill Joy
Read Text Preview

Extract of sample "Socket Programming - BSD UNIX by Bill Joy"

Socket Programming of Learning Introduction In computer networking, a socket represents a technology that allows communication between application via a standard mechanism present in operating system and network hardware. Socket programming thus involves the creation of manner in which socket application program interface (APIs) can be used in the establishment of communication links involving the local and remote processes. Nowadays, many of current software packages depend on socket technology (Nagel & Serban, 2004). Basically, a socket presents a point of connection that involves software installed in two different computers. However, sockets can also be used to facilitate communication on one computer being either as synchronous (blocking) or an asynchronous (non-blocking) socket (Luo etal., 2009). The difference between the two is that the blocking socket ensures socket operation to be completed before the program resumes the next execution. On the other hand, non-blocking socket usually allow the application to be responsive to other events Background The development of socket programming has achieved notable success over the years. It all started with the development of a free version of UNIX operating system in the year 1978, the BSD UNIX by Bill Joy. The second free version of BSD was released some months later which become the internet backbone due to its open source concept. On this front, it was notable in facilitating the development of TCP/IP with UNIX as the research platform (Parziale etal., 2009). This breakthrough into spearheading internet research using UNIX operating system made Bill Joy to be regarded as the “Edison of the Internet”. The socket interface development was initially conducted on BSD UNIX after which it was later incorporated into other operating system to simplify porting applications (Mansfield & Antonakos, 2010). Types of interface They are mainly divided into three categories; Stream socket (SOCK_STREAM) – mainly involved in connection-oriented data transmission where the data is usually considered as a stream of bytes. Uses the bind (), listen (), accept (), and connect function to establish connectivity and develops flow control to ensure there is no data overruns. To effect communication successfully, a stream socket requires that the two parties involved in the communication process to establish the connection first before initiating the dialog process. The client program requests for connection after which the server program determines the suitable socket connection. The data being transmitted is bound to arrive following its sending order without any duplication or errors. Stream socket relies on transmission control protocol during the two-way data transmission (Nagel & Serban, 2004). Datagram sockets (SOCK_DGRAM) - implements a connection-less communication link with information being transferred in form of datagram (a header then data). Only connect () function can be applied but the destination has to be specified. This implies that the client program does not set up a socket connection before initiating a data transfer. The data is transmitted and awaits approval from the party receiving. The major drawback of this interface is that the data sent can be received in an order less manner or even lost/duplicated during transmission. However, their preference compared to stream socket is tied to the fact that they give the applications involved a boost in performance and flexibility. It operates manly in conjunction with User Datagram Protocol (UDP) as the transport provider (Nagel & Serban, 2004). Raw socket (SOCK_RAW) – it mainly bypass the support built in library which demand that standard protocols like UDP and TCP be followed during data transmission. In this regard, it offers a direct access to protocol in the lower layer which includes IPv4/IPv6 and Internet Control Message Protocol. This type of socket requires a higher programming expertise compared to the above two sockets (Nagel & Serban, 2004). They are mainly used in the development of custom low-level protocol. Stream versus datagram socket stream socket datagram socket Connection-oriented Connectionless Reliable in data delivery Unreliable Has safety guarantee, suitable for file application No safety guarantee, suitable for media applications Has flow and packets sequence control No sequence or flow control Allow data transmission in both direction i.e. full-duplex Allow only a one way data transfer i.e. half-duplex Uses TCP Uses UDP Prerequisites for socket programming These steps are important before developing socket applications Compiler requirements QSYSINC library installation – provides header files that are deemed necessary C compiler installation i.e. (5722-CX2) licensed program Requirements for AF_INET6 and AF_INET address families This is done to compliment compiler requirements Plan TCP/IP Install TCP/IP TCP/IP configuration In case the applications under development will use the address family AF_INET6, configure TCP/IP required for IPv6 Requirements for Global Secure Toolkit and Secure Socket Layer APIs This is done to complement the above two requirements Install and configure a licensed Digital Certificate Manager program preferably 5722-SS1 Install a licensed Cryptographic Access Provider program preferably 5722-AC3 Install and configure the 2058 Cryptographic Accelerator for the iSeries How socket work They are mainly used in facilitating client/server interaction. It is a form of system configuration that consists of a client machine on one end and a server machine on the other end. The main aim for initiating connection with the server is for information exchange after which it disconnects (Parziale etal., 2006). The socket () function – signifies the communication endpoint and generates a suitable socket descriptor The listen () function – shows willingness to accept the request from client connection The bind () function - binds a name to the socket Connect () function – used by client application to initiate connection with the server (found on stream socket) The accept () function – indicates the acceptance of connection request Flow of events in a session involving connection oriented socket Send/receive () functions – represent the options available to client and server during data transfer Close () function – initiated when the client or server wants to stop the data exchange (Calvert & Donahoo, 2002). Flow of events in a session involving connection-oriented socket Server client Block until connection from client Connection establishment Data request Data reply Flow of events in a session involving connection-less socket Block until data received Data (request) Data (reply) Socket characteristics They are represented by a socket descriptor in form of an integer Their existence is dependent on the maintenance of an open link with the socket by the process initiated (Calvert & Donahoo, 2002). A socket can be named and used to initiate communication to other sockets in the domain They can be created in pairs i.e. those in the address family AF_UNIX Determination of socket characteristics The following parameters are used by an application in the identification of a socket (Mansfield & Antonakos, 2010) Address family - gives the socket address structure Socket type – refers to form of communication desired by the socket Socket protocol – refer to the preferred protocol for a given socket Address family Socket type Socket protocol AF_UNIX SOCK_STREAM N/A SOCK_DGRAM N/A AF_INET SOCK_ STREAM TCP SOCK_DGRAM UDP SOCK_ RAW IP,ICMP AF_INET6 SOCK_ STREAM TCP SOCK_DGRAM UDP SOCK_RAW IP6,ICMP6 AF_TELEPHONY SOCK_ STREAM N/A AF_UNIX_CCSID SOCK_ STREAM N/A SOCK_DGRAM N/A Table A. a summary of socket characteristics Socket address family AF_INET address family This address family handles inter process communications that occur between processes running on same or different systems. Port number and IP addresses are the main addresses used in AF_INET sockets. The following are some of fields used in this address family (Mansfield & Antonakos, 2010); Sin_len – the field contain address length. sin_family - has the address family. When UDP or TCP is used, the address family used is AF_INET. sin_port – the number of the port is located in this field. sin_addr – the address for the internet is contained in this field. sin_zero – a reserved field. AF_INET6 address family The address family makes use of 16 byte (128 bit) address. In its architecture, the host number uses 64 bits while the network number uses the remaining 64 bits. It mainly gives support to Internet Protocol version 6 (IPv6). This address family makes use of sockaddr_in6 address structure for socket application that makes use of RAW, UDP or TCP. The following are some of fields used in this address family (Nagel & Serban, 2004); Sin6_len – contain the address length. Sin6_family - the address family for AF_INET6 is specified in this field. Sin6_port – the port transport layer is located in this field. Sin6_flowinfo - the information present in this field includes the flow label and traffic class. Sin6_addr - the IPv6 is specified in this field. Sin6_scope_id – an interface set that is appropriate for the specified scope on the sin6_addr is indicated in this field. AF_UNIX address family Inter process communication are provided in this family for those systems that make use of socket APIs. The address represents a path name for gaining entry into the file system. All sockets that have this address family make use of the address structure sockaddr_un. The following are some of fields used in this address family (Mansfield & Antonakos, 2010); Sun_len – the length of the address is contained in this field. Sun_family – address family is located in this field. Sun_path – the path name linked to an entry in the system file is located in this field. AF_UNIX_CCSID address family This family possesses the same characteristics as the AF_UNIX including the limitations this family can be connection-oriented or connection-less. The main difference between the two is that AF_UNIX_CCSID has the address structure sockaddr_unc. The following are some of fields used in this address family (Mansfield & Antonakos, 2010); Sunc_format – AF_UNIX_CCSID is located in this field since it functions as the default address family. Sunc_format – contains two formats, the SO_UNC_DEFAULT and SO_UNC_USE_QLG that describes the path name. Sunc_zero – a reserved field. Sunc_qlg – the format for path name is specified in this field. Sunc_path – the path name is found in this find and can be represented by a maximum of 126 characters. AF_TELEPHONY address family This family supports telephone calls by users making use of the APIs standard socket on the ISDN telephone network. Mainly used in the development of fax support represented by 40 digits. Uses the socket type SOCK_STREAM and the sockaddr_tel address structure. The following are some of fields used in this address family; Stel_family – the field has the address family. Stel_addr – the field contains telephony address. Stel_zero – a reserved field. Conclusion Sockets are mainly bidirectional in that either side can send or receive data. They are usually independent of the programming languages that implement them in that a socket program in Java language can interact with a program written in C++ or C language. Stream, Datagram and Raw socket provide viable interface in the development of socket programming (Parziale etal., 2006). It is worth noting that sockets are indentified in a unique manner by port number, end-to-end protocol and internet address. Upon socket creation, it is therefore imperative to use a valid port number and IP address that match it. The port number determines the application that a certain data packet will be delivered after passing through the appropriate protocol (Mansfield & Antonakos, 2010). Therefore, following proper guidelines in the use of socket not only provide the user with efficient connection, but also guarantee reliability in data transfer. References Calvert, K. L., & Donahoo, M. J. (2002). TCP/IP sockets in Java: Practical guide for programmers. San Francisco: Morgan Kaufmann Publishers. Luo, Q., & International Conference on Future Computer and Communication. (2009).Applied computing, computer science, and advanced communication: Proceedings. Berlin ; Heidelberg ; New York, NY: Springer. Mansfield, K. C., & Antonakos, J. L. (2010). Computer networking from LANs to WANs: Hardware, software and security. Boston, MA: Course Technology, Cengage Learning. Nagel, C., & Serban, A. (2004). Pro .NET 1.1 network programming. Berkeley, Calif: Apress. Parziale, L., & International Business Machines Corporation. (2006). TCP/IP tutorial and technical overview. United States?: IBM International Technical Support Organization. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Socket programming Research Paper Example | Topics and Well Written Essays - 1500 words”, n.d.)
Retrieved from https://studentshare.org/information-technology/1640193-socket-programming
(Socket Programming Research Paper Example | Topics and Well Written Essays - 1500 Words)
https://studentshare.org/information-technology/1640193-socket-programming.
“Socket Programming Research Paper Example | Topics and Well Written Essays - 1500 Words”, n.d. https://studentshare.org/information-technology/1640193-socket-programming.
  • Cited: 1 times

CHECK THESE SAMPLES OF Socket Programming - BSD UNIX by Bill Joy

Programming Models and Contribution Per Unit

Formulation of linear programming model The linear programming model can be developed by forming equations for constraints and objective functions.... Task 1 1.... Contribution per unit Contribution per unit is calculated in order to form an objective function.... The variable cost per hour for each test device is multiplied by the number of hours required for testing each peripheral device on a particular test device....
5 Pages (1250 words) Essay

Programming with Objects

Answer In all programming languages, it is a practice to declare variables along with their types.... hellip; By doing so a compiler binds the reserved space with the type of variable and applies some set of rules to it. Answer An operator is simply a method implemented in a programming language to modify, replace, or combine values represented by variables.... Without operators, a programming language would not be very useful because the programmer would not be able to store or manipulate the data....
4 Pages (1000 words) Essay

Logo Programming Language

draws the square spiral. Answer) The Logo programming language is a functional programming language.... hellip; Dividing a big module into smaller modules of same type is the key feature of dynamic computer programming.... In Logo programming language, REPEAT command is used to run a set of statements a number of times.... The secret of recursive programming is the same as a secret of problem solving in general that is to reduce a big problem to a smaller problem....
12 Pages (3000 words) Essay

Unix Vs. Windows

In fact, an open source version of unix, known as Linux, had evolves as a popular choice among ardent programming enthusiasts.... Apart from allowing unix vs.... WINDOWS unix and windows are the primary operating systems in the world today.... In fact, an open source version of unix, known as Linux, had evolves as a popular choice among ardent programming enthusiasts.... However, unix (as also its various versions) continues to be the preferred choice of programmers and software developers in the case of network programming....
2 Pages (500 words) Essay

Exhibition/Programming Catalogue

Since they are made in Australia, the exhibition seeks to attract an relatively large crowd of Australians.... Many people have a liking for goods that are given ample… Therefore, this would be a better drill to the market as many people will be attracted to the films.... In addition to this, the market will appreciate information in regard to the themes, plot and setting of the film....
9 Pages (2250 words) Essay

Editing And Sound In Kill Bill

This essay, therefore, provides a comparative analysis of the use of editing and sound techniques for the film Quentin Tarantino's KILL bill.... One of the most amazing features of Kill bill is the varying styles in each chapter that makes the film to be full of diversified editing techniques.... The Movie, Quentin Tarantino's Kill bill is a good example that uses these techniques in the transportation of feelings.... In the film kill bill, even if you cannot see the horrific image, you can still hear the cracking of the bones, the blood spray, and the victim let out dying breath or one last shriek....
4 Pages (1000 words) Essay

Communications Mechanisms and Methodologies within the Unix

If it is unix, then the answer would be “Yes.... rdquo; unix has contributed in the Information technology sector for the last 25 years.... nbsp;… Millions of installations conducted on various platforms and unix has proved to be organized and scalable.... unix invented in 1969, by the computer scientists Dennis Ritchie and Kenneth Thompson employed at AT&T Bell Labs.... unix has contributed immensely in recent years....
6 Pages (1500 words) Research Paper

The Effectiveness of Open Source Products and Development Procedures

Asynchronous I/O functionality is not effective in unix since signals are very rare and expensive to catch.... If all sockets are set to be non-blocking, the process can execute a loop that analyzes each socket to see if there is something to be read.... If the data is not available it goes on a sleep mode until the next time the socket is scheduled to be checked.... The parent process can use fork () to create a child process for socket handling....
11 Pages (2750 words) Research Paper
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us