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 ...
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 ...
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 ...
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 ...
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. ...
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 (...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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-...
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 ...
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 ...
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 ...
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 ...
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-...
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 ...
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 ...
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).
...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
udp × 226tcp × 97
layer4 × 40
transport-protocol × 37
protocol-theory × 27
nat × 25
ip × 21
ipv4 × 16
multicast × 15
ethernet × 14
routing × 13
router × 10
wireshark × 10
networking × 9
icmp × 9
switch × 8
checksum × 8
ipv6 × 7
packet-loss × 7
network × 6
firewall × 6
packet-analysis × 6
dns × 6
cisco × 5
vpn × 5