Chapter 4 OSI Transport Layer CCNA 1 1

  • Slides: 76
Download presentation
Chapter 4 OSI Transport Layer CCNA 1 -1 Chapter 4

Chapter 4 OSI Transport Layer CCNA 1 -1 Chapter 4

Note for Instructors • These presentations are the result of a collaboration among the

Note for Instructors • These presentations are the result of a collaboration among the instructors at St. Clair College in Windsor, Ontario. • Thanks must go out to Rick Graziani of Cabrillo College. His material and additional information was used as a reference in their creation. • If anyone finds any errors or omissions, please let me know at: • tdame@stclaircollege. ca. CCNA 1 -2 Chapter 4

OSI Transport Layer Roles of the Transport Layer CCNA 1 -3 Chapter 4

OSI Transport Layer Roles of the Transport Layer CCNA 1 -3 Chapter 4

Purpose of the Transport Layer • The Layer 4 data stream is a logical

Purpose of the Transport Layer • The Layer 4 data stream is a logical connection between the endpoints of a network. • It provides transport services from a host to a destination. • This service is sometimes referred to as an end-to-end service. • Provides two protocols: • TCP – Transmission Control Protocol • UDP – User Datagram Protocol CCNA 1 -4 Chapter 4

Purpose of the Transport Layer • We will be focusing on the Layer that:

Purpose of the Transport Layer • We will be focusing on the Layer that: • Segments the data. • Creates and inserts the header for either the TCP or the UDP protocol. CCNA 1 -5 Chapter 4

Purpose of the Transport Layer • Primary responsibilities: • Tracking the individual communications between

Purpose of the Transport Layer • Primary responsibilities: • Tracking the individual communications between applications on the source and destination hosts. • Segmenting the 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. CCNA 1 -6 Chapter 4

Segmentation and Reassembly • An Ethernet frame has a maximum frame size or Maximum

Segmentation and Reassembly • An Ethernet frame has a maximum frame size or Maximum Transmission Unit (MTU) of 1, 518 bytes. • When a larger message must be sent, the application data must be segmented into sections that will not exceed the maximum size. • The segment size must also take into account the encapsulation process that must take place before the frame can be transmitted. CCNA 1 -7 Chapter 4

Segmentation and Reassembly CCNA 1 -8 Chapter 4

Segmentation and Reassembly CCNA 1 -8 Chapter 4

Tracking Individual Conversations • Any host can have multiple applications running simultaneously. • Transport

Tracking Individual Conversations • Any host can have multiple applications running simultaneously. • Transport Layer maintains these separate data streams. • For example, it makes sure that Instant Messaging data does not appear on the E-mail application. CCNA 1 -9 Chapter 4

Segmenting Data Application Layer passes large amounts of data. Transport Layer breaks into smaller

Segmenting Data Application Layer passes large amounts of data. Transport Layer breaks into smaller pieces called segments. CCNA 1 -10 Chapter 4

Segmenting Data Multiplexing allows multiple, concurrent applications. Segmentation allows multiplexing of the data from

Segmenting Data Multiplexing allows multiple, concurrent applications. Segmentation allows multiplexing of the data from all sessions. CCNA 1 -11 Chapter 4

Reassembling Segments Segment numbers allow reassembly of the data in the proper order. CCNA

Reassembling Segments Segment numbers allow reassembly of the data in the proper order. CCNA 1 -12 Chapter 4

Reassembling Segments After reassembly, the port number is used to pass the data to

Reassembling Segments After reassembly, the port number is used to pass the data to the correct application. 25 80 25 CCNA 1 -13 When created, each segment is assigned a unique application identifier. (Port Number) Chapter 4

Flow Control Network hosts have limited resources. (Memory, Bandwidth) Regulating the amount that can

Flow Control Network hosts have limited resources. (Memory, Bandwidth) Regulating the amount that can be transmitted or received is flow control. CCNA 1 -14 Chapter 4

