Professional Documents
Culture Documents
: 20BRS1016
FACULTY: Mr. Seshu Babu Pulagra
LAB SLOT: L37-L38
CSE1004
Communications and Networks
FAT LAB
Part -1: Cisco Packet Tracer
ALGORITHM:
NETWORK DIAGRAM:
CONFIGURATIONS:
OBSERVATIONS:
CONCLUSION: We are successful in creating the given network using Cisco Packet
Tracer Software.
PART-2: Programming
Aim: To code for basic server-client system where the client enters a domain
name, server sends the IP Address of the domain name. (using TCP/IP
protocol)
Client:
Create a Socket.
Connect with the server by sending a request.
Send and Receive data from the server.
Close the Socket created.
CODE FOR THE SERVER:
import socket
s = socket.socket()
print("Socket Created")
s.bind(('localhost',9999))
s.listen(1)
print("Listening...")
while True:
c,addr = s.accept()
domain_name = c.recv(1024).decode()
ipaddr=socket.gethostbyname(domain_name)
print("Connected with", addr)
c.send(bytes(ipaddr,'utf-8'))
c.close()
c = socket.socket()
c.connect(('localhost',9999))