OSI Transport Layer Network Fundamentals Chapter 4 Version

  • Slides: 46
Download presentation
OSI Transport Layer Network Fundamentals – Chapter 4 Version 4. 0 © 2007 Cisco

OSI Transport Layer Network Fundamentals – Chapter 4 Version 4. 0 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1

Objectives § Explain the role of Transport Layer protocols and services in supporting communications

Objectives § Explain the role of Transport Layer protocols and services in supporting communications across data networks. § Analyze the application and operation of TCP mechanisms that support reliability. § Analyze the application and operation of TCP mechanisms that support reassembly and manage data loss. § Analyze the operation of UDP to support communicate between two processes on end devices. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 2

Transport Layer Role and Services § Transport layer is responsible for overall end-to-end transfer

Transport Layer Role and Services § Transport layer is responsible for overall end-to-end transfer of application data © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 3

Transport Layer Role and Services § Transport layer enables applications on devices to communicate

Transport Layer Role and Services § Transport layer enables applications on devices to communicate § Fig 4. 2 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4

Purpose of Transport Layer § Tracking the individual communications between applications on the source

Purpose of Transport Layer § Tracking the individual communications between applications on the source and destination hosts § Segmenting data and managing each piece § Reassembling the segments into streams of application data § Identifying the different applications § Performing flow control between end users § Enabling error recovery § Initiating a session © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 5

1. Tracking Individual Conversation § Any host can have multiple applications communicating across the

1. Tracking Individual Conversation § Any host can have multiple applications communicating across the network § TL maintain the multiple communication streams between these applications. § Ex. Email, IM, Websites and Vo. IP simultaneously § Fig 4 -3 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 6

Segmenting Data § AL passes large amounts of data to TL § TL has

Segmenting Data § AL passes large amounts of data to TL § TL has to break data into smaller pieces =segments – suited transmission § Without segmentations, only one application would be able to receive data § Fig 4. 4 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7

Reassembling Segments § Networks prove multiple routes – diff trans times § Data can

Reassembling Segments § Networks prove multiple routes – diff trans times § Data can arrives in the wrong order § Numbering and sequencing – TL ensure segments are reassembled into the proper order § Each segment of data reassembled and directed to appropriate application. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8

Identifying the Applications § To pass data streams to the proper applications § TL

Identifying the Applications § To pass data streams to the proper applications § TL must identify target application § TL assigns an identifier to an application § In TCP/IP, the identifier = port number § Port number used in TL header to indicate which application the data is associated § Each particular set of pieces flowing between a source application and destination application is known as conversation § Dividing data into small parts enables many diff comm to be interleaved/multiplexed on the same network © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9

Flow Control § Network hosts have limited resources – memory, bandwidth § When TL

Flow Control § Network hosts have limited resources – memory, bandwidth § When TL aware, some protocol can request the sending application to reduce the rate of data flow § This is done at TL by regulating the amount of data source transmits as a group. § =FLOW CONTROL § Prevent the loss of segments on net and avoid retransmission © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10

Error Recovery § Possible § Piece of data corrupted or lost while transmitted over

Error Recovery § Possible § Piece of data corrupted or lost while transmitted over the network § TL ensure all pieces reach destination – source device retransmit any data that is lost Initiating a Session § TL can provide connection orientation by creating a session between the app. § These connections prepare the app to communicate with each other before any data transmitted § Data can be closely managed © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11

Transport Layer Role and Services § Supporting Reliable Communication • Diff apps have diff

Transport Layer Role and Services § Supporting Reliable Communication • Diff apps have diff requirements for their data • Diff transport protocols have been developed to meet these requirements • TCP is a TL protocol – ensure reliable delivery • In networking, reliability means each piece of data the source sends arrives at the destination • Three basic operation at TL to support reliability • Tracking transmitted data • Acknowledging received data • Retransmitting any unacknowledged data • More control data (in Layer 4 header) is exchanged to support acknowledgement, tracking and retransmission © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12

Transport Layer Role and Services § Supporting Reliable Communication © 2007 Cisco Systems, Inc.

