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 8847471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:11:51+00:00 2026-06-14T12:11:51+00:00

I am reimplementing an old network layer library, but using boost asio this time.

  • 0

I am reimplementing an old network layer library, but using boost asio this time. Our software is tcpip dialoging with a 3rd party software. Several messages behave very well on both sides, but there is one case I misunderstand:

The 3rd party sends two messages (msg A and B) one after the other (real short timing) but I receive only a part of message A in tcp-packet 1, and the end of message A and the whole message B in tcp-packet 2. (I sniff with wireshark).

I had not thought of this case, I am wondering if it is common with tcp, and if my layer should be adaptative to that case – or should I say to the 3rd party to check what they do on their side so as I received both message in different packets.

  • 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-06-14T12:11:53+00:00Added an answer on June 14, 2026 at 12:11 pm

    Packets can be fragmented and arrive out-of-sequence. The TCP stack which receives them should buffer and reorder them, before presenting the data as an incoming stream to the application layer.

    My problem is with message B, that I don’t see because it’s after the end of message one in the same packet.

    You can’t rely on “messages” having a one-to-one mapping to “packets”: to the application, TCP (not UDP) looks like a “streaming” protocol.

    An application which sends via TCP needs another way to separate messages. Sometimes that’s done by marking the end of each message. For example SMTP marks the end-of-message as follows:

    The transmission of the body of the mail message is initiated with a
    DATA command after which it is transmitted verbatim line by line and
    is terminated with an end-of-data sequence. This sequence consists of
    a new-line (), a single full stop (period), followed by
    another new-line. Since a message body can contain a line with just a
    period as part of the text, the client sends two periods every time a
    line starts with a period; correspondingly, the server replaces every
    sequence of two periods at the beginning of a line with a single one.
    Such escaping method is called dot-stuffing.

    Alternatively, the protocol might specify a prefix at the start of each message, which will indicate the message-length in bytes.

    If you’re are coding the TCP stack, then you’ll have access to the TCP message header: the “Data offset” field tells you how long each message is.

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

Sidebar

Related Questions

I am using iptables string match + libnetfilter_queue library to monitor http requests and
I'm rendering text using FormattedText , but there does appear to be any way
I am currently re-implementing some project using Lift. All the old views were done
Our code has to run on both SLES9 (old) and an even older version
Our system will run on a local network with no more than 50 clients
I remember seeing a video with Jon Skeet reimplementing Linq-to-Objects a while back but
I am reimplementing a function using BigInteger in place in int. Now there is
I'm re-implementing a old BBS MUD game in Java with permission from the original
I have asp.net mvc 2 application. Now I'm reimplementing it for working with Ninject
I'm trying to get a mouse click event in Qt, this mouse click must

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.