MULTICAST USING UDP SOCKETS. PRELIMINARIES *CAST Unicast Communication is strictly from one sender to another specified receiver eg: TCP on LAN Broadcast.

Slides:



Advertisements
Similar presentations
Socket Programming with IPv6. Why IPv6? Addressing and routing scalability Address space exhaustion Host autoconfiguration QoS of flow using flowlabel.
Advertisements

© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Addressing the Network – IPv4 Network Fundamentals – Chapter 6.
Multicasting© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science.
Socket Options. abstraction Introduction getsockopt and setsockopt function socket state Generic socket option IPv4 socket option ICMPv6 socket option.
Multicast Fundamentals n The communication ways of the hosts n IP multicast n Application level multicast.
Multicasting - Part II© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Multicasting Jari Kellokoski Introduction When a unicast address identifies a sigle IP interface Then a broadcast address identifies all IP.
COS 420 Day 18. Agenda Group Project Discussion Program Requirements Rejected Resubmit by Friday Noon Protocol Definition Due April 12 Assignment 3 Due.
Socket option Getsockopt ou setsockopt fcntl ioctl.
CSE679: Multicast and Multimedia r Basics r Addressing r Routing r Hierarchical multicast r QoS multicast.
Broadcast and Multicast. Unicast Host 2Host 1 Broadcast Packet received by every host on network (including the sender!)
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Addressing the Network – IPv4 Network Fundamentals – Chapter 6.
Chapter 4: Managing LAN Traffic
ECE 4110 – Internetwork Programming Client-Server Model.
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Multicast routing.
Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J.
CSC 600 Internetworking with TCP/IP Unit 8: IP Multicasting (Ch. 17) Dr. Cheer-Sun Yang Spring 2001.
Multicast Routing Algorithms n Multicast routing n Flooding and Spanning Tree n Forward Shortest Path algorithm n Reversed Path Forwarding (RPF) algorithms.
Sockets API Overview Sockets with UDP Sockets with TCP Fast Sockets (Fast UDP) IP Multicasting.
Chapter 4: Interprocess Communication‏ Pages
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Lector: Aliyev H.U. Lecture №10 Multicast network software design TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT OF DATA COMMUNICATION.
Broadcasting & Multicasting with UDP sockets Chap 20, 21.
Chaptere19 multicasting. contents multicast address multicasting versus broadcasting on a LAN multicasting on a WAN multicast socket option mcast_join.
Distributed Computing Systems Project 3 – Nutella: A P2P Streaming Movie System Due: Tuesday, April 15 th.
CS 4396 Computer Networks Lab IP Multicast - Fundamentals.
CSC 600 Internetworking with TCP/IP Unit 7: IPv6 (ch. 33) Dr. Cheer-Sun Yang Spring 2001.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
Chapter 9 Hardware Addressing and Frame Type Identification 1.Delivering and sending packets 2.Hardware addressing: specifying a destination 3. Broadcasting.
Today’s topic –Broadcast and multicast –Send/receive broadcast and multicast packets.
Socket options: a summary –Tcp options, ip options and general socket options can be examined and sometimes modified. getsockopt, setsockopt routines Some.
Multicast Routing. Unicast: one source to one destination Multicast: one source to many destinations Two main functions: – Efficient data distribution.
Network Layer4-1 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol.
TELE 402 Lecture 8: Broadcast and Multicast 1 Overview Last Lecture –IPv6 This Lecture –Broadcast and multicast sockets –Source: Chapters 20&21 of Stevens’
1 Socket Options getsockopt and setsockopt functions Check options and obtain default values Generic socket options IPv4 socket options IPv6 socket options.
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
4.6 Multicast at the Network Layer Introduction: The Internet multicast abstraction and multicast groups The IGMP Protocol Multicast.
1 Spring Semester 2008, Dept. of Computer Science, Technion Internet Networking recitation #7 Socket Programming.
NUS.SOC.CS5248 Ooi Wei Tsang Protocols. NUS.SOC.CS5248 Ooi Wei Tsang You are Here Network Encoder Sender Middlebox Receiver Decoder.
Distributed Computing Systems Project 3 – Nutella a P2P Streaming Movie System Due: Sunday, February 14 th.
Broadcasting and Multicasting –An area that is not well standardized – systems from different vendors may behave differently when dealing with broadcast.
Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki CS 547/490 Network.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
Lecture Class 3 Advanced Socket Programming: Broadcast & Multicast Concepts.
1 CMPT 471 Networking II Multicasting © Janice Regan,
DMET 602: Networks and Media Lab
IP: Addressing, ARP, Routing
Socket Option.
The New Internet Protocol
The New Internet Protocol
IP - The Internet Protocol
Multicast architecture in Linux
學研計畫Training Course IP Multicasting
CSCI {4,6}900: Ubiquitous Computing
Chapter 07. Socket Options.
INTERNET PROTOCOL Presented by: Md:Faruque-A-Azam ID:1642CSE00570 Batch:42 CSE,MIU.
Chapter 10 IGMP Prof. Choong Seon HONG.
Chapter 06. UDP Server/Client.
IP - The Internet Protocol
Refs: Chapter 10, Appendix A
IP Multicast COSC /5/2019.
Internet Networking recitation #8
16EC Computer networks unit II Mr.M.Jagadesh
The New Internet Protocol
Implementing Multicast
IP - The Internet Protocol
Socket options: a summary
Advanced UNIX programming
Presentation transcript:

