Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Networks Unit - IV: Transport Layer

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 60

COMPUTER NETWORKS

Unit – IV
Transport Layer
Introduction (Transport Layer)
 A transport layer protocol provides for logical communication between
application processes running on different hosts.
 The logical communication means that the communicating application
processes are not physically connected to each other from the
applications viewpoint.
 Application processes use the logical communication provided by the
transport layer to send messages to each other.
 Transport layer protocols are implemented in the end systems but not
in network routers. Network routers only act on the network-layer
fields. All transport layer protocols provide an application
multiplexing/de-multiplexing service.

2
Introduction (Transport Layer)
The transport service is said to perform “peer to peer” communication,
with the remote transport entity. The data communicated by the
transport layer is encapsulated in a transport layer PDU and sent in a
network layer SDU The network layer nodes transfer the transport PDU
intact, without decoding or modifying the content of the PDU.
 The transport layer is the fourth layer In the OSI layered architecture.
The Transport layer is responsible for reliable data delivery.

3
Introduction (Transport Layer)
Transport Layer Functions:
 This layer breaks messages into packets.
 It performs error recovery if the lower layer are not adequately error free
 Function of flow control if not done adequately at the network layer.
 Functions of multiplexing and de-multiplexing sessions together.
 This layer can be responsible for setting up and releasing connections
across the network.
Following parameters are used for communication:
1. Local host
2. Local process
3. Remote host
4. Remote process
4
Transport Services

 The following categories of service are useful for describing the transport
service.
1. Type of service
2. Quality of service
3. Data transfer
4. User interface
5. Connection management
6. Expedited delivery
7. Status reporting
8. Security

5
User Datagram Protocol (UDP)
 UDP is a simple, datagram-oriented, transport layer protocol. This
protocol is used in place of TCP. UDP is connectionless protocol
provides no reliability or flow control mechanisms. It also has no error
recovery procedures.
 Several application layer protocols such as TFTP (Trivial File Transfer
Protocol) and the RPC use UDP. UDP makes use of the port concept to
direct the datagrams to the proper upper-layer applications. UDP serves
as a simple application interface to the IP.
 The UDP datagram contains a source port number and destination port
number. Source port number identifies the port of the sending application
process. The destination port number identifies the receiving process on
the destination host machine.
6
User Datagram Protocol (UDP)

UDP encapsulation

7
User Datagram Protocol (UDP)

UDP header

8
User Datagram Protocol (UDP)

 The UDP length field is the length of the UDP header and the UDP data
in bytes.
 The UDP checksum covers the UDP header and the UDP data. Both
UDP and TCP include a 12 byte pseudo-header with the UDP datagram
just for the checksum computation.
 UDP checksum is end-to-end checksum. It is calculated by the sender,
and then verified by receiver. It is designed to catch any modification of
the UDP header or data anywhere between sender and receiver.

9
User Datagram Protocol (UDP)
Port Numbers and Applications:

 UDP uses port numbers as the addressing mechanisms in the transport


layer.
Port No. Protocol Description
7 Echo Echoes a received datagram back to the
sender.
9 Discard Discards any datagram that is received.
11 Users Active users.
13 Daytime Returns the date and the time
17 Quote Returns the quote of the day
19 Chargen Returns a string of characters
53 Nameserver Domain Name Service
67 Bootps Client port to download bootstrap
information
68 Bootpc Client port to download bootstrap
information
69 TFTP Trivial File Transfer Protocol
111 RPC Remote Procedure Call
123 NTP Network Time Protocol
161 SNMP Simple Network Management Protocol
10
User Datagram Protocol (UDP)
Applications of UDP :

 UDP is used for some route updating protocols such as RIP.


 UDP is used for multicasting.
 It is suitable for a process with internal flow and error control
mechanisms.

11
User Datagram Protocol (UDP)

Remote Procedure Calls (RPC) :

 RPC is based on a client-server model that is an asymmetric type of


communication. The ISO-OSI model and TCP/IP support the process of
RPC. Client server model widely used in the local area networks in which
dump terminals node access the server to obtain application software,
files, etc.
 RPC is implemented in the client-server operation through a technique
called STUB. Stub is a procedure such as read or write and can be
defined for each server’s clients.
 If the server fails problem will occur in RPC. CLIENT

12
User Datagram Protocol (UDP)
Remote operations with stub :

13
User Datagram Protocol (UDP)

OSI remote procedure operations:

 It is based on two operation sending request to server and receiving


the result to the client. The result of the operation can report on various
combinations of success or failure. ROSE also uses class number to
describe the result of the operation, either for synchronous or
asynchronous communication processes.
 For obtaining the services from remote server, Unix operating
