0% found this document useful (0 votes)
27 views8 pages

MODULE 4 Transport Layer - SHAFIA-1

CN transport layer topic complete

Uploaded by

nandanpm150904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views8 pages

MODULE 4 Transport Layer - SHAFIA-1

CN transport layer topic complete

Uploaded by

nandanpm150904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Transport Layer

o The transport layer is a 4th layer from the top.

o The main role of the transport layer is to provide the communication services directly
to the application processes running on different hosts.
The services provided by the transport layer protocols can be divided into five
categories:

o End-to-end delivery

o Addressing

o Reliable delivery

o Flow control

o Multiplexing

Elements of Transport protocols:

Addressing
Connection establishment
Connection release
Crash recovery

Addressing:
• When an application (e.g., a user) process wishes to set up a connection to a remote
application process, it must specify which one to connect to. (Connectionless transport has
the same problem: to whom should each message be sent?) The method normally used is to
define transport addresses to which processes can listen for connection requests.
• In the Internet, these endpoints are called ports. We will use the generic term TSAP
(Transport Service Access Point) to mean a specific endpoint in the transport layer. The
analogous endpoints in the network layer (i.e., network layer addresses) are naturally called
NSAPs (Network Service Access Points). IP addresses are examples of NSAPs.
• Figure 4.7 illustrates the relationship between the NSAPs, the TSAPs, and a transport
connection
2. Connection Establishment(3 way handshake)

Establishing a connection sounds easy, but it is actually surprisingly tricky. At first glance, it
would seem sufficient for one transport entity to just send a CONNECTION REQUEST
segment to the destination and wait for a CONNECTION ACCEPTED reply. The problem
occurs when the network can lose, delay, corrupt, and duplicate packets. This behavior causes
serious complications.
3.CONNECTION RELEASE:
A connection is released using either asymmetric or symmetric variant. But, the improved
protocol for releasing a connection is a 3-way handshake protocol.

There are two styles of terminating a connection: 1) Asymmetric release and 2) Symmetric
release. Asymmetric release is the way the telephone system works: when one party hangs
up, the connection is broken. Symmetric release treats the connection as two separate
unidirectional connections and requires each one to be released separately.

4. Crash Recovery:
• If hosts and routers are subject to crashes or connections are long-lived (e.g., large software
or media downloads), recovery from these crashes becomes an issue.
• If the transport entity is entirely within the hosts, recovery from network and router crashes
is straightforward. The transport entities expect lost segments all the time and know how to
cope with them by using retransmissions.
• A more troublesome problem is how to recover from host crashes. In particular, it may be
desirable for clients to be able to continue working when servers crash and quickly reboot.

UDP (User Datagram Protocol):


• The Internet has two main protocols in the transport layer, a connectionless protocol and a
connection-oriented one. The protocols complement each other.
• The connectionless protocol is UDP. It does almost nothing beyond sending packets
between applications, letting applications build their own protocols on top as needed.
• The connection-oriented protocol is TCP. It does almost everything. It makes connections
and adds reliability with retransmissions, along with flow control and congestion control, all
on behalf of the applications that use it
The Internet protocol suite supports a connectionless transport protocol called UDP (User
Datagram Protocol). • UDP provides a way for applications to send encapsulated IP
datagrams without having to establish a connection

UDP Header
UDP header is an 8-byte fixed and simple header, while for TCP it may vary from 20 bytes
to 60 bytes. The first 8 Bytes contain all necessary header information and the remaining
part consists of data. UDP port number fields are each 16 bits long, therefore the range for
port numbers is defined from 0 to 65535; port number 0 is reserved. Port numbers help to
distinguish different user requests or processes.

 Source Port: Source Port is a 2 Byte long field used to identify the port
number of the source.
 Destination Port: It is a 2 Byte long field, used to identify the port of the
destined packet.
 Length: Length is the length of UDP including the header and the data. It is a
16-bits field.
 Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of
the one’s complement sum of the UDP header, the pseudo-header of information
from the IP header, and the data, padded with zero octets at the end (if
necessary) to make a multiple of two octets.
TCP vs UDP
User
Datagram
Protocol
Transmission Control Protocol
Basis (TCP) (UDP)

UDP is the Datagram-


TCP is a connection-oriented oriented protocol. This is
protocol. Connection orientation because there is no
means that the communicating overhead for opening a
devices should establish a connection, maintaining a
connection before transmitting connection, or terminating
data and should close the a connection. UDP is
connection after transmitting the efficient for broadcast and
Type of Service data. multicast types of network
transmission.

Reliability TCP is reliable as it guarantees The delivery


the delivery of data to the
of data to the
User
Datagram
Protocol
Transmission Control Protocol
Basis (TCP) (UDP)

destination
cannot be
destination router.
guaranteed in
UDP.

UDP has only the basic error-


TCP provides extensive error-
checking mechanisms. It is checking mechanism using
Error checking because it provides flow control
mechanism and acknowledgment of data. checksums.

Acknowledgme An acknowledgment segment is


No acknowledgment segment.
nt present.

There is no sequencing of data in


