Skip to main content
Share Your Experience: Take the 2024 Developer Survey
81 votes
Accepted

Why does DHCP use UDP and not TCP?

DHCP cannot use TCP as the transport protocol because TCP requires both end-points to have unique IP addresses. At the time a host is required to use DHCP, it does not have an IP address it can source ...
Mario Jost's user avatar
  • 1,709
61 votes
Accepted

Does UDP do anything at all?

Interesting perspective and question! Yes, most of what UDP does is supply a standard means for multiple applications to co-exist using the same IP address, by defining the concept of UDP ports. The ...
Jeff Wheeler's user avatar
  • 5,493
48 votes

Does UDP do anything at all?

UDP is a transport protocol, like TCP. That means it provides a protocol for an application to use IP. Like TCP, UDP has addressing (ports) to which applications bind so that datagrams destined to ...
Ron Maupin's user avatar
  • 99.8k
47 votes

Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?

TCP is about as fast as you can make something with its reliability properties. If you only need, say, sequencing and error detection, UDP can be made to serve perfectly well. This is the basis for ...
jonathanjo's user avatar
  • 16.3k
29 votes
Accepted

Why does one say IP fragmentation is bad and to be avoided when in reality data always needs to be fragmented for MTU compatibility?

Fragmentation is resource intensive in a router, and it slows packet forwarding. Today, we use PMTUD to determine the smallest MTU in the path so that packets are properly sized prior to sending. ...
Ron Maupin's user avatar
  • 99.8k
28 votes
Accepted

Why is Packet Size Limited?

Why we don't just send one single packet? why we need to split content into multiple pockets (ignoring size limit). That would just lead back to circuit-switched networks like the original PSTN (...
Ron Maupin's user avatar
  • 99.8k
26 votes

Why does DHCP use UDP and not TCP?

Since the source has no IP address (0.0.0.0) and the destination is everyone (255.255.255.255), it's hard to see how you would identify a particular session. But even if you could, what would be the ...
Ron Trunk's user avatar
  • 67.7k
21 votes

Why does DHCP use UDP and not TCP?

There are multiple reasons why TCP wouldn't work for DHCP(v4.) First of all, TCP is connection-oriented. A TCP connection is defined between two particular hosts. However, when a DHCP client first ...
reirab's user avatar
  • 469
20 votes
Accepted

What does a UDP connection timeout really mean?

While there is no formal "connection" with UDP there is still a convention that clients send requests and expect to get responses back with the source IP and port swapped with the Destinatoin IP and ...
Peter Green's user avatar
  • 13.3k
18 votes

Ping port number?

I'd like to give you an additional answer especially to this part of the question: ... someone says ICMP uses Port 7 Port 7 (both TCP and UDP) is used for the "echo" service. If this service is ...
Martin Rosenau's user avatar
15 votes

Does UDP do anything at all?