Error Recovery It is possible for a piece of data to become corrupted or

Error Recovery It is possible for a piece of data to become corrupted or lost. Transport layer protocols can request a retransmission. CCNA 1 -15 Chapter 4

Initiating a Session Transport layer provides for connection orientation. Allows the data to be

Initiating a Session Transport layer provides for connection orientation. Allows the data to be closely managed. CCNA 1 -16 Chapter 4

Supporting Reliable Communication UDP TCP • Different applications have different requirements. • Different protocols

Supporting Reliable Communication UDP TCP • Different applications have different requirements. • Different protocols have been developed to meet them. CCNA 1 -17 Chapter 4

OSI Transport Layer TCP and UDP CCNA 1 -18 Chapter 4

OSI Transport Layer TCP and UDP CCNA 1 -18 Chapter 4

TCP and UDP • Two most common Transport Layer protocols CCNA 1 -19 Chapter

TCP and UDP • Two most common Transport Layer protocols CCNA 1 -19 Chapter 4

TCP and UDP CCNA 1 -20 Chapter 4

TCP and UDP CCNA 1 -20 Chapter 4

User Datagram Protocol (UDP) • Connectionless • “Best Effort” delivery • Low overhead CCNA

User Datagram Protocol (UDP) • Connectionless • “Best Effort” delivery • Low overhead CCNA 1 -21 Example Applications Domain Name System (DNS) Online Games Voice over IP (Vo. IP) Dynamic Host Configuration Protocol (DHCP) Trivial File Transfer Protocol (TFTP) Chapter 4

Transmission Control Protocol (TCP) • • Connection-oriented Reliable delivery Error checking Flow control CCNA

Transmission Control Protocol (TCP) • • Connection-oriented Reliable delivery Error checking Flow control CCNA 1 -22 Example Applications Hypertext Transfer Protocol (HTTP) File Transfer Protocol (FTP) Telnet Simple Message Transfer Protocol (SMTP) Chapter 4

OSI Transport Layer Port Addressing CCNA 1 -23 Chapter 4

OSI Transport Layer Port Addressing CCNA 1 -23 Chapter 4

Identifying the Conversations IP Packet Header • At the TCP/IP Internet Layer: • The

Identifying the Conversations IP Packet Header • At the TCP/IP Internet Layer: • The IP Packet Header has a Protocol field that specifies whether the segment is TCP or UDP. CCNA 1 -24 Chapter 4

Identifying the Conversations IP Packet Header • When a packet is encapsulated at the

Identifying the Conversations IP Packet Header • When a packet is encapsulated at the Network Layer, it is coded to identify the source of the packet (TCP or UDP). CCNA 1 -25 Chapter 4

Identifying the Conversations IP Protocol = 6 Data sent to TCP _______ IP Protocol

Identifying the Conversations IP Protocol = 6 Data sent to TCP _______ IP Protocol = 17 Data sent to UDP • When a packet is decapsulated at the destination, the code is used to send the packet to the proper protocol (TCP or UDP). CCNA 1 -26 Chapter 4

Identifying the Conversations • Both TCP and UDP use port numbers to pass information

Identifying the Conversations • Both TCP and UDP use port numbers to pass information to the upper layers. • These ports are actually termed sockets. • A socket is simply the combination of the device’s IP address and the source/destination port for the data, separated by a colon. • e. g. 207. 134. 65. 2: 80 references an HTTP socket. CCNA 1 -27 Chapter 4

Identifying the Conversations CCNA 1 -28 Chapter 4

Identifying the Conversations CCNA 1 -28 Chapter 4

Port Addressing Types and Tools • Port numbers are managed and assigned by the

Port Addressing Types and Tools • Port numbers are managed and assigned by the Internet Assigned Number Authority (IANA). CCNA 1 -29 Chapter 4

Port Addressing Types and Tools • Some ports are reserved in both TCP and

