Flamingo Raises $4.5M Seed Round

Skip to content

TCP vs UDP: the difference for troubleshooting

Technology
IT Operations
Troubleshooting
"Fae" Grace Meadows"Fae" Grace Meadows
October 6, 2026
298 views
TCP vs UDP: the difference for troubleshooting

How TCP differs from UDP for a technician: what each protocol guarantees, the three-way handshake as a diagnostic, TCP ports vs UDP ports, which services use which transport, reading both in netstat and Wireshark, firewall rules and port tests by protocol, and where QUIC fits.


TCP differs from UDP in what it promises: TCP opens a connection with a three-way handshake, numbers every byte, confirms delivery and resends what was lost, while UDP sends each datagram once with an eight-byte header and no connection, ordering or retry. That makes TCP the protocol for web pages, file transfers and email, where every byte has to arrive, and UDP the protocol for DNS lookups, voice and video, where a quick small exchange or on-time delivery matters more than a resend. This guide shows how the difference appears in netstat, Wireshark, a firewall rule and a port test, starting from a VoIP rule that allows port 5060 and still drops calls.

TL;DR

  • The difference. TCP sets up a connection, numbers every byte, confirms delivery and resends what was lost. UDP sends a datagram and forgets it, with no connection, no ordering and no retry.
  • The cost. TCP pays for its guarantees in round trips and in waiting for lost data. UDP pays in silence: when a packet is gone, nothing tells the sender.
  • Who uses which. File transfer, email, web pages and remote shells ride TCP. DNS, VoIP, video, NTP, DHCP and VPN tunnels such as WireGuard and IPsec ride UDP, and DNS, SIP and Remote Desktop use both.
  • For troubleshooting. A TCP problem shows up as a failed handshake or retransmissions. A UDP problem shows up as one-way traffic, a timeout or a firewall that never sees a reply.

What TCP guarantees, and what UDP does not

Both protocols sit on top of IP and do the same basic job: they get data from a program on one machine to a program on another, using port numbers to say which program. What separates them is the list of promises each one makes.

TCP, defined today in RFC 9293, promises a connection. Before any data moves, the two ends agree on starting sequence numbers. Every byte after that is numbered, the receiver acknowledges what arrived, and the sender retransmits anything that is not acknowledged in time. Segments that arrive out of order are put back in order before the application sees them. The receiver also advertises a window, which tells the sender how much it can accept, so a fast server cannot flood a slow client.

UDP, defined in RFC 768, promises almost nothing. The whole header is eight bytes: source port, destination port, length and a checksum. The RFC itself says delivery and duplicate protection are not guaranteed, and that applications needing ordered, reliable delivery should use TCP. On IPv4 the checksum is optional: a zero means the sender did not compute one.

That is the entire difference. Everything else in this post is a consequence of it. TCP is the protocol for data that has to arrive complete, in order, no matter how long that takes. UDP is the protocol for data where waiting for a retransmission is worse than losing the packet, and for anything that wants to build its own rules on top of a blank slate.

PowerCert's animated comparison covers the same ground in five minutes, and it is the one to send a junior tech before the capture review:

The three-way handshake, packet by packet

A TCP connection starts with three packets, and each one tells you something when a connection fails.

The client sends a SYN with its starting sequence number. The server, if it is listening on that port, answers with a SYN-ACK: its own sequence number plus an acknowledgment of the client's. The client replies with an ACK, and both sides are in the ESTABLISHED state. Data can ride on that third packet. RFC 9293 lays the exchange out line by line, and the reason it exists is to stop an old, delayed SYN from opening a connection nobody asked for.

Read the handshake as a diagnostic and three failure shapes appear:

What you seeWhat it means
SYN sent, nothing comes back, SYN repeatsA firewall is dropping it, the route is broken, or the host is down. Nothing at the far end saw the request, or a filter ate the reply.
SYN sent, RST comes backThe host is up and reachable, but nothing is listening on that port. The service is stopped or bound to another address.
SYN, SYN-ACK, ACK, then retransmissionsThe port is open and the path works. The problem is inside the session: packet loss, a stalled application or a middlebox resetting idle flows.

When a connection closes, each side sends a FIN and the side that closed first sits in TIME-WAIT for two maximum segment lifetimes, so late packets from the old connection cannot be mistaken for a new one. That is why a server under heavy short-lived load shows thousands of TIME-WAIT entries in netstat. Those entries are expected, and they clear on their own when the timer runs out.

UDP has none of this. A client sends a datagram to port 53 and either an answer comes back or it does not. There is no state on the wire to inspect, which is why a UDP failure in a capture looks like a request with no reply, and why finding the cause takes a different set of tools.

This r/networking thread is the handshake failure in the wild: SYN goes out, nothing comes back, retries at one, two and four seconds, while UDP and ICMP to the same address work fine. The poster's guess, a stateful device treating TCP differently for certain source prefixes, is the right place to look.

Which services use which, and why

