49 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 ...
DavidPostill's user avatar
  • 157k
48 votes
Accepted

Accessing 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. ...
harrymc's user avatar
  • 481k
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 ...
u1686_grawity's user avatar
29 votes
Accepted

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 ...
u1686_grawity's user avatar
26 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 ...
DavidPostill's user avatar
  • 157k
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 ...
Victor Marchuk's user avatar
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 ...
u1686_grawity's user avatar
14 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 ...
mixel's user avatar
  • 471
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 ...
Jason Nelson's user avatar
14 votes
Accepted

Send TCP packets with Curl

You can send raw text with curl to any host:port as netcat would do, using the telnet protocol: curl telnet://192.168.0.170:59403 <<< someText
xtian's user avatar
  • 266
13 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 ...
Spiff's user avatar
  • 104k
13 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 ...
Spiff's user avatar
  • 104k
10 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 ...
MariusMatutiae's user avatar
9 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 "...
KCD's user avatar
  • 500
9 votes

Open a test TCP connection to a specified IP/Port

Late answer, but still a good one: PowerShell v3 Test-NetConnection google.com -Port 80 Will actually perform a TCP test and provide results: TcpTestSucceeded : True I do need to note that ...
Unknown Variable's user avatar
9 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. ...
Damiano Verzulli's user avatar
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 ...
Kamil Maciorowski's user avatar
9 votes
Accepted

Iptables Fail to block inbound from specific ip

A packet being routed rather than received by a local process traverses the filter/FORWARD chain and not the filter/INPUT chain, even if this is caused by the use of NAT. So the current blocking rules ...
A.B's user avatar
  • 5,936
8 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 ...
Sufiyan Ghori's user avatar
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 ...
poige's user avatar
  • 419
8 votes
Accepted

Windows 10 loss of TCP connectivity

EventID 4227 seems related to too many outstanding TCP connections. Not an answer, but the following first steps are too long for a comment: Run sfc /scannow In Device Manager delete the network ...
harrymc's user avatar
  • 481k
8 votes
Accepted

Do socket and buffer mean the same thing?

A socket is a broader concept than a buffer. A socket has two buffers and some other information associated with it. In the context of sockets programming, a socket is your app's interface to one TCP ...
Spiff's user avatar
  • 104k
8 votes
Accepted

What prevents unsolicited internet packets from using up my monthly data limit?

My home router can use port-forwarding to act as a server, so I assume all internet packets sent with my public IP address as a destination are hitting it (and just not getting any response from my ...
u1686_grawity's user avatar
6 votes

How to check the TCP congestion control algorithm flavour in Ubuntu

Adding to @grawity answer, it is possible to check all TCP congestion control algorithms available with the following command: sysctl net.ipv4.tcp_available_congestion_control A list of some of the ...
Guy Avraham's user avatar
6 votes
Accepted

How does TCP handle multiple requests targeted to one port?

TCP doesn't really define what a "request" looks like; as a transport protocol it only provides a duplex data stream (no different from data transfer over a serial port) and leaves it up to the ...
u1686_grawity's user avatar
6 votes

What does TCP packet [P.] flag means in tcpdump's output?

What exactly this [P.] Flag It is a PUSH flag. Tcpflags are some combination of S (SYN), F (FIN), P (PUSH), R (RST), U (URG), W (ECN CWR), E (ECN-Echo) or `.' (ACK), or `none' if no flags are set. ...
DavidPostill's user avatar
  • 157k
6 votes
Accepted

Capture only TCP SYN-ACK packets with tcpdump

Based on looking at the pcap-filter man page and especially the examples at the end I would suggest that the correct filter syntax to match packets which have at least both SYN and ACK are set would ...
Steffen Ullrich's user avatar
6 votes

Why don't we have a usable IP address in 127.0.0.0?

In the IPv4 specifications, the lowest address in any IPv4 network is reserved as the network address which has a distinct purpose from the broadcast address which is normally the highest address in ...
penguin359's user avatar
5 votes

What is the difference between :::: and 0.0.0.0 from the netstat -an output?

:: and 0.0.0.0 have the same meaning but in completely different context. They are not the same. At the server side both are used to denote "no particular address" if you binding processes (not ...
Gote Guru's user avatar
  • 161
5 votes

can TCP client use the same port to connec to different remote TCP servers?

To answer this question we may need to differentiate between TCP, the API-agnostic protocol, and BSD Sockets, the most well-known and widely-adopted API by which apps access the features of their OSes'...
Spiff's user avatar
  • 104k

Only top scored, non community-wiki answers of a minimum length are eligible