Port Addressing Types and Tools • Some ports are reserved in both TCP and UDP, although applications might not be written to support them. • Three groupings of port types: • Well-known or Contact Ports (0 to 1023). • Registered Ports (1024 through 49151). • Private and/or Dynamic Ports (49152 through 65535). CCNA 1 -30 Chapter 4

Port Addressing Types and Tools • Well-Known Ports: • Reserved for common services and

Port Addressing Types and Tools • Well-Known Ports: • Reserved for common services and applications. 20 – FTP Data 25 – SMTP 21 – FTP Control 110 – POP 3 23 – Telnet CCNA 1 -31 194 – IRC 443 – HTTPS 69 – TFTP 520 – RIP Chapter 4

Port Addressing Types and Tools • Registered Ports: • Optional user processes and applications.

Port Addressing Types and Tools • Registered Ports: • Optional user processes and applications. 1863 – MSN Messenger 8008 – Alternate HTTP 8080 – Alternate HTTP CCNA 1 -32 1812 – RADIUS 2000 – Cisco Vo. IP 5004 – RTP 5060 – SIP (Vo. IP) Chapter 4

Port Addressing Types and Tools • Dynamic Ports: • Assigned to a user application

Port Addressing Types and Tools • Dynamic Ports: • Assigned to a user application at connect time. Dynamic port usage will become clearer as we move through the material. STAY TUNED! CCNA 1 -33 Chapter 4

Port Addressing Types and Tools • Using both TCP and UDP: • Some applications

Port Addressing Types and Tools • Using both TCP and UDP: • Some applications may use both TCP and UDP. • For example, the low overhead of UDP enables DNS to serve many client requests very quickly. • Sometimes, however, sending the requested information may require the reliability of TCP. In this case, the well known port number of 53 is used by both protocols with this service. CCNA 1 -34 Chapter 4

Port Addressing Types and Tools Source IP Source Port Destination IP Destination Port TCP/UDP

Port Addressing Types and Tools Source IP Source Port Destination IP Destination Port TCP/UDP Source Socket Destination Socket Connection State netstat –a –n command • Actually, when you open up a single web page, there are usually several TCP sessions created, not just one. CCNA 1 -35 Chapter 4

OSI Transport Layer TCP Communicating with Reliability CCNA 1 -36 Chapter 4

OSI Transport Layer TCP Communicating with Reliability CCNA 1 -36 Chapter 4

Transmission Control Protocol (TCP) • • Connection-oriented Reliable delivery Error checking Flow control CCNA

Transmission Control Protocol (TCP) • • Connection-oriented Reliable delivery Error checking Flow control CCNA 1 -37 Example Applications Hypertext Transfer Protocol (HTTP) File Transfer Protocol (FTP) Telnet Simple Message Transfer Protocol (SMTP) Chapter 4

Making Conversations Reliable • The key difference between TCP and UDP is reliability. •

Making Conversations Reliable • The key difference between TCP and UDP is reliability. • TCP uses connection-oriented sessions. • Before any data is exchanged, the Transport Layer initiates a connection to the destination. • This connection allows the tracking of the session. • Sequence Numbers • Acknowledgments • Creates the overhead of TCP. • Reliability is achieved by having fields in the TCP header that have specific functions. CCNA 1 -38 Chapter 4

Making Conversations Reliable TCP session that opened a connection. Usually a random value above

Making Conversations Reliable TCP session that opened a connection. Usually a random value above 1023. The number of the last octet (byte) in the segment. CCNA 1 -39 Upper Layer application on the remote site. The number of the next octet (byte) expected by the receiver. Chapter 4

Making Conversations Reliable The length of the segment header in bytes. Individual 1 bit

Making Conversations Reliable The length of the segment header in bytes. Individual 1 bit fields used in session management. Flow control. Error checking the header. CCNA 1 -40 If the Urgent FLAG is set, the location of the urgent data. Chapter 4

Making Conversations Reliable - FYI U R G • • • A C K