Protocol designers choose TCP or UDP based on one question: is a late packet still useful? For a file, yes. For a voice sample from 400 milliseconds ago, no.

ServiceTransportWhy
HTTP/1.1 and HTTP/2 (80, 443)TCPA web page with missing bytes is a broken page
HTTP/3 (443)UDP, via QUICQUIC rebuilds reliability in user space and avoids TCP's head-of-line blocking
DNS (53)UDP, with TCP fallbackSmall queries fit one datagram; large answers set the truncation bit and the client retries over TCP
SMB file sharing (445), SSH (22), SMTP (25)TCPEvery byte matters
Remote Desktop (3389)TCP and UDPSession control over TCP, graphics over UDP when the path allows it
VoIP: SIP (5060) and RTP mediaUDP for media, SIP on eitherLate audio is worse than lost audio
NTP (123), SNMP (161), syslog (514)UDPOne small datagram per request; a lost poll is retried next cycle
DHCP (67, 68), TFTP (69)UDPNeeded before the host even has a full IP stack to work with
IPsec IKE (500, 4500), WireGuard, OpenVPN defaultUDPA tunnel inside TCP suffers two layers of retransmission when a packet drops

The IANA service registry is where these assignments live, and it lists both transports for a long list of names, including 3389 and 445. For firewall rules, a registration on both transports says nothing about which one the service listens on: SMB listens on TCP 445 only, while Remote Desktop uses both when it can.

The practical rule for a technician is to never assume. A vendor doc that says "open port 5060" is incomplete. Ask which protocol, and if the answer is both, write two rules.

TCP ports vs UDP ports

TCP and UDP each have their own 16-bit port number space, from 0 to 65535, so TCP port 53 and UDP port 53 are two separate endpoints that share a number. RFC 6335 splits both spaces the same way: System Ports from 0 to 1023 and User Ports from 1024 to 49151, both assigned by IANA, and Dynamic Ports from 49152 to 65535, which IANA never assigns.

That also answers whether TCP and UDP can use the same port: they can, at the same time. A DNS server listens on TCP 53 and UDP 53 at once, and netstat -ano shows them as two separate lines because the protocol is part of the endpoint.

The registry lists both transports for older services because, until RFC 6335 was published in 2011, IANA assigned a new port on both TCP and UDP even when the request named only one. A Windows Firewall rule therefore needs the protocol the vendor documents, since the registry entry alone can't tell you, and a web server that offers HTTP/3 on the default port needs both TCP 443 and UDP 443 open.

Why "faster" is the wrong question

Ask whether UDP is faster than TCP and the answer is yes, no and it depends, which is why the question is unhelpful. The useful version is: what does each protocol do when a packet is lost?

TCP waits. The receiver holds everything after the gap until the missing segment is retransmitted, and the application sees nothing in the meantime. That is head-of-line blocking, and on a lossy link it turns a 1% loss rate into visible stalls. TCP also starts slow by design: congestion control ramps up the sending rate and backs off on loss, which is what keeps a shared link usable but makes TCP look sluggish on a short transfer.

UDP does not wait, because it does not know. The lost packet is gone, the next one is delivered the moment it arrives, and the application decides what to do about the hole. A VoIP codec conceals a missing 20 millisecond sample. A game interpolates a missing position update. A DNS resolver resends the query after a timeout.

So UDP has less overhead: no handshake before the first byte, no acknowledgments, an eight-byte header instead of twenty or more. On a clean network the two feel the same for bulk data, because TCP's extra packets are small. On a lossy network UDP stays smooth while TCP stutters, and the price is that UDP delivered less of the data. A more accurate label for that trade is "timing over completeness".

Where this bites in practice is the VPN tunnel. Running a tunnel over TCP means the inner TCP sessions and the outer TCP session both detect loss and both retransmit, and the two timers fight. That is why OpenVPN defaults to UDP and WireGuard supports nothing else, and why a VPN that was switched to TCP 443 to get through a hotel firewall feels slow even on a good connection.

Reading TCP and UDP in netstat and Wireshark

The first tool on a Windows box is netstat. netstat -ano lists every TCP connection with its state, and every UDP endpoint with no state at all, because there is none to show. A TCP line reads ESTABLISHED, LISTENING, TIME_WAIT or SYN_SENT. A UDP line reads an address and a port, and nothing else. The PowerShell equivalents are Get-NetTCPConnection, which filters by state, and Get-NetUDPEndpoint, which cannot, for the same reason. Our list of useful PowerShell commands has both sorted by the ticket you are on.

A SYN_SENT line that never changes is the netstat view of a dropped SYN. A LISTENING line that is bound to 127.0.0.1 instead of 0.0.0.0 is the netstat view of a service that answers locally and refuses everyone else.

