DCL - Experiment 2 1
DCL - Experiment 2 1
Experiment No. 2
PART B
(PART B: TO BE COMPLETED BY STUDENTS)
Class: Batch:
Grade:
B.1 Software Code written by student:
● Server.py import
1
') new_socket.listen(1) conn, add =
new_socket.accept()
print("Received connection from ", add[0]) print('Connection
Established. Connected From: ',add[0]) client =
(conn.recv(1024)).decode() print(client + ' has connected.')
● Client.py import
socket_server.send(name.encode()) server_name =
socket_server.recv(1024) server_name =
server_name.decode()
2
●
● Client.py
3
4
B.3 Observations and learning:
In this experiment, we learnt socket programming to establish a server-client network and
implemented a chat application in python.
B.4 Conclusion:
We successfully implemented a chat application using socket programming in python. B.5
Question of Curiosity.
Q1: Server Socket consists of port address and IP address or only port address. ANS:
- A server socket has a port address as well as an IP address. Every device on a TCP/IP
network requires an IP address. The gadget is identified by its IP address. A socket is
5
associated with a port number so that the TCP layer can identify the application to
which data is being transmitted.
Q2: Compare UDP socket programming and TCP socket programming ANS:
Optimal use
Used by HTTPS, HTTP, SMTP, Video conferencing, streaming,
POP, FTP, etc DNS, VoIP, etc
Error checking Extensive error checking and Basic error checking mechanism using
acknowledgement of data checksums
Q3. The distributed system uses a ___________architecture to break down the complexity of
system design. The _______________ is the distributed software that drives the distributed
system while providing transparency of heterogeneity at the platform level.
1. Layered, Middleware
2. Message-passing, CORBA
3. Tree, RPC
6
4. Loosely coupled, MPI