SlideShare a Scribd company logo
Socket programming assignment
Team Members:-Rajkumar Meena(ug201310025)
Ravi Prakash Gupta(ug201310027)
The socket programming for communication based on
server/client
Abstract
We are going to introduce the application of the client/server(C/S) mode ,the concept and the
programming principle of the socket based on server/client. The transmission layer can provide
connection-oriented to use TCP protocol, connectionless-oriented to use UDP protocol. There are two
different kinds of services with different kinds of sockets. Only by understanding the characters of TCP
protocol and UDP protocol, the service provided by the two protocols for application, can we know what
deal with in these protocols, what need to deal with in application, can we easier compile vigorously and
healthily, highly efficient client service program. With datagram sockets, communication occurs in the
form of discrete messages sent from the sender to receiver; whereas with stream-mode sockets, data is
transferred using the concept of a continuous data stream flowing from a source to a destination.
Introduction
The computer network is the product of the combination between computer technology and
communication technology. With the development of the computer network, application of the
computer network has been applied to social and economic life in all aspects, for example, Bank teller,
point-of-terminal, the verification of check and invoice etc. The design and development of network
software is more and more popular, the most of system software (such as operating system UNIX, Linux,
Windows versions ,etc) and application software are online versions at present. It is very important to
master the network programming principle and method for designing and developing web applications.
With the emergence of more powerful desktop computers it became less and less necessary for companies
to rely on big, fast mainframe computers in the mid 80's. So, instead of using one big computer with
centralized software and 'dumb' terminals on each desk they put a personal computer on each desk and
'empowered' the employee to use whatever software was best for the task at hand. However, companies
had large databases which could not be put on every personal computer: first, they were simply too big
for typical PC hard disks, and secondly, if one person updated the database, the next person needs to see
these changes. Thus, with large databases, they had two choices: stick with the old approach of having
one central mainframe computer to handle all database requests, or develop a new strategy. Of course,
they chose the second approach and developed the 'client-server' approach. Actually, this approach was
not so new: it has been used since the late 60's for the Internet as it existed then. But the need that big
corporations had for this client-server approach made it quickly very popular (similar to the Internet
today: many Universities used the Internet extensively for decades, but the 'general population' did not
even know about its existence; as soon as large corporations thought that they could use the Internet for
their own purposes, the term became commonplace). Now I am going to introduce server-client approach.
Socket- A socket is one end-point of a two-way communication link between two programs running
on the network. Socket classes are used to represent the connection between a client program and a
server program.
The server-An applications runs on a large computer (large meaning either fast or large storage
space or both). The server application is usually written in such a way that it does not provide any
method to interact with a user. Instead, it waits for other programs to connect (i.e. other programs
take the place of a user) and interacts with these programs. Typically, a server application has
control over large amounts of data, and can access that data fast and efficiently. It can also handle
requests by many clients (more or less) simultaneously.
The client-An application that runs on a personal computer. It has an extensive and appealing user
interface, but it has no data that it can manipulate or present to the user. The client application
'asks' what a user wants, then connects to the server application to obtain that data. Once the data
has been obtained, it is presented to the user in a nice format. A client usually gets the data from
one server at a time, and interacts with one user only.
Client-Server programs can run on any type of network. These days, however, people are most
interested in them when they utilize the Internet. So, we will only talk about client-server programs
running on the Internet, and we will oversimplify many issues to understand the basic ideas and concepts.
The Principle of Socket Communication
Socket is a kind of abstract data structure provided by operating system, it is used to build an access in
the absence of correlation between the process of sending to receive messages. Socket has been
providing communications endpoint process in fact and has been accomplishing the data transmission
through the endpoint.
First, the socket function call attendant to create a type of Socket, then bind socket into client-side
through bind function. Attendant set listening attentively to the formation the length through
transferring the listen function to make a prepare from client client's requests. Attendant transfers the
accept function to start in the port which binding to listen attentively comes from the connection
request which the client carries.
Client-side build a type of socket through socket function(it should be similar with the type of client-
side’s socket). Then connect function call to the attendant where the host issued a connection request.
It need to designate service where the host IP address and socket, as well as other relevant information
when you link it .
TCP is a connection-oriented protocol that provides a reliable fl ow of data between two computers.
Example applications that use such services are HTTP, FTP, and Telnet. UDP is a protocol that sends
independent packets of data, called datagrams , from one computer to another with no guarantees
about arrival and sequencing. Example applications that use such services include Clock server and Ping.
The TCP and UDP protocols use ports to map incoming data to a particular process running on a
computer. Port is represented by a positive (16-bit) integer value. Some ports have been reserved to
support common/well known services:
ftp 21/tcp
telnet 23/tcp
smtp 25/tcp
login 513/tcp
http 80/tcp,udp
https 443/tcp,udp
User-level process/services generally use port number value >= 1024.
Ad