Transport Layer Role and Services § Supporting Reliable Communication © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 13

TCP and UDP § Two most common TL protocols of TCP/IP are § Transmission

TCP and UDP § Two most common TL protocols of TCP/IP are § Transmission Control Protocol (TCP) and User Datagram Protocol (TCP) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14

UDP § Simple and connectionless protocol § Low-overhead data delivery § 8 bytes of

UDP § Simple and connectionless protocol § Low-overhead data delivery § 8 bytes of overhead § UDP segments = datagrams § UDP sends datagrams as ‘best effort’ § Applications of UDP • DNS • Video Streaming • Vo. IP © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15

Transport Layer Role and Services § Identify the basic characteristics of the UDP and

Transport Layer Role and Services § Identify the basic characteristics of the UDP and TCP protocols © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16

TCP § Connection-Oriented protocol § Additional overhead to gain functions § Additional functions •

TCP § Connection-Oriented protocol § Additional overhead to gain functions § Additional functions • Same-order delivery • Reliable delivery • Flow-control • Each TCP segments has 20 bytes of overhead • Applications • Web browsers • E-mail • File transfer © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17

Transport Layer Role and Services § Identify the basic characteristics of the UDP and

Transport Layer Role and Services § Identify the basic characteristics of the UDP and TCP protocols © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 18

Transport Layer Role and Services © 2007 Cisco Systems, Inc. All rights reserved. Cisco

Transport Layer Role and Services © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 19

Port Addressing § TCP and UDP based services keep track of various applications. §

Port Addressing § TCP and UDP based services keep track of various applications. § To differentiate segments and datagrams for each application – TCP and UDP have header fields that uniquely identify these apps. § Header contains source and dest port § Server processes have static port number assigned § Client dynamically choose a port number for each conversation. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 20

Port Addressing § Identifying Conversations © 2007 Cisco Systems, Inc. All rights reserved. Cisco

Port Addressing § Identifying Conversations © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 21

Port Addressing § The combination of TL port number and NL IP address uniquely

Port Addressing § The combination of TL port number and NL IP address uniquely identifies a particular process running on specific host device. § This combination = socket § Ex : Web server on host 192. 168. 1. 20, web browser (dynamically assigned port 49152) on host 192. 168. 100. 48 § Destined socket = 192. 168. 1. 10: 80 § Socket for the web page = 192. 168. 100. 48: 49152 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 22

Port Addressing © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23

Port Addressing © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23

Port Addressing § Different types of port numbers • Well-known ports (0 -1023) •

Port Addressing § Different types of port numbers • Well-known ports (0 -1023) • Reserved for services and apps • FTP 20, SMTP 25, HTTP 80 • Registered Ports (1024 -49151) • Assigned to user processes or application • Dynamic or private ports (49152 -65535) • Netstat command © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24

TCP Connection Establishment and Termination § TCP Three-Way Handshake § Three steps in TCP

TCP Connection Establishment and Termination § TCP Three-Way Handshake § Three steps in TCP connection establishment: 1. Initiating client sends a segment containing an initial sequence value. 2. Server responds with segment containing an acknowledgement value of received sequence+1, plus its own synchronizing sequence value 3. Initiating client responds with an acknowledgement received sequence+1 § Fig 4. 11 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 25

TCP Connection Establishment and Termination © 2007 Cisco Systems, Inc. All rights reserved. Cisco

TCP Connection Establishment and Termination © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 26

TCP Session Termination § Client has no more data to send, it sends a

TCP Session Termination § Client has no more data to send, it sends a segment with FIN flag set § The server sends an ACK to acknowledge the receipt of the FIN to terminate the session from client to server § The server sends a FIN to the client to terminate server to client session § Client responds with ACK to acknowledge the FIN from server § Fig 4 -12 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 27

TCP Session Termination © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28

TCP Session Termination © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28

Managing TCP Sessions § Describe how TCP sequence numbers are used to reconstruct the

Managing TCP Sessions § Describe how TCP sequence numbers are used to reconstruct the data stream with segments placed in the correct order © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29

