News for hackers. Stuff that matters.
Re:Why TCP needs 3 handshakes by deathanatos on Wednesday October 02, 2024 @01:18AM (#41717410)
I've always considered it one handshake, with 3 packets, which are for some reason then called "3 way". But it's one 3-way-handshake.
Re:Why TCP needs 3 handshakes by qwertox on Wednesday October 02, 2024 @02:18AM (#41717707)
It is only one handshake, with 3 packets.

The author made a mistake in the title, but the content is mostly correct (fails at "First Handshake", "Second Handshake" and "Third Handshake").

He should call them stages, phases or something like that.

Re:Why TCP needs 3 handshakes by AStonesThrow on Wednesday October 02, 2024 @03:13AM (#41718009)
To be really specific, they are not "packets" but at the TCP protocol level, they are "segments"

TFA appears to use both terms sort of interchangeably, which is uncool when describing a formalized protocol standard!

Segments are encapsulated in IP datagrams, or packets, which are, in turn, encapsulated in other PDU types, such as Ethernet frames.

Re:Why TCP needs 3 handshakes by Ekaros on Wednesday October 02, 2024 @03:49AM (#41718212)
And one could ask are segments without well data segment a segments? As mostly 2 first PDUs in exchange do not contain data...
Re:Why TCP needs 3 handshakes by AStonesThrow on Wednesday October 02, 2024 @05:03AM (#41718610)
Yes they are. I don't know what "well data segment" is, but perhaps you mean a payload. TCP streams consist of segments, and the fragmentation or collection of those logical segments into packets is a function of the lower-layer protocols which are not TCP.

https://www.rfc-editor.org/rfc/rfc9293.html

Re:Why TCP needs 3 handshakes by tsimionescu on Wednesday October 02, 2024 @06:20PM (#41725488)
I think one important mention here is that fragmentation happens at two levels: most commonly, an upper layer protocol message (such as an HTTP request) is fragmented into several TCP segments, each with one TCP header. Those TCP segments themselves can sometimes be fragmented into multiple IP packets if the TCP MSS (maximum segment size) is larger than the Ethernet MTU (maximum transmission unit).

IP fragmentation is typically avoided, and in IPv6 it is only allowed at the originator of a packet - if a router is trying to route an IPv6 packet larger than the MTU of the outgoing link's MTU, it must drop the packet and send a signal about the MTU back. An IPv4 router may fragment the packet, but this rarely works well in practice.

Re:Why TCP needs 3 handshakes by AStonesThrow on Friday October 04, 2024 @03:38PM (#41744877)
I suppose, if you want to squeeze it into the definition given in RFC 9293, but that same RFC only uses "fragmentation" to denote "internet fragments" or IP-level fragmentation.

You're referring to "segmentation" which is also defined in that RFC. https://www.rfc-editor.org/rfc/rfc9293.html#name-segmentatio...

Re:Why TCP needs 3 handshakes by iwontberude on Wednesday October 02, 2024 @01:22PM (#41722921)
Appreciate pedantry when it’s absolutely warranted. Well said!
Re:Why TCP needs 3 handshakes by ddfs123 on Wednesday October 02, 2024 @02:26AM (#41717744)
I've consider it to be 4 handshakes but the middle 2 are merged.
Re:Why TCP needs 3 handshakes by ay on Wednesday October 02, 2024 @03:13AM (#41718015)
There is a scenario called “simultaneous open”, which has 4 packets handshake and is a wonderful source of corner cases and debugging. Mostly doesn’t happen these days, but is possible by standard and is explicitly described.
Re:Why TCP needs 3 handshakes by winternewt on Wednesday October 02, 2024 @04:47AM (#41718517)
It has been used for NAT traversal when both parties are behind NAT, but sadly it doesn't work with all routers.
Re:Why TCP needs 3 handshakes by sedatk on Wednesday October 02, 2024 @01:32AM (#41717475)
"3 shake handshake"? :)
Re:Why TCP needs 3 handshakes by nasretdinov on Wednesday October 02, 2024 @03:59AM (#41718259)
3 hands handshake, nothing unusual here
Re:Why TCP needs 3 handshakes by beng-nl on Wednesday October 02, 2024 @06:12AM (#41718957)
Next TCP: Zaphod
Re:Why TCP needs 3 handshakes by AStonesThrow on Wednesday October 02, 2024 @02:51PM (#41723858)
It all started when Jon Postel obtained the Holy Hand Grenade of Antioch and reverse-engineered it...
Re:Why TCP needs 3 handshakes by Uptrenda on Wednesday October 02, 2024 @04:22AM (#41718380)
Its just 1 packet: an RST with a data field containing a swear word.
Re:Why TCP needs 3 handshakes by evilc00kie on Wednesday October 02, 2024 @04:27AM (#41718403)
Jokes like that make me realize I understand the matter more than I want to :'D
Re:Why TCP needs 3 handshakes by odo1242 on Wednesday October 02, 2024 @10:42AM (#41721128)
I did not know RST packets had a data field lol
Re:Why TCP needs 3 handshakes by odo1242 on Wednesday October 02, 2024 @10:41AM (#41721121)
The reason it’s considered a “3-way” handshake is mostly latency related. If the delay sending a packet between the client and server is k, there are 3 hops involved in establishing a connection so the time is 3k. Confusingly, this has nothing to do with how many devices are involved.
Re:Why TCP needs 3 handshakes by jabiko on Wednesday October 02, 2024 @01:20PM (#41722899)
> The reason it’s considered a “3-way” handshake is mostly latency relate

Its not latency related. Its because there 3 packets involved in completing the handshake.

> If the delay sending a packet between the client and server is k, there are 3 hops involved in establishing a connection so the time is 3k.

Also I think calling it "hops" is not correct. A hop occurs when a packet passes through a router.

> Confusingly, this has nothing to do with how many devices are involved.

In a TCP handshake there are only two devices involved (disregarding any middleboxes that meddle with the connection).

Re:Why TCP needs 3 handshakes by foobiekr on Wednesday October 02, 2024 @02:51PM (#41723859)
it's called 3-way because from the point of view of a network message diagram, there are three arrows which change direction at each step.

what it really amounts to is a three phase transaction.