Recommended

Operating System
Operating System
sweetysweety8
 
Private messenger
Private messenger
Piyush Gaur
 
Peer peer messaging system (synopsis)
Peer peer messaging system (synopsis)
Mumbai Academisc
 
04 Client Server Technology
04 Client Server Technology
Laguna State Polytechnic University
 
Internet Architecture and Design Philosophy
Internet Architecture and Design Philosophy
Dilum Bandara
 
Csc network
Csc network
Ashwin Ananthapadmanabhan
 
Introduction to Peer-to-Peer Networks
Introduction to Peer-to-Peer Networks
Venkatesh Iyer
 
client server protocol
client server protocol
bmuhire
 
An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...
IOSR Journals
 
Project report on mesh hybrid topology network vision
Project report on mesh hybrid topology network vision
Jignesh Ameta
 
P2p Peer To Peer Introduction
P2p Peer To Peer Introduction
venkatesh munirathinam
 
Communication in Distributed Systems
Communication in Distributed Systems
Dilum Bandara
 
Protocols and standards
Protocols and standards
PriyankaM69
 
Peer to peer data management
Peer to peer data management
Junaid Lodhi
 
Peer to Peer vs Client/Server Network By Ahnaf
Peer to Peer vs Client/Server Network By Ahnaf
ahnarokz
 
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
ncct
 
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
IRJET Journal
 
Peer to-peer networks
Peer to-peer networks
Nkosinathi Lungu
 
Networks
Networks
Christian Technical Training Centre
 
Internet
Internet
Suneel Dogra
 
Client Server Architecture
Client Server Architecture
Rence Montanes
 
Service usage classification with encrypted internet traffic in mobile messag...
Service usage classification with encrypted internet traffic in mobile messag...
Finalyearprojects Toall
 
Fundamentals of internet_measurement_a_tutorial
Fundamentals of internet_measurement_a_tutorial
Turisticae
 
Internet (i mcom)
Internet (i mcom)
priya Nithya
 
Peer to peer network schemes and finding algorithms
Peer to peer network schemes and finding algorithms
Mohamed El Sharnoby
 
Final peersimp pt
Final peersimp pt
Clement Robert Habimana
 
Lecture - Network Technologies: Peer-to-Peer Networks
Lecture - Network Technologies: Peer-to-Peer Networks
James Salter
 
Peer Sim & P2P
Peer Sim & P2P
Chandan Balachandra
 
Module 1 part 2.pptx with clear notes and explanation
Module 1 part 2.pptx with clear notes and explanation
farsankadavandy
 
sockets SMTP Bmsce ppt information science and engineering
sockets SMTP Bmsce ppt information science and engineering
UtkarshaMahajan6
 

More Related Content

What's hot (20)

An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...
IOSR Journals
 
Project report on mesh hybrid topology network vision
Project report on mesh hybrid topology network vision
Jignesh Ameta
 
P2p Peer To Peer Introduction
P2p Peer To Peer Introduction
venkatesh munirathinam
 
Communication in Distributed Systems
Communication in Distributed Systems
Dilum Bandara
 
Protocols and standards
Protocols and standards
PriyankaM69
 
Peer to peer data management
Peer to peer data management
Junaid Lodhi
 
Peer to Peer vs Client/Server Network By Ahnaf
Peer to Peer vs Client/Server Network By Ahnaf
ahnarokz
 
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
ncct
 
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
IRJET Journal
 
Peer to-peer networks
Peer to-peer networks
Nkosinathi Lungu
 
Networks
Networks
Christian Technical Training Centre
 
Internet
Internet
Suneel Dogra
 
Client Server Architecture
Client Server Architecture
Rence Montanes
 
Service usage classification with encrypted internet traffic in mobile messag...
Service usage classification with encrypted internet traffic in mobile messag...
Finalyearprojects Toall
 
Fundamentals of internet_measurement_a_tutorial
Fundamentals of internet_measurement_a_tutorial
Turisticae
 
Internet (i mcom)
Internet (i mcom)
priya Nithya
 
Peer to peer network schemes and finding algorithms
Peer to peer network schemes and finding algorithms
Mohamed El Sharnoby
 
