Hello guys, Multicasting is an important concept for Java developers, particularly those working on high frequency low latency Java application like trading apps, client connectivity and exchange connectivity systems, order management systems (OMS), Algorithm trading system, and smart order routers. As it provides a faster way to deliver messages than TCP. Yes, Multicasting is usually UDP based which is faster than TCP. While UDP doesn't guarantee message delivery, you can use things like sequence number to track messages and replay if a message went missing. Since multicasting is heavily used on big investment banks like JP Morgan, Barclays, Citi, Morgan Stanley, and others on their Java applications, its also an important topics for interviews. Not just on banks but also on many product based companies.
It's also a tricky topic to master as its quite confusing if you don't know the details in depth. There are also not many articles or interview questions available on multicasting so I decided to create this post, not just for myself but for all other Java developers who are looking to learn Multicasting or level up their multicasting skills.
Multicasting Interview Questions and Answers
Without any further ado, here is a list of multicasting interview questions and answers for intermediate and experienced developers.
Mulltcasting or Internet Protocol (IP) multicasting is a communication mechanism where one host can send messages to multiple hosts by just sending a single copy. Sender sends messages to a multicast group e.g. (239.255.10.10) and all hosts which have joined that group receives that messages.
2. What is multicast address?
multicast addresses are class D IP addresses in the range of 224.0.0.0 and 239.255.255.255. These addresses are specially reserved by IANA (Internet Assigned Numbers Authority ) for multicasting. multicast addresses are then further divided based upon their usages e.g. addresses in the range of 224.0.0.0 to 224.0.0.255 (224.0.0.0/24) are reserved for local subnet multicast traffic.
Datagrams sent to addresses in this range are not forwarded by IP routers
IP address in range 224.0.1.0 to 238.255.255.255 are known as globally scoped addresses, which means they can be used for multicasting across an intranet or the Internet.
Addresses in the range of 239.0.0.0 to 239.255.255.255 (239.0.0.0/8) are reserved for administratively scoped addresses. Administratively scoped addresses as defined by RFC 2365 are used to prevent the forwarding of multicast traffic across boundaries
3. What is multicast group?
A multicast group is the set of hosts listening on a specified multicast address e.g. 239.255.10.10. When host joins multicast group they become part of it and starts receiving multicast traffic, when they left, they don't receive multicast traffic.
4. What is requirement for multicasting?
In order to support multicasting, both your host and router must be multicast enabled. A multicast enabled router can manage multicast group membership by processing IGMP requests by hosts to join or leave a multicast group. A multicast enabled router can also forward multicast traffic to other routers and subnetwork that contain multicast group members.
5. Difference between multicast and broadcast?
In case of broadcast all hosts in the network receives messages but in case of multicast, only hosts which are part of multicast group receives messages. Also multicast is more efficient than broadcast.
7. Why multicast is more efficient than broadcast?
multicast is more efficient than broadcast because broadcast packets has to be received by everyone on the local link. Each OS takes an interrupt, and passes the packet on for inspection, which normally involves some data copies. In multicast, the network card doesn't listen to these multicast packets unless it has been told to do so.
8. What is IGMP protocol?
IGMP protocol stands for Internet Group Membership Protocol and dynamically allows host to join or leave a multicast group. A multicast enabled host sends IGMP request to multicast enabled router to join or leave a multicast group. Routers use this protocol to query for active group members in a subnet.
9. How do you check multicast groups on a UNIX system like Linux?
You can check netstat -g to display multicast group membership information in UNIX based system e.g Linux or Mac OS X.
10. How to check if multicast is enabled on your network?
First step to check if multicast is enabled on your network is to check if your host supports multicast or not. You can use ifconfig or netstat command to do that.
To check if multicast is enabled on the interface do a "ifconfig eth0" and look for: MULTICAST
IP address in range 224.0.1.0 to 238.255.255.255 are known as globally scoped addresses, which means they can be used for multicasting across an intranet or the Internet.
Addresses in the range of 239.0.0.0 to 239.255.255.255 (239.0.0.0/8) are reserved for administratively scoped addresses. Administratively scoped addresses as defined by RFC 2365 are used to prevent the forwarding of multicast traffic across boundaries
3. What is multicast group?
A multicast group is the set of hosts listening on a specified multicast address e.g. 239.255.10.10. When host joins multicast group they become part of it and starts receiving multicast traffic, when they left, they don't receive multicast traffic.
4. What is requirement for multicasting?
In order to support multicasting, both your host and router must be multicast enabled. A multicast enabled router can manage multicast group membership by processing IGMP requests by hosts to join or leave a multicast group. A multicast enabled router can also forward multicast traffic to other routers and subnetwork that contain multicast group members.
5. Difference between multicast and broadcast?
In case of broadcast all hosts in the network receives messages but in case of multicast, only hosts which are part of multicast group receives messages. Also multicast is more efficient than broadcast.
7. Why multicast is more efficient than broadcast?
multicast is more efficient than broadcast because broadcast packets has to be received by everyone on the local link. Each OS takes an interrupt, and passes the packet on for inspection, which normally involves some data copies. In multicast, the network card doesn't listen to these multicast packets unless it has been told to do so.
8. What is IGMP protocol?
IGMP protocol stands for Internet Group Membership Protocol and dynamically allows host to join or leave a multicast group. A multicast enabled host sends IGMP request to multicast enabled router to join or leave a multicast group. Routers use this protocol to query for active group members in a subnet.
9. How do you check multicast groups on a UNIX system like Linux?
You can check netstat -g to display multicast group membership information in UNIX based system e.g Linux or Mac OS X.
10. How to check if multicast is enabled on your network?
First step to check if multicast is enabled on your network is to check if your host supports multicast or not. You can use ifconfig or netstat command to do that.
To check if multicast is enabled on the interface do a "ifconfig eth0" and look for: MULTICAST
$ ifconfig eth0 | grep MULTICAST
In case ifconfig command is not enabled on your server than you can also use netstat -g . BTW, On Redhat Linux servers normal users don't have /sbin (where ifconfig lives) in their path, but you can always run it like /sbin/ifconfig
You can also do cat /proc/net/igmp to find groups you are subscribed to.
11. Which protocol is used to impalement IP multicasting?
UDP protocol is used to implement IP multicasting. There is no such thing link TCP multicasting, why? because the point of multicast is to be efficient with the network and send the same data package to as many different, possibly unknown computers. Since TCP require connection establishment and retransmission of lost packet, it could be very resource intensive, which would defeat much of the point of using multicast.
12. What does multicast address '224.0.0.1' and '224.0.0.2' denotes?
Both are special multicast address, 224.0.0.1 is all hosts on this subnet and 224.0.0.2 is all routers on this subnet.
13. How does multicasting works across the network?
In order to make multicasting works across the network, all the router which comes into path must support multi-casting and should contain forwarding entries for multicast packets. Whenever a client joins a multicast group, a distribution tree is created for it which specifies the path for the multicast traffic corresponding to this multicast connection.
14. What is MBone?
The MBone, or Internet multicast backbone, is the portion of the Internet that supports the forwarding of Internet-based IP multicast traffic. The MBone, used in conjunction with tunneling, provides a way for multicast traffic to travel across portions of the Internet that do not support multicasting.
multicast notes
1) multicast address are class D IPv4 address and always in range 224.0.0.0 to 239.255.255.2552) There are two special multicast address e.g. 224.0.0.1 which means "all systems in this subnet" and 224.0.0.2 which means "all routers in this subnet".
3) Multicast is more efficient than broadcast because in broadcast every system have to receive packet. Each OS has takes an interrupt, and passes the package on for inspection, which normally involves some data copies. In multicast, the network card (NIC) doesn't listen to these multicast packages unless they are are told to.
4) In multicast, not only NIC can ignore un-interesting messages but routes can also make that decision to ignore certain multicast traffic, if no body on that network is interested.
5) On system can have multiple NIC cards. Generally, one NIC is used for multicast only.
6) A NIC can tell router that it is interested in joining a particular multicast group and it can do so by using IGMP protocol, which stands for Internet group management protocol.
7) Hosts or routers can join multicast groups via IGMP to tell other routers that they are interested.
That's all on this list of multicasting interview questions and answers. If you have any doubt feel free to ask in comments.
All the best and happy learning.
No comments:
Post a Comment