You are on page 1of 3

Data Communication and Socket Programming

Data Communication and Networking


Ammar Yousuf
Department.of Computer.& Software Engineering
Bahria.University Karachi Campus
Karachi, Pakistan
Ammaryousuf10@gmail.com@gmail.com

Abstract Data communication and networking has


changed the lives of many. It has led millions of users to
carry out their work with effectiveness and efficiency with
less network traffic and minimal resources and higher speed.
Data Communication, Socket Programming. Socket, TCP/IP
(key words)

I. INTRODUCTION
Data Communication is the transfer of data and information
from one node (device) to another device through network
system, and network system is the combination of software and
hardware that allow user to send data. The hardware of
network system consists of physical equipment that can be
used to send data in form of signal from one point of the
internet to another point, whereas software of network system
is the set of instruction that are used for the working of
hardware possible as we expected.
Network system has two models Open System
Interconnection commonly known as OSI model and other one
is Transmission Control Protocol / Internet Protocol Suite
commonly known as TCP/IP suite. OSI model consist of
seven-layer model which provide standard to network
communication while TCP/IP suite has four layers originally
but when we compare it with OSI model it has five layers
which are discuss later. In TCP/IP we have four types of
address are used physical address, logical address, port address
and specific address. Sockets are used in logical and port
addressing. Sockets can be termed as one endpoint in the flow
of communication between two programs which are running on
network
Sockets are basic technology which provide a platform for
programming software to exchange information on TCP/IP
network.
II. DATA COMMUNICATION AND ITS IMPORTANCE
Communication is the sharing of information. We can
share information in two ways either locally or remotely, local
communication occurs when we are communicating with
someone face to face, while remote communication occurs

when
we
are
communicating
over
distance
(telecommunication is an example of remote communication
process that is used for sharing information over distance).
Data communication can be defined as the exchange of
information (i.e. data) between two or more devices via
transmission medium like wire cables. There must be a
communication system if we want data communication to
occur.
Data communication is one the main reason for the creation
of computer networks, before the invention of computer
networks data and information had to be physically conveyed
from one device (node) to another device. With the invention
digital networks, it is not only easier to send data plus we can
send and receive data quickly. It is because of data
communication that we can communicate and share
information across the globe. In modern world we are using
cell phones, projectors, laptops and many other inventions
these all inventions work due to data communication. We can
communicate with anyone globally with in few seconds, all of
these tasks are performed just because of data communication.
We can say that our modern societies relies on data
communication. It is due to data communication that we can
exchange information in the form of text, video, image, audio
with anyone around the world
III. OSI MODEL AND ITS IMPORTANCE
In 1984, International Standard Organization (ISO)
introduce a seven-layer model Open System Interconnection
(OSI) that covers all the functions of network communication.
To replace all the computing communication standards ISO
introduce OSI model. OSI was design to maintain a standard of
network communication globally. An OSI is a set of rules and
protocols that allow any two different network system to
communicate with each other regardless of their physical
structure. OSI is a layered approach and each layer depended
on the previous one. OSI also used to understand network
communication system. The purpose and importance of layered
approach is to address some goals which are define below,
Complex communication network was logically
decomposed into a smaller, understandable and
manageable parts

It provides a standardized communication and


interface between different network modules and
function
Provide a standard platform and language for network
function easily understand by network user and
vendors.

protocols responsible for delivery of a message from


running program to another running program.
Application Layer
The responsibilities of application layer is
equivalent to session, application and
presentation layer OSI model.

IV. TCP / IP PROTOCOL SUITE


TCP/IP protocol suite was developed before OSI model,
therefore the layers in TCP/IP suite does not match exactly
with OSI model. Initially TCP/IP has four layers:
Host to Network
Internet
Transport
Application
However, when we compare TCP/IP model with OSI
model, we can say that there are TCP/IP is mapped to five
layers. Host to network layer is equal to physical and data
link layers. Internet layers is equal to network layer, and
application is performing the job of session, presentation
layers and application layer in TCP/IP layer is doing the
duties of session layer. So after five layers are:
Physical
Data link
Network
Transport
Application
so figure 1 shows the five layers of TCP/IP when comparing
with OSI model.

