Hot answers tagged

80 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,700
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,449
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
  • 98.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.2k
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
  • 98.8k
29 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
  • 98.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.1k
23 votes
Accepted

What do TCP/UDP add to "raw ip"?

IP is a Layer 3 protocol. TCP/UDP are Layer 4 protocols. They each serve different purposes. Layer 3 is in charge of end to end delivery. Its sole function is adding whatever is necessary to a packet ...
Eddie's user avatar
  • 15k
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.2k
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.2k
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
  • 98.8k
13 votes
Accepted

How to know whether a protocol uses TCP or UDP

You asked a good question. Don't let anyone tell you otherwise. Regrettably, there is no rule of thumb for the types of protocols that use TCP versus the types of protocols that use UDP. The decision ...
Eddie's user avatar
  • 15k
13 votes

How to verify that a UDP port is open?

UDP is obviously a send-and-forget protocol. For example, during an NMap UDP scan, the only way to definitively prove that a UDP port is open is if you receive a response from that port. Keep in mind ...
Goodies's user avatar
  • 445
13 votes

How to verify that a UDP port is open?

This is a quick recipe: 1) Start a packet sniffer: sudo tcpdump -n -i eth2 icmp & [1] 1409 $ tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth2, link-...
Everton's user avatar
  • 1,636
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.1k
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.2k
11 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
  • 98.8k
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.1k
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.5k
10 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
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
  • 82.7k
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.1k
8 votes
Accepted

What is the reason for the different order of the Source and Destination in a L2 header?

The roots of the two technologies just are not really related. When Bob Metcalfe, et al. were creating ethernet, they were not working with Vint Cerf, et al. who were creating IP. These were two ...
Ron Maupin's user avatar
  • 98.8k

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