system programming syntax is used. Remote commands also allow the
C programs to write data as input to the remote process and read from
the local program what the remote process has output.

14
User Datagram Protocol (UDP)

Real Time Transport Protocol:

 Real time transport protocols run over user datagram protocol.


Real Time Protocol (RTP) used in multimedia applications,
videoconferencing, music-on-demand, video-on-demand. Audio, video
and text are the content of the multimedia.
 Multimedia application also contains other types of data streams.
All these data is stored into the RTP library in user space along with the
application. This library then multiplexes the streams and encodes them
in RTP packets, which then stuffs into a socket.

15
User Datagram Protocol (UDP)
Real Time Transport Protocol:

 Version: Size of version field is 2-bits. It indicates version number.


The current version is 2.
 P bit: Size is 1-bit. P bit indicates that the packet has been padded
to a multiple of 4 bytes.
 X-bit: Size is again 1-bit and it indicates that the extension header
is present.
 CC field: Size of CC field is 4-bits. CC field is used for indicating
number of source present. The range is from 0 to 15.
 M bit: Marker bit is of 1-bit size. This bit is used to indicate start of
the frame. It may be video frame, start of a word in an audio channel.

16
User Datagram Protocol (UDP)

Real Time Transport Protocol:

 Payload type: Size of the payload type field is 7-bits. This field is
used for indicating encoding algorithm has been used. It determines its
interpretation by the application.
 Sequence number: This 16-bit field is incremented by one each time
an RTP packet is sent. The number can be used by the receiver to detect
packet loss and to recover packet sequence. The initial value is selected
at random.

17
User Datagram Protocol (UDP)
Real Time Transport Protocol:

 Time stamp: It is 32-bits number specifies the sampling instant of


the first byte in the RTP data packet. This value can help to reduce jitter
at the receiver by decoupling the playback from the packet arrival time.
The initial value is selected at random.
 Synchronization source identifier: This field tells which stream the
packet belongs to. It is the method used to multiplex and demultiplex
multiple data streams onto a single stream of UDP packets.
 Contributing source identifier: This list of 0 to 15 thirty-two bit items
specifies the contributing sources for the payload contained in the
packet. This field is used when mixers are present in the studio.

18
User Datagram Protocol (UDP)
RTP Control Protocol (RTCP) :

 RTCP is the protocol of RTP, RTCP provides feedback on the


quality of the data distribution. It does not support transport of data.
 RTCP provides the feedback on delay, jitter, congestion, bandwidth
to the sources. This feedback information is sent in the form of RTCP
sender and receiver reports. This information can be used by the
encoding process to increases data rate.
 RTCP defines several types of packets to carry different types of
control information.
 Types of packets are: Sender Report (SR), Receiver Report (RR),
Source description (SDES), BYE and APP.

19
User Datagram Protocol (UDP)

RTP Control Protocol (RTCP) :

 Sender report gives transmission and reception statistics from active


senders.
 Receiver report gives reception statistics from participants that are
not active sender.
 SDES provides source description items such as CNAME, email,
name, phone number, location etc.
 BYE indicates the end of participation by the sender.
 APP provides application specific functions that are defined in
profile specification.

20
Transmission Control Protocol (TCP)

 Transmission Control Protocol (TCP) is the connection oriented


protocol whereas User Data Protocol (UDP) is connectionless protocol.
Both are internet protocols used in the transport layer.
 TCP provides a connection-oriented, reliable, byte stream service.
The term connection oriented means the two applications using TCP
must establish a TCP connection with each other before they can
exchange data.

21
Transmission Control Protocol (TCP)

TCP Services :
 TCP and UDP use the same network layer (IP), TCP provides totally
different services. TCP provides a connection-oriented, reliable, byte
stream service. There are exactly two end points communicating with
each other on a TCP connection.
 TCP does not support multicasting and broadcasting. The
application data is broken into what TCP considers the best sized chunks
to send. The unit of information passed by TCP to IP is called a segment.
 When TCP sends a segment it maintains a timer, waiting for the other
end to acknowledge reception of segment. If an acknowledgement isn’t
received in time, the segment is retransmitted.

22
Transmission Control Protocol (TCP)
TCP Services :

 When TCP receives data from the other end of the connection, it
sends an acknowledgement. TCP maintains a checksum on its header
and data.
 TCP segments are transmitted as IP datagrams, and since IP
datagrams can arrive out of order, TCP segments can arrive out of order.
Since IP datagrams can get duplicated, a receiving TCP must discard
duplicate data.
 TCP also provides flow control. Each end of a TCP connection has
