The Transport Layer
The Transport Service
•
•
•
•

Services Provided to the Upper Layers
Transport Service Primitives
Berkeley Sockets
An Exam...
Services Provided to the Upper Layers

The network, transport, and application layers.
Transport Service Primitives

The primitives for a simple transport service.
Transport Service Primitives (2)

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

A state diagram for a simple connection management scheme.
Transitions labeled in italic...
Berkeley Sockets

The socket primitives for TCP.
Elements of Transport Protocols
•
•
•
•
•
•

Addressing
Connection Establishment
Connection Release
Flow Control and Buffe...
Transport Protocol

(a) Environment of the data link layer.
(b) Environment of the transport layer.
Note:
The transport layer is responsible for
process-to-process delivery.
Types of data deliveries
Port Numbers
IP addresses versus port numbers
Socket Sample
Multiplexing & De-multiplexing
Connection Establishment (1)
Connection Release
a)
b)
c)

d)

There are two styles of terminating a connection: asymmetric
release and symmetric releas...
Connection Release
Connection Release (2)

The two-army problem.
Symmetric Release (3)
a)
b)

c)
d)

e)
f)

To see the relevance of the two-army problem to releasing
connections, just sub...
Connection Release (4)

6-14, c,d

(c) Response lost. (d) Response lost and subsequent DRs lost.
Error Control
Flow Control and Buffering

(a) Chained fixed-size buffers. (b) Chained variable-sized buffers.
(c) One large circular buf...
The Internet Transport Protocols: UDP
• Introduction to UDP
• Remote Procedure Call
• The Real-Time Transport Protocol
Note:
UDP is a connectionless, unreliable
protocol that has no flow and error
control. It uses port numbers to
multiplex d...
Introduction to UDP

The UDP header.
Popular Application
Port

Protocol

Description

7

Echo

Echoes a received datagram back to the sender

9

Discard

11

U...
Remote Procedure Call

Steps in making a remote procedure call. The stubs are shaded.
The Real-Time Transport Protocol

(a) The position of RTP in the protocol stack. (b) Packet nesting.
The Internet Transport Protocols: TCP
•
•
•
•
•
•

Introduction to TCP
The TCP Service Model
The TCP Protocol
The TCP Segm...
Port

Protocol

   7

Echo

Description
Echoes a received datagram back to the sender

9

Discard

Discards any datagram t...
The TCP Service Model (2)

(a) Four 512-byte segments sent as separate IP datagrams.
(b) The 2048 bytes of data delivered ...
Stream Delivery
Sending & Receiving Window
Example 1
Imagine a TCP connection is transferring a file of 6000 bytes. The
first byte is numbered 10010. What are the se...
Note:
The bytes of data being transferred in
each connection are numbered by
TCP. The numbering starts with a
randomly gen...
Note:
The value of the sequence number
field in a segment defines the number
of the first data byte contained in that
segm...
Note:
The value of the acknowledgment field
in a segment defines the number of the
next byte a party expects to receive.
T...
The TCP Segment Header
The TCP Segment Header (2)
Connection Establishment

Active
open

Passive
open

seq: 8000
UAPRS F
SYN

Connection
opened

seq: 15000
ack: 8001
nd: 50...
Connection Release
TCP Transmission Policy

Window management in TCP.
TCP Transmission Policy (2)

Silly window syndrome.
TCP Congestion Control

(a) A fast network feeding a low capacity receiver.
(b) A slow network feeding a high-capacity rec...
Congestion Control
a)

TCP has a mechanism for congestion control. The mechanism is
implemented at the sender

b)

The win...
AIMD
Source

Add one packet
each RTT

Destination
Disadvantage
a)
b)
c)
d)

Too slow.
Reacts aggressively.
Wastage of bandwidth at initial stage.
Congestion is detected whe...
Congestion Control
a) The sender has two additional parameters:
–
–

Congestion Window (cwnd) Initial value is 1 MSS (=max...
Slow start, exponential increase
1
cwnd
RTT
2
cwnd

RTT
4
cwnd

RTT
8
cwnd
Note

In the slow start algorithm, the size of the
congestion window increases exponentially
until it reaches a threshold.
Congestion avoidance, additive increase
Note

In the congestion avoidance algorithm the
size of the congestion window
increases additively until
congestion is det...
TCP Timers
Retransmission Timer
a)
b)
c)

When a segment is sent, a retransmission timer is started.
If the segment is acknowledged b...
Persistence Timer
a)
b)

c)