Final peersimp pt
Final peersimp pt
Clement Robert Habimana
 
Lecture - Network Technologies: Peer-to-Peer Networks
Lecture - Network Technologies: Peer-to-Peer Networks
James Salter
 
Peer Sim & P2P
Peer Sim & P2P
Chandan Balachandra
 
An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...
IOSR Journals
 
Project report on mesh hybrid topology network vision
Project report on mesh hybrid topology network vision
Jignesh Ameta
 
Communication in Distributed Systems
Communication in Distributed Systems
Dilum Bandara
 
Protocols and standards
Protocols and standards
PriyankaM69
 
Peer to peer data management
Peer to peer data management
Junaid Lodhi
 
Peer to Peer vs Client/Server Network By Ahnaf
Peer to Peer vs Client/Server Network By Ahnaf
ahnarokz
 
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
ncct
 
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
IRJET Journal
 
Client Server Architecture
Client Server Architecture
Rence Montanes
 
Service usage classification with encrypted internet traffic in mobile messag...
Service usage classification with encrypted internet traffic in mobile messag...
Finalyearprojects Toall
 
Fundamentals of internet_measurement_a_tutorial
Fundamentals of internet_measurement_a_tutorial
Turisticae
 
Peer to peer network schemes and finding algorithms
Peer to peer network schemes and finding algorithms
Mohamed El Sharnoby
 
Lecture - Network Technologies: Peer-to-Peer Networks
Lecture - Network Technologies: Peer-to-Peer Networks
James Salter
 

Similar to Socket programming assignment (20)

Module 1 part 2.pptx with clear notes and explanation
Module 1 part 2.pptx with clear notes and explanation
farsankadavandy
 
sockets SMTP Bmsce ppt information science and engineering
sockets SMTP Bmsce ppt information science and engineering
UtkarshaMahajan6
 
Networking in python by Rj
Networking in python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
RockyBhai46825
 
Network Programming-Python-13-8-2023.pptx
Network Programming-Python-13-8-2023.pptx
ssuser23035c
 
Socket Programming
Socket Programming
elliando dias
 
Socket programming
Socket programming
Divya Sharma
 
Application Layer and Socket Programming
Application Layer and Socket Programming
elliando dias
 
Basics of Socket Programming using python
Basics of Socket Programming using python
NalinadeviKadiresan1
 
chapter-4-networking hjgjjgj did hfhhfhj
chapter-4-networking hjgjjgj did hfhhfhj
AmitDeshai
 
Final networks lab manual
Final networks lab manual
Jaya Prasanna
 
Os 2
Os 2
university of Gujrat, pakistan
 
Socket programming using java
Socket programming using java
UC San Diego
 
Gu3112991305
Gu3112991305
IJERA Editor
 
Java socket programming
Java socket programming
Mohammed Abdalla Youssif
 
Mail Server Project Report
Mail Server Project Report
Kavita Sharma
 
Application programming interface sockets
Application programming interface sockets
Kamran Ashraf
 
How a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdf
arccreation001
 
Network programming in Java
Network programming in Java
Tushar B Kute
 
28 networking
28 networking
Ravindra Rathore
 
Module 1 part 2.pptx with clear notes and explanation
Module 1 part 2.pptx with clear notes and explanation
farsankadavandy
 
sockets SMTP Bmsce ppt information science and engineering
sockets SMTP Bmsce ppt information science and engineering
UtkarshaMahajan6
 
Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
RockyBhai46825
 
Network Programming-Python-13-8-2023.pptx
Network Programming-Python-13-8-2023.pptx
ssuser23035c
 
Socket programming
Socket programming
Divya Sharma
 
Application Layer and Socket Programming
Application Layer and Socket Programming
elliando dias
 
Basics of Socket Programming using python
Basics of Socket Programming using python
NalinadeviKadiresan1
 
chapter-4-networking hjgjjgj did hfhhfhj
chapter-4-networking hjgjjgj did hfhhfhj
AmitDeshai
 
Final networks lab manual
Final networks lab manual
Jaya Prasanna
 
Socket programming using java
Socket programming using java
UC San Diego
 
Mail Server Project Report
Mail Server Project Report
Kavita Sharma
 
Application programming interface sockets
Application programming interface sockets
Kamran Ashraf
 
How a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdf
arccreation001
 
Network programming in Java
Network programming in Java
Tushar B Kute
 
Ad

Socket programming assignment

  • 1. Socket programming assignment Team Members:-Rajkumar Meena(ug201310025) Ravi Prakash Gupta(ug201310027) The socket programming for communication based on server/client Abstract We are going to introduce the application of the client/server(C/S) mode ,the concept and the programming principle of the socket based on server/client. The transmission layer can provide connection-oriented to use TCP protocol, connectionless-oriented to use UDP protocol. There are two different kinds of services with different kinds of sockets. Only by understanding the characters of TCP protocol and UDP protocol, the service provided by the two protocols for application, can we know what deal with in these protocols, what need to deal with in application, can we easier compile vigorously and healthily, highly efficient client service program. With datagram sockets, communication occurs in the form of discrete messages sent from the sender to receiver; whereas with stream-mode sockets, data is transferred using the concept of a continuous data stream flowing from a source to a destination. Introduction The computer network is the product of the combination between computer technology and communication technology. With the development of the computer network, application of the computer network has been applied to social and economic life in all aspects, for example, Bank teller, point-of-terminal, the verification of check and invoice etc. The design and development of network software is more and more popular, the most of system software (such as operating system UNIX, Linux, Windows versions ,etc) and application software are online versions at present. It is very important to master the network programming principle and method for designing and developing web applications. With the emergence of more powerful desktop computers it became less and less necessary for companies to rely on big, fast mainframe computers in the mid 80's. So, instead of using one big computer with centralized software and 'dumb' terminals on each desk they put a personal computer on each desk and 'empowered' the employee to use whatever software was best for the task at hand. However, companies had large databases which could not be put on every personal computer: first, they were simply too big for typical PC hard disks, and secondly, if one person updated the database, the next person needs to see these changes. Thus, with large databases, they had two choices: stick with the old approach of having one central mainframe computer to handle all database requests, or develop a new strategy. Of course, they chose the second approach and developed the 'client-server' approach. Actually, this approach was not so new: it has been used since the late 60's for the Internet as it existed then. But the need that big
  • 2. corporations had for this client-server approach made it quickly very popular (similar to the Internet today: many Universities used the Internet extensively for decades, but the 'general population' did not even know about its existence; as soon as large corporations thought that they could use the Internet for their own purposes, the term became commonplace). Now I am going to introduce server-client approach. Socket- A socket is one end-point of a two-way communication link between two programs running on the network. Socket classes are used to represent the connection between a client program and a server program. The server-An applications runs on a large computer (large meaning either fast or large storage space or both). The server application is usually written in such a way that it does not provide any method to interact with a user. Instead, it waits for other programs to connect (i.e. other programs take the place of a user) and interacts with these programs. Typically, a server application has control over large amounts of data, and can access that data fast and efficiently. It can also handle requests by many clients (more or less) simultaneously. The client-An application that runs on a personal computer. It has an extensive and appealing user interface, but it has no data that it can manipulate or present to the user. The client application 'asks' what a user wants, then connects to the server application to obtain that data. Once the data has been obtained, it is presented to the user in a nice format. A client usually gets the data from one server at a time, and interacts with one user only. Client-Server programs can run on any type of network. These days, however, people are most interested in them when they utilize the Internet. So, we will only talk about client-server programs running on the Internet, and we will oversimplify many issues to understand the basic ideas and concepts. The Principle of Socket Communication Socket is a kind of abstract data structure provided by operating system, it is used to build an access in the absence of correlation between the process of sending to receive messages. Socket has been providing communications endpoint process in fact and has been accomplishing the data transmission through the endpoint. First, the socket function call attendant to create a type of Socket, then bind socket into client-side through bind function. Attendant set listening attentively to the formation the length through transferring the listen function to make a prepare from client client's requests. Attendant transfers the accept function to start in the port which binding to listen attentively comes from the connection request which the client carries. Client-side build a type of socket through socket function(it should be similar with the type of client- side’s socket). Then connect function call to the attendant where the host issued a connection request. It need to designate service where the host IP address and socket, as well as other relevant information when you link it . TCP is a connection-oriented protocol that provides a reliable fl ow of data between two computers. Example applications that use such services are HTTP, FTP, and Telnet. UDP is a protocol that sends
  • 3. independent packets of data, called datagrams , from one computer to another with no guarantees about arrival and sequencing. Example applications that use such services include Clock server and Ping. The TCP and UDP protocols use ports to map incoming data to a particular process running on a computer. Port is represented by a positive (16-bit) integer value. Some ports have been reserved to support common/well known services: ftp 21/tcp telnet 23/tcp smtp 25/tcp login 513/tcp http 80/tcp,udp https 443/tcp,udp User-level process/services generally use port number value >= 1024.