Making Conversations Reliable - FYI U R G • • • A C K P S H R S T S Y N F I N 6 Bits 0 = OFF 1 = ON URG – the Urgent Pointer Field is significant. ACK – the Acknowledgement Number field is significant PSH – push function RST – reset connection SYN – synchronize sequence numbers FIN – no more data from sender CCNA 1 -41 Chapter 4

TCP Server Processes Source = 49650 Destination = 80 • Server is listening on

TCP Server Processes Source = 49650 Destination = 80 • Server is listening on Port 80 for HTTP connections. • The client sets the destination port to 80 and uses a dynamic port as its source. CCNA 1 -42 Chapter 4

TCP Server Processes Source = 80 Destination = 49650 • Server replies with the

TCP Server Processes Source = 80 Destination = 49650 • Server replies with the web page. • Sets the source port to 80 and uses the client’s source port as the destination. CCNA 1 -43 Chapter 4

TCP Server Processes Source = 49650 Destination = 80 Source = 80 Destination =

TCP Server Processes Source = 49650 Destination = 80 Source = 80 Destination = 49650 • Notice how the source and destination ports are used. CCNA 1 -44 Chapter 4

TCP Server Processes Source = 49650 Destination = 80 172. 16. 230. 5 Source

TCP Server Processes Source = 49650 Destination = 80 172. 16. 230. 5 Source = 49655 Destination = 80 Source = 80 Destination = 49650 207. 22. 146. 33 Source = 80 Destination = 49655 • What if there are two sessions to the same server? • The client uses another dynamic port as its source and the destination is still port 80. • Different source ports keep the sessions unique on the server. CCNA 1 -45 Chapter 4

TCP Server Processes Source = 49650 Destination = 80 172. 16. 230. 5 Source

TCP Server Processes Source = 49650 Destination = 80 172. 16. 230. 5 Source = 49655 Destination = 80 Source = 80 Destination = 49650 207. 22. 146. 33 Source = 80 Destination = 49655 • How does the Transport Layer keep them separate? • The socket (IP Address: Port) 172. 16. 230. 5: 49650 172. 16. 230. 5: 49655 CCNA 1 -46 207. 22. 146. 33: 49650 207. 22. 146. 33: 49655 Chapter 4

OSI Transport Layer TCP Connection Establishment and Termination CCNA 1 -47 Chapter 4

OSI Transport Layer TCP Connection Establishment and Termination CCNA 1 -47 Chapter 4

TCP Three-Way Handshake • For a connection to be established, the two end stations

TCP Three-Way Handshake • For a connection to be established, the two end stations must synchronize on each other's initial sequence numbers (ISNs). • The ISN is the starting sequence number used when a TCP connection is established. CCNA 1 -48 Chapter 4

TCP Three-Way Handshake • Sequence numbers are used to track the order of segments

TCP Three-Way Handshake • Sequence numbers are used to track the order of segments and to ensure that no segments are lost in transmission. • The Flag fields are used to identify the type of segment. CCNA 1 -49 Chapter 4

TCP Three-Way Handshake I wish to connect and here’s my first sequence number. 1

TCP Three-Way Handshake I wish to connect and here’s my first sequence number. 1 CCNA 1 -50 Chapter 4

TCP Three-Way Handshake OK…. Here’s my first sequence number. I’ve added 1 to your

TCP Three-Way Handshake OK…. Here’s my first sequence number. I’ve added 1 to your ISN as an acknowledgement. I’ll expect that to be your next sequence number. 1 2 CCNA 1 -51 Chapter 4

TCP Three-Way Handshake OK…. Here’s the next segment with the sequence number you expect.

TCP Three-Way Handshake OK…. Here’s the next segment with the sequence number you expect. I’ve added 1 to your ISN to acknowledge your segment. I’ll expect that to be your next sequence number. 1 2 3 CCNA 1 -52 Chapter 4

TCP Three-Way Handshake 1 2 3 • Only part of the TCP headers are

