McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

29
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer

Transcript of McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

Page 1: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Chapter 3

TransportLayer

Page 2: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Understand the position of the transport layer in the Internet Understand the position of the transport layer in the Internet model.model.

Understand the rationale for the existence of the transport layer.Understand the rationale for the existence of the transport layer.

Understand the concept of application-to-application delivery.Understand the concept of application-to-application delivery.

Understand the duties of the transport layer: packetizing,Understand the duties of the transport layer: packetizing,addressing, connection creation, and reliable delivery.addressing, connection creation, and reliable delivery.

After reading this chapter, the reader should After reading this chapter, the reader should be able to:be able to:

OOBJECTIVESBJECTIVES

Know which application layer program can use UDP and whichKnow which application layer program can use UDP and whichcan use TCP. can use TCP.

Distinguish between the two transport-layer protocols usedDistinguish between the two transport-layer protocols usedin the Internet: UDP and TCP.in the Internet: UDP and TCP.

Page 3: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

APPLICATION-TO-APPLICATION-TO-APPLICATIONAPPLICATION

DELIVERYDELIVERY

APPLICATION-TO-APPLICATION-TO-APPLICATIONAPPLICATION

DELIVERYDELIVERY

3.13.1

Page 4: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-1

Transport layer in the Internet model

The transport layer provides The transport layer provides application-to-applocationapplication-to-applocationDeliveryDelivery in the Internet. in the Internet.

Page 5: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-2

Application-to-application delivery

The application program is aware of only one layer The application program is aware of only one layer (the transport layer)involve in this delivery.(the transport layer)involve in this delivery.

Page 6: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

DUTIESDUTIESDUTIESDUTIES

3.23.2

Page 7: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-3

Duties of the transport layer

Page 8: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Packetizing :Packetizing : Packetizing devides a long message into smaller ones ;Packetizing devides a long message into smaller ones ; these smaller units are encapsulated into the data field of thethese smaller units are encapsulated into the data field of the transport-layer packet and headers are added.transport-layer packet and headers are added.

Creating connection :• connection-oriented : connection-oriented : - A connection-oriented protocol first establishes a connection- A connection-oriented protocol first establishes a connection (a virtual path) between the sender and receiver.(a virtual path) between the sender and receiver. - The process is much like a telephone call.- The process is much like a telephone call.

• connectionless :connectionless : Connectionless delivery means that there is no virtual Connectionless delivery means that there is no virtual connection (no session) between two application programs.connection (no session) between two application programs.

Page 9: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-4

Connection establishment(Three-way handshake)

Page 10: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-5

Connection termination

Page 11: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Connection is closely Connection is closely related to reliability: A related to reliability: A connectionless protocol connectionless protocol

cannot be reliable because cannot be reliable because the relationship between the relationship between

packets provides reliability. packets provides reliability.

Note:Note:

Page 12: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Addressing :Addressing : Local Addresses :Local Addresses : The client needs the address of the remote computer,The client needs the address of the remote computer, which must be unique to distinguish it from all the computerwhich must be unique to distinguish it from all the computer in the world. in the world.

Port Number :Port Number : - In the Internet model, the addresses at the transport layer- In the Internet model, the addresses at the transport layer are called are called port unmberport unmber.. - A port number is a number between - A port number is a number between 00 and and 65,53565,535..

Page 13: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-6

Application programs

Page 14: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

The addresses of client and The addresses of client and server programs are server programs are

defined at the transport defined at the transport layer. These addresses are layer. These addresses are

local to the computer local to the computer running the programs. The running the programs. The addresses must be unique addresses must be unique locally but not universally. locally but not universally.

Note:Note:

Page 15: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-7

Port numbers

Page 16: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Technical Focus:Technical Focus: Range of Port NumbersRange of Port Numbers

The port numbers range from 0 to 65535 and The port numbers range from 0 to 65535 and are divided into three ranges:are divided into three ranges:

Well-known ports: 0 to 1023Well-known ports: 0 to 1023

Temporary ports: 49,152 to 66,535Temporary ports: 49,152 to 66,535

