Questions tagged [tcp]

The Transport Control Protocol (TCP) is a low-level part of the protocol stack used by the Internet. It sits directly above the IP layer and is responsible for making sure that dropped packets are resent.

142 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
744 views

Using socat to Tunnel/Proxy TCP want to split send/receive into separate files

I'm using socat to dump plain TCP (e.g. HTTP) traffic: socat -v tcp-listen:$PORT,reuseaddr,fork,keepalive tcp:$TARGET_HOST:$TARGET_PORT At the moment all send and receive traffic is dumped into ...
4
votes
0answers
105 views

Does Linux kernel allocate free TCP port based on IP address?

This is a hypothetical question, just to help me understand more about how TCP ports work. Suppose I have multiple Ethernet cards on my machine and they are attached to different subnets. Now if I ...
4
votes
2answers
3k views

lsof shows protocol: TCP

I ran sudo lsof -p $(pidof foo) and I got a lot of these. Does anyone know what these represent? I know they come from the process but there are no ports / IP addresses. COMMAND PID USER FD ...
4
votes
0answers
1k views

Socat open TCP only when PTY opened

I am trying to link a virtual PTY with a remote device which accepts TCP connections on port 23. The opening and closing of the socket on the target device is a significant event and part of the ...
4
votes
0answers
476 views

How do I get Consul to work so I can get Docker Overlay to work?

I am running CentOS 7 with Docker. I am trying to install Consul on the Docker server. Consul is unzipped. The binary file works for showing the version. I ran this: echo $CONSUL_RPC_ADDR This ...
4
votes
0answers
1k views

graph TCP connection performance based on `ss -i`

A nearby question has brought to my attention the ss utility on Linux, another utility to investigate sockets. It would appear that it may be a great tool to monitor the performance of, say, an ssh ...
3
votes
0answers
270 views

TCP Stack tuning,(TIME_WAIT) - python process ignores sysctl setting?

I'm playing around with tuning various tcp settings for high number of outgoing client connections. I've put following in my /etc/sysctl.conf on Ubuntu 16.04. net.ipv4.ip_local_port_range = 18000 ...
3
votes
0answers
569 views

Is there a way to simulate a socket stuck in CLOSE_WAIT or FIN_WAIT2?

I have a problem that I am trying to hack around where I have lots of local port forwards getting sockets stuck in CLOSE_WAIT and lots of remote port forwards getting sockets stuck in FIN_WAIT2. ...
3
votes
0answers
522 views

why does nmap shows same ports sometimes as filtered and sometimes as closed?

When I'm scanning port range 4050-4060 of an smart metering device all ports are reported as closed: root@abc:~/rvm/dlms# nmap -p 4050-4060 192.168.1.242 Starting Nmap 6.47 ( http://nmap.org ) at ...
3
votes
0answers
450 views

Netid in ss output is confusing

I'm on an Ubuntu 14.04 x64 machine. I have something running on port 51236 and I want to know whether it's TCP or UDP. So I ran ss -an | grep 51236 and got the following output. tcp ESTAB 0 ...
3
votes
2answers
283 views

Binding two incoming TCP connections

I have a client to connect multiple devices. For not paying monthly static IP fee per device. We plan to change the architecture. In this new architecture devices connect to a server. Instead of ...
3
votes
0answers
836 views

why do I have so many open socket handlers and netstat DGRAM entries?

I run on a RPi (Raspbian 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux) a daemon in Python 2.7.8 which queries various APIs via requests and provides itself an API for another ...
3
votes
0answers
2k views

telnet connection closes

I am running hdfs in one machine. I am trying to write into hdfs from my second machine. I got connection refused error and got this link in the error itself: http://wiki.apache.org/hadoop/...
3
votes
1answer
600 views

Why are these connections not classified as “established” under conntrack?

I have the following rule for iptables: -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT such that outgoing connections not classified as established will be logged. Occasionally, the firewall ...
3
votes
1answer
428 views

Force application to use specific port on Fedora machine

I have an application on my fedora machine that sends SIP TCP requests to the server. The application chooses a random source port to send the requests. Is there some way I can force the application ...
3
votes
0answers
1k views

Rsync - Corrupted MAC on input

Background I have a script on my NAS which is a Synology DS212J which is running on a special distro where uname -a gives me Linux DS212J 2.6.32.12 #4493 Wed Jul 16 11:37:16 CST 2014 armv5tel GNU/...
3
votes
1answer
184 views

detect process that executes portscans

