Download presentation
Presentation is loading. Please wait.
Published byBernice Moody Modified over 8 years ago
1
NUS.SOC.CS5248 Ooi Wei Tsang Protocols
2
NUS.SOC.CS5248 Ooi Wei Tsang You are Here Network Encoder Sender Middlebox Receiver Decoder
3
NUS.SOC.CS5248 Ooi Wei Tsang Interested ISO Layers Application Transport Network
4
NUS.SOC.CS5248 Ooi Wei Tsang Interested ISO Layers RTP TCP Network IP Multicast IP UDP
5
NUS.SOC.CS5248 Ooi Wei Tsang IP Multicast
6
NUS.SOC.CS5248 Ooi Wei Tsang Communication Models Traditional Applications: One-to-One receiversender
7
NUS.SOC.CS5248 Ooi Wei Tsang Communication Models Media Applications: One-to-Many sender receivers
8
NUS.SOC.CS5248 Ooi Wei Tsang Communication Models Media Applications: Many-to-Many
9
NUS.SOC.CS5248 Ooi Wei Tsang Naïve Solution Create M unicast connection for M clients NOT Scalable!
10
NUS.SOC.CS5248 Ooi Wei Tsang Famous Example Victoria’s Secret Spring Fashion Show Live Broadcast in 1999 Video bit-rate: 28 Kbps Number of viewers: 1.5 Millions
11
NUS.SOC.CS5248 Ooi Wei Tsang New Model: IP Multicast sender receivers
12
NUS.SOC.CS5248 Ooi Wei Tsang Group and Members members
13
NUS.SOC.CS5248 Ooi Wei Tsang Sending to a Group
14
NUS.SOC.CS5248 Ooi Wei Tsang Joining and Leaving
15
NUS.SOC.CS5248 Ooi Wei Tsang Anyone can Send
16
NUS.SOC.CS5248 Ooi Wei Tsang Multicast Address Group ID or “Multicast address” 224.0.0.0 – 239.255.255.255
17
NUS.SOC.CS5248 Ooi Wei Tsang Unicast Router A B C S A B C
18
NUS.SOC.CS5248 Ooi Wei Tsang Multicast Router A B C S G
19
NUS.SOC.CS5248 Ooi Wei Tsang Multicast Router A B C S G G
20
NUS.SOC.CS5248 Ooi Wei Tsang Multicast Router A B C S G G
21
NUS.SOC.CS5248 Ooi Wei Tsang Question 1 Router G ? should I forward this packet to my subnet?
22
NUS.SOC.CS5248 Ooi Wei Tsang Question 2 Router which neighbors should I forward this packet to?
23
NUS.SOC.CS5248 Ooi Wei Tsang Group Management
24
NUS.SOC.CS5248 Ooi Wei Tsang Group Management Routers maintain “local host group membership table” “which group has a member in my subnet ?”
25
NUS.SOC.CS5248 Ooi Wei Tsang IGMP v2.0 JOIN message A : “I want to join group G.” QUERY message R : “Which group have you joined ?” Internet Group Management Protocol
26
NUS.SOC.CS5248 Ooi Wei Tsang IGMP v2.0 LEAVE message “I want to leave group G” Group-Specific Query “Anybody else belongs to group G ?”
27
NUS.SOC.CS5248 Ooi Wei Tsang IGMP v2.0 MEMBERSHIP Report A : “I am a member of group G” A : “I am a member of group H” B : “I am a member of group G”
28
NUS.SOC.CS5248 Ooi Wei Tsang Avoiding Implosion Select random delay t After time t, if nobody belongs to the same group, send membership report. Resend the report after some delay just to be safe.
29
NUS.SOC.CS5248 Ooi Wei Tsang Question 2 Router which neighbors should I forward this packet?
30
NUS.SOC.CS5248 Ooi Wei Tsang Routing Protocols
31
NUS.SOC.CS5248 Ooi Wei Tsang Routing Protocols Generic Methods : Form a tree to all routers with members Deliver the packets along the tree
32
NUS.SOC.CS5248 Ooi Wei Tsang Shortest Path Tree One tree for each source for each group
33
NUS.SOC.CS5248 Ooi Wei Tsang Shared Tree One tree for each group
34
NUS.SOC.CS5248 Ooi Wei Tsang Routing Protocols DVMRP – shortest path tree CBT – shared tree PIM – combine both
35
NUS.SOC.CS5248 Ooi Wei Tsang DVMRP Distance Vector Multicast Routing Protocol
36
NUS.SOC.CS5248 Ooi Wei Tsang From S to G RP Q T S :
37
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T Is R on the shortest path to S ? S :
38
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T If no.. ignore the packet
39
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T If yes.. Where should I forward it to ?
40
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T Is my subnet interested?
41
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T ? ? Are my neighbors interested?
42
NUS.SOC.CS5248 Ooi Wei Tsang Observation If neighbor is going to ignore my packets, don’t need to send the packets to it.
43
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T Exchanging Routing Tables DestNext HopCost SP4 AT3 BP2
44
NUS.SOC.CS5248 Ooi Wei Tsang Flooding Default : Always send to neighboring routers, unless told otherwise.
45
NUS.SOC.CS5248 Ooi Wei Tsang Pruning Routers who received a “useless” packet send a prune message back. “Don’t send me packets addressed to G anymore !”
46
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T
47
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T PRUNE
48
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T
49
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T GRAFT
50
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T
51
NUS.SOC.CS5248 Ooi Wei Tsang RP Q T PRUNE
52
NUS.SOC.CS5248 Ooi Wei Tsang A router needs to remember.. If it has any member for group G in its subnet Where to forward packets from source S to group G Which neighbors will not throw my packets away Which sub-trees are pruned
53
NUS.SOC.CS5248 Ooi Wei Tsang Problems of DVMRP Not Scalable O(|S||G|) Not Efficient Flooding initially Periodically exchange routing tables
54
NUS.SOC.CS5248 Ooi Wei Tsang CBT Core-based Tree
55
NUS.SOC.CS5248 Ooi Wei Tsang Core Based Tree One tree per group Pick a router as core
56
NUS.SOC.CS5248 Ooi Wei Tsang A Shared Tree core P Q R U V W
57
NUS.SOC.CS5248 Ooi Wei Tsang V Joins G core P Q R U V JOIN W
58
NUS.SOC.CS5248 Ooi Wei Tsang V Joins G core P Q R U V JOIN W
59
NUS.SOC.CS5248 Ooi Wei Tsang V Joins G core P Q R U V ACK W
60
NUS.SOC.CS5248 Ooi Wei Tsang V Joins G corePQ R U V ACK W
61
NUS.SOC.CS5248 Ooi Wei Tsang V Joins G corePQ R U V W
62
NUS.SOC.CS5248 Ooi Wei Tsang U Joins G corePQ R U V JOIN W
63
NUS.SOC.CS5248 Ooi Wei Tsang U Joins G corePQ RU V ACK W intercept!
64
NUS.SOC.CS5248 Ooi Wei Tsang P Sends (on Tree) corePQ RU V W
65
NUS.SOC.CS5248 Ooi Wei Tsang W Sends (Not on Tree) corePQ RU V W
66
NUS.SOC.CS5248 Ooi Wei Tsang CBT Strengths Scalable O(|G|) states No flooding No exchange of states
67
NUS.SOC.CS5248 Ooi Wei Tsang CBT Weaknesses Core placement matters Single point of failure Core can become bottleneck Paths not always shortest
68
NUS.SOC.CS5248 Ooi Wei Tsang PIM Protocol Independent Multicast
69
NUS.SOC.CS5248 Ooi Wei Tsang PIM Get the best of both world : dense mode : similar to DVMRP sparse mode : similar to CBT
70
NUS.SOC.CS5248 Ooi Wei Tsang Summary What is IP Multicast? How to route packets IGMP DVMRP/CBT/PIM
71
NUS.SOC.CS5248 Ooi Wei Tsang So, why can’t we multicast? Who assign multicast address? Who pay for multicast traffic? How to inter-operate between protocols? How can we prevent DoS?
72
NUS.SOC.CS5248 Ooi Wei Tsang Multicast Programming
73
NUS.SOC.CS5248 Ooi Wei Tsang Create a UDP Socket s = socket(PF_INET, SOCK_DGRAM, 0) bind(s, sock_addr, sizeof(sock_addr))
74
NUS.SOC.CS5248 Ooi Wei Tsang Join a Group struct sockaddr_in groupStruct; struct ip_mreq mreq; mreq.imr_multiaddr = … // init mcast addr setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof(mreq))
75
NUS.SOC.CS5248 Ooi Wei Tsang Leave a Group struct sockaddr_in groupStruct; struct ip_mreq mreq; mreq.imr_multiaddr = … // init mcast addr setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, (char *) &mreq, sizeof(mreq))
76
NUS.SOC.CS5248 Ooi Wei Tsang Transport Layer
77
NUS.SOC.CS5248 Ooi Wei Tsang Interested ISO Layers RTP TCP Network IP Multicast IP UDP
78
NUS.SOC.CS5248 Ooi Wei Tsang TCP vs UDP
79
NUS.SOC.CS5248 Ooi Wei Tsang TCP vs UDP TCP connection oriented packet ordering reliability congestion control UDP just send!
80
NUS.SOC.CS5248 Ooi Wei Tsang How TCP Works (Roughly) Sender expects packet to be ACK If received duplicate ACKs or no ACK after RTO, assume packet lost
81
NUS.SOC.CS5248 Ooi Wei Tsang How TCP Works (Roughly) Congestion Avoidance - Reduce sending window when packet lost, increase when packet gets through
82
NUS.SOC.CS5248 Ooi Wei Tsang Conventional Wisdom Continuous media uses UDP Retransmission may not be useful Congestion control makes throughput unpredictable Multicast + TCP has problems
83
NUS.SOC.CS5248 Ooi Wei Tsang UDP Header struct UDPHeader { short src_port; short dst_port; short length; short checksum; }
84
NUS.SOC.CS5248 Ooi Wei Tsang UDP not enough Who sent this packet? How do I interpret this packet? When was this packet generated? Which packets come first? Is this packet important? Should I ask for retransmission?
85
NUS.SOC.CS5248 Ooi Wei Tsang Application-Level Framing Expose details to applications Let application decides what to do with a packet, not transport protocol
86
NUS.SOC.CS5248 Ooi Wei Tsang RTP Real-Time Transport Protocol
87
NUS.SOC.CS5248 Ooi Wei Tsang RTP Packet Format RTP Header RTP Payload Header RTP Payload
88
NUS.SOC.CS5248 Ooi Wei Tsang payload type: 7 bits identify content e.g. 14: mp3 32: MPEG-1 RTP Header
89
NUS.SOC.CS5248 Ooi Wei Tsang RTP Header sequence number: 16 bits packet sequence number
90
NUS.SOC.CS5248 Ooi Wei Tsang RTP Header media timestamp: 32 bits the instant the first byte in this packet is captured
91
NUS.SOC.CS5248 Ooi Wei Tsang RTP Header SSRC: 32 bits random, unique in a session identify a source (not host!)
92
NUS.SOC.CS5248 Ooi Wei Tsang RTP Header marker bit: depends on payload e.g. beginning of frame
93
NUS.SOC.CS5248 Ooi Wei Tsang On Receiving RTP packet check SSRC new source? existing source? which one? check payload type has format been changed? which decoder should I use?
94
NUS.SOC.CS5248 Ooi Wei Tsang RTCP Real-Time Transport Control Protocol
95
NUS.SOC.CS5248 Ooi Wei Tsang RTCP Real-Time Control Protocol Provides receiver’s feedback network conditions time synchronization receiver’s description
96
NUS.SOC.CS5248 Ooi Wei Tsang RTCP Packet Types Sender’s Report (SR) Receiver’s Report (RR) Source Description (SDES) Application Specific (APP) BYE
97
NUS.SOC.CS5248 Ooi Wei Tsang Fields in SR NTP and RTP Timestamp relate media timestamp to real time Sender’s stats byte count, packet count
98
NUS.SOC.CS5248 Ooi Wei Tsang Fields in SR + RR Reception Report Number of lost packets % of lost packets Inter-arrival jitter Timestamp of last SR Delay since last SR t lsr t dlsr SR RR
99
NUS.SOC.CS5248 Ooi Wei Tsang Deducing Network Conditions Packet Loss Rate Interarrival Jitter Round Trip Time
100
NUS.SOC.CS5248 Ooi Wei Tsang Calculating Packet Loss Ratio for each source, keep first sequence number S 0 last sequence number S last Expected packets = S last – S 0 Count how many received packets
101
NUS.SOC.CS5248 Ooi Wei Tsang Calculating Interarrival Jitter Variance in packet spacing Define: P i.arrival_time P i.media_timestamp P i.transit_time
102
NUS.SOC.CS5248 Ooi Wei Tsang Calculating Interarrival Jitter P i.transit_time = P i.arrival_time - P i.media_timestamp Difference in transit time for two consecutive packets = |P i.transit_time – P i-1.transit_time|
103
NUS.SOC.CS5248 Ooi Wei Tsang Calculating Interarrival Jitter Jitter after packet i = J i J i = (1-a) J i-1 + a D(i,i-1)
104
NUS.SOC.CS5248 Ooi Wei Tsang Calculating RTT t lsr t dlsr
105
NUS.SOC.CS5248 Ooi Wei Tsang Calculating ??? P i.sender_byte_count P i.sender_packet_count
106
NUS.SOC.CS5248 Ooi Wei Tsang RTCP Scaling B: Fix RTCP bandwidth N: Number of participants S: Mean RTCP packet size Sending interval =
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.