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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:00:27+00:00 2026-05-16T15:00:27+00:00

I have a TCP server that listens for an incoming client, then sends it

  • 0

I have a TCP server that listens for an incoming client, then sends it one packet of data every second. I was wondering, does the SYN/ACK packet only get sent on initial connection, so it looks like this:

<client connect>
SYN
ACK
DATA
DATA
DATA
<client disconnect>

Or does it get sent with every packet, like this?

<client connect>
SYN
ACK
DATA

SYN
ACK
DATA

SYN
ACK
DATA
<client disconnect>

Also, if it’s the first case, are there any benefits of UDP over TCP if you just keep the connection open over a long period of time?

  • 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-16T15:00:27+00:00Added an answer on May 16, 2026 at 3:00 pm

    It’s kinda like:

    +-------------------------------------------------------+
    |     client           network            server        |
    +-----------------+                +--------------------|
    |    (connect)    | ---- SYN ----> |                    |
    |                 | <-- SYN,ACK -- |     (accepted)     |
    |   (connected)   | ---- ACK ----> |                    |
    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    
    when client sends...
    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    |                 |                |                    |
    |     (send)      | ---- data ---> |                    |
    |                 | <---- ACK ---- |  (data received)   |
    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    
    when server sends...
    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    |                 |                |                    |
    |                 | <--- data ---- |       (send)       |
    | (data received) | ---- ACK ----> |                    |
    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    
    ...and so on, til the connection is shut down or reset
    

    SYN starts a connection; you’ll usually only see it when the connection’s being established. But all data being sent via TCP requires an ACK. Every byte sent must be accounted for, or it will be retransmitted (or the connection reset (closed), in severe cases).

    Actual connections aren’t usually exactly like the diagram above, though, for two reasons:

    • ACKs can build up, so one ACK can acknowledge everything received up to that point. That means you can acknowledge two or more sends with one ACK.
    • An ACK is simply a flag and field in a TCP header. Sending one requires at least a header’s worth of bandwidth, plus whatever the lower layers tack on. But data segments already include all that…so if you’re sending data, you can send an ACK at the same time for free.

    Most TCP/IP stacks try to reduce the number of naked ACKs without unduly risking retransmission or a connection reset. So a conversation like this one is quite possible:

    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    |                 |                |                    |
    |                 | <--- data ---- |       (send)       |
    | (data received) |                |                    |
    |     (send)      | -- data,ACK -> |                    |
    |                 |                |  (data received)   |
    |                 | <- data,ACK -- |       (send)       |
    | (data received) |                |                    |
    |  (wait a bit)   | <--- data ---- |       (send)       |
    | (data received) |                |                    |
    |     (send)      | -- data,ACK -> |                    |
    |                 |                |  (data received)   |
    |     (send)      | ---- data ---> |   (wait a bit)     |
    |                 |                |  (data received)   |
    |                 | <- data,ACK -- |       (send)       |
    | (data received) |                |                    |
    |  (wait a bit)   |   (dead air)   |                    |
    |                 | ---- ACK ----> |                    |
    \_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/
    

    As for UDP, there’s no built-in concept of SYN and ACK — UDP is by nature “unreliable”, and not connection-oriented, so the concepts don’t apply as much. Your acknowledgement will usually just be the server’s response. But some application-layer protocols built on top of UDP will have some protocol-specific way of acknowledging data sent and received.

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

Sidebar

Related Questions

No related questions found

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.