MULTICAST USING UDP SOCKETS

PRELIMINARIES

*CAST Unicast Communication is strictly from one sender to another specified receiver eg: TCP on LAN Broadcast Communication is strictly from one sender to all other connected receivers eg: ARP on LAN Multicast Communication is from one or more senders to a set of connected clients who have elected to receive

○Efficient if the routers do it (may use hardware capabilities) ○When bandwidth savings are required (up to 1/N of the bandwidth compared to N separate unicast clients) ○Used primarily in streaming media (surveillance, habitat monitoring, etc) MULTICAST APPLICATIONS

○IP MCAST packet is nearly identical to unicast packets ○Uses a special class of destination address (class D) which denotes a specific mcast group □Leading address bits = 1110 in IPv4 and ff00 in IPv6 ○TCP supports just unicast and hence mcast must use UDP MULTICAST PACKETS

PROCEDURE

○Multicast clients receive a stream of packets only if they have previously elect to do so from a sender ○This is realized through MCAST group memberships which are dynamic and controlled by receivers ○Routers’ responsibility to learn which sub-networks have active clients with the objective of minimizing packets transmitted ○Once the receivers join a particular IP multicast group, a multicast distribution tree is constructed for that group MULTICAST GROUPS

 int getsockopt (int s, int level, int optname, void* optval, int* optlen);  int setsockopt (int s, int level, int optname, const void* optval, int optlen); ○s = socket (DGRAM/RAW + AF_INET) ○level = IPPROTO_IP ○optname = value passed/returned to/from kernel MULTICAST GROUPS REALIZATION

OPTNAME IP_MULTICAST_TTL Dictates time to live and is set to 1 by default to avoid mcast packets from moving beyond local network u_char ttl = 2; setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); IP_MULTICAST_IF Select interface from which mcast packets are sent struct in_addr interface_addr; setsockopt (socket, IPPROTO_IP, IP_MULTICAST_IF, &interface_addr, sizeof(interface_addr)); IP_DROP_MEMBERSHIP Leave an mcast group struct ip_mreq mreq; setsockopt (socket, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); IP_ADD_MEMBERSHIP fill a ip_mreq structure and inform kernel of your interest to join group struct ip_mreq mreq; setsockopt (socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); IP_MULTICAST_LOOP Decide whether data sent must loopback - Needed if a process is listening u_char loop = 0; setsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop));

IOCTLS and CAVEATS ○To select outgoing interfaces, ioctls might be useful: □ SIOCGIFADDR (to get an interface's address) □ SIOCGIFCONF (to get the list of all the interfaces) □ SIOCGIFFLAGS (to get an interface's flags and determine if it is multicast capable [IFF_MULTICAST]) ○Alternatively, use ifconfig ○If the host has more than one interface and the IP_MULTICAST_IF option is not set, multicast transmissions are sent from the default interface

MULTICAST METHODOLOGY Socket Creation sock = socket(AF_INET, SOCK_DGRAM, 0); Populate Sockaddr_in addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(MCAST_PORT); Sender addrs.sin_addr.s_addr = inet_addr(MCAST_GROUP); sendto(sock, message, sizeof(message), 0,&addr, addrlen); Receive recvfrom(sock, message, sizeof(message), 0, &addr, &addrlen); Join MCAST group mreq.imr_multiaddr.s_addr = inet_addr(MCAST_GROUP); mreq.imr_interface.s_addr = htonl(INADDR_ANY); setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,&mreq, sizeof(mreq));

Experiment 1: One sender and one receiver

Experiment 2: Two senders and one receiver

Experiment 3: One sender and two receivers

○One sender many receivers work if all on stdlinux ○Many senders and many receivers work if all on stdlinux ○One sender many receivers work if all on RI ○Many senders and many receivers work if all on RI ○Mcast doesn’t work across these networks ○Changing ttl didn’t work ○Used “ ” and port 6000 for mcast program ○Attempted different mcast group ips and ports ○Mostly port 22 packets are allowed EXPERIMENTS CONCLUSIONS

ROUTING ○Source address used to determine stream direction ○Source of mcast traffic is considered upstream ○Router determines which downstream interfaces are destinations for the mcast group

QUESTIONS ○What happens when there are no receivers? Do packets get dropped at the router closest source? ○What are the limits? ○How is security ensured? Didn’t see any authentication mechanism to allow mcast membership join ○Are there any restrictions on which IPs can be used for group identification? If not how do routers figure out where receivers lie? Is it brute force?

○ pages/uni-b-mcast.htmlhttp:// pages/uni-b-mcast.html ○ ○ B99/samples/multicast.chttp://web.cs.wpi.edu/~claypool/courses/4514- B99/samples/multicast.c ○ ○ multicast/16450-mcastguide0.htmlhttp:// multicast/16450-mcastguide0.html REFERENCES