Questions tagged [tcp]

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

Transmission Control Protocol (TCP) is a transport layer protocol that provides a connection-oriented data stream service with guaranteed, in-order delivery 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 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 chunks and adds a TCP header to each (creating a TCP segment)
  • Internet: Encapsulates each segment (and splits if necessary) into IP datagram (with source and destination IP address)
  • Link: Encapsulates each datagram (and splits if necessary) and adds physical address (MAC)

There is more information at the Wikipedia article on TCP.

21130 questions
5
votes
1 answer

Android TCP Connection (Multiple Client)

I use this (Android TCP Connection Enhanced) tutorial to create simple JAVA TCPServer ana Android TCPClient. It works perfect, but with this code i can connect only one device to the server at the same time. What do I have to change to connect with…
WOLVERINE
  • 729
  • 3
  • 12
  • 28
5
votes
1 answer

How to simulate a huge amount of simultaneous requests to a web-server?

I want to see how far my nginx + node.js setup can go and what changes I can make to squeeze out extra performance I've stumbled on a great article detailing some tuning that can be done to the OS to withstand more requests (which I'm not sure I…
dsp_099
  • 5,021
  • 13
  • 59
  • 115
5
votes
2 answers

when is the 'connect' event in nodejs net module emitted?

I have this simple TCP server: var net = require('net'); var server = net.createServer(function (socket) { socket.on('connect', function() { console.log("New client!"); }); }); server.listen(8000, function(){ …
Jatin
  • 13,582
  • 14
  • 46
  • 73
5
votes
2 answers

Fetch source address and port number of packet - Scapy script

I am doing a sniffing of the network and trying to get ip address and port number on every tcp packet. I used scapy with python and could successfully sniff packets and in a callback function could even print the packet summary. But I would want to…
ds345
  • 717
  • 3
  • 7
  • 17
5
votes
4 answers

C#: How do I terminate a socket before Socket.BeginReceive calls back?

I have a server that receives connection requests from clients. This server makes use of the asynchronous Socket.BeginReceive and Socket.EndReceive method. The code is pretty similar to the code found here. In my case, after calling…
Lopper
  • 3,269
  • 7
  • 35
  • 57
5
votes
2 answers

How can I group socket connections by the client application instance they propagated from?

Most recently I have been working on an application that is leveraged by a TCP client-server model (reverse connection). In order to improve the performance of long-running operations, I have made it so that a single instance of the client…
Caster Troy
  • 2,758
  • 2
  • 20
  • 44
5
votes
2 answers

Can you pass a TCP connection from one process to the other?

I am doing some network testing, and I am connecting between linux boxes with 2 small C programs that are just using function: connect() After connection some small calculations are made and recorded to local file, and I instruct one of the…
OBV
  • 1,029
  • 1
  • 9
  • 22
5
votes
1 answer

Perl socket programming problems after continuous write to socket

I am using IO::Socket::INET to create socket like this: $lsn1 = IO::Socket::INET->new( PeerAddr => '192.168.0.2', PeerPort => 1850, Proto => 'tcp', …
user195678
  • 495
  • 3
  • 11
  • 26
5
votes
3 answers

What causes a NullReferenceException in .NET Threading / accepting TCP connections?

In my own webserver software, I am getting entries in the Event Viewer on the server that contain the following stack trace: Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info:…
Timwi
  • 61,190
  • 29
  • 155
  • 224
5
votes
7 answers

How can I verify that a TCP packet has received an ACK in C#?

After sending some tcp data with the blocking/non-blocking methods such as: Socket.Send() or Socket.SendAsync() How can I know that my data has received an ACK message? Can .NET know if TCP data has been successfully sent?
Justin Tanner
  • 13,409
  • 16
  • 75
  • 99
5
votes
2 answers

Deploying a TCP server to Heroku

I have a TCP server coded in node.js. I'd like to put it up on Heroku because it's a free service and I don't need anything more than what their free plan offers. Now, I know very little about the inner workings of Heroku and I'm pretty new to the…
Luka Horvat
  • 3,985
  • 2
  • 24
  • 45
5
votes
2 answers

How do I get the remote IP-Address of clients connecting to a Rebol3 based server?

I'm playing with these basic TCP test scripts and would like to know: "How to get the IP-Address of clients connecting to the server?" Any ideas? I tried to probe a client subport at the server-side, but it doesn't show the remote-ip. Can someone…
TGD
  • 175
  • 1
  • 5
5
votes
1 answer

Multiple Ethernet Interfaces - How to create a separate network and access from C code

I have a Linux device (actually a BeagleBoard for the prototype) with two Ethernet adapters. What I want is this: Primary ethernet interface (eth0) connects to a client's network (may be DHCP or assigned a static IP). Second ethernet interface…
Jeremy
  • 869
  • 1
  • 11
  • 22
5
votes
2 answers

Comparison between HTTP and RPC

RPC protocol uses TCP as an underlying protocol and HTTP again uses TCP as an underlying protocol. So why is HTTP is widely accepted? Why does SOAP use HTTP as an underlying protocol - why not RPC?
Programmer
  • 663
  • 7
  • 22
5
votes
1 answer

Does TCP endpoint that has sent a FIN, still send keepalive?

Sending a FIN is an indication that the end won't send any data. But can it send TCP keepalive? If it can then it contradicts the statement of "sending stuff after FIN" even though it is keepalive but not data. If it doesn't send keepalive, it…
Nikhil
  • 1,982
  • 4
  • 29
  • 46
1 2 3
99
100