0% found this document useful (0 votes)
5 views

Chapter 3

Computer Networks Notes _ Ch. 3

Uploaded by

Siddharth Jha
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Chapter 3

Computer Networks Notes _ Ch. 3

Uploaded by

Siddharth Jha
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Transport layer

and
Session layer
By - Sneha Nandanwar
TRANSPORT LAYER
⚫ The transport layer is the fourth layer in the open system
interconnection (OSI) model, and is responsible for end-to-end
communication over a network.
⚫ It provides logical communication between application
processes running on different hosts within a layered architecture
of protocols and other network components.
⚫ Transport layer collects message segments from applications,
and transmits them into the network
⚫ The transport layer is also responsible for the management of
error correction, providing quality and reliability to the end
user.
⚫ This layer enables the host to send and receive error corrected data,
packets or messages over a network and is the network component
that allows multiplexing.
SERVICES OFFERED BY
TRANSPORT LAYER

1. Process To Process Delivery


2. End to End connection between the hosts
3. Multiplexing & De-multiplexing
4. Congestion Control
5. Data Integrity
6. Error Correction
7. Flow Control
Multiplexing and Demultiplexing
Multiplexing: At the sender site, multiple processes can occur,
and those processes are required to send packets. It is a
technique that combines multiple processes into one process.
Demultiplexing: At the receiver site, it is a technique that
separates many processes.
CONNECTION-ORIENTED PROTOCOLS

⚫TCP is an example of a connection-oriented protocol. It


requires a logical connection to be established between the
two processes before data is exchanged.

⚫With orderly release, any data remaining in the buffer is


sent before the connection is terminated.

⚫Examples of services that use connection-oriented


transport services are telnet, rlogin, and ftp.
CONNECTION-LESS PROTOCOLS
⚫ Connectionless protocols, in contrast, allow data to be
exchanged without setting up a link between processes.
⚫ Each unit of data, with all the necessary information to route
it to the intended destination, is transferred independent of
other data packets and can travel over different paths to reach
the final destination. Some data packets might be lost in
transmission or might arrive out of sequence to other data
packets.
⚫ UDP is a connectionless protocol. It is known as a datagram
protocol because it is analogous to sending a letter where you
don't acknowledge receipt.
⚫ Examples of applications that use connectionless transport
services are broadcasting and tftp.
USER DATAGRAM PROTOCOL
⚫ User Datagram Protocol (UDP) is a Transport Layer
protocol. UDP is a part of Internet Protocol suite, referred
as UDP/IP suite.
⚫ Unlike TCP, it is unreliable and connectionless
protocol. So, there is no need to establish connection prior
to data transfer.
⚫ Since high performance is needed, UDP permits packets to
be dropped instead of processing delayed packets. There is
no error checking in UDP, so it also save bandwidth.
UDP HEADER

checksum is a small-sized block of data derived from


another block of digital data for the purpose of detecting
errors.
UDP HEADER
⚫ Source Port - This 16 bits information is used to identify the source port of
the packet.

⚫ Destination Port - This 16 bits information, is used identify application level


service on destination machine.

⚫ Length - Length field specifies the entire length of UDP packet (including
header). It is 16-bits field and minimum value is 8-byte, i.e. the size of UDP
header itself.

⚫ Checksum - This field stores the checksum value generated by the sender
before sending. IPv4 has this field as optional so when checksum field does not
contain any value it is made 0 and all its bits are set to zero.
UDP APPLICATIONS
Here are few applications where UDP is used to
transmit data:
⚫ Domain Name Services
⚫ Simple Network Management Protocol
⚫ Trivial File Transfer Protocol
⚫ Routing Information Protocol
⚫ Kerberos
TRANSMISSION CONTROL
PROTOCOL
⚫ TCP (Transmission Control Protocol) is a standard that defines how to

establish and maintain a network conversation through


which application programs can exchange data.

⚫ TCP works with the Internet Protocol (IP), which defines how

