197

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 everything that was sent. The receiving party can use the opposite speaker's sequence number to acknowledge what it has received. But the sequence number doesn't ...


60

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 exciting part about UDP isn't so much the network protocol but the API implemented by operating systems and socket libraries. While not part of the UDP ...


45

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 bound applications get sent by UDP to the correct applications. UDP for IPv4 also provides an optional checksum, but the checksum is required for IPv6. UDP is a ...


27

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 number of clients to ~64k. Each TCP Packet has two Port fields one for the destination and one for the source (as well as two IP addresses). A given TCP ...


26

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 size is the largest frame a network (segment) can transport. For Ethernet, this is 1518 bytes by definition. The frame encapsulates an IP packet, so the largest ...


24

If you are asking in a general sense, then the answer is most definitely "yes", any HTTP method (like POST) requires a TCP connection, and the only way to initiate a TCP connection is to use the three way handshake. IF, however, you are asking in a specific case, maybe if you are capturing your own traffic and don't see the 3 way handshake after you submit ...


24

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 a sequence number set to a random value n, which then is acknowledged by the other party via a ACK segment with a sequence number set to n+1.


24

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 acknowledgment by TCP does not guarantee that the data has been delivered to the end user, but only that the receiving TCP has taken the responsibility to do so. I ...


22

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 protocol itself is the issue), requiring a new port each time. At the rate we'll be sending these clients messages (gigabytes), kafka will run out of ports to read ...


21

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 them that, by definition, would not have been sent unless the packet you sent got through. TCP essentially uses two kinds of messages for this: SYN (to request ...


15

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 handshake). What you may be referring to is the fact that a web browser will form, use, and close multiple TCP connections with the web server. Each connection will ...


14

Well technically fragmentation can happen in IPv6; This is the wikipedia article on it. This Juniper page is a bit old but it shows that you can clamp an MSS for TCP over IPv6 on Junos the same as you would in IPv4 using the same command, tcp mss. The same is shown in this article for Cisco IOS 15, using the traditional ip tcp adjust-mss command. So you ...


14

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 it's really uncommon), DHCP, NTP, and PTP. All of these protocols have some specific things in common: They care about being able to coexist with other ...


13

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 the application will still consider the connection closed and not send or receive any more data on it. Just compare it to a phone call. If the other end ...


13

TCP and UDP are layer 4 (transport) protocols. They always use IP as the layer 3 (network) protocol. The text you quote is just plain wrong. You may notice that the page you reference was marked for cleanup. That should indicate that you should be suspicious of the accuracy.


12

Both HTTP GET and HTTP POSTS use TCP. If you are asking whether a POST also requires a 3-way TCP handshake (syn-synack-ack), it does just like any other TCP connection. The TCP handshake is required before any application protocol (such as HTTP) starts work. FYI, your three-way handshake is incorrect; it should be "syn-synack-ack" ADD: If browser use ...


12

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 stack will handle congestion events depend on what variant you are using. This drawing looks like an example of the TCP Reno algorithm. When seeing 3 duplicate ...


12

There can be several things going on - the most common would be the use of TCP Fast Retransmission which is a mechanism by which a receiver can indicate that it has seen a gap in the received sequence numbers that implies the loss of one or more packets in transit. The repeated acknowledgements at the last known value before the gap signal which packets the ...


12

First, TCP does not care about single packets. If these are just data packets without any previous connection establishment than they will be simply dropped, no sockets involved. So I'm assuming that this is about established connections, or initial packets to establish a connection. A TCP connection is defined at least by the 4 tuple of (src-ip, src-port, ...


11

1. What goes into setting the MSS? In the question you referenced it stated this, the MSS is derived directly from MTU. A typical Ethernet MTU will 1500, but IP and TCP headers must also be taken into account - each of them are 20 bytes. Note: Just an FYI, MTU can be different sizes - see Jumbo Frames for an example. We end up with: MSS = 1500 - 20 - ...


11

In normal TCP behavior, they should never both be set to 1 (on) in the same packet. There are many tools that exist that let you craft TCP packets, and the typical response to a packet with SYN and FIN bits set to one is a RST, since you are violating the rules of TCP.


11

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, destination IP, destination port. Only if all of these are identical it's the same socket.


10

It is still used a bit, but most providers are phasing it out.


10

I teach TCP, and I often run into people who were mis-taught that the ACK is only sent when the Window Size is reached. This is not true. (To be really transparent, I too taught this incorrectly before I knew better as well, so I completely understand the mistake). NOTE, I'll be using Receiver/Sender to describe it, but keep in mind TCP is bidirectional, ...


10

[rephrasing a somewhat confused question] Can I communicate with raw IP datagrams, without a transport layer? Short answer: Yes, but: It's an exceptionally strange way to build an application (you'd have to tell your OS NIC driver to ignore the IP protocol number and queue all packets directly to your application buffers). You should not bother ...


10

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 packets to go through a specific route, but it's rarely, if ever, used, and it's totally ignored by routers on the Internet) So each router can change the ...


10

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 functioning and data reached the end host. Presumably, that's all you care about.


9

This all comes about because different vendors often choose to use different terminology or in some cases the same terminology for different concepts. What Cisco calls a trunk port is also known as a tagged port by certain other vendors. This means that 802.1Q headers are inserted on all of the traffic for the tagged VLANs. What Cisco calls an access port ...


9

One type of attack in the olden days was to have every Flags set to 1. That was: Nonce CWR ECN-ECHO URGENT ACK Push RST SYN FIN A few implementation of IP stacks didn't check correctly and crashed. It was called a Christmas Tree Packet


9

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 decision whether a protocol uses one or the other come down to whomever wrote/created the protocol to begin with. If they didn't want to bother with writing their own ...


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