1 chapter 24-25 internetworking part 4 (transport protocols, udp and tcp, protocol port numbers)

Post on 25-Dec-2015

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Chapter 24-25Chapter 24-25

Internetworking

Part 4(Transport Protocols, UDP and TCP, Protocol

Port Numbers)

2

Transport ProtocolTransport Protocol

Separate layer of protocol stackConceptually between

ApplicationIP

3

TerminologyTerminologyIP

Provides computer-to-computer communicationSource and destination addresses are computersCalled machine-to-machine

Transport ProtocolsProvide application-to-application communicationNeed extended addressing mechanism to identify

applicationsCalled end-to-end

4

Transport Protocol Functionality

Transport Protocol Functionality

Identify sending and receiving applicationsOptionally provide

ReliabilityFlow controlCongestion control

Note: not all transport protocols provide above facilities

5

Two main Transport Protocols available Two main Transport Protocols available

Transmission Control Protocol (TCP)User Datagram Protocol (UDP)Major differences

Interface to applicationsFunctionality

Other Transport ProtocolsOther Transport Protocols

Datagram Congestion Control Protocol (DCCP)

DCCP is useful for applications with timing constraints on the delivery of data that may become useless to the receiver if reliable in-order delivery combined with congestion avoidance is used. Such applications include streaming media, multiparty online games and Internet telephony.

6

Other Transport ProtocolsOther Transport Protocols

Stream Control Transmission Protocol (SCTP)

Serving in a similar role as the popular protocols TCP and UDP. SCTP provides some of the same service features of both, ensuring reliable, in-sequence transport of messages with congestion control.

SCTP is transaction-oriented and supports multi-streaming.

7

8

User Datagram Protocol (UDP)

User Datagram Protocol (UDP)

Provides unreliable transferRequires minimal

OverheadComputationCommunication

Best for LAN applications

9

UDP DetailsUDP Details

Connectionless service paradigmMessage-oriented interface

Each message encapsulated in IP datagramUDP header identifies

Sending applicationReceiving application

10

Identifying An ApplicationIdentifying An Application

Cannot extend IP addressNo unused bits

Cannot use OS-dependent quantityProcess IDTask numberJob name

Must work on all computer systems

11

Identifying an Application (continued)

Identifying an Application (continued)

Invent new abstractionUsed only with TCP/IPIdentifies sender and receiver unambiguously

TechniqueEach application assigned unique integerCalled protocol port number

12

Protocol PortsProtocol Ports

ServerFollows standardAlways uses same port numberUses lower port numbers

ClientObtains unused port from protocol softwareUses higher port numbers

13

Protocol PortsProtocol Ports

The port numbers are divided into three ranges: the Well Known Ports, the Registered Ports, and the Dynamic and/or Private Ports.

Well Known Ports: 0 through 1023. For privileged users.

Registered Ports: 1024 through 49151. For normal users.

Dynamic and/or Private Ports: 49152 through 65535

14

Well known Port number samples

Well known Port number samples

ftp-data 20/tcp File Transfer [Default Data] ftp-data 20/udp File Transfer [Default Data]ftp 21/tcp File Transfer [Control]ftp 21/udp File Transfer [Control]ssh 22telnet 23DNS 53http 80pop3 110

15

Protocol Port ExampleProtocol Port Example

Domain name server application is assigned port 53Application using DNS obtains port 28900UDP datagram sent from application to DNS server has

Source port number 28900Destination port number 53

When DNS server replied, DP datagram hasSource port number 53Destination port number 28900

16

Transmission Control Protocol (TCP)

Transmission Control Protocol (TCP)

Major transport protocol used in InternetHeavily usedCompletely (?) reliable transfer

17

TCP FeaturesTCP Features

Connection-oriented servicePoint-to-pointFull-duplex communicationStream interfaceStream divided into segments for transmissionEach segment encapsulated in IP datagramUses protocol ports to identify applications

18

TCP Feature SummaryTCP Feature Summary

TCP provides a completely reliable (no data duplication or loss), connection-oriented, full-duplex stream transport service that allows two application programs to form a connection, send data in either direction, and then terminate the connection.

19

Relationship Between TCP And Other Protocols

Relationship Between TCP And Other Protocols

TCP on one computer uses IP to communicate with TCP on another computer

20

