David
David

Reputation: 51

How is a connection kept opened at the physical layer level

I'm having a difficult time understanding the concept of persisent connection.

If we take as an example the Http protocol using the keep-alive header, after tcp/ip performing the handshake along with the necessary validations, the connection is kept alive for x ms, allowing the user to send multiple requests using the same connection/port. The impact of a persistent connection is clear to me, at least at this level of understanding, overhead is reduced.

Regards

Upvotes: 1

Views: 273

Answers (1)

Zac67
Zac67

Reputation: 2912

The physical layer doesn't know any "open connection". It works on bits or packets alone and just transports bits from one end of a link to the other.

A logical connection becomes only possible much higher up the stack where TCP (or a similar protocol) uses the lower layers to simulate a connection that really isn't there in packet-switched networks.

Within a single logical connection, completely different routes = physical paths can be used without the transport layer even noticing.

Whether or not a transport layer protocol (or application layer protocol for that matter) uses some kind of keep-alive or not is entirely up to the protocol. Most often, a connection is closed when there's been no transmission for a certain period (timeout) so you don't end up with a bunch of zombie sockets.

Upvotes: 2

Related Questions