Hot answers tagged

236 votes
Accepted

Why do we need a 3-way handshake? Why not just 2-way?

Break down the handshake into what it is really doing. In TCP, the two parties keep track of what they have sent by using a Sequence number. Effectively it ends up being a running byte count of ...
Eddie's user avatar
  • 14.8k
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,439
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.4k
33 votes
Accepted

Is a TCP server limited to 65535 clients?

The short answer is no, that's not the limit. A TCP Port field is 2x bytes and holds a quantity of 65536. This number limits the amount of addresses a server can have. But this doesn't limit the ...
Kind Contributor's user avatar
29 votes
Accepted

How can a TCP window size be allowed to be larger than the maximum size of an ethernet packet?

The TCP window size is generally independent of the maximum segment size which depends on the maximum transfer unit which in turn depends on the maximum frame size. Let's start low. The maximum frame ...
Zac67's user avatar
  • 81.6k
28 votes

Why do we need a 3-way handshake? Why not just 2-way?

The three-way handshake is necessary because both parties need to synchronize their segment sequence numbers used during their transmission. For this, each of them sends (in turn) a SYN segment with ...
dr_'s user avatar
  • 1,299
26 votes

Why do we need a 3-way handshake? Why not just 2-way?

In order for the connection to work, each side needs to verify that it can send packets to the other side. The only way to be sure that you got a packet to the other side is by getting a packet from ...
The Spooniest's user avatar
25 votes
Accepted

acknowledgment by TCP does not guarantee that the data has been delivered

This part of the RFC is about passing responsibility over to the operating system or whatever is the next stage of the process. It's fundamentally concerned with the separation of layers. An ...
jonathanjo's user avatar
  • 16.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
  • 14.8k
22 votes
Accepted

Does TCP open a new connection for every packet that is sent?

One of my buddies is saying that TCP will be a problem for this gateway because it is going to establish a new connection for every message it sends (not kafka but the underlying transportation ...
Kevin's user avatar
  • 336
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

Does the destination port change during TCP three-way handshake?

No, a TCP connection is uniquely identified by both source and destination IP and TCP (port) addresses. Changing any one of those will break the TCP connection (or prevent it from forming in the ...
Ron Maupin's user avatar
  • 98.4k
13 votes
Accepted

Is there a way to ignore client's TCP FIN and keep TCP connection?

Does that make any sense? No. The FIN is send because the sender decided that it wants to close the connection. Even if you would change the recipient that it will ignore the FIN the sender side of ...
Steffen Ullrich's user avatar
13 votes

Why does NAT translate a source port?

First, I'm assuming you're focused on TCP. UDP has some differences, and I'm not as up-to-speed on that part. I’m beginning to learn about nat and I was wondering why does NAT translate a source ...
Slartibartfast's user avatar
12 votes
Accepted

How exactly does TCP react to a retransmission timeout?

What happens at the time-out is actually pretty clear from the drawing... The congestion window size drops back to its original value of 1 and slow start is run again. The specifics of how a TCP ...
Gerben's user avatar
  • 4,670
11 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 verses the types of protocols that use UDP. The ...
Eddie's user avatar
  • 14.8k
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.4k
11 votes
Accepted

Port Numbers related doubt

User applications use random ephemeral ports for outgoing connections. TCP port 80 is only the server side's default port for WWW. A TCP socket connection consists of source IP, source port, ...
Zac67's user avatar
  • 81.6k
11 votes

Can anyone explain to me the difference between the PSH and URG flags in TCP segment?

Jeremy Stretch has a good article on this. This is where the PSH flag comes in. The socket that TCP makes available at the session level can be written to by the application with the option of "...
Ron Trunk's user avatar
  • 66.9k
11 votes

Does the destination port change during TCP three-way handshake?

We know that port 80 is just a welcoming port, when the web server reveives a http request, it create a new connection port(let's say 5000) That's not correct for the HTTP protocol. Some protocols, ...
Josh's user avatar
  • 211
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.4k
10 votes

Does TCP open a new connection for every packet that is sent?

My understanding is that when you establish a TCP connection, that connection remains open until it is timed out by the application or forcibly closed by either the server or client. From the ...
Ron Maupin's user avatar
  • 98.4k
10 votes
Accepted

At which layer does router operate?

Network address translation (NAT) is a feature of Router which is required for routing traffic. That is completely incorrect. NAT is a kludge (a clumsy, inefficient solution) designed to extend the ...
Ron Maupin's user avatar
  • 98.4k
10 votes

acknowledgment by TCP does not guarantee that the data has been delivered

From the RFC perspective, the "end user" is the application. There's no guarantee that the application got the data, just that the TCP process received it. From your NOC perspective, the network is ...
Ron Trunk's user avatar
  • 66.9k
9 votes

Why is the last ACK needed in TCP four way termination

A -----FIN-----> B FIN_WAIT_1 CLOSE_WAIT A <----ACK------ B FIN_WAIT_2 (B can send more data here, this is half-close state) A <----FIN------ B TIME_WAIT LAST_ACK A -----ACK----...
Luciano Afranllie's user avatar
9 votes

How multiple client connections are made to single web server?

Now, from googling what I got is, the server listens at port 80 for incoming requests. Indeed, more specifically there is a special type of socket called a "listening" socket. Normally a socket is ...
Peter Green's user avatar
9 votes
Accepted

How does NAT decide which connections are inbound, and which are outbound?

TCP is a connection-oriented protocol, and it can only communicate through connections. Before you start programming using TCP, it would be helpful to first understand how TCP works, and you should ...
Ron Maupin's user avatar
  • 98.4k
9 votes

Can anyone explain to me the difference between the PSH and URG flags in TCP segment?

Suppose the receiving buffer has already some data to be processed by the application. A segment with the PSH flag set to 1 is sent now. The sending buffer will not wait to be filled, instead, it will ...
avistein's user avatar
8 votes

What layer of the OSI model does NAT work?

Nat is a cross-layer process. It involves at least layers 3 (IP) and 4 (TCP, UDP, etc). In some cases it can also involve layer 7 (application). A one to one NAT needs at minimum to modify the IP ...
Peter Green's user avatar
8 votes

Why do we need a 3-way handshake? Why not just 2-way?

TCP connection is bidirectional. What this means is that it actually is a pair of one-way connections. The initiator sends SYN, the responder sends ACK: one simplex connection begins. "Then" the ...
Sergio's user avatar
  • 146

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