Lecture 20 Transport Layer
Lecture 20 Transport Layer
Addressing:
At the transport layer, we need a transport layer
address, called a port number, to choose among
multiple processes running on the destination host.
The destination port number is needed for delivery;
the source port number is needed for reply.
In the internet model, the port numbers are 16- bit
integers between 0 to 65,535. The client program
defines itself with a port number, chosen randomly by
the transport layer software running on the client
host.
numbers play different roles in selecting the final
destination of data. The destination IP address defines
the host among the different hosts in the world. After the
host has been selected, the port number defines one of
the processes on this particular host.
IANA Ranges:
The IANA (Internet Assigned number Authority) has
divided the port numbers in to three ranges: well known,
registered and dynamic (or private).
Well Known Ports: The ports ranging from 0 to 1023
are assigned and controlled by IANA use by the
application end points that communicate using the
Internet's Transmission Control Protocol (TCP) or the
User Datagram Protocol (UDP). These are well known
ports. For example, a remote job entry application has
the port number of 5; the Hypertext Transfer Protocol
(HTTP) application has the port number of 80, for DNS
the port number is 53.
Registered Ports: The port ranging from 1024 to 49151
are assigned by IANA for specific service upon
application by a requesting entity. 4224 is used for Cisco
Audio Session Tunneling
Socket Address:
Process to process delivery needs two different
identifiers, IP address and the port number at each end
to make a connection. The combination of an IP address
and port number is called a socket address. The client
socket address defines the client process uniquely and
server socket address defines the server process
User Datagram protocol:
•The user datagram protocol (UDP) is called
connectionless, unreliable transport protocol.
•It does not add anything to the service of IP except to
provide process-to-process communication instead of
host–to-host communication.
•It performs very limited error checking.
•UDP is very simple protocol using a minimum of
overhead.
•If a process wants to send a small message and does not
care much about reliability, it can use UDP.
•Sending a small message by using UDP takes much less
interaction between the sender and receiver then using
TCP.
User Datagram:
UDP packets, called user datagrams, have a fixed –size
header of 8 bytes.
Source port Address:
This is the port number used by the process running on
the source host. It is 16 bit long, which means that the
port number can range from 0 to 65,535.
Destination Port address:
This is the port number used by the process running on
the destination host. It is 16 bit long, which means that
the port number can range from 0 to 65,535?
Total Length:
This is a 16 bit field that define a total length of
the user datagram header and data. The 16 bits
can define the total length of 0 to 65,535 bytes.
The length field in the user data gram is not
necessary. A user datagram is encapsulated in an
IP datagram. There is a field in the IP datagram
that defines the total length. There is another
field in the IP datagram that defines the length
of the header. So if we subtract the value of the
second field from the first, we can deduce the
length of a UDP datagram that is encapsulated in
an IP datagram.
TCP Services:
•Process-to-process communication
•Stream Delivery Services
•Sending and receiving buffers
•Segments
•Full duplex Communication
•Connection oriented Services
•Acknowledgement
•Error Control
•Flow Control
•Congestion Control
Segment:
TCP carries the data in the form of segment.TCP provides the
reliable transmission but less in speed in comparison to UDP.
Because of its smaller frame size the UDP is much faster than TCP. A
brief description of each fields are here
Source Port Address: The source port address define the application
program in the source computer .
Destination Port Address: The destination port address defines the
application program in the destination computer.
Sequence Number: A stream of data from the application program may be
divided in two or more TCP segments. The sequence number defines the
position of the data in the original data stream.
Acknowledgement Number: The 32 bit acknowledgement number is used
to acknowledge the receipt of data from the other communicating device.
This number is valid only if the ACK bit in the control field is set.
Header Length (HLEN): The four bit HLEN field indicates the number of 32-
bit (four byte) words in the TCP header.
Reserved: This is a 6 bit field reserved for future use.
Window Size: This field define the size of the window, in bytes, that the
sender and receiver must maintain the size of window.
Checksum: This 16 bit field contains the checksum. Check sum is
mandatory in TCP.
Control: This field defines 6 different control bits or flag as shown in
figure these are:
• URG: The value of the urgent pointer field is valid.
• ACK: The value of the acknowledgement field is valid
• PSH: Push the data
• RST: Reset the connection
• SYN: Synchronize sequence Number during connection
• FIN: Terminate the connection
Urgent Pointer: The 16 bit field, which is valid only if the urgent flag is
set. This field is used when the segment contains urgent data.
Options: There can be up to 40 bytes of optional information in the
TCP Header.