Skip to content

RootSprout/CTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTP — Custom Transport Protocol

Alt Text


CTP, is a frame-based custom transport protocol implemented in pure C. This project simulates reliable serial communication over virtual or real serial ports, including frame creation, CRC error detection, and ACK/NACK based retransmission.


🌟 Features

Protocol Feature CAP Implementation
Frame Structure Each frame has preamble, sequence number, payload, and CRC
CRC Error Detection Detects transmission errors using binary CRC
ACK/NACK Reliability Receiver sends ACK/NACK; sender retransmits if needed
Virtual Serial Communication Uses socat to simulate connected serial ports
Termios Integration Configures serial ports, baud rate, character size, and blocking mode
Simple Data Transfer Send arbitrary payloads reliably over serial

🚀 Getting Started

Requirements

  • GCC / C compiler
  • Unix-based OS (Linux, macOS)
  • socat (for virtual serial port testing)
  • make

🔧 Build

cd ctp
socat -d -d pty,raw,echo=0,link=/tmp/sender pty,raw,echo=0,link=/tmp/receiver
make
make run-receiver
make run-sender

CTP Architecture

Alt Text

Readmore here: CTP Blog

🤝 Contributing

We ❤️ contributors!

To contribute:

  1. Fork the repository.
  2. Clone it locally:
    git clone [repo]
    cd ctp
    git checkout -b feature/my-improvement

License

@Meerthika

About

A Serial Datalink transport protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published