a finite amount of buffer space. A receiving TCP only allows the other
end to send as much data as the receiver has buffers for. This prevents a
fast host from taking all the buffers on a slower host.

23
Transmission Control Protocol (TCP)

TCP Services :

 A TCP connection is a byte stream, not a message stream. A


stream of 8-bit bytes is exchanged across the TCP connection between
the two applications. There are no record markers automatically inserted
by TCP. This is called a byte stream service.
 If the application on one end writes 20 bytes followed by a write of
40 bytes, followed by a write of 80 bytes, the application at the other end
of the connection.

24
Transmission Control Protocol (TCP)
TCP Segment Format :
 Encapsulation of TCP data

25
Transmission Control Protocol (TCP)
TCP Segment Format :
 TCP header format

26
Transmission Control Protocol (TCP)

TCP Segment Format :


 Description of field in the TCP header as follows:
 Source port
 Destination port.
 Sequence number
 Acknowledgement number
 Header length
 Reserved
 TCP header contains six flag bits. They are, URG, ACK, PSH, RST, SYN, FIN.
 Window size
 Checksum
 Urgent pointer
 Options
 Data

27
Transmission Control Protocol (TCP)

TCP Protocol:

 Sending receiving TCP entities exchange data in the form of


segments. A TCP segments consists of a fixed 20-byte header followed
by zero or more data bytes.
 TCP software decides how big segments should be. Two limits restrict
the segment size.
 Each segment including the TCP header must fit in the 65515 bytes
IP payload 2.
 Each network has a Maximum Transfer Unit (MTU) and each segment
must fit in the MTU.
 The basic protocol used by TCP entities is the sliding window protocol.

28
Transmission Control Protocol (TCP)

TCP Connection Establishment:

 Connection establishment in a TCP session is initialized through a