Fig. 1 Comparison of OSI model layers with TCP/IP suite Layers

Physical Layer
In TCP/IP physical layer performing the
responsibilities of sending and receiving individual bit
from one node to another
Data Link Layer
It responsible for sending and receiving
frames from one node to another
Network Layer
At network layer TCP/IP support the
functions of internetworking protocols
Transport Layer
The transport Layer in TCP/IP is represented
by two protocols TCP and UDP. UDP and TCP

Fig.2 Mapping of TCP/IP layers with respect to OSI model Layers

V. WORKING OF SOCKET AT TCP / IP PROTOCOL SUITE


A socket is an endpoint through which an application
can receive and send data. Socket allows a platform for an
application to communicate with other applications by
plugging in the application to a network. The application
that are plugged in the same network can communicate with
each other. When an application writes an information to the

socket on one machine can be read by an application which


is on a different machine, and vice versa.
Fig. 3 TCP/IP Network

There are different types of sockets, depends on the


different underlying of protocol families and stack of
protocols within a family. We only discuss TCP/IP family.
The basic two main flavors (Types) of TCP/IP family are
stream sockets and datagram sockets.
Stream sockets use TCP as an end-to-end protocol
also provide a byte-stream services, while datagram sockets
use TCP as UDP and it provide a best datagram services
that all applications can use to send and receive individual
messages. Both datagram and stream sockets are also
supported by other protocol suites.
Internet address uniquely define a TCP/IP protocol as
port number and end-to-end protocol (UDP or TCP). At

first when a socket is created it has as associated protocol


but no port number and internet address. It can only receive
message when it has bounded to a port number
VI. SOCKET PROGRAMMING
Sockets are the part of the important technologies in
the computer world. Socket allow the data and
information to send or receive through networks
hardware. A socket of CPU connects the processor of a
computer to a motherboard. Socket 370 is the example of
CPU socket. Socket programming allow a programmer to
write a program that can communicate send request to
another node over the network

Fig. 4 Socket Programming Code

VII. PROS AND CONS OF SOCKET PROGRAMMING

Socket provide an easy and manageable platform to


transmit data, information and files. Socket is
sufficient to transfer large amount of data across or
within the network
It easy to use
Sockets are very effective because it provides
communication within the network system at high
speed.
Sockets are highly effective for general (common)
communications.
Sockets sends only necessary data as they produce
low traffic in the network
It is good for sharing software with in system, also
sockets software are available at reasonable price
Sockets have security issues as it creates a connection
with machine from where it came from rather than
every where else in network, so there is a potential
risk of losing data.
The disadvantage of socket programming is that it
can only communicate within the machine requested
and it cannot be use to communicate with other
machines at one time. It requires a mechanism to
send or receive the data for further use.

VIII. CONCLUSION
Data communication plays a major role in communicating
with other node over network. It is only possible due to data
communicating that we can send and receive data. This
research paper also covers the importance of OSI model and
socket programming. Socket are the endpoint in the flow of
communication between two programs over network. Socket
programming allow user to transmit data at high speed.
ACKNOWLEDGEMENT
I am very grateful that I have completed my assignment of
DATA COMMUNICATION AND NETWORKING given
by Sir Eng. Muhammad Ali Yousuf. I have submitted my
assignment before the deadline. I sincerely thank my course
teacher for giving full support and his guidance
REFERENCES
[1] http://en.wikipedia.org/wiki/Berkeley_sockets.
[2] James F. Kurose, Keith W. Ross, Computer Networking: A
Top- down Approach featuring the Internet
[3] http://stackoverflow.com/questions/9308392/whats-theadvantages-and-disadvantages-of-using-socket-in-ipc
[4] Joseph M. Dibella , Socket Programming with Java
[5] http://www.tutorialspoint.com/java/java_networking.htm
[6] https://docs.oracle.com/javase/tutorial/networking/sockets/defini
tion.html
[7] The Java Tutorials, Lesson: All about Sockets.

You might also like