Sequencing of data is a feature of
UDP. If the order is required, it
Transmission Control Protocol
(TCP). this means that packets has to be managed by the
Sequence arrive in order at the receiver. application layer.

TCP is comparatively slower than UDP is faster, simpler, and more


Speed UDP. efficient than TCP.

There is no retransmission of lost


Retransmission of lost packets is
packets in the User Datagram
possible in TCP, but not in UDP.
Retransmission Protocol (UDP).

TCP has a (20-60) bytes variable UDP has an 8 bytes fixed-length


Header Length length header. header.

Weight TCP is heavy-weight. UDP is lightweight.


User
Datagram
Protocol
Transmission Control Protocol
Basis (TCP) (UDP)

Handshaking Uses handshakes such as SYN, It’s a connectionless protocol i.e.


Techniques ACK, SYN-ACK No handshake

TCP doesn’t support


UDP supports Broadcasting.
Broadcasting Broadcasting.

TCP is used by HTTP, UDP is used by DNS, DHCP,


Protocols HTTPs , FTP , SMTP and Telnet . TFTP, SNMP , RIP, and VoIP.

The TCP connection is a byte UDP connection is a message


Stream Type stream. stream.

Overhead Low but higher than UDP. Very low.

This protocol is primarily utilized This protocol is used in situations


in situations when a safe and where quick communication is
trustworthy communication necessary but where
procedure is necessary, such as in dependability is not a concern,
email, on the web surfing, and such as VoIP, game streaming,
Applications in military services. video, and music streaming, etc.

Features of TCP protocol


The following are the features of a TCP protocol:

o Transport Layer Protocol


TCP is a transport layer protocol as it is used in transmitting the data from the sender to the
receiver.

o Reliable
TCP is a reliable protocol as it follows the flow and error control mechanism. It also supports
the acknowledgment mechanism, which checks the state and sound arrival of the data. In the
acknowledgment mechanism, the receiver sends either positive or negative acknowledgment
to the sender so that the sender can get to know whether the data packet has been received or
needs to resend.

o Order of the data is maintained


This protocol ensures that the data reaches the intended receiver in the same order in which it
is sent. It orders and numbers each segment so that the TCP layer on the destination side can
reassemble them based on their ordering.

o Connection-oriented
It is a connection-oriented service that means the data exchange occurs only after the
connection establishment. When the data transfer is completed, then the connection will get
terminated.

o Full duplex
It is a full-duplex means that the data can transfer in both directions at the same time.

o Stream-oriented
TCP is a stream-oriented protocol as it allows the sender to send the data in the form of a
stream of bytes and also allows the receiver to accept the data in the form of a stream of
bytes.

. The TCP Segment Header: • Figure 4.20 shows the layout of a TCP segment. Every
segment begins with a fixed-format, 20-byte header. The fixed header may be followed by
header options. After the options, if any, up to 65,535 − 20 − 20 = 65,495 data bytes may
follow, where the first 20 refer to the IP header and the second to the TCP header

 Source port: this is a 16 bit field that specifies the port number of the sender.
 Destination port: this is a 16 bit field that specifies the port number of the receiver.
 Sequence number: the sequence number is a 32 bit field that indicates how much
data is sent during the TCP session. When you establish a new TCP connection (3
way handshake) then the initial sequence number is a random 32 bit value. The
receiver will use this sequence number and sends back an acknowledgment. Protocol
analyzers like wireshark will often use a relative sequence number of 0 since it’s
easier to read than some high random number.
 Acknowledgment number: this 32 bit field is used by the receiver to request the next
TCP segment. This value will be the sequence number incremented by 1.
 DO: this is the 4 bit data offset field, also known as the header length. It indicates the
length of the TCP header so that we know where the actual data begins.
 RSV: these are 3 bits for the reserved field. They are unused and are always set to 0.
 Flags: there are 9 bits for flags, we also call them control bits. We use them to
establish connections, send data and terminate connections:
o URG: urgent pointer. When this bit is set, the data should be treated as priority
over other data.
o ACK: used for the acknowledgment.
o PSH: this is the push function. This tells an application that the data should be
transmitted immediately and that we don’t want to wait to fill the entire TCP
segment.
o RST: this resets the connection, when you receive this you have to terminate
the connection right away. This is only used when there are unrecoverable
errors and it’s not a normal way to finish the TCP connection.
o SYN: we use this for the initial three way handshake and it’s used to set the
initial sequence number.
o FIN: this finish bit is used to end the TCP connection. TCP is full duplex so
both parties will have to use the FIN bit to end the connection. This is the
normal method how we end an connection.
 Window: the 16 bit window field specifies how many bytes the receiver is willing to
receive. It is used so the receiver can tell the sender that it would like to receive more
data than what it is currently receiving. It does so by specifying the number of bytes
beyond the sequence number in the acknowledgment field.
 Checksum: 16 bits are used for a checksum to check if the TCP header is OK or not.
 Urgent pointer: these 16 bits are used when the URG bit has been set, the urgent
pointer is used to indicate where the urgent data ends.
 Options: this field is optional and can be anywhere between 0 and 320 bits.

You might also like