computers send packets of data to each other.

⚫ Together, TCP and IP are the basic rules defining the Internet.

⚫ The transmission Control Protocol (TCP) is one of the most important

protocols of Internet Protocols suite. It is most widely used protocol


for data transmission in communication network such as internet.
TRANSMISSION CONTROL
PROTOCOL FEATURES
⚫ TCP is reliable protocol.

⚫ TCP ensures that the data reaches intended destination in the same order it was
sent.

⚫ TCP is connection oriented. TCP requires that connection between two remote
points be established before sending actual data.

⚫ TCP provides error-checking and recovery mechanism.

⚫ TCP provides end-to-end communication.

⚫ TCP provides flow control and quality of service.

⚫ TCP operates in Client/Server point-to-point mode.

⚫ TCP provides full duplex server, i.e. it can perform roles of both receiver and
sender.
TCP SEGMENT HEADER
TCP SEGMENT HEADER
⚫ Source Port Address –
16 bit field that holds the port address of the application that is
sending the data segment.
⚫ Destination Port Address –
16 bit field that holds the port address of the application in the host
that is receiving the data segment.
⚫ Sequence Number –
32 bit field that holds the sequence number, i.e, the byte number of
the first byte that is sent in that particular segment. It is used to
reassemble the message at the receiving end if the segments are
received out of order.
⚫ Acknowledgement Number –
32 bit field that holds the acknowledgement number, i.e, the byte
number that the receiver expects to receive next. It is an
acknowledgment for the previous bytes being received successfully.
TCP SEGMENT HEADER
⚫ Header Length (HLEN) –
This is a 4 bit field that indicates the length of the TCP header by
number of 4-byte words in the header, i.e, if the header is of 20
bytes(min length of TCP header), then this field will hold 5
(because 5 x 4 = 20) and the maximum length: 60 bytes, then it’ll
hold the value 15(because 15 x 4 = 60). Hence, the value of this
field is always between 5 and 15.
⚫ Window size –
This field tells the window size of the sending TCP in bytes.
⚫ Checksum –
This field holds the checksum for error control. It is mandatory in
TCP as opposed to UDP.
TCP SEGMENT HEADER
⚫ Control flags –
These are 6 1-bit control bits that control connection establishment,
connection termination, connection abortion, flow control, mode of
transfer etc. Their function is:URG: Urgent pointer is valid
⮚ ACK: Acknowledgement number is valid( used in case of
cumulative acknowledgement)
⮚ PSH: Request for push
⮚ RST: Reset the connection
⮚ SYN: Synchronize sequence numbers
⮚ FIN: Terminate the connection
⚫ Urgent pointer –
This field (valid only if the URG control flag is set) is used to point
to data that is urgently required that needs to reach the
receiving process at the earliest. The value of this field is added to
the sequence number to get the byte number of the last urgent byte.
TCP THREE WAY
HANDSHAKING
TCP THREE WAY
HANDSHAKING
TCP DATA TRANSFER
TCP CONNECTION TERMINATION
TCP FLOW CONTROL
DRAWBACKS IN TCP FLOW
CONTROL
SILLY WINDOW SYNDROME
⚫ Silly window syndrome is a problem in computer networking
caused by poorly-implemented TCP flow control.
⚫ If a server with this problem is unable to process all incoming
data, it requests that its clients reduce the amount of data they
send at a time (the “window” setting on a TCP packet).
⚫ If the server continues to be unable to process all incoming
data, the window becomes smaller and smaller, sometimes to
the point that the data transmitted is smaller than the packet
header, making data transmission extremely inefficient.
⚫ The name of this problem is due to the window size shrinking
to a “silly” value.
SILLY WINDOW SYNDROME

The SWS occurs due to two reasons:

⚫ SERVER SIDE(Nagles Algorithm)


⚫ RECEIVER SIDE(Clarke’s Algorithm, Delayed
Acknowledgment)
ERROR CONTROL

