49
Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Embed Size (px)

Citation preview

Page 1: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Guide to TCP/IP, Third Edition

Chapter 5: Transport Layer TCP/IP Protocols

Page 2: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 2

Objectives

• Understand the key features and functions of the User Datagram Protocol

• Explain the mechanisms that drive segmentation, reassembly, and retransmission for the Transmission Control Protocol

• Choose between using User Datagram Protocol and Transmission Control Protocol

Page 3: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 3

UDP – A Connectionless Transport Layer Protocol

• Connectionless protocols– Provide the simplest kind of transport services

• UDP– Used by applications that contain their own

connection oriented timeout values and retry counters

– Runs up to 40 percent faster than TCP

Page 4: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 4

UDP – A Connectionless Transport Layer Protocol (continued)

• Connectionless protocols handle the following kinds of tasks– Message checksum– Higher-layer protocol identification

Page 5: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 5

Overview of UDP

• UDP limitations– No reliability mechanisms– No delivery guarantees– No connection handling– Identifies Application layer protocol conveyed– Checksum for entire message carried in UDP header– No buffering services– No segmentation

Page 6: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 6

UDP Header Fields and Functions

• UDP header’s main function– To define the process or application that is using the

IP and UDP Network and Transport layers

• UDP header fields– Source Port Number field– Destination Port Number field– Length field– Checksum field

Page 7: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 7

Page 8: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 8

UDP Header Fields and Functions (continued)

• Source Port Number field– Defines the application or process that sends the

packet using the UDP header

• Well-known port numbers (0 Through 1023) – Assigned to core services that systems offer

• Registered port numbers (1024 Through 49151)– Assigned to industry applications and processes

• Dynamic ports – Used as temporary ports for specific

communications while they are underway

Page 9: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 9

Page 10: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 10

UDP Header Fields and Functions (continued)

• Destination Port Number Field– Defines destination application or process that uses

the IP and UDP headers

• Length field – Defines the length of the packet from the UDP

header to the end of valid data

• Checksum field is optional

Page 11: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 11

UDP Port Numbers and Processes

• UDP and TCP– Use port numbers to define the source and

destination processes or applications

• By default– Windows 2000 and Windows XP support up to 5,000

ports

Page 12: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 12

Page 13: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 13

Page 14: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 14

TCP – A Connection-Oriented Protocol

• Functions of connection-oriented protocols– Create a logical connection directly between two

peers on an internetwork– Track the transfer of data and ensure it arrives

successfully– Use sequence number tracking– Have a timeout mechanism– Have a retry mechanism

Page 15: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 15

Overview of TCP

• TCP offers connection-oriented services with– Sequencing, error recovery– Sliding window mechanism

• TCP hosts– Create a virtual connection with each other using a

handshake process

• TCP – Transfers data as a continuous stream of bytes

• Maximum TCP segment size is 65,495 bytes

Page 16: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 16

Page 17: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 17

TCP Startup Connection Process

• Begins with handshake between two hosts

• One host initiates the handshake to another host to– Ensure the destination host is available– Ensure the destination host is listening on the

destination port number– Inform destination host of initiator’s sequence

number

Page 18: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 18

Page 19: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 19

Page 20: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 20

Page 21: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 21

Page 22: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 22

Page 23: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 23

TCP Half-Open Connections

• Occur when the handshake process does not end successfully with a final ACK

• Half-open connection communication sequence occurs in the following order– SYN >>>>>– <<<<< ACK SYN– <<<<< ACK SYN– <<<<< ACK SYN

Page 24: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 24

TCP Keep-Alive Process

• Can maintain connection when there is no data sent across the wire

• TCP keep-alives – Disabled by default on Windows 2000, Windows

Server 2003, and Windows XP

• KeepAliveTime setting– Defines how long to wait before sending the first

TCP keep-alive packet

Page 25: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 25

Page 26: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 26

TCP Connection Termination

• Requires four packets– Host 1

• Sends a TCP packet with the FIN and ACK flags set

– Host 2• Sends an ACK in response

• Then sends a TCP packet with FIN and ACK flags set

– Host 1 • Returns ACK response

Page 27: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 27

Page 28: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 28

Page 29: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 29

TCP Sequence and Acknowledgment Process

• Guarantees that packets are ordered properly and protects against missing segments

• During handshake process– Each side of connection selects its own starting

sequence number– Each side increments its sequence number value by

the amount of data included in the outbound packet

Page 30: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 30

Page 31: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 31

Page 32: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 32

TCP Error-Detection and Error-Recovery Process

• Retransmission timer– First error-detection and error-recovery mechanism– Retransmission timeout (RTO)

• Value specified by timer

• Retransmission operation increments– 1st retransmit: RTO seconds– 2nd retransmit: 2 x RTO seconds– 3rd retransmit: 4 x RTO seconds– 4th retransmit: 8 x RTO seconds– 5th retransmit: 16 x RTO seconds

Page 33: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 33

TCP Congestion Control

• Congestion – The overloading of the network or a receiver

• Overloading of the network– Occurs when there is too much data on the network

medium• Overloading a receiver

– Occurs when the number of data bytes is greater than the advertised window

• Current window– Always the lesser of what the network and receiver

can handle

Page 34: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 34

Page 35: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 35

TCP Congestion Control (continued)

• TCP has four defined congestion control mechanisms– Slow Start– Congestion Avoidance– Fast Retransmit– Fast Recovery

Page 36: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 36

Page 37: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 37

Page 38: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 38

TCP Sliding Window

• Used to determine the amount of unacknowledged data that can go out on the wire from any sender

• Nagle algorithm – When small data segments are being sent, but not

acknowledged, no other small segments can be sent

• Silly Window Syndrome (SWS)– Caused when enough data is sent to a TCP host to

fill its receiver buffer– Puts receiver in a zero-window state

Page 39: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 39

TCP Header Fields and Functions

• Source Port Number Field

• Destination Port Number Field

• Sequence Number Field

• Acknowledgment Number Field

• Header Length Field

Page 40: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 40

Page 41: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 41

Page 42: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 42

Page 43: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 43

TCP Header Fields and Functions (continued)

• Window Size Field

• TCP Checksum Field

• Urgent Pointer Field

• TCP Options Field(s)

Page 44: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 44

Page 45: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 45

Page 46: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 46

Choosing Between TCP and UDP

• Because TCP is robust and reliable– It carries a lot of baggage, including

• Additional header fields• Explicit meta-messages in the form of TCP messages

• For some lightweight services, such as Microsoft Messenger Service– TCP is overkill and UDP is used instead

• TCP– No longer as important as it once was because

• Long-haul and local area networks have significantly increased speed, capacity, and reliability

Page 47: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 47

Summary

• Transport layer protocols come in two types – Connectionless and connection-oriented

• User Datagram Protocol– The connectionless protocol associated with TCP/IP

protocol suite

• UDP header is short and simple, consisting of – A protocol identifier in the IP header– An optional checksum value– Source and destination port addresses

Page 48: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 48

Summary (continued)

• Transmission Control Protocol– Heavyweight, connection-oriented protocol that

helps name the TCP/IP protocol suite

• TCP header – Longer and more complex,– Includes a variety of flags, values, and message

types

Page 49: Guide to TCP/IP, Third Edition Chapter 5: Transport Layer TCP/IP Protocols

Transport Layer TCP/IP Protocols 49

Summary (continued)

• Appropriate (and historical) uses for UDP – Concentrate on Application layer services that

manage their own reliability and connections

• Appropriate (and historical) uses for TCP – Concentrate on providing reliable delivery of user

services