TCP Three-Way Handshake 1 2 3 • Only part of the TCP headers are displayed…. CCNA 1 -53 Chapter 4

TCP Session Termination • Four step process using the Flag and sequence number fields.

TCP Session Termination • Four step process using the Flag and sequence number fields. CCNA 1 -54 Chapter 4

OSI Transport Layer TCP Acknowledgements and Windowing CCNA 1 -55 Chapter 4

OSI Transport Layer TCP Acknowledgements and Windowing CCNA 1 -55 Chapter 4

TCP Acknowledgements and Windowing • Remember that the Transport Layer must reassemble the segments

TCP Acknowledgements and Windowing • Remember that the Transport Layer must reassemble the segments in the correct order. CCNA 1 -56 Chapter 4

TCP Acknowledgements and Windowing Used together to confirm the receipt of data CCNA 1

TCP Acknowledgements and Windowing Used together to confirm the receipt of data CCNA 1 -57 Chapter 4

TCP Acknowledgements and Windowing Expectational Acknowledgement ACK = ISN + 1 CCNA 1 -58

TCP Acknowledgements and Windowing Expectational Acknowledgement ACK = ISN + 1 CCNA 1 -58 Chapter 4

TCP Acknowledgements and Windowing • With a window size of 10, each segment carries

TCP Acknowledgements and Windowing • With a window size of 10, each segment carries only ten bytes of data and must be acknowledged before another segment is transmitted. • Window Size: • The amount of data that can be sent before requiring an acknowledgement. • Determined by the Window field in the header. CCNA 1 -59 Chapter 4

TCP Retransmission • A destination host service using TCP usually only acknowledges data for

TCP Retransmission • A destination host service using TCP usually only acknowledges data for contiguous sequence bytes. • If one or more segments are missing, only the data in the segments that complete the stream are acknowledged. CCNA 1 -60 Chapter 4

TCP Flow Control CCNA 1 -61 Chapter 4

TCP Flow Control CCNA 1 -61 Chapter 4

TCP Flow Control Amount of data that can be sent before an acknowledgement. The

TCP Flow Control Amount of data that can be sent before an acknowledgement. The initial window size is determined during the three-way handshake. CCNA 1 -62 Chapter 4

TCP Dynamic Window Sizes • TCP Full-duplex Service: • Means data can be flowing

TCP Dynamic Window Sizes • TCP Full-duplex Service: • Means data can be flowing in each direction, simultaneously. • Window sizes, sequence numbers and acknowledgment numbers are independent of each other’s data flow. • The receiver sends an acceptable window size to the sender during each segment transmission. • If too much is data being sent, the acceptable window size is reduced. • if more data can be handled, the acceptable window size is increased. • This is known as a Stop-and-Wait windowing protocol. CCNA 1 -63 Chapter 4

Dynamic Window Sizes Initial Window Size CCNA 1 -64 Chapter 4

Dynamic Window Sizes Initial Window Size CCNA 1 -64 Chapter 4

OSI Transport Layer UDP Communicating with Low Overhead CCNA 1 -65 Chapter 4

OSI Transport Layer UDP Communicating with Low Overhead CCNA 1 -65 Chapter 4

User Datagram Protocol (UDP) • Connectionless • “Best Effort” delivery • Low overhead NO

User Datagram Protocol (UDP) • Connectionless • “Best Effort” delivery • Low overhead NO THREE-WAY HANDSHAKE CCNA 1 -66 Example Applications Domain Name System (DNS) Online Games Voice over IP (Vo. IP) Dynamic Host Configuration Protocol (DHCP) Trivial File Transfer Protocol (TFTP) Chapter 4

User Datagram Protocol (UDP) • Low Overhead: • Connectionless: • No connection establishment as

User Datagram Protocol (UDP) • Low Overhead: • Connectionless: • No connection establishment as with TCP. • Unreliable or “Best Effort” delivery: • No error checking • No flow control • No congestion control • No sequence numbers for ordered delivery CCNA 1 -67 Chapter 4

