Upload
laurence-lyons
View
221
Download
0
Embed Size (px)
Citation preview
TCP/UDP
指導教授:吳坤熹演講者:黃驛翔
Class : IP Telephony
Outline
• Introduction• Linking to Application Layer• Packetization and Reassembly
– Protocol Data Units– TCP Header– UDP Header
• Establishing connection (virtual)– TCP technique– UDP technique
Outline (Con.)
• Service Primitives
• TCP vs. UDP
• References
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)
Introduction
• Transport Layer Functions– Linking to Application Layer– Packetization and Reassembly– Establishing connection (virtual)
• Connect oriented• Connectionless• Quality of Service (QoS)
Linking to Application Layer
• TCP may serve several Application at the same time
• User identified by
port number or
service access
point (SAP)
Packetization and Reassembly
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
TCP Header
UDP Header
Establishing connection ─ TCP
• Connection-oriented– Establishment– Maintenance– Termination
• Reliability– Data confirm– Error correction
• Flow control
Connection-oriented - Establishment
• 3-Way Handshaking
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
Reliable – Data confirm
Reliable – Error correction
Reliable – Error correction
Flow control
• Sliding Window
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
Establishing connection ─ UDP
• Connection-less
• No acks (Unconfirmed Service)
– high rate of transmission
– But unreliable
• No flow control
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
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
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
Service Primitives
• Primitives specify function to be performed for the transport layer
• Four Primitive types
• Confirmed service : TCP
• Nonconfirmed service : UDP
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
Timing Sequence for Service Primitives
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
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