Giter Site home page Giter Site logo

p4_reliable_tcp's Introduction

P4_Reliable_TCP

Project for CS 5700 Computer Networks by Professor Christo Wilson in Spring 2024.

  • Contributors: Ujwal Gupta, Shujun Chen

Reliable Communication

This project implements a reliable TCP communication over UDP between a sender and a receiver. The sender sends messages to the receiver, and the receiver acknowledges the receipt of each message. The sender employs congestion control and timeout-based retransmission mechanisms to ensure reliable delivery of messages.

High-Level Approach

  • Sender:

    • Utilize UDP sockets for communication.
    • Attach checksum to packets.
    • Maintain a seq_num and last_ack_seq to keep track of packet status.
    • Keep a copy of all in-flight packets with meta info including sent time, timeout time, re-transmit or not, etc.
    • Handle accumulative ack and remove packets from in_flight list properly.
    • Implements congestion control using a sliding window mechanism.
    • Estimate the RTT with each sample RTT from all non-retranmitted packets.
    • Maintain a timeout value, which is dynamictic adjusted by estimating RTT.
    • Dynamically adjust cwnd based on acknowledgments and timeouts, in response to various network enviroments and incidents.
    • Simulate TCP Reno's behavior of fast-retransmission.
    • Handles acknowledgments, timeouts, and retransmissions reliably.
  • Receiver:

    • Binds to a UDP socket to receive messages.
    • Verifies checksums for received packets to detect corruption.
    • Sends cumulative acknowledgments to the sender.
    • Maintain a next_expected sequence number.
    • Hold on to all out of order packets in an recved dictionary
    • Reconstructs the original message from received packets.

Challenges Faced

  • Reliability Over UDP: Implementing reliability over UDP required handling acknowledgments, timeouts, and retransmissions to ensure message delivery.
  • Congestion Control: Designing an efficient congestion control mechanism to regulate the flow of data while maximizing throughput without causing congestion collapse.
  • Checksum Calculation: Ensuring accurate checksum calculation to detect corrupted packets while minimizing computational overhead.

Key Features

  • Reliability: Implements acknowledgment-based reliability mechanisms to ensure message delivery.
  • Congestion Control: Utilizes a sliding window and congestion window to regulate the flow of data.
  • Checksum Verification: Computes and verifies checksums for detecting corrupted packets.
  • Timeout-Based Retransmissions: Retransmits packets upon timeout to handle packet loss.
  • Cumulative Acknowledgments: Sends cumulative acknowledgments to acknowledge received packets efficiently.

Testing Approach

  • All tests done using the testing network simulator.
  • Unit Testing: Conducted extensive unit testing for individual components and functionalities.
  • Integration Testing: Tested the interaction between sender and receiver to ensure seamless communication.
  • Stress Testing: Simulated various network conditions and loads to evaluate the robustness and scalability of the protocol.
  • Error Handling Testing: Tested error handling mechanisms for scenarios such as packet corruption, timeout, and unexpected behavior.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.