1 / 61

CIS 81 Fundamentals of Networking Chapter 7: Transport Layer Part 2 of 2

CIS 81 Fundamentals of Networking Chapter 7: Transport Layer Part 2 of 2. CCNA Introduction to Networking 5.0 Rick Graziani Cabrillo College graziani@cabrillo.edu Fall 2013. Chapter 7: Objectives. Part 1

Download Presentation

CIS 81 Fundamentals of Networking Chapter 7: Transport Layer Part 2 of 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS 81 Fundamentals of NetworkingChapter 7: Transport LayerPart 2 of 2 CCNA Introduction to Networking 5.0 Rick Graziani Cabrillo College graziani@cabrillo.edu Fall 2013

  2. Chapter 7: Objectives Part 1 • Describe the purpose of the transport layer in managing the transportation of data in end-to-end communication. • Describe characteristics of the TCP and UDP protocols, including port numbers and their uses. Part 2 • Explain how TCP session establishment and termination processes facilitate reliable communication. • Explain how TCP protocol data units are transmitted and acknowledged to guarantee delivery. • Explain the UDP client processes to establish communication with a server. • Determine whether high-reliability TCP transmissions, or non-guaranteed UDP transmissions, are best suited for common applications.

  3. Session Establishment

  4. Client Sending TCP Requests

  5. Request Destination / Source Ports

  6. Response Destination / Source Ports

  7. Establishing a Session • TCP is reliable because it has connection and session mechanisms. • When a host wants to communicate with another host using TCP, a connection must be established before data can be exchanged. • This is known as the Three-way Handshake • After the communication is completed, the session is closed and the connection is terminated.

  8. A TCP Conversation … A B

  9. Control Bits (Flags) (6 bits) • Includes bit codes, or flags, that indicate the purpose and function of the TCP segment.

  10. TCP Mechanisms • The 6 bit TCP Control field contains 1 bit control information used to manage the TCP processes. • Fields are referred to as flags and are 1 bit long. • It can only contain 1 of 2 values: 0 or a 1. • A bit value = 1: indicates control information is contained.

  11. TCP Control Bits • Used in • three-way handshake. • There are 6 bits that are used by the TCP: • URG - (0x020) Urgent pointer field significant • ACK - (0x010) Acknowledgement field significant • PSH - (0x004) Push function • RST - (0x003) Reset the connection • SYN - (0x002) Synchronize sequence numbers • FIN - (0x001) No more data from sender NOTE: Other flags are either reserved for future use or for special functions and are beyond the scope of this course.

  12. Connection Establishment Phase • When two hosts communicate using TCP, a connection is established before data can be exchanged. • To establish the connection, hosts use a three-way handshake flagging with the SYN and ACK control bits in the TCP header. • The three-way handshake: • Establishes that the destination device is present on the network. • Verifies that the destination device has an active service and is accepting requests on specified destination port number. • Informs the destination device that the source client intends to establish a communication session on that port number.

  13. Connection Establishment Phase • The 1st host sends an Initial Sequence Number (ISN): • The SYN flag set to binary 1. • All other control bits (ACK, FIN, RST, URG, and PSH) are set to binary 0.

  14. Connection Establishment Phase • The 2nd host receives the 1st host’s ISN and replies with: • An Acknowledgment (ACK) consisting of the 1st host’s ISN + 1. • This is called an expectational acknowledgement – the next byte this host expects to receive • And it’s own Initial Sequence Number (ISN). • The reply is flagged with SYN and ACK set to binary 1.

  15. Connection Establishment Phase • The 1st host receives the ACK and recognizes its ISN+1 and replies with: • An ACK consisting of the 2nd host’s ISN + 1. • The 1st host’s next sequence number (SN). • The ACK flag is set to binary 1

  16. TCP Three-Way Handshake Server PC1 • PC1 requests a client-to-server communication session. • The Server acknowledges the client-to-server communication session and requests a server-to-client communication session. • The initial request contains PC1’s ISN and flags the SYN bit. • 100 • The response consists of the Server’s ISN and PC1’s ISN+ 1 with the SYN and ACK bits flagged. • 300 • 100 + 1 = 101. • PC1acknowledges the server-to-client communication session. • The final response consists of PC1’s next SN and the Server’s ISN + 1 with the ACK bit flagged. • 101 • 300 + 1 = 301. HTTP Request (GET)

  17. Terminating a Current Session • To close a connection, the Finish (FIN) control flag must be set in the segment header. • Each host performs a two-way handshake is used using the FIN segment and an ACK control bits. • Therefore, to terminate a single conversation supported by TCP, four exchanges are needed to end both sessions.

  18. Connection Termination Phase • The 1st host sends a segment with the FIN bit set. • The 2nd host replies with the ACK bit set. • The 2nd host sends a segment with the FIN bit set. • The 1st host replies with the ACK bit set:

  19. Termination Mechanisms

  20. Reliable Delivery

  21. Segments Can Be Lost • Congestion can cause segments to be dropped. • For example, when a receiver is congested it may drop segments. • Congestion can be caused by: • Traffic faster than a network can transfer it. • Multiple computers simultaneously sending segments to a single destination.

  22. TCP Provides Reliability • In TCP, clients acknowledge the receipt of segment(s) before the next segment is sent. • The sender also starts a timer when it sends a segment, and it retransmits a segment if the timer expires before an acknowledgment arrives.

  23. TCP Provides Reliability • The sequence number (SN) and acknowledgement (ACK) number are used to confirm receipt of data contained in the transmitted segments. • The SN number indicates the relative number of bytes that have been transmitted in this session, including the bytes in the current segment. • TCP uses the ACK number sent back to the source to indicate the next byte that the receiver expects to receive. • This is called expectational acknowledgement.

  24. Send 1 Receive 1 Send ACK 2 Receive ACK 2 Send 2 Receive 2 Send ACK 3 Receive ACK 3 Send 3 Receive 3 Send ACK 4 Receive ACK 4 Reliability - Simplified

  25. Managing TCP Sessions Next 10 bytes starting with byte 11 10 bytes

  26. Flow Control

  27. TCP Windows • Waiting for an acknowledgment after each segment would be very inefficient. • To maintain efficiency, TCP actually forwards segments in a “window”. • A window specifies the number of segments the sender can forward without receiving an acknowledgment.

  28. Client Window Size=5,000 Server Window Size=10,000 Flow Control and Reliability • The window size specifies the number of bytes, starting with the acknowledgment number, that the receiving host's TCP layer is currently prepared to receive. • Included in every TCP segment starting with three-way handshake. • TCP is a full duplex service • Client and server specify their own window sizes.

  29. Windowing and Flow Control • Instead of allowing data to be dropped or lost, a “not ready” indicator can be sent to the sender. • Referred to as Flow control. • Flow control uses windows to prevent a receiver from being overwhelmed by incoming data. • TCP implements flow control by increasing / decreasing window sizes as required. • Referred to a “sliding windows” (coming). • Window sizes are variable during the lifetime of a connection.

  30. My Receive Window: 10,000 My Receive Window: 5,000 Client Window Size=5,000 Server Window Size=10,000 Client’s Send Window: 5,000 Server’s Send Window: 10,000 “I can send 10,000 bytes without hearing an ACK, and I can only receive 5,000 bytes at a time.” “I can send 5,000 bytes without hearing an ACK, and I can only receive 10,000 bytes at a time.” Receive Window • Sending host can send only that amount of data before getting an acknowledgment and window update from this (the receiving) host. Send Window (not a TCP field) • The TCP Receive Window size of the other host. Client Example • Receive Window Size=5,000 bytes – Server can only send 5,000 bytes before it receives an acknowledgement. • Send Window Size = 10,000 bytes – Server told the client that it can send the server 10,000 bytes before receiving an acknowledgment.

  31. MSS of 1,000 bytes Client has a Window Size of 5,000 bytes Web Server Client Send Window=5,000 Client Window Size=5,000 Server Window Size=10,000 SEQ=1 (to 1,000) … SEQ=1,001 (to 2,000) SEQ=2,001 (to 3,000) SEQ=3,001 (to 4,000) SEQ=4,001 (to 5,000) • ACK=5,001 Client Window Size=5,000 Send Window: Byte 10,000 Server Window Size=10,000 SEQ=5,001 (to 6,000) • This is known as a Stop-and-Wait windowing protocol. • Server must wait for acknowledgment before continuing to send data. • A better method? • Sliding Windows • Next! • Send Window Byte: This is the last byte that can be sent before receiving an ACK … SEQ=6,001 (to 7,000) SEQ=7,001 (to 8,000) SEQ=8,001 (to 9,000) SEQ=9,001 (to 10,000) Client Window Size=5,000 Send Window: Byte 15,000 • ACK=10,001 Server Window Size=10,000 SEQ=10,001 (to 11,000) … ….

  32. Send 1 Send 4 Receive 1 Receive 4 Send 2 Send 5 Receive 2 Receive 5 Send 6 Send 3 Receive 3 Receive 6 Send ACK 4 Window size: 3 Receive ACK 4 Send ACK 7 Window size: 3 Receive ACK 7 Windowing Sizes - Example 3 • Window = x - Acknowledge after x segments • Window = 1 - Acknowledge each segment sent • Window = 0 - Stop sending

  33. SEQ 1 | Bytes 1 - 1000 SEQ 1001 | Bytes 1001 - 2000 SEQ 2001 | Bytes 2001 - 3000 SEQ 3001 | Bytes 3001 - 4000 SEQ 4001 | Bytes 4001 - 5000 SEQ 5001 | Bytes 5001 - 6000 ACK = 3001 ACK = 6001 Windows and Acknowledgements • In actual fact, the window specifies the number of “bytes” that the receiving TCP process is currently prepared to receive without acknowledgement. • For example: • Host B is downloading a 10 KB file from Host A. • The Window size is set to 3 KB. • Host B downloads 1 KB segments (maximum segment size).

  34. Managing TCP Sessions

  35. Sliding Windows (FYI) and SACK (FYI) • For flow control hosts use: • Sliding windows • Selective Acknowledgements (SACK) • See notes in the next two PowerPoint slides for more information.

  36. For simplicity, we will use segments, 1,000 bytes per segment Sliding Windows (FYI) Server Client Window = 10 segments (10,000 bytes) Request Window Size=10,000 Segment 1 Segment 2 • ACK=2 Segment 3 • ACK=3 Segment 4 • ACK=4 • Sliding windows allows the sender to transmit multiple segments within the TCP window size without receiving an acknowledgment. • A device can send successive segments without waiting for an acknowledgement that a previous segment has been received. • See notes in PowerPoint for more information. Segment 5

  37. SACK (FYI) 1 Segment 1 Client Server Segment 2 X Segment 3 • ACK=2 2 Segment 4 Normal windowing (without SACK) • The process of retransmitting segments that did not arrive at their destination can lead to certain inefficiencies. • See notes in PowerPoint for more information Segment 5 • ACK=2 (Duplicate) 3 • ACK=2 (Duplicate) • ACK=2 (Duplicate) 4 Segment 2 Segment 3 5 • ACK=3 Segment 4 • ACK=4 Segment 5 • ACK=5 • ACK=6 Segment 6 6

  38. SACK (FYI) Client • SACK Server 1 SACK Segment 1 2 Segment 2 With SACK • SACK is an optional implementation of TCP introduced with RFC 2018. • Support of SACK is negotiated during the establishment of the TCP connection. • If both hosts support SACK, then it will be used during the connection. X Segment 3 • ACK=2 3 Segment 4 Segment 5 4 • ACK=2, SACK= 3 • ACK=2, SACK= 3-4 5 • ACK=2, SACK= 3-5 6 7 Segment 2 8 • ACK=6 Segment 6 8

  39. UDP

  40. User Datagram Protocol (UDP) • Connectionless-oriented protocol, described in RFC 768. • Advantage of providing for low overhead data delivery. • Each UDP segment adds a 8 byte header to the Application layer data. • It is a stateless protocol, meaning neither the client, nor the server, is obligated to keep track of the state of the communication session. • The UDP PDU is called a datagram, but generically the transport layer is referred to as a segment. • UDP datagrams are sent as "best effort". • Applications that use UDP include: • Domain Name System (DNS) • Video Streaming • Voice over IP (VoIP)

  41. UDP Protocol • UDP is simpler and requires less overhead than TCP. • It is not connection-oriented and does not provide the sophisticated retransmission, sequencing, and flow control mechanisms.

  42. UDP Services • UDP does not establish a connection between the hosts before data can be sent and received. • UDP does not establish a connection between the hosts before data can be sent and received. . • Occasionally data is received in a different order than it was sent. • UDP does not provide any mechanism for reassembling the data in its original sequence. • The data is simply delivered to the application in the order that it arrives. • Unlike TCP, UDP does not provide segmentation or reassembly, or: • There are no flow control mechanisms within UDP • If resources on the destination host become overtaxed, the destination host mostly likely drops data sent until resources become available. • Unlike TCP, with UDP there is no mechanism for automatic retransmission of dropped data.

  43. No Ordered Data Reconstruction Having taken different routes to the destination, the datagrams arrive out of order. • Segments arriving out-of-order are not reorganized because there are no sequence numbers.

  44. UDP Header

  45. Sample UDP Datagram

More Related