PowerPoint Presentation
COMP30023 – Computer Systems
Copyright By PowCoder代写 加微信 powcoder
5/5/22© University of Melbourne
Transport Layer – Services & UDP
• (Presentation and Session Layers)
• Transport Layer
• Services Provided
(c) University of
• OSI layer 6 to provide:
– Encryption
– Compression
– Data conversion (e.g., mapping CR/LF to LF, .doc to .docx)
– Mapping between character sets (ASCII/EBCDIC, now UTF-8/BIG5/…)
• These services haven’t vanished: done by applications
• Why does IETF consider them “Application Layer”?
– The protocol to negotiate encryption etc. is quite simple and separate from
the algorithms
– There aren’t simple “common services” needed by all applications
– The application is not in the kernel, and so much more flexible
– “Layering violations”
• Closest thing to presentation layer: Real time protocol (RTP)
Presentation Layer
(c) University of
• OSI Layer 5 to provide
– Authentication
– Authorization
– Session restoration
• continue a failed download
• log back in to same point in an online purchase
• Examples:
– Remote procedure call (RPC)
– Point-to-point tunneling protocol (PPTP)
– Password (/Extensible) Authentication Protocol (PAP/EAP)
• Often used between protocols called* layer 2 and layer 3
*Layers are funny. Ethernet is always called “layer 2”, but has many properties
of layer 3, and even some of layer 4.
Session Layer
(c) University of
Application needs:
• Data is a stream of bytes
• Data from one application
is not mixed with that for
• Data arrives reliably (or we
know when a packet has
been lost)
• Data arrives in order
• Data doesn’t arrive faster
than we can handle
Network provides:
• Get packets from
host to host…
– …most of the
– …sometimes
multiple copies
Transport layer
(c) University of
Role: provide services needed by applications,
using services available by the network layer.
• The transport layer services provide interfaces between the
application layer and the network/internet layer.
• Services provide a “logical” communication channel
between processes running on different hosts:
– Connection-oriented
• = Connection establishment, data transfer, connection release (TCP)
• Like phone call
– Connectionless: data transfer (UDP)
• Like text messages
Transport Layer
(c) University of
Connection-oriented transport services (can) provide a reliable
service on top of an unreliable network.
Transport entity illustrated
(Tanenbaum)
(c) University of
TN 6th 6-1
• Abstract representation of messages sent to and from
transport entities
• Encapsulation of segments (transport layer units) in packets
(network/internet layer units) in frames (data/link layer
Transport layer encapsulation
(c) University of
TN 6th 6-3
• Terminology (not universal, don’t memorize these):
– Segments – sent at the transport layer
– Packets – sent at the internet/network layer
– Frames – sent at the link/data link layer
• In the case of a reliable connection orientated service
– Provides a notional “perfect” connection between two nodes
• Doesn’t provide privacy, isochrony (preserving delay between packets)
– Hides acknowledgements, congestion control, lost packets
– This service is provided to the higher layers
• In the case of an unreliable connectionless orientated service
– Provides multiplexing between different processes
Transport layer services
(c) University of
• Specification of the remote process to “connect to” is
required at both the application and transport layers.
• Addressing in the transport layer is typically done using port
numbers (e.g. port 80).
– cf. Unix /etc/services, www.iana.org (well known ports) a process
server intercepts inbound connections and spawns requested server
and attaches inbound connection
• cf. Unix /etc/(x)inetd
• Full address is a 5-tuple
– (source IP address, source port, destination IP address, destination
port, protocol)
Transport Layer Addressing
(c) University of
• Port numbers can range from 0-65535 (16 bits)
• Allocated by Internet Assigned Numbers Authority (IANA)
– (http://www.iana.org/assignments/port-numbers)
• Ports are classified into 3 segments:
– Well Known Ports (0-1023) [specific numbers are not examinable]
• 23 Telnet
• 110 POP3
• 119 NNTP
– Registered Ports (1024-49151)
• Also called “user ports” but still registered with IANA or similar body
– Dynamic Ports (49152-65535)
Port allocations
(c) University of
• Shortened to MUXING and DEMUXING
– Multiplexing – combining multiple distinct streams into a single
shared stream
– Demultiplexing – splitting distinct streams out from a single shared
Multiplexing /Demultiplexing
(c) University of
(c) University of
Really 5-tuples
• The User Datagram Protocol allows applications to transmit
encapsulated IP datagrams without a connection.
– UDP transmits in segments consisting of a header followed by the
• UDP headers contain source and destination ports, payload
is handed to the process which is attached to the particular
port at the destination (using BIND primitive or similar)
UDP – User Datagram Protocol
(c) University of
• The main advantage of using UDP over raw IP is the ability to
specify ports for source and destination pairs.
• Note: both source and destination ports are required
– destination allows initial routing for incoming segments
– source allows reply routing for outgoing segments.
• Strengths and weaknesses of UDP:
– Strengths: multiplexing/de-multiplexing;
no delay waiting to recover lost packets
– Weaknesses: No flow control, error control
or retransmission of bad segments
– Conclusion: where applications require a precise level of control over
packet flow/error/timing, UDP is a good choice
UDP – User Datagram Protocol
(c) University of
• (top) UDP header
• (bottom) The IPv4 pseudoheader included in the UDP checksum.
UDP header
(c) University of
TN 6th 6-27, 6-28
• Simple and efficient
• Suitable for some client – server settings
– Clients sends a short request to the server, expects a short response
– If that does not occur (request or response is lost) client timeouts
and resends
– Simple to code, and fewer messages, one in each direction
– DNS is a good example
• Also suitable for real-time services (e.g., VoIP)
– If a packet is lost, we don’t want to wait for it to be resent
– Loss concealment: fill in the time with our “best guess” sound
UDP – User Datagram Protocol
(c) University of
• RPC – Remote Procedure Calls
– Allow calling procedures on a remote server as if they are local to
the client
– Hides the networking aspects from the programmer
• RPC isn’t a single protocol/API. Dozens of variants exist.
• How it works abstractly:
– Client process on Machine A calls procedure on Machine B
– Process on machine A is suspended, whilst execution of the
procedure takes place on Machine B
– Machine B responds with result to Machine A, which then continues
processing
Remote Procedure Calls
(c) University of
• To hide the networking, the client and server must be
bound to respective stubs
– Client stub – operates in the client address space
– Server stub – operates in the server address space
• From the perspective of the client and server processes, all
the calls are local
• Parameters can be passed and returned
– Marshalling – convert the in-memory data structure to a form that
can be stored or transmitted
– Unmarshalling – covert the stored or transmitted data into an
in-memory data structure
Remote Procedure Calls
(c) University of
Remote Procedure Calls
(c) University of
TN 6th 6-29
• Conceptually simple, but many challenges exist
– Cannot pass pointers easily – client and server are in different
address spaces
• Possible to marshal and unmarshal underlying value and create a
pointer in each address space
– Does not work for complex data structures
– Weakly typed languages like C can present problems
• e.g. unknown array sizes
– Unable to deduce parameter types
– Global variables are not shared
Remote Procedure Calls
(c) University of
• UDP can be a good choice for RPC
– Requires some additional scaffolding
• Resending after timeout if no reply is received
– a reply constitutes an acknowledgement of the request
• Handling large parameter sizes that need to be split across multiple
UDP segments
– Caution must be used if operation is not idempotent
• e.g., incrementing a bank balance
• TCP can be used for non-idempotent operations
Remote Procedure Calls
(c) University of
• Real-Time Transport Protocol (RTP)
• Which layer is RTP at?
– Runs in user space, uses UDP from the transport layer -> Application layer
– Generic protocol that provides services to applications -> Transport layer
– (Neither – Presentation layer!)
• RTP multiplexes several streams into a single stream of UDP
RTP – Streaming and VOIP
(c) University of
UDP Segments
The position of real-time protocol in the protocol stack
UDP Example Use
(c) University of
Packet nestingTN 6th 6-30
• Payload type – encoding used (MP3, etc.) – can vary each time
• Sequence Number – counter incremented on each packet
• Timestamp – Source controlled relative to start of the stream
RTP Header
(c) University of
TN 6th 6-31
• Control protocol for RTP
– Handles feedback, synchronization, and UI
• Feedback to source
– Delay, jitter, bandwidth, congestion
– Used by encoder to adaptively encode to suit network conditions
– In multicast settings, feedback is limited to small percentage of media bandwidth
• Synchronization
– Where different streams use different clocks/have different drift
– naming sources to show who is on a conference call
• (Another network model:
“Control plane” is a stack parallel to the “data plane” stack.)
Real-time Transport Control
Protocol (RTCP)
(c) University of
• Jitter – variation in delay of packets
– Buffer at receiver to counter it
• Packet 8 too late, can wait or skip, depending on application
• Size of buffer is also application specific (VOIP = small buffer)
RTP Playback
(c) University of
TN 6th 6-32
And finally…
(c) University of
• Memcached Reflected DDoS Attacks
– Distributed memory object caching –
speeds up dynamic websites by caching
database queries
– Should never been configured externally
• Small UDP request made to
memcached server with fake source IP
• Memcached responds with up to
50,000 times the data
– 203 byte request results in 100MB
response [
https://blogs.akamai.com/2018/03/memc
ached-fueled-13-tbps-attacks.html
https://blogs.akamai.com/2018/03/memcached-fueled-13-tbps-attacks.html
https://blogs.akamai.com/2018/03/memcached-fueled-13-tbps-attacks.html
• The slides were adapted by from slides
prepared by and based on
material developed previously by: , , , and .
• Some of the images included in the notes were supplied as
part of the teaching resources accompanying the text books
listed in lecture 1.
– (And also) Computer Networks, 6th Edition, Tanenbaum A., Wetherall. D.
https://ebookcentral.proquest.com/lib/unimelb/detail.action?docID=6481879
• Textbook Reference: 3.2,3.3, 9.4.1 (9.3 for interest)
Acknowledgement
(c) University of
https://ebookcentral.proquest.com/lib/unimelb/detail.action?docID=6481879
(c) University of
Transport Layer – Services & UDP
Presentation Layer
Session Layer
Transport layer
Transport Layer
Transport entity illustrated (Tanenbaum)
Transport layer encapsulation
Transport layer services
Transport Layer Addressing
Port allocations
Multiplexing /Demultiplexing
UDP – User Datagram Protocol
UDP – User Datagram Protocol (2)
UDP header
UDP – User Datagram Protocol (3)
Remote Procedure Calls
Remote Procedure Calls (2)
Remote Procedure Calls (3)
Remote Procedure Calls (4)
Remote Procedure Calls (5)
RTP – Streaming and VOIP
UDP Example Use
RTP Header
Real-time Transport Control Protocol (RTCP)
RTP Playback
And finally…
Acknowledgement
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com