I have to administer an ubuntu 12.04 server, where there seem to go portscans to the whole subnet. How can I find out the process that does the scans? pstree init─┬─acpid ├─apache2───14*[apache2]...
2
votes
0answers
74 views

How many times is the data packet copied before finally reaching the NIC?

On a typical linux machine, how many times would packets be copied from the application layer to all the way in its journey to the network card. I am assuming the protocol being used here is TCP/IP ...
2
votes
0answers
589 views

Send response based on netcat client request

I am trying to create a socket where the client receives a response based on their request, but I can not figure out how to achieve this on CentOS 7. Until now I have the socket opened on port 100 ...
2
votes
0answers
608 views

Use tcpdump to capture TCP transmitted data withouth the protocol's details (similar to tcpflow)

I use tcpflow a lot to capture data transmitted as part of TCP connections. It allows you to see the transmitted data without any of the TCP protocol details. Is there a way to accomplish the same ...
2
votes
0answers
645 views

TCP stack tuning

I have a couple Oracle Linux 6 systems acting as rsyslogd remote receivers. I'm pretty much certain the TCP stack is overloaded, and I've been trying to tune it. But, I'm at the end of my Google ...
2
votes
1answer
100 views

Why I don't see drops with TCP flows in linux

I wanted to observe the congestion window of a TCP flow so for that I have two nodes (using linux namespaces) connected to each other through veth pairs and a bridge. To limit bandwitdh to 10mbps I ...
2
votes
0answers
858 views

Why doesn't netstat show me some ports?

When port-scanning my computer with another machine, I find three open ports: Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-08 22:14 CEST Nmap scan report for laptop.local (192.168.11.103) Host ...
2
votes
0answers
3k views

Socat- No buffering

I am using a TP-Link router TL-WR710N with OpenWRT as an IPv4-to-IPv6 translater/gateway with the following socat-command: socat TCP4-LISTEN:80,fork,su=nobody TCP6:[xx:xx:xx::xx]:80 On the IPv4-...
2
votes
1answer
421 views

Get amount of fast retransmissions from TCP Info

I'm trying to fetch the amount of fast retransmissions from the TCP Info struct. As there is multiple different variables that seem to hold retransmissions, I'm unsure which holds the amount of fast ...
2
votes
0answers
272 views

Why am I unable to prioritize TCP traffic using ToS fields?

I am trying to prioritize TCP traffic using ToS field in IP header. I am saturating the interface(ethernet) by sending 1GB data through iperf with ToS field set to 0x10 (Minimize-Delay). I then start ...
2
votes
0answers
249 views

Out of order Packet Reassembly for dnat rule using iptables

We all know that packet reassembly only occurs at the destination or in between hops(when security devices need to inspect packet for threat detection or for signature macthing). Consider a scenario ...
2
votes
0answers
705 views

Socat exec script in tunnel

I am running a tunnel like this: socat TCP-LISTEN:9090,fork TCP:192.168.1.3:9090 I would like to run a script to execute code with the strings passing through the tunnel. The script does not change ...
2
votes
0answers
73 views

Are source IPs included in Linux's Ephemeral Port Uniqueness?

From http://aleccolocco.blogspot.com/2008/11/ephemeral-ports-problem-and-solution.html (2008) Linux shares the assigned list of ephemeral ports across all local IPs for unconnected sockets. Has ...
2
votes
0answers
637 views

Why would all our CLOSE_WAIT connections have 24 bytes in the receive queue?