Managing TCP Sessions § TCP Acknowledgement with Windowing • The sequence number indicates the

Managing TCP Sessions § TCP Acknowledgement with Windowing • The sequence number indicates the relative number of bytes that have been transmitted in this session, including the bytes in the current segment. • TCP use acknowledgement number in segment sent back to indicate the next byte expects to receive. • Fig 4 -13 • But if A had to wait for ack of the receipt of each 10 bytes – lot of overhead © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30

Managing TCP Sessions § TCP Acknowledgement with Windowing © 2007 Cisco Systems, Inc. All

Managing TCP Sessions § TCP Acknowledgement with Windowing © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 31

Managing TCP Sessions § TCP Acknowledgement with Windowing • Multiple segments of data can

Managing TCP Sessions § TCP Acknowledgement with Windowing • Multiple segments of data can be sent and ack with a single TCP message in opposite direction. • Ex start with SEQ = 2000, if 10 segments of 1000 bytes were received, an ACK = 12001 would be returned to the source. • Amount of data can be transmitted before ACK = window size • Window size is a field in TCP header used for management of lost data and flow control © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 32

TCP Retransmission § Data loss will occasionally occur § Dest host using TCP only

TCP Retransmission § Data loss will occasionally occur § Dest host using TCP only ack data for contiguous sequence bytes § If one or more segments are missing, only segments that complete the stream is ack § Ex. Segments with SEQ=1500 to 3000 and SEQ=3400 to 3500 were received, the ACK will be =3001 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 33

TCP Retransmission © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 34

TCP Retransmission © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 34

TCP Congestion Control § Flow Control & Dynamic Window Sizes © 2007 Cisco Systems,

TCP Congestion Control § Flow Control & Dynamic Window Sizes © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 35

TCP Congestion Control § Flow Control • Adjusting the effective rate of data flow.

TCP Congestion Control § Flow Control • Adjusting the effective rate of data flow. • Window size field in TCP header specifies amount of data can be transmitted before an ACK • Initial window size determined through 3 -way handshake • TCP feedback mechanism adjusts the effective rate to the maximum flow network and destination can support without loss • Fig 4 -14 • During the delay in receiving the ACK, sender will not sent additional segments for the session © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 36

TCP Congestion Control § Dynamic Window Size • When network resources are constrained, TCP

TCP Congestion Control § Dynamic Window Size • When network resources are constrained, TCP can reduce the window size • After no data losses or constrained resources, receiver will begin to increase the window size field • This dynamic increasing and decreasing of window size is a continuous process in TCP © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 37

TCP Congestion Control © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38

TCP Congestion Control © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38

UDP Protocol § Communicating with low overhead © 2007 Cisco Systems, Inc. All rights

UDP Protocol § Communicating with low overhead © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 39

UDP Protocol § Simple protocol § Basic TL functions § Not connection oriented §

UDP Protocol § Simple protocol § Basic TL functions § Not connection oriented § Does not provide sophisticated retransmission, sequencing and flow control mechanism § UDP does not provide reliability. . so be careful. . § but, are not always unreliable just the reliability is not provided © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 40

UDP Datagram Reassembly § Session are not established § When app has data to

UDP Datagram Reassembly § Session are not established § When app has data to send, it simply sends the data § When larger amounts of data – split into multiple segments =datagrams § Multiple datagrams – may take different paths and arrives in the wrong order § UDP has no way to reorder the datagrams into their transmission order. § UDP simply reassembles the data in order it was received and forward to app § If seq is important for app, the app will have to identify the proper sequence and how it should be processed © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 41

UDP Datagram Reassembly © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 42

UDP Datagram Reassembly © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 42

UDP Protocol § Servers use port numbers to identify a specified application layer process

UDP Protocol § Servers use port numbers to identify a specified application layer process and direct segments to the proper service or application © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 43

UDP Protocol § UDP protocol and port numbers are utilized in clientserver communication ©

UDP Protocol § UDP protocol and port numbers are utilized in clientserver communication © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 44

Summary © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 45

Summary © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 45

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 46

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 46