It is designed to prevent the following deadlock.
The receiver sends an acknowledgement with ...
Keep-alive Timer
a)

b)

When a connection has been idle for a long time, the keep-alive
timer may go off to cause one sid...
Timed Wait Timer
a)

It runs for twice the maximum packet lifetime to make sure that
when a connection is closed, all pack...
Thanks
It’s beginning of end
Lecture 10   transport layer
Upcoming SlideShare
Loading in...5
×

Lecture 10 transport layer

2,479

Published on

Complete Description of Transport Layer

Published in: Education, Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,479
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
213
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Lecture 10 transport layer

  1. 1. The Transport Layer
  2. 2. The Transport Service • • • • Services Provided to the Upper Layers Transport Service Primitives Berkeley Sockets An Example of Socket Programming: – An Internet File Server
  3. 3. Services Provided to the Upper Layers The network, transport, and application layers.
  4. 4. Transport Service Primitives The primitives for a simple transport service.
  5. 5. Transport Service Primitives (2) The nesting of TPDUs, packets, and frames.
  6. 6. 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.
  7. 7. Berkeley Sockets The socket primitives for TCP.
  8. 8. Elements of Transport Protocols • • • • • • Addressing Connection Establishment Connection Release Flow Control and Buffering Multiplexing Crash Recovery
  9. 9. Transport Protocol (a) Environment of the data link layer. (b) Environment of the transport layer.
  10. 10. Note: The transport layer is responsible for process-to-process delivery.
  11. 11. Types of data deliveries
  12. 12. Port Numbers
  13. 13. IP addresses versus port numbers
  14. 14. Socket Sample
  15. 15. Multiplexing & De-multiplexing
  16. 16. Connection Establishment (1)
  17. 17. Connection Release a) b) c) d) There are two styles of terminating a connection: asymmetric release and 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. asymmetric release may result in loss of data:
  18. 18. Connection Release
  19. 19. Connection Release (2) The two-army problem.
  20. 20. Symmetric Release (3) a) b) c) d) e) f) To see the relevance of the two-army problem to releasing connections, just substitute ”disconnect” for ”attack.” if neither side is prepared to disconnect until it is convinced that the other side is prepared to disconnect too, the disconnection will never happen. Examples: Normal case: Host 1 sends disconnect request (DR). Host 2 responds with a DR. Host 1 acknowledges, and ACK arrives at host 2. ACK is lost: What should host 2 do? It doesn’t know for sure that its DR came through. Host 2’s DR is lost: What should host 1 do? Of course, send another DR, but this brings us back to the normal case. This still means that the ACK sent by host 1 may still get lost.
  21. 21. Connection Release (4) 6-14, c,d (c) Response lost. (d) Response lost and subsequent DRs lost.
  22. 22. Error Control
  23. 23. Flow Control and Buffering (a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One large circular buffer per connection.
  24. 24. The Internet Transport Protocols: UDP • Introduction to UDP • Remote Procedure Call • The Real-Time Transport Protocol
  25. 25. Note: UDP is a connectionless, unreliable protocol that has no flow and error control. It uses port numbers to multiplex data from the application layer.
  26. 26. Introduction to UDP The UDP header.
  27. 27. Popular Application Port Protocol Description 7 Echo Echoes a received datagram back to the sender 9 Discard 11 Users 13 Daytime 17 Quote 19 Chargen 53 Nameserver 67 Bootps Server 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 162 SNMP Simple Network Management Protocol (trap) Discards any datagram that is received Active users Returns the date and the time Returns a quote of the day Returns a string of characters Domain Name Service
  28. 28. Remote Procedure Call Steps in making a remote procedure call. The stubs are shaded.
  29. 29. The Real-Time Transport Protocol (a) The position of RTP in the protocol stack. (b) Packet nesting.
  30. 30. The Internet Transport Protocols: TCP • • • • • • Introduction to TCP The TCP Service Model The TCP Protocol The TCP Segment Header TCP Connection Establishment TCP Connection Release
  31. 31. Port Protocol    7 Echo Description Echoes a received datagram back to the sender 9 Discard Discards any datagram that is received 11 Users 13 Daytime 17 Quote 19 Chargen 20 FTP, Data 21 FTP, Control 23 TELNET 25 SMTP 53 DNS 67 BOOTP 79 Finger Finger 80 HTTP Hypertext Transfer Protocol 111 RPC Active users Returns the date and the time Returns a quote of the day Returns a string of characters File Transfer Protocol (data connection) File Transfer Protocol (control connection) Terminal Network Simple Mail Transfer Protocol Domain Name Server Bootstrap Protocol Remote Procedure Call
  32. 32. The TCP Service Model (2) (a) Four 512-byte segments sent as separate IP datagrams. (b) The 2048 bytes of data delivered to the application in a single READ CALL.
  33. 33. Stream Delivery
  34. 34. Sending & Receiving Window
  35. 35. Example 1 Imagine a TCP connection is transferring a file of 6000 bytes. The first byte is numbered 10010. What are the sequence numbers for each segment if data are sent in five segments with the first four segments carrying 1000 bytes and the last segment carrying 2000 bytes? Solution The following shows the sequence number for each segment: Segment 1 ==> sequence number: 10,010 (range: 10,010 to 11,009) Segment 2 ==> sequence number: 11,010 (range: 11,010 to 12,009) Segment 3 ==> sequence number: 12,010 (range: 12,010 to 13,009) Segment 4 ==> sequence number: 13,010 (range: 13,010 to 14,009) Segment 5 ==> sequence number: 14,010 (range: 14,010 to 16,009)
  36. 36. Note: The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number.
  37. 37. Note: The value of the sequence number field in a segment defines the number of the first data byte contained in that segment.
  38. 38. Note: The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative.
  39. 39. The TCP Segment Header
  40. 40. The TCP Segment Header (2)
  41. 41. Connection Establishment Active open Passive open seq: 8000 UAPRS F SYN Connection opened seq: 15000 ack: 8001 nd: 5000 U A P R S F rw SYN + ACK seq: 8000 ack: 15001 UAPRS F rwnd: 10000 ACK Means “no data” ! seq: 8001 if piggybacking
  42. 42. Connection Release
  43. 43. TCP Transmission Policy Window management in TCP.
  44. 44. TCP Transmission Policy (2) Silly window syndrome.
  45. 45. TCP Congestion Control (a) A fast network feeding a low capacity receiver. (b) A slow network feeding a high-capacity receiver.
  46. 46. Congestion Control a) TCP has a mechanism for congestion control. The mechanism is implemented at the sender b) The window size at the sender is set as follows: Send Window = MIN (flow control window, congestion window) Send Window = MIN (flow control window, congestion window) where a) flow control window is advertised by the receiver b) congestion window is adjusted based on feedback from the network
  47. 47. AIMD Source Add one packet each RTT Destination
  48. 48. Disadvantage a) b) c) d) Too slow. Reacts aggressively. Wastage of bandwidth at initial stage. Congestion is detected when time out occurs.
  49. 49. Congestion Control a) The sender has two additional parameters: – – Congestion Window (cwnd) Initial value is 1 MSS (=maximum segment size) counted as bytes Slow-start threshold Value (ssthresh) Initial value is the advertised window size) a) Congestion control works in two modes: – – Slow start (cwnd < ssthresh) Congestion avoidance (cwnd >= ssthresh)
  50. 50. Slow start, exponential increase 1 cwnd RTT 2 cwnd RTT 4 cwnd RTT 8 cwnd
  51. 51. Note In the slow start algorithm, the size of the congestion window increases exponentially until it reaches a threshold.
  52. 52. Congestion avoidance, additive increase
  53. 53. Note In the congestion avoidance algorithm the size of the congestion window increases additively until congestion is detected.
  54. 54. TCP Timers
  55. 55. Retransmission Timer a) b) c) When a segment is sent, a retransmission timer is started. If the segment is acknowledged before the timer expires, the timer is stopped. If, on the other hand, the timer goes off before the acknowledgement comes in, the segment is retransmitted (and the timer os started again).
  56. 56. Persistence Timer a) b) c) It is designed to prevent the following deadlock. The receiver sends an acknowledgement with a window size of 0, telling the sender to wait. Later, the receiver updates the window, but the packet with the update is lost. Now the sender and the receiver are each waiting for the other to do something. When the persistence timer goes off, the sender transmits a probe to the receiver. The response to the probe gives the window size. If it is still 0, the persistence timer is set again and the cycle repeats. If it is nonzero, data can now be sent.
  57. 57. Keep-alive Timer a) b) When a connection has been idle for a long time, the keep-alive timer may go off to cause one side to check whether the other side is still there. If it fails to respond, the connection is terminated.
  58. 58. Timed Wait Timer a) It runs for twice the maximum packet lifetime to make sure that when a connection is closed, all packets created by it have died off.
  59. 59. Thanks It’s beginning of end
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×