CN - Unit4.1
CN - Unit4.1
CN - Unit4.1
(KCS-603)
Session 2020-21
Transport Layer
Transport Layer
The ultimate goal of the transport layer is to provide efficient,
reliable, and cost- effective service to its users, normally
processes in the application layer. To achieve this goal, the
transport layer makes use of the services provided by the network
layer. The hardware and/or software within the transport layer
that does the work is called the transport entity.
Transport Layer
• End to End Delivery
• Addressing
• Reliable Delivery:
– Error Control
– Sequence Control
– Loss Control
– Duplication Control
• Flow Control
• Multiplexing
Position of transport layer
Services Provided to the Upper Layers
The bottom four layers can be seen as the transport service
provider, whereas the upper layer(s) are the transport service
user.
Process-to-process delivery
The transport layer is responsible for process-to- process
delivery—the delivery of a packet, part of a message, from
one process to another. Two processes communicate in a
client/server relationship.
Port numbers
IP addresses versus port numbers
The TCP Protocol
• Every byte on a TCP connection has its own 32-bit sequence
number.
• The sending and receiving TCP entities exchange data in the
form of segments. A TCP segment consists of a fixed 20-byte
header (plus an optional part) followed by zero or more data
bytes. The TCP software decides how big segments should be.
Well-known ports
The range of well-known port is 0 to 1023. The well-known ports
are used with those protocols that serve common applications and
services such as HTTP (hypertext transfer protocol), IMAP
(Internet Message Access Protocol), SMTP (Simple Mail Transfer
Protocol), etc. For example, we want to visit some websites on an
internet; then, we use http protocol; the http is available with a port
number 80, which means that when we use http protocol with an
application then it gets port number 80. Similarly, with other
protocols such as SMTP, IMAP; well-known ports are defined. The
remaining port numbers are used for random applications.
What is a TCP port?
Registered ports
The range of registered port is 1024 to 49151. The registered
ports are used for the user processes. These processes are
individual applications rather than the common applications that
have a well-known port.
Dynamic ports
The range of dynamic port is 49152 to 65535. Another name of
the dynamic port is ephemeral ports. These port numbers are
assigned to the client application dynamically when a client
creates a connection. The dynamic port is identified when the
client initiates the connection, whereas the client knows the
well-known port prior to the connection. This port is not known
to the client when the client connects to the service.
TCP Connection Establishment
• Connections are established in TCP by means of the three-way
handshake. To establish a connection, one side(server) passively
waits for an incoming connection by executing the LISTEN and
ACCEPT primitives.
• The other side, say, the client, executes a CONNECT primitive,
specifying the IP address and port to which it wants to connect,
the maximum TCP segment size it is willing to accept, and
optionally some user data (e.g., a password). The CONNECT
primitive sends a TCP segment with the SYN bit on and ACK bit
off and waits for a response.
• When this segment arrives at the destination, the TCP entity
there checks to see if there is a process that has done a LISTEN
on the port given in the Destination port field. If not, it sends a
reply with the RST bit on to reject the connection.
UDP
• The User Datagram Protocol (UDP) is a transport layer
protocol defined for use with the IP network layer protocol. It is
defined by RFC 768 written by John Postel. It provides a best-
effort datagram service to an End System (IP host).
H2 replies
ACKs x
announce own s# y
H1replies
ACKs y
H2 sends ACK to H1
H1 rejects X
H2 knows it was tricked
Worst case
• DD CR, old ACK floating
H2 gets delayed CR, replies
H1 rejects
X
H2 gets old DATA, discards
X
• (z received instead of y)
Connection Release
Easier than establish
However, some pitfalls
Asymmetric release
the way telephone works
6-14, a, b
H2 responds with DR
36
Connection Release
6-14, c,d
•
Flow Control and Buffering