tcp/udp 指導教授:吳坤熹 演講者:黃驛翔 class : ip telephony. outline introduction...

27
TCP/UDP 指指指指 指指指 指指指 指指指 Class IP Telephony

Upload: laurence-lyons

Post on 04-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

TCP/UDP

指導教授:吳坤熹演講者:黃驛翔

Class : IP Telephony

Page 2: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Outline

• Introduction• Linking to Application Layer• Packetization and Reassembly

– Protocol Data Units– TCP Header– UDP Header

• Establishing connection (virtual)– TCP technique– UDP technique

Page 3: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Outline (Con.)

• Service Primitives

• TCP vs. UDP

• References

Page 4: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Introduction

• Transport layer– Responsible for end-to-end delivery of messa

ges– Responsible for segmentation and reassembl

y

• Two Protocols :– TCP (Transmission Control Protocol)– UDP (User Datagram Protocol)

Page 5: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Introduction

• Transport Layer Functions– Linking to Application Layer– Packetization and Reassembly– Establishing connection (virtual)

• Connect oriented• Connectionless• Quality of Service (QoS)

Page 6: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Linking to Application Layer

• TCP may serve several Application at the same time

• User identified by

port number or

service access

point (SAP)

Page 7: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Packetization and Reassembly

Page 8: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Protocol Data Units (PDU)

• At each layer, protocols are used to communicate

• Control information is added to user data at each layer (PDU = Control + Data)

• Transport layer may fragment user data• Transport layer may fragment user data• Each fragment has a transport header added

– Destination SAP (port)– Sequence number– Error detection code

Page 9: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

TCP Header

Page 10: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

UDP Header

Page 11: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Establishing connection ─ TCP

• Connection-oriented– Establishment– Maintenance– Termination

• Reliability– Data confirm– Error correction

• Flow control

Page 12: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Connection-oriented - Establishment

• 3-Way Handshaking

Page 13: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Connection-oriented – Termination

Seq:X, ACK: Y. ACK..FIN

Seq:Y, ACK: X+1, ACK

Seq:Y, ACK: X+1, ACK..FIN

Seq:X+1, ACK: Y+1, ACK

Page 14: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Reliable – Data confirm

Page 15: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Reliable – Error correction

Page 16: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Reliable – Error correction

Page 17: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Flow control

• Sliding Window

Page 18: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

The usage of TCP

Protocol Port # Application

UDP 53 DNS

UDP 67 BOOTP server

UDP 68 BOOTP client

UDP 520 RIP

TCP 20 FTP data

TCP 21 FTP Control

TCP 23 Telnet

TCP 25 SMTP

TCP 80 HTTP

TCP 119 NNTP

Page 19: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Establishing connection ─ UDP

• Connection-less

• No acks (Unconfirmed Service)

– high rate of transmission

– But unreliable

• No flow control

Page 20: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Connection-less

• Sending packets individually without a virtual circuit

• Each packet is sent independently

• It will be routed separately, following different routes and arriving at different time

Page 21: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

The consideration of using UDP

• Reduce the requirement of computer resources

• The checking scheme has provided completely by the application program

• When using the Multicast or Broadcast to transfer

• The transmission of Real-time packets

Page 22: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

The usage of UDP

• Trivial File Transfer Protocol , TFTP

• Simple Network Management Protocol ,SNMP

• Dynamic Host Configuration Protocol , DHCP

• Domain Name System , DNS

• Routing Information Protocol , RIP

• Real-Time Transport Protocol , RTP

Page 23: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Service Primitives

• Primitives specify function to be performed for the transport layer

• Four Primitive types

• Confirmed service : TCP

• Nonconfirmed service : UDP

Page 24: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Primitive TypesREQUEST A primitive issued by a service user to invoke some

service and to pass the parameters needed to specify fully the requested service

INDICATION A primitive issued by a service provider either to:

indicate that a procedure has been invoked by the peer service user on the connection and to provide the associated parameters, or

notify the service user of a provider-initiated action

RESPONSE A primitive issued by a service user to acknowledge or complete some procedure previously invoked by an indication to that user

CONFIRM A primitive issued by a service provider to acknowledge or complete some procedure previously invoked by a request by the service user

Page 25: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

Timing Sequence for Service Primitives

Page 26: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

TCP vs. UDP

TCP UDP

connection-oriented connectionless

confirmed service unconfirmed service (request, indication, (request, indication)

response, confirm)

high overhead low overhead (header 20 octets) (header 8 octets)

flow control no flow control

Page 27: TCP/UDP 指導教授:吳坤熹 演講者:黃驛翔 Class : IP Telephony. Outline Introduction Linking to Application Layer Packetization and Reassembly –Protocol Data Units

References• J. FitzGerald and A. Dennis, “Business Data Communi

cations and Networking”, (9th Ed. 2007), John Wiley & Sons Inc., U.S.A.

• J. F. Hurose and K. W. Ross, “computer Networking”, (4th Ed. 2006), Peason Addison-Wesley Inc., U.S.A.

• 吳坤熹 教授,” The PowerPoint of IP Telephony class”, 2008

• 陳彥錚 副教授,” The PowerPoint of Computer Networking class, Ch2,Ch6”, 2008

• William Stallings, Computer Networking with Internet Protocols and Technology, Prentice Hall, 2008