CN Praticals 8,9,10
CN Praticals 8,9,10
AIM: Design multiple subnet with suitable number of hosts. Make a plan to assign static IP addressing
across all subnet to explain implementation of subnetting.
THEORY:
Subnetting is the practice of dividing up a network into two or more networks. Common advantages of
Subnetting include enhancing routing efficiency, network management control, and improving network
security. While these are just a few of the benefits that subnetting provides, they are the most noticeable after
immediately implementing a subnet system.
This results in the logical division of an IP address into two fields: the network number or routing prefix and
The rest field or host identifier. Addresses help to identify the pieces of hardware connected to your network.
To locate a particular device you would need to organize the IP addresses in a logical way. This is where
subnetting excels as a tool to help you maintain efficiency across your network.
8.1 Purpose:
The main objective of the proposed experiment is to divide multiple networks using the concept of
AIM: Routing at Network Layer: Simulate Static and Dynamic Routing Protocol Configuration using
CISCO Packet Tracer.
9.1 Purpose:
The main objective of the proposed experiment is to implement static and dynamic routing protocol using
serial and parallel routing connections. It also gives an opportunity to students to learn serial and parallel
9.3 TOOLS/SOFTWARE:
Cisco Packet Tracer
9.4 Expected Output:
9.5 Practice Excercises:
1. Design an actual LAN network using 4 nodes. Design two subnets from the designed network
using class A Ip address classes.
2. Design actual Wi-Fi network using 4 nodes. Design two subnets from the designed network using
class A Ip address classes.
9.6 Conclusion : The study and simulation of static and dynamic routing protocols using CISCO Packet Tracer
provide valuable insights into the mechanisms and functionalities that underpin network layer routing. Static
routing offers
simplicity and ease of implementation, making it suitable for smaller networks with limited changes. However
, it lacks scalability and fails to adapt to network topology changes dynamically.
On the other hand, dynamic routing protocols such as RIP, OSPF, and EIGRP automatically adjust to network
variations, ensuring optimal path selection and efficient data transmission. These protocols, while more
complex, provide robustness, scalability, and better fault tolerance, making them ideal for larger and more
dynamic network environments.
By configuring and comparing both static and dynamic routing in CISCO Packet Tracer, we gain practical
experience in understanding the strengths and limitations of each approach. This exercise underscores the
importance of choosing the appropriate routing strategy based on network requirements and highlights the
critical role of routing in achieving efficient and reliable network communication.
EXPERIMENT NO: 10
ALGORITHM:
SERVER:
STEP 1: Start
STEP 2: Declare the variables for the socket
STEP 3: Specify the family, protocol, IP address and port number
STEP 4: Create a socket using socket() function
STEP 5: Bind the IP address and Port number
STEP 6: Listen and accept the client’s request for the connection
STEP 7: Read and Display the client’s message
STEP 8: Stop
CLIENT:
STEP 1: Start
STEP 2: Declare the variables for the socket
STEP 3: Specify the family, protocol, IP address and port number
STEP 4: Create a socket using socket() function
STEP 5: Call the connect() function
STEP 6: Read the input message
STEP 7: Send the input message to the server
STEP 8: Display the server’s echo
STEP 9: Close the socket
STEP 10: Stop
SOURCE CODE:
SERVER:
print("UDP server up and listening,L") # Listen for incoming datagrams while(True): bytesAddressPair =
UDPServerSocket.recvfrom(bufferSize) message = bytesAddressPair[0] address = bytesAddressPair[1]
clientMsg = "Message from Client:{}".format(message) clientIP = "Client IP Address:{}".format(address)
print(clientMsg)
print(clientIP)
UDPServerSocket.sendto(bytesToSend, address)
CLIENT:
import socket msgFromClient = "Hello UDP Server" bytesToSend = str.encode(msgFromClient)
serverAddressPort = ("127.0.0.1", 20001)
bufferSize = 1024
# Create a UDP socket at client side
UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
# Send to server using created UDP socket
UDPClientSocket.sendto(bytesToSend, serverAddressPort) msgFromServer =
UDPClientSocket.recvfrom(bufferSize)
OUTPUT: SERVER:
CLIENT:
RESULT:
Thus the program for UDP echo client server was executed and the output was verified.
AIM:
To write a program for TCP echo client server.
SOURCE CODE:
SERVER
CLIENT:
OUTPUT:
SERVER:
CLIENT:
Conclusion : Implementation of an echo client-server system using TCP/UDP sockets provides valuable
hands-on experience with socket programming and networking protocols.
Key Takeaways:
Understanding Protocols: TCP (Transmission Control Protocol) offers reliable, ordered, and error-checked
delivery of a stream of bytes, making it ideal for applications where data integrity is crucial. On the other
hand, UDP (User Datagram Protocol) provides a connectionless, lightweight solution with minimal overhead,
suitable for time-sensitive applications like video streaming or gaming.
Practical Application: This project demonstrates how to establish client-server communication, handle data
transmission, and manage multiple client connections efficiently.
Debugging and Error Handling: Through this implementation, one learns the importance of robust error
handling and debugging techniques, as network communication can be susceptible to various issues such as
data loss, packet corruption, or connection timeouts.
Scalability and Performance: While the echo server is a simple application, the principles learned can be
applied to more complex systems. Understanding the trade-offs between TCP and UDP helps in designing
scalable and high-performance network applications.
By successfully creating an echo client-server system, we lay a solid foundation for further exploration and
development in the field of network programming.