⚫ CHECKSUM-

⚫ Every segment contains a checksum field which is used to


find corrupted segment.
⚫ If the segment is corrupted, then that segment is discarded
by the destination TCP and is considered as lost.
⚫ TCP uses a 16-bit checksum that is mandatory in every
segment.
⚫ Acknowledgement –

⚫ TCP has another mechanism called


acknowledgement to affirm that the data segments have
been delivered.
⚫ Control segments that contain no data but have sequence
numbers will be acknowledged but not in proper way.
⚫ Retransmission –

⚫ When a segment is missing, delayed to deliver to a


receiver, corrupted when it is checked by the receiver
then that segment is retransmitted again.
⚫ Segments are retransmitted only during two events:
when the
⚫ sender receives three duplicate acknowledgements
(ACK)
or
⚫ when a retransmission timer expires
⚫ Retransmission after RTO:

⚫ TCP always preserves one retransmission time-out


(RTO)TCP always preserves one retransmission time-out
(RTO) timer for all sent but not acknowledged segments.
⚫ When the timer runs out of time, the earliest segment is
retransmitted.
⚫ Here no timer is set for acknowledgement.

⚫ Retransmission after Three duplicate ACK segments:

⚫ This is a fast retransmission because it makes it possible to


quickly retransmit lost segments instead of waiting for
timer to end.
TCP CONGESTION CONTROL

⚫ TCP congestion control is a method used by the TCP


protocol to manage data flow over a network and prevent
congestion.
⚫ Here, we assumed that only the receiver could dictate the
sender’s window size. We ignored another entity here, the
network.
⚫ If the network cannot deliver the data as fast as it is created
by the sender, it must tell the sender to slow down.
⚫ In addition to the receiver, the network is a second entity
that determines the size of the sender’s window.
TCP CONGESTION CONTROL
⚫ TCP uses a congestion window and a congestion
policy that avoid congestion.
⚫ Congestion policy in TCP –
⮚ Slow Start Phase: starts slowly increment is
exponential to threshold
⮚ Congestion Avoidance Phase: After reaching the
threshold increment is by 1
⮚ Congestion Detection Phase: Sender goes back to
Slow start phase or Congestion avoidance phase.
⚫ Slow Start Phase

⚫ Example:- If the initial congestion window size is 1


segment, and the first segment is successfully
acknowledged, the congestion window size becomes 2
segments.
⚫ If the next transmission is also acknowledged, the
congestion window size doubles to 4 segments.
⚫ This exponential growth continues as long as all
segments are successfully acknowledged.
⚫ Congestion Detection Phase

⚫ If congestion occurs, the congestion window size is


decreased. The only way a sender can guess that
congestion has happened is the need to retransmit a
segment.
⚫ Retransmission is needed to recover a missing packet
that is assumed to have been dropped by a router due to
congestion.
⚫ Retransmission can occur in one of two cases: when
the RTO timer times out or when three duplicate ACKs
are received.
TCP TIMERS
TCP implementation uses four timers –
⚫ Retransmission Timer
⚫ Persistent Timer
⚫ Keep Alive Timer
⚫ Time Wait Timer

Please refer following links:


https://www.gatevidyalay.com/tcp-timers-
transmission-control-protocol/
SESSION LAYER
⚫ This layer allows users on different machines to
establish active communications sessions between
them.
⚫ It is responsible for establishing, maintaining,
synchronizing, terminating sessions between end-user
applications.
⚫ Here, streams of data are received and further marked,
which is then resynchronized properly, so that the ends
of the messages are not cut initially and further data loss
is avoided.
Session Layer Protocols :

Session Layer uses some protocols which are required for


safe, secure and accurate communication which exists
between two-ender user applications.

⚫ AppleTalk Data Stream Protocol (ADSP): ADSP is


that type of protocol which was developed by Apple Inc.
and it includes a number of features that allow local area
networks to be connected.

