Download presentation
Presentation is loading. Please wait.
Published byElvin Wade Modified over 8 years ago
1
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 4th edition. Jim Kurose, Keith Ross Chapter 23 (mainly read this) Transport Layer
2
Transport Layer3-2 Transport Layer Our goals: r Review transport layer services: m reliable data transfer m flow control m multiplexing/demult iplexing r learn about transport layer protocols in the Internet: m UDP: connectionless transport m TCP: connection- oriented transport TCP congestion control
3
Transport Layer3-3 Transport services and protocols r provide logical communication between app processes running on different hosts r more than one transport protocol available to applications m TCP and UDP application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport
4
Transport Layer3-4 Transport vs. network layer r network layer: logical communication between hosts r transport layer: logical communication between processes m relies on, enhances, network layer services Household analogy: 12 kids sending letters to 12 kids r processes = kids r app messages = letters in envelopes r hosts = houses r transport protocol = Ann and Bill r network-layer protocol = postal service
5
Transport Layer3-5 Internet transport-layer protocols r reliable, in-order delivery (TCP) m error & flow control m connection setup m congestion control r unreliable, unordered delivery: UDP m no-frills extension of “best-effort” IP r services not available: m delay guarantees m bandwidth guarantees application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport
6
Transport Layer3-6 Addressing r MAC address- physical address r IP Address- host address r Port no- process/application identifier Transport Layer
7
3-7 Socket addrees IP address + Port number 200.33.54.169 200.33.54.180 192.12.12.1225
8
Transport Layer3-8 Socket address
9
Transport Layer3-9 outline r Transport-layer services r Multiplexing and demultiplexing r Connectionless transport: UDP r Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management r Principles of congestion control
10
Transport Layer3-10 UDP: User Datagram Protocol [RFC 768] r “no frills,” “bare bones” Internet transport protocol r “best effort” service, UDP segments may be: m lost m delivered out of order to app r connectionless: m no handshaking between UDP sender, receiver m each UDP segment handled independently of others
11
Transport Layer3-11 UDP Datagram format r small segment header r no connection establishment (which can add delay) r simple: no connection state at sender, receiver r no congestion control: UDP can blast away as fast as desired
12
Transport Layer3-12 UDP: more r often used for streaming multimedia apps m loss tolerant m rate sensitive r other UDP uses m DNS m SNMP r reliable transfer over UDP: add reliability at application layer m application-specific error recovery!
13
Transport Layer3-13 Outline r Transport-layer services r Multiplexing and demultiplexing r Connectionless transport: UDP r Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management r Principles of congestion control
14
Transport Layer3-14Transport Layer 3-14 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection r connection-oriented: m handshaking (exchange of control msgs) init’s sender, receiver state before data exchange r flow controlled: m sender will not overwhelm receiver r point-to-point: m one sender, one receiver r reliable, in-order byte steam r pipelined: m TCP congestion and flow control set window size r send & receive buffers
15
Transport Layer3-15 TCP Segment format
16
TCP Sequence Numbers: r The bytes of data being transferred in each connection are numbered by TCP. r Number of the first data byte contained in that segment. r The numbering can start with a randomly generated number. Transport Layer3-16
17
Transport Layer3-17 TCP seq. #’s example:
18
TCP Acknowledgement Number: r The number of the next byte a party expects to receive. r The acknowledgment number is cumulative. Transport Layer3-18
19
Transport Layer3-19 TCP Control Fields:
20
Transport Layer3-20 TCP Connection Establishment: Three Way Handshake
21
Transport Layer3-21 A SYN segment cannot carry data, but it consumes one sequence number. A SYN + ACK segment cannot carry data, but does consume one sequence number. An ACK segment, if carrying no data, consumes no sequence number. TCP Notes:
22
Transport Layer3-22 TCP Data Transfer:
23
TCP Window Size r Purpose: To control the flow of data so that the destination does not become overwhelmed with data. r The amount of data in bytes that a send can send without waiting for an acknowledgement. r TCP sliding windows are byte-oriented. Transport Layer3-23
24
TCP Window Size r Window Size 3000 bytes means: r 3000 bytes can be sent (if ready) without any acknowledgement from receiver. r This 3000 bytes can be in one segment or multiple segments. Transport Layer3-24
25
TCP Window – Sender Window 3-25 r Sender Window Size is dictated by the receiver window. r Usually sender window size is determined by the available buffer space in the receiver (rwnd).
26
3-26 TCP Window – Receiver Window
27
Normal Flow Control Transport Layer3-27
28
Transport Layer3-28 What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5000 bytes and 1000 bytes of received and unprocessed data? Solution The value of rwnd = 5000 − 1000 = 4000. Host B can receive only 4000 bytes of data before overflowing its buffer. Host B advertises this value in its next segment to A. TCP Receiver Window:
29
Transport Layer3-29 TCP Window r Today, TCP protocols include that the sender’s window size is not only determined by the receiver but also by congestion in the network. r Windows Size of TCP m Minimum of rwnd and cwnd m Where rwnd is the receiver advertised window size m And cwnd is the networks congestion window size Actual window size = minimum of (rwnd,cwnd)
30
Transport Layer3-30 What is the size of the window for host A if the value of rwnd is 3000 bytes and the value of cwnd is 3500 bytes? Solution The size of the window is the smaller of rwnd and cwnd, which is 3000 bytes. TCP Window Size:
31
Transport Layer3-31 cwnd = 20 bytes rwnd = 09 bytes TCP Window Size:
32
Transport Layer3-32 ACK segments do not consume sequence numbers and are not acknowledged. TCP Notes:
33
Transport Layer3-33 Data may arrive out of order and be temporarily stored by the receiving TCP. TCP guarantees that no out-of-order segment is delivered to the process. The receiver TCP delivers only ordered data to the process. TCP Notes:
34
Transport Layer3-34 TCP Normal Operation:
35
Transport Layer3-35 In modern implementations, a retransmission occurs if the retransmission timer expires or three duplicate ACK segments have arrived. No retransmission timer is set for an ACK segment. TCP Retransmissions:
36
Transport Layer3-36 Lost Segment:
37
Transport Layer3-37 Fast Transmission:
38
Transport Layer3-38 TCP Termination- 3 Way:
39
Transport Layer3-39 The FIN segment consumes one sequence number if it does not carry data. The FIN + ACK segment consumes one sequence number if it does not carry data. TCP Notes:
40
Transport Layer3-40 TCP Termination- Half Close:
41
Transport Layer3-41 TCP Congestion Control
42
Transport Layer3-42 Congestion Control Vs Flow Control Congestion control try to make sure networks can carry o ff ered tra ffi c, a global issue involving all the hosts and routers. It can be open-loop based or involving feedback Flow control is related to point-to-point tra ffi c control between given sender and receiver. it always involves direct feedback from receiver to sender
43
Transport Layer3-43 Congestion occurs the load on the network > the capacity of the network Congestion: the number of packets sent to the networkthe number of packets a network can handle.
44
Transport Layer3-44 Queues in a router If packet arrival rate > the packet processing rate input queues becomes longer and longer If packet departure rate < the packet processing rate output queues becomes longer and longer
45
Transport Layer3-45 Network Performance Delay has a negative effect on the load consequently the congestion. When a packet is delayed, no ack for source, so source retransmits, making the delay and congestion worse.
46
Transport Layer3-46 Network Performance Why does the throughput sharply decline after the load reaches capacity instead of remaining constant?
47
Transport Layer3-47 Congestion Control What is Congestion Control? mechanisms and techniques to control the congestion and keep the load below the capacity. Two categories of Congestion Control Open Loop (Prevention) Closed Loop ( Removal)
48
Transport Layer3-48 Congestion Control Categories
49
Transport Layer3-49 Open Loop Congestion Control
50
r Involves deciding: m When to accept traffic m When to discard packets m Which packets to discard m Making scheduling decisions etc r Decisions taken in regardless of the current state of network. Transport Layer3-50 Open Loop Congestion Control
51
Policies at different layers: Transport Layer3-51
52
Policy concerned with: How fast a sender times out What it transmit upon timeout Go-Back N ARQ window vs Selective Repeat ARQ. Transport Layer3-52 Retransmission /Window Policy
53
Acknowledgement Policy Transport Layer3-53 Acknowledging every packet, ack packets generate extra traffic. Lesser acks (waiting to do piggybacking) may create Extra timeouts Retransmissions A tight flow control scheme, a balance will fight congestion.
54
Transport Layer3-54 Open Loop Congestion Control Discarding Policy: A good policy by routers may prevent congestion and at the same time may not harm the integrity of the transmission. Admission Policy: Check resource requirement before sending packet. Allow no new virtual circuits.
55
Transport Layer3-55 Closed Loop
56
r Approach has three parts: m Monitor the system to detect congestion m Pass this information to where action can be taken m Adjust system operation to correct the problem m Detect, Feedback and Correct Transport Layer3-56
57
Transport Layer3-57 Backpressure r Congestion node stops receiving data from upstream nodes. r Upstream nodes may get congested, they in turn reject data from their upstream nodes. r Used in Virtual Circuits.
58
Transport Layer3-58 Choke packet r From a router to source directly. r Immediate nodes are not warned. r Example ICMP-source quench message. Immediate routers take no action.
59
Transport Layer3-59 Implicit Signaling r No communication between the congested node or nodes and the source. r Source guesses congestion by m No acknowledgement for sent packets m Delayed acknowledgements r Then source slows down.
60
Transport Layer3-60 Explicit Signaling r The node experiencing congestion sends signal to the source. r Not a separate packet like the “choke”packet. r Signal included in the data packet itself. r Can be m Backward Signaling-Source warned, slows data m Forward Signaling-Receiver warned, slows acks.
61
Transport Layer3-61 Congestion Control in TCP
62
Transport Layer3-62 TCP congestion control r TCP does congestion control in three phases: m Slow Start m Congestion Avoidance m Congestion Detection
63
Transport Layer3-63 Slow Start r cwnd starts with one maximum segment size(MSS). r MSS determined during connection establishment. r MSS increases exponentially after each acknowledgement.
64
Transport Layer3-64 Slow Start- Exponential Increase
65
Transport Layer3-65 MSS (max. segment size) Slow Start- Exponential Increase
66
Transport Layer3-66 In the slow-start algorithm, the size of the congestion window increases exponentially until it reaches a threshold. r Assumptions: r rwnd>cwnd, so sender window=cwnd r Each segment 1 byte r Each segment is acknowledged individually*. Slow Start- Exponential Increase
67
Transport Layer3-67 Sender keeps track of a variable named ssthresh. When window reaches ssthresh the next phase starts. Most implementation ssthresh is 65,535 bytes. Slow Start
68
Transport Layer3-68 In the congestion avoidance algorithm, the size of the congestion window increases additively until congestion is detected. Congestion Avoidance:
69
Transport Layer3-69 Congestion Avoidance:
70
Transport Layer3-70 Congestion Avoidance:
71
Transport Layer3-71 An implementation reacts to congestion detection in one of the following ways: ❏ If detection is by time-out, a new slow start phase starts. ❏ If detection is by three ACKs, a new congestion avoidance phase starts. Congestion Detection:
72
Transport Layer3-72 TCP Congestion Policy:
73
Transport Layer3-73 TCP Congestion Example:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.