User Datagram Protocol (UDP) • UDP is said to be transaction-based. • When an

User Datagram Protocol (UDP) • UDP is said to be transaction-based. • When an application has data to send, it simply sends the data. • The UDP protocol data unit (PDU) is referred to as a datagram, although the terms segment and datagram are sometimes used interchangeably to describe a Transport layer PDU. CCNA 1 -68 Chapter 4

User Datagram Protocol (UDP) • If datagrams take multiple paths, they will sometimes arrive

User Datagram Protocol (UDP) • If datagrams take multiple paths, they will sometimes arrive in the wrong order. • UDP does not sequence the datagrams as TCP does nor are there any acknowledgements. • Re-sequencing datagrams and handling missing data is up to the application. CCNA 1 -69 Chapter 4

User Datagram Protocol (UDP) IP Packet Header • When a packet is encapsulated at

User Datagram Protocol (UDP) IP Packet Header • When a packet is encapsulated at the Network Layer, it is coded to identify the source of the packet (TCP or UDP). CCNA 1 -70 Chapter 4

UDP Server Processes • Like TCP, UDP applications use Well-Known or Registered ports specifically

UDP Server Processes • Like TCP, UDP applications use Well-Known or Registered ports specifically set aside for UDP. • When UDP receives a datagram destined for one of these applications, it forwards the datagram based on its port number. CCNA 1 -71 Chapter 4

UDP Client Processes Source = 53478 Destination = 53 172. 16. 230. 5 Source

UDP Client Processes Source = 53478 Destination = 53 172. 16. 230. 5 Source = 53479 Destination = 53 Source = 53 Destination = 53478 207. 22. 146. 33 Source = 53 Destination = 53479 • Uses the same methods as TCP for keeping multiple conversations separate (Socket - IP Address: Port). 172. 16. 230. 5: 53478 172. 16. 230. 5: 53479 CCNA 1 -72 207. 22. 146. 33: 53478 207. 22. 146. 33: 53479 Chapter 4

Summary: Port Numbers Port Layer 4 Application Number Protocol Description 20 FTP TCP File

Summary: Port Numbers Port Layer 4 Application Number Protocol Description 20 FTP TCP File Transfer Protocol – Data 21 FTP TCP File Transfer Protocol – Control Commands 23 TELNET TCP Terminal connection 25 SMTP TCP Simple Mail Transfer Protocol - Email 53 DNS UDP Domain Name System 67, 68 DHCP UDP Dynamic Host Configuration Protocol 69 TFTP UDP Trivial File Transfer Protocol 80 HTTP TCP Hypertext Transfer Protocol CCNA 1 -73 Chapter 4

Summary: TCP vs UDP • Transmission Control Protocol (TCP): • Connection-oriented • Reliable end-to-end

Summary: TCP vs UDP • Transmission Control Protocol (TCP): • Connection-oriented • Reliable end-to-end delivery of messages • Error detection and recovery • Flow control • User Datagram Protocol (UDP): • Connectionless • Best-effort datagram delivery • Applications that do not require full TCP services CCNA 1 -74 Chapter 4

Summary: Applications • TCP: • File Transfer Protocol (FTP) • Telnet • Simple Mail

Summary: Applications • TCP: • File Transfer Protocol (FTP) • Telnet • Simple Mail Transfer Protocol (SMTP) • Post Office Protocol (POP 3) • Hypertext Transfer Protocol (HTTP) • UDP: • Trivial File Transfer Protocol (TFTP) • Domain Name System (DNS) • Simple Network Management Protocol (SNMP) • Dynamic Host Configuration Protocol (DHCP) CCNA 1 -75 Chapter 4

Am I Drivin’ too fast for ‘ya? CCNA 1 -76 Time to do some

Am I Drivin’ too fast for ‘ya? CCNA 1 -76 Time to do some STUFF! Chapter 4