Skip to content

🌐 Network Sockets & Communication explores TCP, UDP, and parallel socket programming with real-time chat, connection-oriented & connectionless communication, and frame-based data exchange. πŸš€ Built with Python, this project demonstrates multi-connection handling and structured data transmission. πŸ’‘

License

Notifications You must be signed in to change notification settings

SimranShaikh20/Computer-Network-Assignment

Repository files navigation

🌐 Network Sockets & Communication

Welcome to the Network Sockets & Communication repository! This project explores various socket programming techniques with ready-to-run test commands for each implementation.

πŸ“Œ Table of Contents


✨ Features

  • βœ… TCP & UDP implementations with test cases
  • βœ… Chat application with message exchange demo
  • βœ… Parallel socket handling verification
  • βœ… Frame transmission validation

πŸ§ͺ Test Commands

πŸ”— TCP Communication Tests

# Terminal 1 (Server)
cd Connection-Oriented-Socket
python tcp_server.py

# Terminal 2 (Client - Test basic message)
python tcp_client.py "Hello TCP World!"

# Terminal 3 (Client - Test long message)
python tcp_client.py "$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 1024 | head -n 1)"

πŸ“± UDP Communication Tests

# Terminal 1 (Server)
cd Connectionless-Socket
python udp_server.py

# Terminal 2 (Client - Test single packet)
python udp_client.py "UDP Test Packet"

# Terminal 3 (Client - Test multiple packets)
for i in {1..5}; do python udp_client.py "Packet $i"; done

πŸ’¬ Chat Application Tests

# Terminal 1 (Server)
cd Chat_App
python server.py

# Terminal 2 (Client 1)
python client.py --name Alice

# Terminal 3 (Client 2)
python client.py --name Bob

# Exchange test messages between Alice and Bob

🀼 Frame Technique Tests

# Terminal 1 (Receiver)
cd Frame-technique
python frame_receiver.py

# Terminal 2 (Sender - Test small frame)
python frame_sender.py "SMALL_FRAME"

# Terminal 3 (Sender - Test large frame)
python frame_sender.py "$(dd if=/dev/zero bs=1024 count=10 | base64)"

πŸ”„ Parallel TCP/UDP Tests

# Terminal 1 (Server)
cd Parallel-TCP-UDP-Socket
python parallel_server.py

# Terminal 2 (TCP Client)
python parallel_tcp_client.py "TCP through parallel"

# Terminal 3 (UDP Client)
python parallel_udp_client.py "UDP through parallel"

# Terminal 4 (Stress Test)
./test_parallel.sh  # Create this script with concurrent calls

πŸ“‚ Project Structure

network-sockets-communication/
β”œβ”€β”€ Api-Details/
β”‚   └── api_reference.md
β”œβ”€β”€ Chat_App/
β”‚   β”œβ”€β”€ client.py             # Test with: python client.py --name [NAME]
β”‚   └── server.py             # Test with: python server.py
β”œβ”€β”€ Connection-Oriented-Socket/
β”‚   β”œβ”€β”€ tcp_client.py         # Test with: python tcp_client.py [MESSAGE]
β”‚   └── tcp_server.py         # Test with: python tcp_server.py
β”œβ”€β”€ Connectionless-Socket/
β”‚   β”œβ”€β”€ udp_client.py         # Test with: python udp_client.py [MESSAGE]
β”‚   └── udp_server.py         # Test with: python udp_server.py
β”œβ”€β”€ Frame-technique/
β”‚   β”œβ”€β”€ frame_receiver.py     # Test with: python frame_receiver.py
β”‚   └── frame_sender.py       # Test with: python frame_sender.py [DATA]
└── Parallel-TCP-UDP-Socket/
    β”œβ”€β”€ parallel_server.py    # Test with: python parallel_server.py
    β”œβ”€β”€ parallel_tcp_client.py
    └── parallel_udp_client.py

πŸ›  Technologies Used

  • Python 3 🐍 (socket, threading, select)
  • Network Protocols: TCP (RFC 793), UDP (RFC 768)
  • Test Tools: Built-in Python unittest, manual verification

πŸ“ License

This project is licensed under the MIT License πŸ“. See the LICENSE file for details.


TypeScript Test Verification

// Test verification snippet
const testsPassed = {
  tcp: true,
  udp: true,
  chat: true,
  parallel: true
};
console.log('All tests completed:', testsPassed);

Enjoy coding! πŸš€βœ¨

About

🌐 Network Sockets & Communication explores TCP, UDP, and parallel socket programming with real-time chat, connection-oriented & connectionless communication, and frame-based data exchange. πŸš€ Built with Python, this project demonstrates multi-connection handling and structured data transmission. πŸ’‘

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages