66
votes
Accepted
What happens to TCP connections when I remove the ethernet cable?
By definition on a layered model as OSI or TCP/IP each layer works independent and not-aware of the lower layers.
When you remove the cable, it's a physical disruption (layer 1), so almost ...
- 16.9k
44
votes
Accepted
How are source ports determined and how can I force it to use a specific port
How are local ports determined
The port number is chosen by the TCP implementation software from a range of port numbers called Ephemeral Ports.
The exact mechanism for choosing the port number and ...
- 149k
34
votes
Why don't we have a usable IP address in 127.0.0.0?
In IPv4, the first address of a subnet is reserved for...unclear reasons, really, but most likely because very long ago it used to be the "broadcast" address. (Later, the last address became ...
- 401k
29
votes
Is it possible to force TCP to find another path to the host?
Is it possible that the route is somehow cached? If so, is it possible to reset this cache?
No, only the first hop (i.e. the route to your local gateway) is under control of the OS, but you have no ...
- 401k
28
votes
Accepted
how to access windows localhost from wsl2?
localhost doesn't work because WSL2 is running with a virtual network
(vNIC) created by the Windows Virtual Machine Platform (a subset of Hyper-V). Inside WSL2, localhost is the address of the vNIC.
...
- 431k
26
votes
Accepted
Must TCP use IP?
TCP and IP (v4 & v6) are definitely separable, and one does not imply the other, as proved by the example of TCP over IPX (RFC 1791).
However, TCP cannot be built over just any network protocol. ...
- 421
25
votes
Is an ACK necessary when using reliable protocols like TCP? How much overhead / throughput penalty does it create?
Is an ACK necessary when using reliable protocols like TCP?
Yes. the ACKs are the mechanism that makes TCP a reliable protocol.
If ACKs were removed from the protocol, then TCP would no longer know if ...
- 149k
21
votes
Accepted
Why ICMP is different that TCP and UDP?
ICMP is a control protocol, meaning that it designed to not carry application data, but rather information about the status of the network itself. The best known example of ICMP in practice is the ...
- 787
20
votes
Accepted
What ports are used by an application
You can use netstat for this. See the example (I grepped for ssh):
netstat -putan | grep ssh
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1725/sshd
tcp 0 ...
- 4,114
19
votes
Accepted
Does the sequence number of TCP packet headers wrap around?
It wraps around going to 0. According to RFC 793:
It is essential to remember that the actual sequence number space is
finite, though very large. This space ranges from 0 to 2**32 - 1.
...
- 16.9k
18
votes
Does the sequence number of TCP packet headers wrap around?
Does the sequence number wrap around and become 0?
Yes. All the details can be found in the TCP Specification RFC 793 - Transmission Control Protocol.
Sequence Numbers
It is essential to remember ...
- 149k
16
votes
Accepted
ICMP packet with TCP?
According to the ICMP message type (3 "Destination Unreachable"), these are not monitoring but error packets (which is the most common use of ICMP). They do not use TCP, but they were caused ...
- 401k
15
votes
Accepted
OpenVPN working with TCP not with UDP
These particular symptoms (with a VPN) are fairly common symptoms indicating an issue with your path MTU.
MTU basics
The path MTU (Maximum transmission unit) is the largest packet that can traverse ...
- 6,553
14
votes
what is TCP Half Open Connection and TCP half closed connection
The other guys did a fairly decent job of describing what half-open and half-closed connections actually are, but the idea of half-open connections is also often searched for in the context of a them ...
- 241
12
votes
Accepted
Why is the TCP MSS (Maximum Segment Size) 1460 bytes?
1460 is not the maximum MSS. The MSS is calculated as the MTU minus the IP and TCP header sizes. On networks with higher path MTUs than 1500 (example: data center networks that use nonstandard 6k or ...
- 99.3k
11
votes
Open a test TCP connection to a specified IP/Port
pkgmgr is now replaced by dism.
Install telnet from command line (run it as administrator):
dism /online /Enable-Feature /FeatureName:TelnetClient
Then you can test TCP connection by:
telnet ...
- 431
10
votes
Accepted
If HTTP runs on a port, does that mean TCP can also run on that port?
TCP and HTTP are different things.
TCP is the transport layer. By definition, it's responsible for carrying application layer protocols (HTTP in your case) over it. TCP does not run over a port. ...
- 13.5k
10
votes
Accepted
Practical (vs theoretical) max limit of TCP packet size
Ethernet has always been influential on TCP/IP packet sizes. Ethernet has a standard MTU of 1500 bytes, which, after typical IPv4 header overhead of 20 bytes and typical modern TCP header overhead of ...
- 99.3k
9
votes
How are source ports determined and how can I force it to use a specific port
David Postill's answer is perfectly right. I would like just to add to it, by stressing that changing the ephemeral port range in Linux is so simple, that the OP has an affirmative answer.
You ...
- 46.4k
9
votes
How to send binary data in netcat to an already established connection?
Note: while following this solution, type commands in a single shell session (or use a single script) unless said otherwise. This is because it uses variables and file descriptors, they are not ...
- 64.8k
8
votes
How can I see 127.0.0.1 traffic on Windows using Wireshark?
To keep this current, as hsluoyz said, install npcap
http://wiki.wireshark.org/CaptureSetup/Loopback
When installed on Windows Vista or later (including Win7, Win8 and
Win10) with option "...
- 480
8
votes
Get the current/default value of TCP initcwnd on Linux
Well, I can't say I'm 100 % sure this should be the answer, buuut, as it often comes, ss is the good choice to get some info revealed, for e. g.:
ss -nli|fgrep cwnd
westwood rto:1000 mss:536 ...
- 399
8
votes
Redirect serial com to tcp port
I think socat has the functionality you are looking for as well.
$ socat TCP-LISTEN:4161,fork,reuseaddr FILE:/dev/ttyUSB0,b57600,raw
- 201
8
votes
Why do computers have 65,535 TCP ports?
"Why do computers have 65535 TCP ports?"
Computers do not have ports. The concept of "ports" to which you're referring is strictly related to the TCP and UDP protocols of the TCP/IP networking stack. ...
- 446
7
votes
Accepted
Localhost tcp throughput performance differences
I believe that the reason that the PowerPC on Windows 7 is much faster on localhost
loopback throughput, is because it can use NetDMA.
The Microsoft article NetDMA (Windows Drivers) defines NetDMA as ...
- 431k
7
votes
What ports are used by an application
Another tool that can do this is lsof:
# lsof -i -a -p 1981
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 1981 root 3u IPv4 917 0t0 TCP host.example.com:ssh (LISTEN)
# ...
- 1,697
7
votes
Does the sequence number of TCP packet headers wrap around?
Yes, it does wrap around. You can read it on Wikipedia or on RFC1323, which shows how to protect against wrapped sequence numbers.
Let me quote:
TCP timestamps are used in an algorithm known as ...
- 46.4k
7
votes
Accepted
How to check the TCP congestion control algorithm flavour in Ubuntu
There aren't TCP variants; there are TCP congestion control algorithms:
sysctl net.ipv4.tcp_congestion_control
cat /proc/sys/net/ipv4/tcp_congestion_control
The default is usually cubic or reno, ...
- 401k
6
votes
Why is my UDP so slow?
As Nick answered, iPerf uses a default of 1Mbit/sec for UDP.
In order to use the same bandwidth as TCP while performing a UDP test, simply provide -b flag with the value of 0.
iperf3 --udp -b 0 -f ...
- 342
6
votes
If HTTP runs on a port, does that mean TCP can also run on that port?
If I understand your question correctly, I might rephrase it as, "If the network infrastructure allows HTTP traffic to pass on a certain port, will it also allow pure TCP (without full HTTP-compliant ...
- 99.3k
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tcp × 859networking × 447
linux × 147
udp × 83
windows × 61
ip × 56
wireshark × 52
tcpip × 51
port × 49
sockets × 49
windows-7 × 37
http × 36
router × 35
iptables × 34
windows-10 × 31
firewall × 30
netstat × 23
tcpdump × 23
vpn × 22
dns × 22
ubuntu × 21
internet × 21
ssh × 19
nat × 19
packet × 19