⚫ ADSP itself has two protocols named: AppleTalk


Address Resolution Protocol (AARP) and Name
Binding Protocol (NBP), both aimed at making system
self-configuring.
⚫ Point-to-Point Tunneling Protocol (PPTP): PPTP is a
protocol which provides a method for implementing virtual
private networks.

⚫ Password Authentication Protocol (PAP): Password


Authentication Protocol is a password-based authentication
protocol used by Point to Point Protocol (PPP).

⚫ Remote Procedure Call Protocol (RPCP): Remote


Procedure Call Protocol (RPCP) is a protocol that is used
when a computer program causes a procedure
Design Issues with Session Layer

⚫ Management of dialog control.

⚫ It allows machines to make sessions between them


seamlessly.

⚫ Token management and Synchronization, such services


also provided by the session layer.

⚫ Provide quality and intensified services to the user.


SESSION LAYER

Responsibilities of Session Layer:

⚫ Session Creation(Authentication-Authorization)

⚫ Session Restoration

⚫ Checkpointing

⚫ Flow control and Synchronization


SESSION LAYER

⚫ Session Creation
1. Session will be initiated as packet enters into the layer.
2. Maintaining the session for further coordination.
3. Authentication-Authorization
4. The establishment of session between machines is an important
service provided by session layer. This session is responsible
for creating a dialog between connected machines. The Session
Layer provides mechanism for opening, closing and managing
a session between end-user application processes
SESSION LAYER

⚫ Session Restoration
1. Any packet is missing or interruption has occurred.
2. In case of any inactive or waiting session.
3. Synchronization
SESSION LAYER

⚫ Checkpointing

1. Checking of data streams for transferring of data.


2. Inactive or waiting phase
3. Checking for new data streams.
1. Example: If a system is sending a file of 2500 pages, It
is advisable to add checkpoints after every 100 to
ensures that a 100-page unit is successfully received and
acknowledged independently.

2. In this case, if a crash happens during transmission of


page number 824; then retransmission begins on page
801. There is no need to retransmit pages 1 to 800
pages.
SESSION LAYER

⚫ Flow control and Synchronization


1. Coordinating
2. Manages proper transmission of data packets across the
layers in session.
3. Checkpoints are the midway marks that are added after a
particular interval during stream of data transfer.
4. These points are also referred to as synchronization points.
The Session layer permits process to add these checkpoints.
SESSION LAYER-REMOTE
PROCEDURE CALL
SESSION LAYER-REMOTE
PROCEDURE CALL
The sequence of events in a remote procedure call are given as
follows −

⚫ The client stub is called by the client.


⚫ The client stub makes a system call to send the message to the
server and puts the parameters in the message.
⚫ The message is sent from the client to the server by the client’s
operating system.
⚫ The message is passed to the server stub by the server operating
system.
⚫ The parameters are removed from the message by the server stub.
⚫ Then, the server procedure is called by the server stub.
⚫ stub is a piece of code that converts parameters
passed between the client and server during a remote
procedure call (RPC).
SESSION LAYER-REMOTE
PROCEDURE CALL
Advantages of Remote Procedure Call
⚫ Some of the advantages of RPC are as follows −
⚫ Remote procedure calls support process oriented and thread
oriented models.
⚫ The internal message passing mechanism of RPC is hidden from
the user.
⚫ The effort to re-write and re-develop the code is minimum in remote
procedure calls.
⚫ Remote procedure calls can be used in distributed environment as
well as the local environment.
⚫ Many of the protocol layers are omitted by RPC to improve
performance.
SESSION LAYER-REMOTE
PROCEDURE CALL

Disadvantages of Remote Procedure Call


⚫ Some of the disadvantages of RPC are as follows −
⚫ The remote procedure call is a concept that can be implemented
in different ways. It is not a standard.
⚫ There is no flexibility in RPC for hardware architecture. It is
only interaction based.
⚫ There is an increase in costs because of remote procedure call.

You might also like