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.

More Related Content

PPTX
Operating System
PPTX
Private messenger
DOC
Peer peer messaging system (synopsis)
PPT
04 Client Server Technology
PPTX
Internet Architecture and Design Philosophy
PPT
Introduction to Peer-to-Peer Networks
PPTX
client server protocol
Operating System
Private messenger
Peer peer messaging system (synopsis)
04 Client Server Technology
Internet Architecture and Design Philosophy
Introduction to Peer-to-Peer Networks
client server protocol

What's hot (20)

PDF
An in-building multi-server cloud system based on shortest Path algorithm dep...
PDF
Project report on mesh hybrid topology network vision
PPT
P2p Peer To Peer Introduction
PPTX
Communication in Distributed Systems
PDF
Protocols and standards
PPTX
Peer to peer data management
PPTX
Peer to Peer vs Client/Server Network By Ahnaf
PDF
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
PDF
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
PPTX
Peer to-peer networks
PDF
Internet
PPTX
Client Server Architecture
DOCX
Service usage classification with encrypted internet traffic in mobile messag...
PDF
Fundamentals of internet_measurement_a_tutorial
PPT
Internet (i mcom)
PDF
Peer to peer network schemes and finding algorithms
PPTX
Final peersimp pt
PPT
Lecture - Network Technologies: Peer-to-Peer Networks
PPTX
Peer Sim & P2P
An in-building multi-server cloud system based on shortest Path algorithm dep...
Project report on mesh hybrid topology network vision
P2p Peer To Peer Introduction
Communication in Distributed Systems
Protocols and standards
Peer to peer data management
Peer to Peer vs Client/Server Network By Ahnaf
4 Sw 2009 Ieee Abstracts Dot Net, Ncct Chennai
IRJET- Design of Anonymous Publish-Subscribe Messaging System in a P2P Networ...
Peer to-peer networks
Internet
Client Server Architecture
Service usage classification with encrypted internet traffic in mobile messag...
Fundamentals of internet_measurement_a_tutorial
Internet (i mcom)
Peer to peer network schemes and finding algorithms
Final peersimp pt
Lecture - Network Technologies: Peer-to-Peer Networks
Peer Sim & P2P
Ad

Similar to Socket programming assignment (20)

PPTX
Module 1 part 2.pptx with clear notes and explanation
PDF
sockets SMTP Bmsce ppt information science and engineering
PPTX
PPTX
Byte Ordering - Unit 2.pptx
PPTX
Network Programming-Python-13-8-2023.pptx
PDF
Socket Programming
PPT
Socket programming
PPT
Application Layer and Socket Programming
PPTX
Basics of Socket Programming using python
PPT
chapter-4-networking hjgjjgj did hfhhfhj
DOCX
Final networks lab manual
PDF
Socket programming using java
PDF
Gu3112991305
PPTX
Java socket programming
DOCX
Mail Server Project Report
DOCX
Application programming interface sockets
PDF
How a network connection is created A network connection is initi.pdf
PPT
Network programming in Java
PDF
28 networking
Module 1 part 2.pptx with clear notes and explanation
sockets SMTP Bmsce ppt information science and engineering
Byte Ordering - Unit 2.pptx
Network Programming-Python-13-8-2023.pptx
Socket Programming
Socket programming
Application Layer and Socket Programming
Basics of Socket Programming using python
chapter-4-networking hjgjjgj did hfhhfhj
Final networks lab manual
Socket programming using java
Gu3112991305
Java socket programming
Mail Server Project Report
Application programming interface sockets
How a network connection is created A network connection is initi.pdf
Network programming in Java
28 networking
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.