Sei sulla pagina 1di 61

Unit-5

Transport Layer

1
Transport Layer
• Transport layer acts as a liaison between the
upper-layer protocols and the lower-layer
protocols.
– To make this separation possible, the transport
layer is independent of the physical network.
– Examples: TCP, UDP, …

• An internetwork

2
The Transport Layer
• Transport layer concept

3
The Transport Layer(cont’d)
• Transport layer compared with data link layer

– The services of the transport layer are similar to those of


the data link layer.

4
Transport Protocol

(a) Environment of the data link layer.


(b) Environment of the transport layer.
5
Transport Layer
Services

Duties

Connection

The OSI Transport Protocol

6
The Transport Service
• Services Provided to the Upper Layers
• Transport Service Primitives
• Berkeley Sockets
• An Example of Socket Programming:
– An Internet File Server

7
Services Provided to the Upper Layers
The network, transport, and application layers.

8
Transport Service Primitives

The primitives for a simple transport service.

9
Transport Service Primitives (2)
The nesting of TPDUs, packets, and frames.

10
Transport Service Primitives (3)

A state diagram for a simple connection management scheme.


Transitions labeled in italics are caused by packet arrivals. The
solid lines show the client's state sequence. The dashed lines show
the server's state sequence. 11
Berkeley Sockets
The socket primitives for TCP.

12
Duties of the Transport Layer(cont’d)

• The services provided by transport layer


protocols:

13
End-to-End Delivery
• The network layer treats each packet as an
independent entry, even those belonging to a
single message.

• The transport layer oversees the end-to-end


(source-to-destination) delivery of an entire
message.

14
Addressing
• Levels of Service Access Points
– Data link level protocols need to know which two
computers within a network are communicating.
• MAC address
– Network level protocols need to know which two
computers within an internet are communicating.
• IP address
– Transport level protocols need to know which
upper-layer protocols are communicating.
• Port

15
Addressing
TSAPs, NSAPs and transport connections.

16
Addressing (cont’d)
• In transport layer, service access points identifies upper-layer
services (applications).

17
Reliable Delivery
• Aspects of reliable delivery

18
Reliable Delivery(cont’d)
• Error Control
– Mechanisms for error control are based on error
detection and retransmission.
– Error detections are performed using algorithms
implemented in software, such as checksum.
– We already have error handling at the data link
layer, why do we need it at the transport layer?

19
Reliable Delivery(cont’d)
• Sequence Control

Segmentation Reassembly

– What is important is that segments are properly


reassembled at the destination.

20
Reliable Delivery(cont’d)
• Segmentation and Reassembly
– Transport layer adds a sequence number at each segment.
– This number indicates the order for reassembly.
– Each segment carries a field that indicates whether it is the
final segment or middle segment of a transmission.
• Concatenation and Separation
– When the size of the data unit belonging to a single
session is so small that several units can fit together into a
single datagram.
– A sequence number at each unit allows correct separation
at the destination.

21
Reliable Delivery(cont’d)
• Loss Control
– Sequence numbers allow the receiver’s transport
layer protocol to identify any missing segments
and request redelivery.

22
Reliable Delivery(cont’d)
• Duplication Control
– Sequence numbers allow the receiver to identify
and discard duplicate segments.

23
Flow Control and buffering
• Flow control at this layer is performed end-to-end rather than
across a single link.
• A sliding window is used to make data transmission more
efficient as well as to control the flow of data so that the
receiver does not become overwhelmed.
• Some points about sliding windows at the transport layer:
– The sender does not have to send a full window’s worth of
data.
– An acknowledgment can expand the size of the window
based on the sequence number of the acknowledged data
segment.
– The size of the window can be increased or decreased by
the receiver.
– The receiver can send an acknowledgment at anytime.

24
Flow Control and buffering)
• Sliding window

25
Flow Control and buffering
• Sliding windows used at the transport layer are usually byte
oriented rather than frame oriented.