three-way handshake. To establish the connection, one side (server)
passively waits for an incoming connection by executing the LISTEN and
ACCEPT primitives, either specifying a specific source.
 Other side (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.
 A connection is established using a three-way handshake
The transmitter sends connection request (seq=x) to start a
connection with transmitter message id x.

29
Transmission Control Protocol (TCP)
TCP Connection Establishment:

30
Transmission Control Protocol (TCP)
TCP Connection Release:

 Any of the two parties involved in exchanging data can close the
connection when connection in one direction is terminated, the other
party can continue sending data in the other direction.
 Four step connection termination. Steps are as follows:
The client TCP sends the first segment, a FIN segment.
The server TCP sends the second segment, an ACK segment, to
confirm the receipt of the FIN segment from the client.
The server TCP can continue sending data in the server client direction.
When it does not have any more data to send, it sends the third
segment.
The client TCP sends the fourth segment, an ACK segment, to confirm
the receipt of the FIN segment from the TCP server.
31
Transmission Control Protocol (TCP)
Four steps connection termination:

32
Transmission Control Protocol (TCP)
TCP Connection Management Modeling :

 The lightface lines are unusual event sequences.


 The event can either be a user-initiated system call (CONNECT
LISTEN, SEND, or CLOSE), a segment arrival (SYN, FIN, ACK, or RST),
or in one case, a timeout of twice the maximum packet lifetime. The
action is the sending of a control segment (SYN, FIN, or RST) or nothing,
indicated by – Comments are shown in parentheses.
 The diagram can best be understood by first following the path of a
client (the heavy solid line) then later the path of a server (the heavy
dashed line). When an application on the client machine issues a
CONNECT request, the local TCP entity creates a connection record,
marks it as being in the SYN SENT state, and sends SYN segment.

33
Transmission Control Protocol (TCP)
TCP Connection Management Modeling :

 When the ACK arrives, a transition is made to state FIN WAIT 2 and one
direction of the connection is now closed. When the other side closes,
too, a FIN comes in, which is acknowledged. Now both sides are closed,
but TCP waits a time equal to the maximum packet lifetime to guarantee
that all packets from the connection have died off, just in case the
acknowledgement was lost. When the timer goes off, TCP deletes the
connection record.
 Connection management from server view point, sever does a LISTEN
and settles down to see who turns up. When a SYN comes in, it is
acknowledged and the server goes to the SYN ACK state. When the
server’s SYN is itself acknowledged, the three way handshake is
complete and the server goes to the ESTABLISHED state.
34
Transmission Control Protocol (TCP)
Finite state Machine for TCP Connection :

35
Transmission Control Protocol (TCP)

Comparison between TCP and UDP:

SNO TCP UDP

1. TCP is connection oriented. UDP is connectionless.

2. TCP connection is byte stream. UDP connection is message stream.

3. It provides error control and flow control It does not provide flow control and error control

4. TCP does not support multicasting and It support broadcasting.


broadcasting.

5. TCP supports full duplex transmission It does not support full duplex transmission.

6. TCP is reliable. UDP is unreliable.

7. TCP packet is called segment. UDP packet is called user datagram.

36
Congestion Control
 TCP uses a form of end to end flow control. Both the sender and the
receiver agree on a common window size for packet flow. The window
size represents the number of bytes that the source can send at a time.
 The window size varies according to the condition of traffic in the network
to avoid congestion.
 A file of size f with a total transfer time of ‘A’ on a TCP connection results
in a TCP transfer throughput ®. i.e. Bandwidth utilization (pu) = where B
= Link bandwidth
 TCP has three congestion control methods
1. Additive increase
2. Slow start
3. Retransmit

37
Congestion Control
Additive Increase, Multiplicative Decrease Control (AIMD):
 TCP maintains a new state variable for each connection, called
congestion window, which is used by the source to limit how much data it
is allowed to have in transit at a given time. The congestion window
represents the amount of data, in bytes.
 AIMD performs a slow increase in the congestion window size when the
congestion in the network decreases and a fast drop in the window size
when congestion increases.
 Let W be the maximum window size, in bytes, representing the maximum
amount of unacknowledged data that a sender is allowed to send.

38
Congestion Control
Additive Increase, Multiplicative Decrease Control (AIMD):
 Max window replaces Advertised window in the calculation of Effective
window.
 Two important factors in setting timeouts follow.
1.Average round trip times (RTTs) and RTT standard deviation
based to set timeouts.
2. RTTS are sampled once every RTT is completed.

39
Congestion Control
Slow Start Method :
 Slow start method increases the congestion window size nonlinearly and
in most cases exponentially, as compared to the linear increase in
additive increase. In this method, the congestion window is again
interpreted in packets instead of bytes.
 The slow start method is normally used.
1. Just after a TCP connection is set up.
2. When a source is blocked, waiting for a timeout.

40
Congestion Control
Slow Start Method :

41
Congestion Control

Congestion:
When too many packets rushing to a node or a part of network, the network
performance degrades, and this situation is called as congestion. When the
number of packets dumped into the subnet and as traffic increases the
network is no longer able to cope and design losing packets at very high
traffic, performance collapses completely and almost no packets are
delivered.

42
Congestion Control

Congestion Control:
Congestion control is a process of maintaining the number of packets in a
network below a certain level at which performance falls off. Congestion
control makes sure that subnet is able to carry the offered traffic. So
congestion control is different process than flow control.

43
Resource Allocation

Ensuring efficient use of network resources


Balancing between demand and available resources
Importance:
Key for achieving high network performance
Essential for meeting Quality of Service (QoS) requirements
Objectives:
Fairness: Equal opportunity for all users
Efficiency: Maximizing utilization of available resources
QoS: Guaranteeing performance levels for different applications

44
Techniques for Resource Allocation
Static vs. Dynamic Allocation:
Static: Fixed allocation, simple but inflexible
Dynamic: Adaptive allocation based on demand, more
efficient
Centralized vs. Distributed Allocation:
Centralized: Single control point, easier management but
single point of failure
Distributed: Multiple control points, more robust but complex

45
TCP Congestion Control
Primary Goals:
Avoid congestion collapse
Efficiently utilize available bandwidth
Ensure fairness among multiple TCP flows
Additional Objectives:
Minimize delay and packet loss
Maintain stability in network traffic
TCP Congestion Control Mechanisms
Key Mechanisms:
Slow Start
Congestion Avoidance
Fast Retransmit
Fast Recovery

46
Slow Start
Initial phase of TCP congestion control
Exponential increase in congestion window (cwnd)
Congestion Avoidance
Phase following Slow Start
Linear increase in cwnd to avoid congestion
Fast Retransmit
Quick retransmission of lost packets
Fast Recovery
Recover from packet loss without returning to Slow Start

47
Congestion Avoidance

Congestion Avoidance:
A congestion avoidance scheme allows a network to operate in the region of
low delay and high throughput. It is a prevention mechanism while
congestion control is a recovery mechanism.

48
Congestion Avoidance
DECbit Scheme:

 DECbit means destination experiencing congestion bit.


 DECbit method is developed on the Digital Network Architecture (DNA).
 It split the responsibility between routers and end hosts. It is router-
based congestion avoidance method.
 Uses a congestion-indication bit in packet header to provide feedback
about congestion. Upon packet arrival, the average queue length is
calculated for last (busy + idle) period plus current busy period. When
the average queue length exceeds one, the router sets the congestion-
indicator bit in arriving packet’s header.
 Queue length is counted over last busy period + idle + current busy
period.
49
Congestion Avoidance

RED:
 RED stands for Random Early Detection. The main idea is to provide
congestion control at the router for TCP flows. RED is based on DECbit,
and was designed to work well with TCP.
 RED implicitly notifies sender by dropping packets. Packet dropping
probability is increased as the average queue length increases.
 The moving average of the queue length is used so as to detect long
term congestion, yet allow short term bursts to arrives.

50
Congestion Avoidance

Properties of RED:
 Drops packets before queue is full, in the hope of reducing the rates of
some flows.
 Drops packet for each flow roughly in proportion to its rate.
 Drops are spaced out in time.
 Because it uses average queue length, RED is tolerant of bursts.
 Random drops hopefully desynchronize TCP sources.

51
Quality of Service (QoS)

 In any multimedia application audio/video packets are delay sensitive


internet all packets are treated equally i.e. QoS offered is same for all
applications. This causes congestion in traffic followed by delay and loss
of packets.
 Analyzing varying network scenarios principles of Quality of Services
(QoS) needed for multimedia applications are derived.

52
Quality of Service (QoS)

Policing:
 Policing is the regulation of the rate at which packet flow is injected
into the network.
Criteria for policing :
 Three important policing criteria are identified, these are:
1. Average rate
2. Peak rate
3. Burst size

53
Quality of Service (QoS)

 Average rate: Average rate is defined as packets per time interval. The
average rate of packets in a network can be limited as a policy. This
limits the traffic in the network for a long period of time.
 Peak rate: Peak rate is defined as maximum number of packets that can
be sent over a short period of time over a network.
 Burst size: Burst size is the maximum number of packets that can be
sent into the network over a extremely short interval of time.

54
Quality of Service (QoS)

Integrated Services:
 Integrated service is a framework to provide guaranteed to individual
application sessions.
 A call step process involves following steps:
1.Traffic characterization and specification of desired QoS.
2.Signalling for call setup.
3. Pre element call admission.
 The integrate architecture defines two major classes of service.
a. Guaranteed service.
b. Controlled load service.

55
Quality of Service (QoS)
Integrated Services:

Traffic Shaping :

 Traffic shaping is about regulating the average rate of data transmission.


 Traffic shaping smooths out the traffic on the server, rather than on the
client side.
 Monitoring a traffic flow is called traffic policing. Agreeing to a traffic
shape and policing it afterward are easier with virtual circuit subnets than
with datagram subnets.
 Two types of algorithm are used for traffic shaping.
1.Leaky bucket algorithm

2.Token bucket algorithm

56
Quality of Service (QoS)

Integrated Services:
Traffic Shaping :
SNO Leaky Bucket (LB) Token Bucket (TB)

1. Leaky bucket discards packets Token bucket discards tokens.

2. With LB, a packet can be transmitted, if the With TB/ a packet can only be transmitted if there
bucket is not full. are enough tokens to cover its length in bytes.

3. LB sends the packets at an average rate. TB allows for large bursts to be sent faster by
speeding up the output.

4. LB does not allow saving, a constant rate is TB allows saving up tokens (permissions) to send
maintained. large bursts.

57
Quality of Service (QoS)
Integrated Services:

Admission Control:

 An admission control, which is a quality of service mechanism, can also


prevent congestion in virutal circuit networks. Admission control in ATM
operates at the connection level and is therefore called connection
admission control.
 Switches in a flow first check the resource requirement of a flow before
admitting it to the network.
 A router can deny establishing a virtual circuit connection if there is
congestion the network.
 A source initiating a new flow must first obtain permission from an
admission control entity that decides whether the flow should be
accepted or rejected.
58
Quality of Service (QoS)
Integrated Services:
RSVP (Resource reservation Protocol):
 RSVP is a signalling protocol used to reserve resources in the Internet.
RSVP is a bandwidth reservation protocol.
 RSVP protocol allows applications to reserve bandwidth for their data
flows.
Characteristics of RSVP
 It provides reservations for bandwidth in multicast trees.
 RSVP is receiver-oriented i.e. receiver initiates this protocol for resource
reservation.

59
Quality of Service (QoS)

Differentiated Services/QoS :

 Some difficulties associated with RSVP and Intserv model are:


1.Scalability: Reservation requests cause significant
overhead in large networks.
2. Flexible service models: The pre-specified service
classes make them vulnerable to router crashes.

60

You might also like