In Wireshark, the handshake is the first thing to filter for. tcp.flags.syn == 1 && tcp.flags.ack == 0 shows every connection attempt; add tcp.flags.reset == 1 to see which ones the far end refused. Wireshark's TCP analysis marks a segment as a retransmission when the sequence number is behind what it expected and the segment carries data or a SYN or FIN, and it marks duplicate ACKs and zero-window conditions the same way. Those flags, filtered with tcp.analysis.flags, turn a 50,000 packet capture into the 40 packets that matter.

UDP gives Wireshark less to work with. There is no sequence number to compare, so the capture cannot tell you a datagram was lost. What it can show is asymmetry: requests to a port with no replies, or replies arriving from a different port than the request went to, which is how NAT and firewall problems can look. For DNS, the resolver's own timeout can be the only error you get, and our guide to a DNS server not responding walks through that case.

A quick way to remember the two views: TCP problems leave a trail, UDP problems leave a gap.

The protocol is part of the firewall rule

A firewall rule names a protocol and a port, such as "UDP port 5060" or "TCP port 5060", and a rule written for the wrong one matches nothing. The Windows firewall makes this explicit: New-NetFirewallRule takes a -Protocol parameter alongside -LocalPort, and a rule with the protocol left out applies to any protocol, which opens more than the vendor asked for.

The second trap is state. A stateful firewall tracks TCP connections precisely, because the handshake and the flags tell it exactly when a session starts and ends. For UDP it has to guess: it records the outbound datagram and allows replies for a short window, then forgets. A SIP registration that goes quiet for a few minutes can find its return path closed, and the symptom is a phone that makes calls but never rings. The post on stateful firewalls covers that pseudo-state and the timers behind it.

The r/sysadmin thread below is the same lesson from the proxy side: a call-center app that needs UDP for STUN and RTP, behind a web proxy that only speaks TCP, and calls with no audio as the result.

The third trap is testing. Test-NetConnection tests TCP ports only; its port parameter is a TCP port, and Microsoft's reference lists the common values as SMB, HTTP, RDP and WINRM. A green result from it proves nothing about UDP. For UDP use PortQry, which Microsoft documents as reporting LISTENING or FILTERED when a UDP port does not answer, then sends a service-specific probe to tell the two apart. Nmap's -sU scan does the same job from any platform. If you need to confirm the rule works end to end, run the real client.

For inbound rules on a router, the same protocol choice applies to each port forwarding entry: a forward for TCP 3389 leaves the UDP half of Remote Desktop on the outside, and the session falls back to TCP alone, which works but drops the smoother transport.

One line for fleet work: Flamingo, which publishes this guide, builds OpenFrame, open, AI-native infrastructure for IT and security that can run a Get-NetTCPConnection and Get-NetUDPEndpoint export as a script across a client's devices and collect the output, at $1 per device a month with a 14-day free trial. A listening-port inventory then doesn't need a remote session to each box.

QUIC adds TCP's guarantees back on top of UDP

QUIC, published as RFC 9000 in May 2021, carries web traffic that uses neither TCP nor plain UDP. It is a transport that runs inside UDP datagrams and rebuilds the things TCP provides: reliable delivery, ordering within a stream, flow control and congestion control. It adds what TCP cannot easily do: multiple independent streams in one connection, so one lost packet stalls one stream rather than all of them, and TLS built into the handshake, so a connection and its encryption come up in fewer round trips. HTTP/3 is HTTP carried over QUIC.

For a technician, QUIC changes two assumptions. First, UDP 443 is now ordinary web traffic. Second, a firewall that blocks UDP 443 does not break browsing, because every major browser falls back to HTTP/2 over TCP, but it does move that traffic onto the path your inspection rules were written for. Blocking UDP 443 on purpose for that reason is a valid policy. Either way, write the choice down so it doesn't survive as a leftover rule nobody remembers.

The pattern QUIC follows is the one to remember when a vendor says its product "uses UDP for speed". UDP adds an eight-byte header and nothing else, so anything that needs reliability has to build it, and the question for the vendor is what they built.

The short version

TCP numbers, acknowledges, orders and retransmits. UDP sends and forgets. Services pick TCP when every byte matters and UDP when timing matters more, and a few, including DNS and Remote Desktop, use both. In a capture, TCP failures show up in the handshake and the analysis flags, while UDP failures show up as requests with no reply. In a firewall, the protocol is half the rule, and the testing tool has to match it.

If the rule is right and the handshake completes but the session still stalls, the next stop is the network itself. Start with how to check bandwidth usage when the graph looks fine, and work out from there.

"Fae" Grace Meadows

"Fae" Grace Meadows

Lead AI Fairy

Some things defy easy explanation: magic dust, the northern lights… and Flamingo’s AI Angels. Think Charlie’s Angels, reimagined with automation brains and serious RMM (Remote Monitoring & Management) chops. Weird? A little. Effective? Absolutely. That’s the job.

Related Content

Frequently Asked Questions

/blog/tcp-vs-udp

Still deciding?

Ask Mingo answers from our docs and customer stories.

Loading related content and questions