Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3945052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:58:25+00:00 2026-05-20T00:58:25+00:00

I am in the process of starting to implement some proprietary communication protocol stack

  • 0

I am in the process of starting to implement some proprietary communication protocol stack in software but not sure where to start. It is the kind of work I have not done before and I am looking for help in terms of resources for best/recommended approaches.

I will be using c/c++ and I am free to use use libraries (BSD/BOOST/Apache) but no GPL. I have used C++ extensively so using the features of C++ is not a problem.

The protocol stack has three layers and it is already fully specified and formally verified. So all I need to do is implemented and test it fully in the specified languages. Should also mention that protocol is very simple but can run on different devices over a reliable physical transport layer. I know the events, inputs, outputs, side effects and the behaviour of the protocol state machine(s). Generally, an interrupt is received to read the message received from the physical layer to read it and send to the waiting device. The receiving device can process and pass the response message to the protocol layer to send out on the physical layer.

Any help with references/recommendations will be appreciated. I am willing to use a different language if only to help me understand how to implement them but I will have to eventually resort to the language of choice.

Update: An example protocol I wish to implement is something like SNEP.

I do not need to worry about connection management. We can assume the connection is already establish and I the protocol does is data exchange where the protocol messages are already well defined in specifications

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:58:26+00:00Added an answer on May 20, 2026 at 12:58 am

    Start with interfaces and messages.

    Declare the interfaces of session that allow peers to exchange messages. Declare the messages as C++ structs with simple types, like ints, doubles, std::string’s and and std::vectors. For example:

    // these are your protocol messages
    struct HelloRequest {
        uint32_t seq_no;
        // more stuff
    };
    struct HelloResponse {
        uint32_t seq_no;
        // more stuff
    };
    
    // Session callback for received messages
    struct SessionReceiver {
        virtual void connected(Session*) = 0;
        virtual void receive(Session* from, HelloRequest msg) = 0;
        virtual void receive(Session* from, HelloResponse msg) = 0;
        virtual void disconnected(Session*) = 0;
    };
    
    // Session interface to send messages
    struct Session {
        virtual void send(HelloRequest msg) = 0;
        virtual void send(HelloResponse msg) = 0;
    };
    
    // this connects asynchronously and then calls SessionReceiver::connected() with a newly established session
    struct SessionInitiator {
        virtual void connect(SessionReceiver* cb, std::string peer) = 0;
    };
    
    // this accepts connections asynchronously and then calls SessionReceiver::connected() with a newly accepted session
    struct SessionAcceptor {
        virtual void listen(SessionReceiver* cb, std::string port) = 0;
    };
    

    Then test your interfaces by coding the business logic that uses these interfaces. Once you are confident that the interfaces allow you to implement the required logic implement the interfaces and serialization of your messages using your preferred event-driven framework, like libevent or Boost.Asio.

    Edit:
    Note that interfaces allow you to have mock or test implementations. Also the fact that serialization happens behind the interface means that for in-process peers you don’t have to serialize and deserialize the messages, you can pass them as is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a document-based Cocoa application that has to start up a sub-process before
I was wondering is learning Python and Django a hard/time consuming process for someone
I am firing up a cmd console from my .net app with some parameters,
I read that the first 3 GBs are reserved for the process and the
I have several Fusioncharts on my page and some of them are outside the
The process is explained here: http://msdn.microsoft.com/en-US/library/d1ae6tz5%28v=VS.80%29.aspx What I don't get from that article is
I have a process as follows: User does a complex search that is done
I have a process that imports a daily file of product registrations, and adds
I am for a long time trying to get a picture how is program
I've been looking at this for a while. I've found plenty of posts and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.