Registered ports: 1,024 to 49,151Registered ports: 1,024 to 49,151

Page 17: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Business Focus:Business Focus: Well-Known PortsWell-Known Ports

Some well-known port numbers are shown Some well-known port numbers are shown below:below:

SMTP: 25

TFTP: 69

HTTP: 80

FTP: 20 and 21

TELNET: 23

Page 18: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

A client uses a temporary A client uses a temporary port number; a server uses port number; a server uses a well-known port number. a well-known port number.

Note:Note:

Page 19: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Reliability :Reliability :The service can be reliable or unreliable :The service can be reliable or unreliable :• Unreliable Service :Unreliable Service : - Some transport-layer protocols (such as UDP) are designed- Some transport-layer protocols (such as UDP) are designed for speed, not reliability.for speed, not reliability. - They do not guarantee reliability.- They do not guarantee reliability. - This unreliable service provide by the transport layer does- This unreliable service provide by the transport layer does not accept responsibility for the packets. not accept responsibility for the packets.

• Reliable Service : Reliable Service : - Some transport-layer protocols (such as TCP) are designed- Some transport-layer protocols (such as TCP) are designed for reliability.for reliability. - Reliability is sacrificed for quick service.- Reliability is sacrificed for quick service.

Page 20: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

For reliable service, the For reliable service, the transport layer needs to transport layer needs to

number packets belonging number packets belonging to a connection using to a connection using sequence numbers.sequence numbers.

Note:Note:

Page 21: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

A reliable transport protocol A reliable transport protocol provides damage control, loss provides damage control, loss

control, order control, and control, order control, and duplicate control even if the duplicate control even if the

underlying networking underlying networking technology and lower-level technology and lower-level protocols are not reliable.protocols are not reliable.

This is done through sequence This is done through sequence numbers, timers, error numbers, timers, error

detection, and retransmission.detection, and retransmission.

Note:Note:

Page 22: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-8 Damage control

Page 23: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

INTERNETINTERNETPROTOCOLSPROTOCOLSINTERNETINTERNET

PROTOCOLSPROTOCOLS

3.33.3

Page 24: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

The Internet specifies two protocols for the transport layer :The Internet specifies two protocols for the transport layer :• User Datagram protocol (UDP)User Datagram protocol (UDP) - UDP is a - UDP is a connectionlessconnectionless, , unreliableunreliable transport protocol. transport protocol. - If an error is detected, the packet is simply discarded with- If an error is detected, the packet is simply discarded with no notification to the sender.no notification to the sender. - UDP is used when an application needs quick action.- UDP is used when an application needs quick action. - For example, TFTP and SNMP.- For example, TFTP and SNMP.

• Transmission Control Protocol (TCP)Transmission Control Protocol (TCP) - UDP is a - UDP is a connection-orientedconnection-oriented, , reliablereliable transport protocol. transport protocol. - It establishes a connection before data transfer and terminates- It establishes a connection before data transfer and terminates the connection after data transfer.the connection after data transfer. - It provides damage control, loss control, order control, and- It provides damage control, loss control, order control, and duplicate control.duplicate control. - For example, SMTP, HTTP, FTP, and TELNET.- For example, SMTP, HTTP, FTP, and TELNET.

Page 25: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-9

UDP and TCP in the Internet model

Page 26: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-10

User datagram

Page 27: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Technical Focus:Technical Focus: User DatagramUser Datagram

The fields in a user datagram are as follows:The fields in a user datagram are as follows:

Source port numberSource port number

LengthLength

Destination port numberDestination port number

ChecksumChecksum

Page 28: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Figure 3-11

Segment

Page 29: McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 3 Transport Layer.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

Technical Focus:Technical Focus: SegmentSegment

The fields in a segment are as follows:The fields in a segment are as follows:

Source port numberSource port number

Destination port numberDestination port number

Sequence numberSequence number

Header lengthHeader length

Control flagsControl flags

ChecksumChecksum

OptionOption

Urgent pointerUrgent pointer