1

In transport layer, TCP is connection oriented and UDP are connectionless.

What is "connection" as in TCP then?

In network layer, is it correct that there should be no distinction between TCP and UDP, and no concept "connection"? Is a "connection" corresponding to a fixed route in the network layer?

Multiple messages can be sent one after another using the same connection.
How is a connection recorded/memorized? Is it memorized only by the endpoints of communication, or also by the intermediaries (routers, gateway, proxy, ...)?

  • RFC 793, Transmission Control Protocol defines TCP. "Connections: The reliability and flow control mechanisms described above require that TCPs initialize and maintain certain status information for each data stream. The combination of this information, including sockets, sequence numbers, and window sizes, is called a connection. Each connection is uniquely specified by a pair of sockets identifying its two sides." – Ron Maupin Feb 11 at 17:44
2

Both TCP and UDP are communication protocols, clarifying rules on how entities can communicate with each other. They are used over the IP protocol which again defines the information a packet should have for its correct redirection to its destination

Check the structure of an IPv4 packet. Packet header information will be used by the midpoints for your packet to reach its destination. So on network layer there isn't the concept of UDP or TCP and u cant really make a distinction out of them.

When you are using UDP you will be encapsulating at the data section of the IP packet a UPD packet with this structure and extra information, same goes for TCP only this time the packet header carries a lot more information.

For example TCP header has a field with sequence number , this helps to enumerate packets that arrive out of order due to random delays each packet has been through or help for the retransmission of a lost packet

The extra information a TCP header has ( 10 mandatory fields while UDP has 4) is utilized to create the concept of "connection" . In TCP an established connection should provide reliable, ordered, and error-checked delivery of a stream of octets (bytes)

  • Thanks. Is an actual connection implemented only in the network layer? Is TCP only providing virtual connection, because its underlying IP protocol is connectionless? – Tim Feb 12 at 12:42
  • 2
    The network layer has no concept of connections. There is no relationship between packets (except for fragments). – Ron Trunk Feb 12 at 13:26
4

In network layer, is it correct that there should be no distinction between TCP and UDP, and no concept "connection"?

Yes. At the network layer, there is no relationship between packets. Each one is sent individually.

How is a connection recorded/memorized? Is it memorized only by the endpoints of communication, or also by the intermediaries (routers, gateway, proxy, ...)?

Only the endpoints. Routers, etc, operate at the network layer and process individual packets. They do not have any concept of connection.

  • Thanks. Underlying a "connection" in TCP, is there a fixed route (endpoints, routers, etc) in the network layer? – Tim Feb 11 at 16:02
  • @Tim No. Each packet finds its own way between source and destination. They can all take the same path or different ones. The network layer doesn't care about the "connection" and the transport layer doesn't care about routing. – Zac67 Feb 11 at 16:08
  • @Zac67 What is a TCP connecton then, if all the messages in a TCP connection can take different network layer route? Looks like no difference from UDP – Tim Feb 11 at 16:12
  • 1
    TCP provides reliable connection and flow control. Both are missing in UDP – Ron Trunk Feb 11 at 16:53
  • 2
    @Tim There's no "actual connection" in a packet-switched network (above the physical layer) other than those transport-layer connections that I'd call virtual or logical. – Zac67 Feb 12 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.