Questions tagged [tcp]

Transmission Control Protocol (TCP) is a transport layer protocol that provides a connection-oriented data stream service with delivery that is guaranteed to be in-order.

Transmission Control Protocol (TCP) is a transport layer protocol that provides a connection-oriented data stream service with delivery that is guaranteed to be in-order on top of the underlying packet-oriented, unreliable IP layer. TCP is referred to as a connection-oriented protocol. This is opposed to UDP, which offers a relatively bare-bones unreliable all-or-nothing delivery of discrete packets and is referred to as a connection-less protocol.

How TCP fits into Internet protocol suite layers (going top to bottom):

  • Application: Encrypts data to be sent or sends data in a specific format (e.g. TLS or HTTPS)
  • Transport: Splits the data into segments and adds a TCP header to each (creating a TCP segment)
  • Internet: Encapsulates each segment (and splits if necessary) into IP packets (with source and destination IP address)
  • Link: Encapsulates each packet (and splits if necessary) and adds physical address (MAC)

The basic definition of TCP is given in RFC 793. There is more information at the Wikipedia article on TCP.

23633 questions
5
votes
0 answers

Proxy via user space socket not functioning as expected

In an attempt to get some insights into the Kubernetes networking model, I started following this doc. I am trying to intercept the packets to a SERVICE_IP from the userspace by writing this code(from the blog shared above). func main() { …
Always_Beginner
  • 2,546
  • 6
  • 25
  • 33
5
votes
2 answers

How do I check client connection is still alive

I am working on a network programming using epoll. I have a connection list and put every client in the list. I can detect user disconnection by reading 0 if the user disconnected normally. However, if the user somehow got disconnected unexpectedly…
codereviewanskquestions
  • 13,460
  • 29
  • 98
  • 167
5
votes
1 answer

TCP Server sends [ACK] followed by [PSH,ACK]

I am working on a high-performance TCP server, and I see the server not processing fast enough on and off when I pump high traffic using a TCP client. Upon close inspection, I see spikes in "delta time" on the TCP server. And, I see the server…
user2548514
  • 53
  • 1
  • 2
  • 4
5
votes
1 answer

TCP listener cuts message at 1024 bytes

Problem just started on client side. Here is my code where I receive TCP/IP message. On my local PC this listener receives many K no problem. I tried to increase buffer size but on client site they still report issues related to it.. Still get's…
katit
  • 17,375
  • 35
  • 128
  • 256
5
votes
1 answer

Will TCPStream.Read block until ALL data is received in send message?

I've written a multi-threaded simple server that uses: clientStream.Read(message, 0, 4096); To block until the client has sent a message. The code then goes on to process that message. So far I've only been using it to send short commands ex.…
Adrian Seeley
  • 2,262
  • 2
  • 29
  • 37
5
votes
1 answer

How do I reuse connections with curl_easy?

I'm writing code with the curl_easy interface of libcurl, and am having a hard time getting it to reuse connections. Details below. curl --version curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1…
bluesmoon
  • 3,918
  • 3
  • 25
  • 30
5
votes
2 answers

Are TCP/UDP IP packets with a source port below 1024 possible

I am analyzing some events against dns servers running unbound. In the course of this investigation I am running into traffic involving queries to the dns servers that are reported as having in some cases a source port between 1 and 1024. As far as…
JdeHaan
  • 332
  • 6
  • 19
5
votes
3 answers

How to close TCP connection in python locust (requests.session)

I'm doing a load test with python Locust package on an service API that's running on Kubernetes. I saw in the source code that the HttpUser uses requests.session.request() to send the requests. By default requests.session keeps the connection alive…
Xuekai Du
  • 617
  • 1
  • 6
  • 27
5
votes
1 answer

How do I get an asynchronous TCP object stream in C#?

I'm pretty new to serialization so please bear with me. I want two instances of my application to communicate with each other over the internet. I have successfully rigged up a TCP client/server relationship and used a binary formatter to get the…
Neal Ehardt
  • 10,334
  • 9
  • 41
  • 51
5
votes
1 answer

How to send data to a specified connection while using node.js

I am using node.js building a TCP server, just like the example in the doc. The server establishes persistent connections and handle client requests. But I also need to send data to any specified connection, which means this action is not client…
Mickey Shine
  • 12,187
  • 25
  • 96
  • 148
5
votes
4 answers

Sending TCP frames of fixed length

I need to send some data over the subnet with fixed non-standard MTU (for example, 1560) using TCP. All the Ethernet frames transfered through this subnet should be manually padded with 0's, if the frame's length is less than MTU. So, the data size…
Grungegurunge
  • 107
  • 1
  • 4
5
votes
5 answers

How can I measure the performance and TCP RTT of my server code?

I created a basic TCP server that reads incoming binary data in protocol buffer format, and writes a binary msg as response. I would like to benchmark the the roundtrip time. I tried iperf, but could not make it send the same input file multiple…
Ward Bekker
  • 6,316
  • 9
  • 38
  • 61
5
votes
3 answers

Private Application IP routing between two countries

I was asked a question in my oral exams: You are accessing a website whose webserver is located in country A. You are in Country B. You know that the TCP/UDP Packets pass through Country C while travelling from Country B to Country A. How will you…
Arihant Nahata
  • 1,802
  • 2
  • 19
  • 30
5
votes
4 answers

synchronize clocks over internet

I am sending real-time-critical data over the internet between two dedicated computers, using my own protocol. There is, of course, latency involved. For debugging and optimization, I like to have both computers use the same timebase. I.e, I need to…
Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149
5
votes
1 answer

TCP Server using NestJS

Is it possible to create a TCP server using NestJS?? I have a GPS tracker that communicate only with TCP. As NestJS could communicate between microservices with TCP, I thought that maybe NestJS could be used as low level network applications…
flemadap
  • 639
  • 8
  • 18
1 2 3
99
100