I would encourage you to look at how higher level protocols that utilize UDP actually use it. Classic and well documented examples are DNS (in most cases at least, it's possible to do DNS over TCP but ...
Austin Hemmelgarn's user avatar
14 votes
Accepted

How `UDP Hole Punching` Works?

Details vary but basically it goes something like. The two peers both open a UDP socket bound to a random local port The two peers both contact a server on the internet. This server responds and ...
Peter Green's user avatar
  • 13.3k
14 votes

Why maximum length of IP, TCP, UDP packet is not suit?

IP protocol build on Ethernet or something, Why an IP packet can be 65535 bytes when Ethernet can only send 1500 bytes? Ethernet is one of several physical layers which can be used to to transport IP ...
Steffen Ullrich's user avatar
14 votes

Could IPv6 make NAT / port numbers redundant?

IPv6 does not have a NAT standard as IPv4 does (NAT breaks the end-to-end premise of IP, and IPv6 was designed to restore that). There is an experimental RFC for IPv6 NAT, but it is a one-to-one NAT ...
Ron Maupin's user avatar
  • 99.8k
12 votes
Accepted

Can two different applications bind the same port on a host if they use different protocols?

Think of it this way: TCP is one street, UDP is another street, and port numbers are the addresses of the houses (ports) on the streets, just as they are layer-4 addresses. Each street has the same ...
Ron Maupin's user avatar
  • 99.8k
12 votes
Accepted

Does a switch always get a MAC address from a PC?

A switch learns the source MAC from the sender. If the destination is not in the CAM table, the switch floods the frame out all ports. So if the receiver never responds, the switch will never learn ...
Ron Trunk's user avatar
  • 67.7k
12 votes

Why is Packet Size Limited?

In general there are several reasons to limit packet size. A larger packet has a longer transmission duration, which means it ties up the line for longer, increasing jitter for other (potentially ...
Peter Green's user avatar
  • 13.3k
11 votes

What does a UDP connection timeout really mean?

Your firewall is maintaining a connection table for UDP connections. For example, when you send a DNS query, the firewall creates an entry for that flow so that the DNS reply will be allowed back ...
Ron Trunk's user avatar
  • 67.7k
11 votes
Accepted

Traceroute UDP port question

To understand the mechanism, let's see it with an example: I issue a traceroute to 44.12.44.1 from my PC My PC sends 3 UDP datagrams to 44.12.44.1 with TLL=1 and port=33434 Inmediately sends 3 UDP ...
jcbermu's user avatar
  • 4,497
11 votes

Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?

UDP with reliability can indeed be a substitute for TCP. We already have an example of it: it's called QUIC. From Wikipedia: Among other applications, QUIC improves performance of connection-...
Andrea Corbellini's user avatar
10 votes
Accepted

Is rerouting possible in UDP?

This is not the hosts that decide which route a packet will follow, each router in the path make it's own decision. (Actually, the originating host could use the IP strict source option to force the ...
JFL's user avatar
  • 19.7k
10 votes
Accepted

How does UDP NAT Know When To Remove The Rule

A NAT router doesn't know when to remove a UDP mapping - it guesses. The router simply ages (or times) out the entry when it hasn't been used for a period of time (usually between 5 and 60 minutes). ...
Zac67's user avatar
  • 84.9k
9 votes

Could IPv6 make NAT / port numbers redundant?

One drawback is that the upper layers would need to be aware of IP addresses, which sort of violates the layering principle. What would then happen if you switched to IPv4? Or something else? How ...
Ron Trunk's user avatar
  • 67.7k
8 votes
Accepted

When would one use UDP over TCP?

This is a frequently asked question. The answer below is one of the best answers from another site. https://stackoverflow.com/questions/1099672/when-is-it-appropriate-to-use-udp-instead-of-tcp In ...
Joey Miller's user avatar
8 votes
Accepted

What is the transport protocol used in wget?

By default, wget uses HTTP to retrieve files. Which means wget uses TCP/80... unless you specify HTTPS, in which case it uses TCP/443.
Eddie's user avatar
  • 15k
8 votes

Ping port number?

As others have already stated, in general pings are ICMP-based and have no ports. There is, however, such a thing as TCP Ping where, instead of the typical 3-way TCP handshake, only the first 2 steps ...
Jesse P.'s user avatar
  • 4,690
8 votes

Why is a TCP Socket identified by a 4 tuple?

In the UDP protocol, a socket is uniquely identified by the source IP and the source port. In the TCP protocol, the socket is uniquely identified by the source IP, source port, destination IP, and ...
jonathanjo's user avatar
  • 16.3k
8 votes

Why does one say IP fragmentation is bad and to be avoided when in reality data always needs to be fragmented for MTU compatibility?

IP packet level fragmentation occurs when the transmitting side is not properly aware of the MTU of the path. This results in worse performance than if the packets are sized correctly already at the ...
jpa's user avatar
  • 366

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