Lecture 4: The Transport Layer and UDP Prof. Shervin Shirmohammadi SITE, University of Ottawa Prof. Shervin Shirmohammadi CEG 4183 4-1 The Transport Layer Provides efficient and robust end-to-end service to upper layers. Not all services need to be provided! Uses services provided by the network layer. End-to-end delivery of entire message. Connection Prof. Shervin Shirmohammadi CEG 4183 4-2 1
End-to-End Delivery Transport layer Networking layer Services are done from an end-to-end perspective Error control, flow control, Connectionless or connection-oriented Prof. Shervin Shirmohammadi CEG 4183 4-3 Addressing Service Access Point (SAP), also referred to as Ports at the transport layer. Prof. Shervin Shirmohammadi CEG 4183 4-4 2
Reliable Delivery Note that it is not compulsory for a transport layer protocol to provide such services. The idea is that if any of these services are to be provided in an end-to-end sense, then the transport layer is where you would implement them. Prof. Shervin Shirmohammadi CEG 4183 4-5 Error Control Error checking is done for the Transport Layer PDU (T-PDU). Even though T-PDU is put into the N-PDU as payload, the networking layer may or may not provide error control for it. What does IP do? error checked at networking error checked at networking error checked at networking Prof. Shervin Shirmohammadi CEG 4183 4-6 3
Sequence Control Prof. Shervin Shirmohammadi CEG 4183 4-7 Loss Control Prof. Shervin Shirmohammadi CEG 4183 4-8 4
Duplication Control What can cause duplication? Prof. Shervin Shirmohammadi CEG 4183 4-9 Flow Control Controls the flow of information, again from an end-to-end perspective. Factors affecting this are the end host, but also the network. Prof. Shervin Shirmohammadi CEG 4183 4-10 5
Multiplexing and Demultiplexing Data Link Networking Transport Prof. Shervin Shirmohammadi CEG 4183 4-11 App1 App2 App3 Multiplexing data data data 123 250 125 TCP UDP SPort=125 App 3 data SPort=123 App 1 data SPort=250 App 2 data IP Protocol=TCP TCP data Protocol=TCP TCP data Protocol=UDP UDP data to data Link layer Prof. Shervin Shirmohammadi CEG 4183 4-12 Protocol=TCP TCP data 6
App1 App2 App3 Demultiplexing data data data 560 440 1090 TCP UDP DPort=1090 App 3 data DPort=560 App 1 data DPort=440 App 2 data Protocol=TCP IP Protocol=TCP TCP data Protocol=UDP UDP data Protocol=TCP TCP data TCP data From data Link layer Prof. Shervin Shirmohammadi CEG 4183 4-13 Connection Obviously required only if we re talking about a connection-oriented transport protocol. Otherwise just send the packet and hope for the best. Need two protocols really: connection establishment connection release Prof. Shervin Shirmohammadi CEG 4183 4-14 7
Connection Establishment Sounds easy but it s quite a tricky process. Why not just send a Connection Request (CR) message and wait for a Connection Accepted Acknowledgement (ACK)? Problems can happen due to old duplicates of either the CR or the ACK packets. Receiver gets CR packets that have expired, but can be misinterpreted as new requests. Sender gets ACK packets that have expired, but can be misinterpreted as readiness of the receiver to receive. Prof. Shervin Shirmohammadi CEG 4183 4-15 Three-way Handshake Tomlinson 1975 Prof. Shervin Shirmohammadi CEG 4183 4-16 8
Connection Release Two types Asymmetric: either side hangs up and the connection breaks. Might cause data loss Symmetric: each side releases gracefully, waiting until the other side acknowledges disconnection. Prof. Shervin Shirmohammadi CEG 4183 4-17 Problem with Symmetric Release The two-army Problem What s the solution? Prof. Shervin Shirmohammadi CEG 4183 4-18 9
3-way Handshake Release Prof. Shervin Shirmohammadi CEG 4183 4-19 User Datagram Protocol (UDP) Defined in RFC 768. Connectionless service Multiplexing/Demultiplexing Error Detection (not really error control) Detection only, no recovery; and even the detection is optional No flow control No congestion control What does it do then? Used by SNMP, DNS, RTP, Multicasting. Prof. Shervin Shirmohammadi CEG 4183 4-20 10
Multiplexing/Demultiplexing Uses Port numbers Also used for addressing Prof. Shervin Shirmohammadi CEG 4183 4-21 ICANN Ranges Internet Corporation for Assigned Names and Numbers http://www.icann.org/ 13: daytime 53: name server 69: TFTP 111: RPC 161 SNMP Prof. Shervin Shirmohammadi CEG 4183 4-22 11
UDP Packet Format There is also a pseudo-header that is created and computed. The pseudo-header does not really exist as a header! Prof. Shervin Shirmohammadi CEG 4183 4-23 Pseudoheader This is done to detect wrong delivery of the packet by the Networking layer. Prof. Shervin Shirmohammadi CEG 4183 4-24 12
Checksum One s complement of the one s complement sum modulo Prof. Shervin Shirmohammadi CEG 4183 4-25 Queues Prof. Shervin Shirmohammadi CEG 4183 4-26 13
Multicasting The ability to send a packet to more than one destination. (send once, receive at multiple destinations). Uses the IP multicasting (class D) addresses. Interested parties must join a multicast group. Network infrastructure (routers, bridges, ) must support IP Multicast for this to happen Mostly not supported on the Internet. Prof. Shervin Shirmohammadi CEG 4183 4-27 14