Apparent ContradictionApparent Contradiction

IP offers best-effort (unreliable) deliveryTCP uses IPTCP provides completely reliable transferHow is this possible?

21

Achieving ReliabilityAchieving Reliability

Reliable connection startupReliable data transmissionGraceful connection shutdown

22

Reliable Data TransmissionReliable Data Transmission

Positive acknowledgment Receiver returns short message when data arrivesCalled acknowledgment

RetransmissionSender starts timer whenever message is

transmittedIf timer expires before acknowledgment arrives,

sender retransmits message

23

Illustration of RetransmissionIllustration of

Retransmission

24

How Long Should TCP WaitBefore Retransmitting?

How Long Should TCP WaitBefore Retransmitting?

Time for acknowledgment to arrive depends onDistance to destinationCurrent traffic conditions

Multiple connections can be open simultaneously

Traffic conditions change rapidly

25

Important PointImportant Point

The delay required for data to reach a destination and an acknowledgment to return depends on traffic in the internet as well as the distance to the destination. Because it allows multiple application programs to communication with multiple destinations concurrently, TCP must handle a variety of delays that can change rapidly

26

Solving the Retransmission Problem

Solving the Retransmission Problem

Keep estimate of round trip time on each connection

Use current estimate to set retransmission timer

Known as adaptive retransmissionKey to TCP’s success

27

Illustration of Adaptive Retransmission

Illustration of Adaptive Retransmission

Timeout depends on current round-trip estimate

28

TCP Flow ControlTCP Flow Control

ReceiverAdvertises available buffer spaceCalled window

SenderCan send up to entire window before Ack arrives

29

Window AdvertisementWindow Advertisement

Each acknowledgment carries new window information

Called window advertisementCan be zero (called closed window)

Interpretation: I have received up through X, and can take Y more octets

30

Flow control and lost segments

Flow control and lost segments

If a segment is lost, the window does not advance until the segment is retransmitted and the sender receives the acknowledgment for the segment. When the receiver gets a segment out of order, it can send an acknowledgment for the highest received data byte without sending individual acknowledgments for the intermediate data.

31

Illustration of Window Advertisement

Illustration of Window Advertisement

32

Startup and ShutdownStartup and Shutdown

Connection startupMust be reliable

Connection shutdownMust be graceful

Difficult

33

Why Startup/Shutdown Difficult

Why Startup/Shutdown Difficult

Segments can beLostDuplicatedDelayedDelivered out of orderEither side can crashEither side can reboot

Need to avoid duplicate “shutdown” message from affecting later connection

34

TCP’s Startup/Shutdown Solution

TCP’s Startup/Shutdown Solution

Uses three-message exchangeKnown as 3-way handshakeNecessary and sufficient for

Unambiguous, reliable startupUnambiguous, graceful shutdown

SYN used for startupFIN used for shutdown

35

Illustration of 3-Way Handshake

Illustration of 3-Way Handshake

36

Congestion ControlCongestion Control

Congestion Packet loss Retransmission more Congestion ….. Congestion Collapse

Solution: If Packet loss, back off!Send only one message (even if large window)If successful, stepwise increase sent data until

full window is used again

37

TCP Segment FormatTCP Segment Format

All TCP segments have same formatDataAcknowledgmentSYN (startup)FIN (shutdown)

Segment divided into two partsHeaderPayload area (zero or more bytes of data)

38

TCP Segment Format (continued)

TCP Segment Format (continued)

Header containsProtocol port numbers to identify

Sending applicationReceiving application

Bits to specify items such asSYNFINACK

Fields for window advertisement, acknowledgment, etc.

39

Illustration of TCP Segment

Illustration of TCP Segment

Sequence number specifies where in stream data belongs

Few segments contain options

40

SummarySummary

Transport protocols fit between applications and Internet Protocol

Two transport protocols in TCP/IP suiteUser Datagram Protocol (UDP)Transmission Control Protocol (TCP)

UDPUnreliableMessage-oriented interface

41

Summary (continued)Summary (continued)

TCPMajor transport protocol used in InternetComplete reliabilityStream-oriented interfaceUses adaptive retransmission

42

Summary (continued)Summary (continued)

Protocol portsIntegersUsed to identify sending and receiving

applicationsAllow unambiguous, simultaneous

communication with multiple applications

top related