We have an Apache reverse proxy that is having connectivity issues with the back-end. This results in timeout errors such as this: [Thu Apr 21 12:12:26.031207 2016] [proxy_http:error] [pid 64620:tid ...
2
votes
0answers
2k views

What does an inode for a socket contain?

I read somewhere that the inode for a TCP socket would contain the buffer space. Is that true, and if so, does it mean that the inode contains a memory address for the buffer space used by the socket,...
2
votes
0answers
285 views

How much of Linux's recent TCP bufferbloat remediation also applies to SCTP?

I am looking at rebuilding an existing communications sub-system within a shared-nothing cluster. The current message protocol is built on UDP but layers on reliable, in-order delivery and connections....
2
votes
0answers
188 views

TCP, UDP, etc. works, HTTP(S) does not

I have been trying to set up Debian Jessie on an old Dell Inspiron 300m. Right now the problem I have is, the ethernet connection only works partially. ICMP works. I can ping IPs and FQDNs. UDP works....
2
votes
0answers
1k views

How do I find out how long a socket is in CLOSE_WAIT?

I have a server relatively with a high number of sockets in CLOSE_WAIT I want to know the age of each socket, to know if it's a real problem (sockets not getting closed) or that the sockets are ...
2
votes
1answer
534 views

Capturing data from a Fluke 1620a via Bash /dev/tcp file descriptor

I am currently trying to develop a script that will connect to a Fluke DewK 1620a Themo-Hygrometer and pull the current temperature and humidity readings from the device. While these devices have a ...
2
votes
0answers
330 views

Exclude a loopback interface or address from processes listening on the “any” address

I'm trying to create a setup where I can connect to some service running on a host only reachable through a SOCKS proxy by the host's actual name and the port the service actually uses (so that ...
2
votes
1answer
4k views

tcpdump not capturing http or tcp/ssl traffic

I have been trying to learn tcpdump and I am using this command to attempt to monitor my network: sudo tcpdump -I -i en1 But this gives me a bunch of stuff I don't want, so I used this version to ...
2
votes
0answers
158 views

Why isn't hydra being disconnected?

I have SSHD running on port 5800 on some machine. (It is a my machine at home.) If I run this manually in a terminal: # ssh someIP -p 5800 The connection is lost because I am disconnected after 3 ...
1
vote
0answers
18 views

Network bandwidth aggregation

Lets say I have access to two different networks: A and B. My device has two different network interfaces N1 and N2. A has a bandwidth of 5 mbps B has a bandwidth of 3 mbps I want to combine these two ...
1
vote
0answers
19 views

Tunnelling TCP to database (ms-Sql) through corporate proxy

What I know. I have a ms sql in Internet, let say hostDB:1433 I have a corporate proxy ipProxy:8080 /bin/nc -z -v -w 1 -x ipProxy:8080 -X connect hostDB 1433 Connection to hostDB 1433 port [tcp/ms-...
1
vote
0answers
40 views

Receive data on a udp port and forward the same on a tcp port

I'm not sure whether this is even possible, but I want to receive some data over UDP port (say 14550) and forward it to a newly opened TCP port (say 50000). I have tried socat as of now but no success:...
1
vote
0answers
47 views

Will delayed-ack acknowledge more than two packets at once time?

Delayed ack is used in Linux TCP implementation to reduce the number of pure ack packets by waiting for a while and aggregating the data received by receiver into a single ack packet. According to ...
1
vote
0answers
227 views

TCP Dup ACKs without packet loss

I have a sender on IP 192.168.2.250 running some embedded RTOS and a receiver running Linux 4.9.x on IP 192.168.2.1 The receiver is configured as a Wireless AccessPoint and the sender is directly ...
1
vote
0answers
274 views

retransmissions/out-of-order packets with large (~1 MB) writes/reads w/ TCP (SOCK_STREAM) over localhost loopback — ACK lost

I'm seeing retransmissions/out-of-order packets when using the loopback interface and have been googling for days to try to determine if I should be surprised by this (which I am) or if anyone else is ...
1
vote
0answers
151 views

How to initiate hping3 with sack (selective ack) option in TCP options

I have a scenario on Linux machine, where I wanted to see if tcp-mss set with lowest value possible (say 48 bytes) along with the sack (selective ack option) of TCP header. On my Ubuntu client, cat /...
1
vote
0answers
287 views

kernel TCP/IP implementation - about accept queue

I'm recently learning the TCP/IP implementation in linux kernel(version 4.4), and got really confused about the accept queue. I know there is a queue in struct inet_connection_sock which is called a ...
1
vote
0answers
1k views

Understanding how MobaXterm keeps an ssh connection alive

I want to have a stable ssh connection to a server where I do things. That would last for days or weeks. In general, one can set TCP keepalive to more than 7200 seconds: Socket reset by peer ever 2 ...
1
vote
0answers
288 views

Total socket count steadily increasing, tcp/udp sockets steady. Why?

I have a server (Ubuntu 16.04.5) running sockets.io and a few other things. This server is running about 5 or 6 different python apps and sockets.io. When the server reaches this level of ~6144 ...
1
vote
0answers
88 views

Is is possible to disable TCP timestamping per-connection?

I am writing simple TCP/IP client (in python, later perhaps using ASIO or Qt) for an embedded system which rejects connections when the first SYN packet uses TCP timestamps. I can make it working by ...
1
vote
0answers
85 views

What's blocking this connect() from a Windows 10 box to an older SuSE on a WiFi LAN?

I have two laptops: a Windows 10 box and a SuSE Linux box (2011-02-21 build of 2.6.37). They're on a wireless LAN and both browsing the internet via the same hub. Yet TCP doesn't work between them. ...