26
Multiplexing
• Upward Multiplexing
– The transport layer can send several transmissions bound for the
same destination along the same path.
– It is useful when the underlying networks have high throughput.
• Downward Multiplexing
– It is useful when the underlying networks have low or slow
capacity(e.g., X.25’s three bit sequence code).

27
Connection
• End-to-end delivery can be accomplished in either of two modes:
– Connection-oriented transmission has three stages:
• connection establishment,
• data transfer,
• connection termination.

– Connectionless transmission

28
Connection(cont’d)
• Connection establishment(three-way
handshaking)

29
Connection Establishment

Three protocol scenarios for establishing a connection using a


three-way handshake. CR denotes CONNECTION REQUEST.
(a) Normal operation,
(b) Old CONNECTION REQUEST appearing out of nowhere.
b) As shown in b) the first TPDU is a delayed duplicate
CONNECTION REQEST from an old connection .The host1 does
not know about it.host2 sends a connection accepted TPDU.but
host1 is not trying for connection establishment and sends
30
REJECT along with ACK=y
Connection Establishment
(c) Duplicate CONNECTION REQUEST and duplicate ACK.

• Worst case situation connection request and ACK


duplicated.host2 gets CR ,sends ACK,host2 proposed a
connection with a seq.no.y .
• When t he second delayed TPDU arrives at host2 ,it
understand that z has been acknowledged and not y.so
it understands that this is too is an old duplicate 31
Connection Release

Abrupt disconnection with loss of data. 32


Connection(cont’d)
• Connection termination(three-way handshaking)

– Termination at TCP: four-way handshaking

33
Crash Recovery
Different combinations of client and server
strategy.

The crash can be recovered by resending lost data.


If n/e layer provides virtual ckt and that is lost then new V.C can be used.

34
The OSI Transport Protocol
• To avoid redundant services, the OSI model
defines five types of transport classes:
– TP0: Simple class
– TP1: Basic error recovery class
– TP2: Multiplexing class
– TP3: Error recovery and multiplexing class
– TP4: Error detection and recovery class

35
The OSI Transport Protocol(cont’d)
• Which class is used depends on the type of service required
by the upper layers.
– TP0 and TP2 are used with perfect network layers.
• In the perfect network layer, the number of packets
that are lost or damaged is almost zero.
– TP1 and TP3 are used with residual-error network layers.
• In the residual-error network layer, some percentage of
errors are never corrected.
– TP4 is used with unreliable network layers.
• TP4 provides fully reliable, full-duplex, connection-
oriented services similar to TCP.
36
The OSI Transport Protocol(cont’d)
• TPDU(Transport Protocol Data Unit)

– Length : Total number of bytes (excluding the length field itself) in the
TPDU.
– Fixed Parameters :
• Code : CR, CC, DR, DC, DT(data), ED, AK, EA, RJ, ER
• Source and destination reference
• Sequence number
• Credit allocation : It enables a receiver to tell the sender how
many more data units may be sent.
– Variable(Optional) Parameters :
• These parameters are used mostly for management.
– Data

37
The OSI Transport Protocol(cont’d)
• Connection-Oriented and Connectionless
Service
– The OSI model supports both COTS and CLTS.
– Connection-oriented model is more commonly
used.

38
Transport Layer Protocols
• The two most common Transport layer
protocols of TCP/IP protocol suite are
Transmission Control Protocol (TCP) and User
Datagram Protocol (UDP). Both protocols
manage the communication of multiple
applications. The differences between the two
are the specific functions that each protocol
implements.

39
Transmission Control Protocol
• TCP is a connection-oriented protocol,
described in RFC 793.
• Each TCP segment has 20 bytes of overhead in
the header encapsulating the Application layer
data.
• Same order delivery
• Reliable delivery
• Flow control.
40
Transmission Control Protocol
• Applications that use TCP are:
– Web Browsers
– E-mail
– File Transfers

