Transporting Voice by Using IP
The RTP Control Protocol [1/3]
n
RTCP
n
A companion control protocol of RTP
n
Periodic exchange of control information
n For quality-related feedback
n
A third party can also monitor session quality and detect network problems.
n Using RTCP and IP multicast
n
Five types of RTCP packets
n
Sender Report:
used by active session participants to relay transmission and reception statisticsn
Receiver Report:
used to send reception statistics from those participants that receive but do not send themThe RTP Control Protocol [2/3]
n
Source Description (SDES)
n One or more descriptions related to a particular session participant
n Must contain a canonical name (CNAME)
n Separate from SSRC which might change
n When both audio and video streams were being transmitted, the two streams would have
n different SSRCs
n the same CNAME for synchronized play-out
n
BYE
n The end of a participation in a session
n
APP
For application-specific functions
The RTP Control Protocol [3/3]
n Two or more RTCP packets will be combined
n SRs and RRs should be sent as often as possible to allow better statistical resolution.
n New receivers in a session must receive CNAME very quickly to allow a correlation between media sources and the received media.
n Every RTCP packet must contain a report packet (SR/RR) and an SDES packet
n Even if no data to report
n An example of RTP compound packet
Encryption Prefix (optional)
RTCP Sender Report
n SR
n Header Info
n Sender Info
n Receiver Report Blocks
n Option
n Profile-specific extension
Header Info
n
Resemble to an RTP packet
n
Version
n 2
n
Padding bit
n Padding octets?
n
RC, report count
n The number of reception report blocks
n 5-bit
n If more than 31 reports, an RR is added
n
PT, payload type (200)
Sender Info
n
SSRC of sender
n
NTP Timestamp
n Network Time Protocol Timestamp
n The time elapsed in seconds since 00:00, 1/1/1900 (GMT)
n 64-bit
n 32 MSB: the number of seconds
n 32 LSB: the fraction of a seconds (200 ps)
n
RTP Timestamp
n The same as used for RTP timestamps in RTP packets
n For better synchronization
n
Sender’s packet count
n Cumulative within a session
n
Sender’s octet count
Cumulative within a session
RR blocks [1/2]
n
SSRC_n
n The source identifier of the session participant to which the data in this RR block pertains.
n
Fraction lost
n Fraction of packets lost since the last report issued by this participant
n By examining the sequence numbers in the RTP header
n
Cumulative number of packets lost
n Since the beginning of the RTP session
n
Extended highest sequence number received
n The sequence number of the last RTP packet received
n 16 lsb, the last sequence number
n 16 msb, the number of sequence number cycles
RR blocks [2/2]
n
Interarrival jitter
n
An estimate of the variance in RTP packet arrival
n
Last SR Timestamp (LSR)
n
Used to check if the last SR has been received
n
Delay Since Last SR (DLSR)
n
The duration in units of 1/65,536 seconds
RTCP Receiver Report
n
RR
n
Issued by a participant who receives RTP packets but does not send, or has not yet sent
n
Is almost identical to an SR
n PT = 201
n No sender information
RTCP Source Description Packet
n
Provides identification and information regarding session participants
n
Must exist in every RTCP compound packet
n
Header
n
V, P, RC, PT=202, Length
n
Zero or more chunks of information
n
An SSRC or CSRC value
n
One or more identifiers and pieces of information
n A unique CNAME (user@host)
n Email address, phone number, name
n
RTCP BYE Packet (PT=203)
n
Indicate one or more media sources (SSRC or CSRC) are no longer active
n
Application-Defined RTCP Packet (PT=204)
n
For application-specific data
n
For non-standardized application
Calculating Round-Trip Time
n
Use SRs and RRs
n
E.g.
n
Report A: A, T1 → B, T2
n
Report B: B, T3 → A, T4
n
RTT = T4-T3+T2-T1
n
RTT = T4-(T3-T2)-T1
n
Report B
n LSR = T1
n DLSR = T3-T2
A B
T1
T4
T2 T3
Calculation Jitter
n
The variation in delay
n
The mean deviation of the difference in
packet spacing at the receiver compared to the packet spacing at the sender for a pair of packets
n
This value is equivalent to the derivation in transit time for a pair of packets.
n
S
i= the RTP timestamp for packet i
n
R
i= the time of arrival
n
D(i,j) = (R
j-R
i)-(S
j-S
i) = (R
j-S
j) - (R
i-S
i)
n
The Jitter is calculated continuously
n
J(i) = J(i-1) + (| D(i-1,i) | - J(i-1))/16
Timing of RTCP Packets
n
RTCP provides useful feedback
n Regarding the quality of an RTP session
n Delay, jitter, packet loss
n Be sent as often as possible
n Consume the bandwidth
n Should be fixed to a small fraction (e.g., 5%)
n
An algorithm, RFC 1889
n Senders are collectively allowed at least 25% of the control traffic bandwidth. (CNAME)
n The interval > 5 seconds
n 0.5 – 1.5 times the calculated interval
n This helps to avoid unintended synchronization where all
participants send RTCP packets at the same time instant, hence clogging the network.
n A dynamic estimate of the avg. RTCP packet size is calculated.
IP Multicast
n
An IP diagram sent to multiple hosts
n Conference
n To a single address associated with all listeners
n
Multicast groups
n Multicast address
n Join a multicast group
n Inform local routers
n Routing protocols
n Support propagation of routing information for multicast addresses
n Routing tables should be set up so that the minimum number of datagrams is sent.
n
IP version 4 (IPv4) address space 224.0.0.0 to 239.255.255.255
n
Hosts in a particular group use the Internet Group Message Protocol (IGMP) to advertise their
membership in a group to routers.
IP Version 6
n
The explosive growth of the Internet
n IPv4 address space, 32-bit
n Real-time and interactive applications
n
Expanded address space, 128 bits
n
Simplified header format
n Enabling easier processing of IP datagrams
n
Improved support for headers and extensions
n Enabling greater flexibility for the introduction of new options
n
Flow-labeling capability
n Enabling the identification of traffic flows (and therefore better support at the IP level) for real-time applications
n
Authentication and privacy
n Support for authentication, data integrity and data confidentiality are included at the IP level.
IPv6 Header [1/3]
IPv6 Header [2/3]
n
Version
n
6
n
Traffic Class, 8-bit
n
For the quality of service
n
Flow Label, 20-bit
n
Label sequences of packets that belong to a single flow
n A VoIP stream
n
A flow := source address, destination address,
flow label
IPv6 Header [3/3]
n
Payload Length, 16-bit unsigned integer
n
The length of payload in octets
n
Header extensions are part of the payload
n
Next Header, 8-bit
n
The next higher-layer protocol
n Same as the Protocol field of the IPv4 header
n
The existence of IPv6 header extensions
n
Hop Limit, 8-bit unsigned integer
n
The TTL field of the IPv4 header
n
Source and Destination Addresses, 128-bit
IPv6 addresses
n
XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
n
X is a hexadecimal character
n
E.g., 1511:1:0:0:0:FA22:45:11
n
The symbol “::” can be used to represent a number of contiguous fields with zero values.
n
= 1511:1::FA22:45:11
n
0:0:0:0:AA11:50:22:F77 = ::AA11:50:22:F77
n
“::” can appears only once
IPv6 special addresses
n The all-zeros address, ::
n An unspecified address; a node does not yet know its address
n The all-zeros address must not be used as a destination address.
n The loopback address, ::1
n To send an IPv6 packet to itself
n On a virtual internal interface
n IPv6 address with embedded IPv4 address (type 1)
n 96-bit zeros + 32-bit IPv4 address
n ::140.113.17.5
n Used by IPv6 hosts and routers that tunnel IPv6 packets through an IPv4 infrastructure
n IPv6 address with embedded IPv4 address (type 2)
n 80-bit zeros + FFFF + 32-bit IPv4 address
n 0:0:0:0:0:FFFF:140.113.17.5
n ::FFFF:140.113.17.5
IPv6 Header Extensions
n
To be placed between the fixed header and the actual data payload
n
Next Header
n
The type of payload carried in the IP datagram
n
The type of header extension
n
Each extension has its own next header field.
Header extension
n
Use the next header field
Hop-by-hop Extension [1/3]
n
It is the only one exception.
n Examined and processed by every intermediate node
n If present, the hop-by-hop extension must immediately follow the IP header
n Of variable length
n
Next header
n
Length of this header extension
n in units of eight octets
n
Options
n TLV (Type-Length-Value) format
n Type: 8-bit
n Length: 8-bit (in units of octets)
n Value: variable length
Type [0:2] are of special significance
Hop-by-hop Extension [2/3]
n
Hop-by-hop header extension
Hop-by-hop Extension [3/3]
n
Option Type: the first two bits (how the node react if it does not understand the option)
n 00: skip this option and continue processing the header
n 01: discard the packet
n 10: discard the packet and send an ICMP Parameter Problem, Code 2 message to the originator of the packet
n 11: do above only if the destination address in the IP header is not a multicast address
n
Option Type: the third bit
n 1, the option data can be changed
n 0, cannot
n
Destination options extension
n
Has the same format as the hop-by-hop extension
n
Only the destination node examine the extension.
n
Header type = 60
n
Routing Extension
n
A routing type field to enable various routing options
n
Only routing type 0 is defined for now
n Specify the nodes that should be visited
Routing Extension [1/2]
Routing Extension [2/2]
n
Routing type
n
Segments Left
n The number of nodes that still need to be visited
n
A list of IP addresses needs to be visited
n
Is this type of header analyzed by intermediate node?
n Yes or no
n A->B->C->D->Z
n A->B, 3, (C,D,Z)
n A->C, 2, (B,D,Z) by B
n A->D, 1, (B,C,Z) by C
n A->Z, 0, (B,C,D) by D
Interoperation IPv4 and IPv6
n
IPv4 and IPv6 will coexist for a long time
n IPv4 nodes ó IPv6 nodes
n IPv6 nodes ó IPv6 nodes via IPv4 networks
n IPv4 nodes ó IPv4 nodes via IPv6 networks
n
IPv4-compatible nodes with IPv4-compatible addresses at the boundaries of IPv6 networks
n IPv6 in IPv4 packets