41
The TCP Segment Header

TCP Header. 42
• When two hosts communicate using TCP, a connection is
established before data can be exchanged.
• To establish the connection, the hosts perform a three-
way handshake. Control bits in the TCP header indicate
the progress and status of the connection. (flags)
– URG - Urgent pointer field significant
– ACK - Acknowledgement field significant
– PSH - Push function:receiver should pass this data to upper layer
as soon as possible.
– RST - Reset the connection.all queued data and allocated buffers
can be freely relinquished.
– SYN - Synchronize sequence numbers seinitnder wants to sync
the conn. Used during initial phases of connection
establishment phase.
– FIN - No more data from sender it is the final segment from
the current TCP connection.

43
• Window =16 bit by TCP for flow control
• Checksum=header +data field
• Urgent pointer=location of the urgent data
• Optyions =not more than 40 bytes due to size of
header length field (4 bits)
• Common options +MSS .A TCP receiver tells the
TCP sender the max seg size (MSS),other options
are used in flow control and congestion control.
• Padding + zeros to make 32 bit word boundary in
TCP header due to options

44
The TCP Segment Header
The pseudoheader included in the TCP
checksum.

45
Port addressing
• Port numbers – unique application identifiers
• Port numbers are assigned in various ways, depending on
whether the message is a request or a response. While
server processes have static port numbers assigned to
them, clients dynamically choose a port number for each
conversation.
• When a client application sends a request to a server
application, the destination port contained in the header
is the port number that is assigned to the service
daemon running on the remote host.
• Example – web page access

46
Knowing the ports
• The client software must know what port number is
associated with the server process on the remote host.
• The source port in a segment or datagram header of a
client request is randomly generated from port numbers
greater than 1023.This port number acts like a return
address for the requesting application.
• The Transport layer keeps track of this port and the
application that initiated the request so that when a
response is returned, it can be forwarded to the correct
application.
• Socket = ?

47
Port numbers
• Well known ports (Numbers 0 to 1023)
• Registered Ports (Numbers 1024 to 49151)
• Dynamic or Private Ports (Numbers 49152 to
65535)
• The Internet Assigned Numbers Authority
(IANA) assigns port numbers.
• netstat

48
TCP Ports

49
TCP Congestion Control

(a) A fast network feeding a low capacity receiver.


(b) A slow network feeding a high-capacity receiver.
50
TCP Congestion Control (2)

An example of the Internet congestion algorithm. 51


TCP Timer Management

(a) Probability density of ACK arrival times in the data link layer.
(b) Probability density of ACK arrival times for TCP.

52
The Internet Transport Protocols: UDP

• Introduction to UDP
• Remote Procedure Call
• The Real-Time Transport Protocol

53
User Datagram Protocol
• UDP is a simple, connectionless protocol,
described in RFC 768.
• It has the advantage of providing for low
overhead data delivery.
• The pieces of communication in UDP are
called datagrams.
• These datagrams are sent as "best effort" by
this Transport layer protocol.
• 8 bytes overhead
54
UDP
• UDP is a simple protocol that provides the
basic Transport layer functions.
• Application layer protocols that use UDP
include:
– Domain Name System (DNS)
– Simple Network Management Protocol (SNMP)
– Dynamic Host Configuration Protocol (DHCP)
– Routing Information Protocol (RIP)
– Trivial File Transfer Protocol (TFTP)
– Online games

55
User Datagram Protocol
• Applications that use UDP include:
– Domain Name System (DNS)
– Video Streaming
– Voice over IP (VoIP)

56
UDP Ports

57
Remote Procedure Call
Steps in making a remote procedure call. The
stubs are shaded.

58
The Real-Time Transport Protocol
(a) The position of RTP in the protocol stack. (b)
Packet nesting.

59
The Real-Time Transport Protocol (2)
The RTP header.

60
TCP+UDP Ports

61

Potrebbero piacerti anche