How do mapping of multicast IP address happen on multicast Ethernet frame? - ip

I tried to understand mapping multicast IP address to layer 2 ethernet frame i.e IEEE 802.3 multicast frame but didn't understand the concept behind it. I'm will appreciate the answers with examples here, of which mapping of an IP address to Ethernet frame can be explained on the scale side by side.

This is very simple:
For ipv4 :
Mac adress has to start with 01:00:5E the 01 in binary gives 00000001 the the lowest bit of the hihgest byte give multicast or not. This is the first bit received by network card so then can quickly ignore or not multicast packet
So you have 01:00:5E:XX:YY:ZZ the range of available mac adresses goes from 01:00:5e:00:00:00 to 01:00:5e:7f:ff:ff
So you have 23 bits to complete with the 23 lowest bits of the ipv4 adresses
IPV4 adresses multicast go from 224.0.0.0 to 239.255.255.255
So for example OSPF (well know routing protocol) use these ipv4 adresses :
224.0.0.5 that give 01:00:5E:00:00:05
224.0.0.6 that give 01:00:5E:00:00:06
For ipv6 :
ipv6 adress are ff00::/8
You use mac prefix 33:33:XX:YY:ZZ (remark the lowest bit of the highest bytes is 1)
and you complete by the lowest bytes of ipv6 adress

Related

What are the bits in an IPv4 CIDR or even IP?

I am trying to understand the bits which are structured in an IPv4 or CIDR. Reading through RFC documentation I understood that the IP addresses began as 4 octets of made up of 32-bits. I am confused at what a network mask of 255.255.0.0 means?
Even more over if we look at an IP associated with cnn.com
151.101.65.67
Are the individual bits of the IP listed above
01101001.01000001.00110101.00110111
?
Or am I not thinking about this correctly. The network mask has 255.255.0.0 as an example but how would I look at the actuals bits represented in the octets?
The IPv4 address 151.101.65.67 corresponds to the number that can be represented as hexadecimal 0x97654143 or decimal ‭2539995459‬. In binary it would be 0b‭10010111011001010100000101000011‬. It is shown as 151.101.65.67 for the sake of human readers (decimal 151 = hexadecimal 97 = binary ‭10010111‬, etc., notice that you can simply concatenate the hexadecimal or binary representations to form the full number, but not the decimal!)
A network mask determines which part of an IP address corresponds to the network and which part is a host. It "shows" the network part with a binary '1's and "hides" the client part with binary '0's.
The network mask is 'anded' to an IP address and results in the network address. In your example:
IP address (‭10010111011001010100000101000011) & mask (11111111111111110000000000000000)
is = 10010111011001010000000000000000, or 151.101.0.0
The network mask is usually only relevant locally. Consider a client with IP address 151.101.66.45 and network mask 255.255.255.0 that wants to view a page on your example IP.
The first decision the client needs to make is: can it connect to the address directly (i. e. is it in the same local network?) or does it need to send the request to the router (gateway). By "&"ing its own IP with its own newtwork mask (result = 151.101.66.0) and comparing it with the remote address & its own network mask (result = 151.101.65.0) it determines that both values are not equal, so the request goes to the router for further communication.

What does this IP address stand for in IPv4

Hi I've been learning networks for a while now and I can't seem to find a solution for this doubt online.
I learnt that if you are sending a packet to a class B network's destination 141.49.255.255, it means you are broadcasting the packet to the whole class B network of 141.49.0.0; I also learnt that if you are sending a packet to a class A network's destination address like 10.255.255.255, you are again broadcasting the packet in the network ID 10.0.0.0
My question is, what am I doing when I'm sending a packet to class B 141.255.255.255 ? Am I sending it to a single host or a network?
Forget classes. Everything is being done in CIDR for the last two decades.
Sending to 141.255.255.255/16 is a subnet broadcast to 141.255.0.0/16. The same address may also be
141.255.255.255/8 - subnet broadcast to 141.0.0.0/8
141.255.255.255/6 - unicast(!) to the node 141.255.255.255
Most often, broadcasts are sent to 255.255.255.255. Routers (usually) don't forward broadcasts, so it's limited to the segment anyway.
However, there are some subtle differences: running e.g. 192.168.1.0/24 and 10.1.0.0/16 inside the very same Ethernet segment, a broadcast to 192.168.1.255/24 is physically sent to all nodes (Ethernet broadcast), even the ones with a 10.1.0.0/16 address. These however will the drop and ignore the packet since it doesn't address them.
In contrast, a broadcast to 255.255.255.255 will be sent to all nodes and processed by all nodes.

convert IP multicast to ethernet multicast address

Can someone explain how does one map IP multicast address to ethernet multicast address?
I know for ethernet few addresses are reserved but dont know which ones
Basically you take last 23 bits of IPv4 and add 01:00:5E at the beginning of the multicast MAC, for example:
ip = 224.1.2.3
mac = 0x01005e000000 + ip & 0x7FFFFF
IPv4 multicast packets are delivered using the Ethernet MAC address range 01:00:5e:00:00:00–01:00:5e:7f:ff:ff (with an OUI owned by the IANA). This range has 23 bits of available address space. The first octet (01) includes the broadcast/multicast bit. The lower 23 bits of the 28-bit multicast IP address are mapped into the 23 bits of available Ethernet address space. This means that there is ambiguity in delivering packets. If two hosts on the same subnet each subscribe to a different multicast group whose address differs only in the first 5 bits, Ethernet packets for both multicast groups will be delivered to both hosts, requiring the network software in the hosts to discard the unrequired packets.
Source: Wikipedia or RFC 1112
To convert an IP multicast address to a 48-bit MAC multicast address you need to understand how the 48-bit MAC multicast address came about.
To get a 48-bit MAC address OUI (24 bits, leaving 24 bits for individual addresses) registered with the IEEE used to cost $1000, which was a lot of money in those days. The guy experimenting with multicast couldn't afford it, so he went in with someone else to buy the OUI, and they split it, each getting 23 bits of addressing in the OUI.
An IPv4 multicast address has 28 bits of addressing (224.0.0.0/4, so 32-4=28). You must somehow map the 28 bits of IPv4 addressing into 23 bits of MAC addressing. That means there are 32 times (28-23=5 and 2^5=32) as many IPv4 multicast addresses as there are 48-bit MAC multicast addresses. Each 48-bit MAC multicast address will map to 32 different IPv4 multicast addresses.
The mapping from an IPv4 multicast address to a 48-bit MAC multicast address is pretty simple. Just take the 48-bit MAC multicast OUI of 01-00-5E, append a zero bit, and append the low-order 23 bits of the IPv4 multicast address. That creates the 48-bit MAC multicast address from an IPv4 multicast address.
The reverse mapping is more complex, and it is inexact since each 48-bit MAC multicast address actually represents 32 different IPv4 multicast addresses. You can only recover the last 23 bits of the IPv4 multicast address from the 48-bit MAC multicast address.

How do I determine that the subnet was going to be .11.254 and .13.254?

I figured out the subnet mask for both subnets 1 and 2. My problem is I can't grasp how the subnet turns to 172.20.11.254 and 172.20.13.254 respectively? I assume this is VSLM, but not certain. I'm just learning this. I got 172.20.8.0 and 172.20.6.0 as my subnet and I know that is wrong now. Thanks for any help you can provide.
To determine which subnet mask will work for the 172.20.0.0 network, first look at the number of hosts required for each subnet:
Subnet1 (connected to FastEthernet0/0) has 672 hosts. To support 672 hosts, a subnet mask of /22 is required (10 host bits in the 2n-2 formula will afford 1022 host addresses in the subnet).
Subnet2 (connected to FastEthernet0/1) has 258 hosts. To support 258 hosts, a subnet mask of /23 is required (9 host bits in the 2n-2 formula will afford 510 host addresses in the subnet).
With a network address of 172.20.0.0 and the masks needed to fit the requirements, you need to configure the following IP address and subnet masks:
For the FastEthernet0/0 connection:
172.20.8.0/22 is the third possible subnet. (172.20.0.0/22 is the first possible subnet and 172.20.4.0/22 is the second possible subnet.)
172.20.11.254 is the last possible IP address in the subnet.
255.255.252.0 is the decimal version of a 22-bit mask.
For the FastEthernet0/1 connection:
172.20.12.0/23 is the next available subnet that does not overlap.
172.20.13.254 is the last possible IP address in the subnet.
255.255.254.0 is the decimal version of a 23-bit mask.
Use the following commands to configure the SFO interfaces:
SFO>enable
SFO#configure terminal
SFO(config)#interface FastEthernet0/0
SFO(config-if)#ip address 172.20.11.254 255.255.252.0
SFO(config-if)#no shutdown
SFO(config-if)#interface FastEthernet0/1
SFO(config-if)#ip address 172.20.13.254 255.255.254.0
SFO(config-if)#no shutdown
SFO(config-if)#exit
SFO(config)#exit
SFO#copy run start
I detect some desperation, so let's see if I can convey and understandable explanation. :-)
172.20.0.0 seems to be the address space destined for you to use in this exercise. That is a class B network (255.255.0.0, or /16 netmask), but since we're going to subnet it variably, you can safely forget that. For example, you could subnet all of it it in small, class C subnets (all with a mask of 255.255.255.0, or /24), and if you did you would use 172.20.0.0/24 for one network, 172.20.1.0/24 for another, 172.20.2.0/24 for another, and so on. But if you did that, each subnet would be able to hold no more than 254 hosts (that is because you leave the last octet - 8 bits - for the host portion, and you have to reserve two - the first and last - for the subnet address and the broadcast address: 2^8-2=254).
But 254 hosts is not enough for your needs, since you have requirements for 672 and 258.
If you use a smaller sized mask (meaning larger sized network -> more hosts) like a /23 (255.255.254.0) you now have 9 bits for the host portion, therefore you can acommodate 2^9-2=510 hosts, big enough for 258, but not for 672. So for the latter you will need a /22 network (255.255.252.0), which will leave 10 bits for the host portion thus allowing 2^10-2=1022.
With each bit you reduce in the netmask, you double your network size. So if a /24 goes from 172.20.0.0 to 172.20.0.255 (the single '0' class C network), a /23 goes from 172.20.0.0 to 172.20.1.255 (two class C networks, '0' and '1'). And a /22 goes from 172.20.0.0 to 172.20.3.255 (four class C networks). In each case the first address is considered the network address and is not assigned to any device, and the last one is the broadcast address, and is not assigned either.
So, back to your example, they choose to assign the 3rd /22 network (1st being from 172.20.0.0 to 172.20.3.255, 2nd being from 172.20.4.0 to 172.20.7.255, and 3rd being from 172.20.8.0 to 172.20.11.255) to that particular subnet. So 172.20.8.0/22 it is. And they choose to assign the 7th /23 subnet possible (1st is '0' and '1' class C's, 2nd is '2' and '3' class C's, and so on) to the other subnet. So 172.20.12.0/23 it is for it. Remember that they cannot overlap!
Now, as to why they chose the .254 addresses for the router interfaces, that is just a convention. Router interfaces are usually configured to use either the first usable (.1) IP address or the last usable (.254) IP address in their subnets, at least on the LAN side. Note that your subnets' broadcast addresses are 172.20.11.255 for the /22 and 172.20.13.255 for the /23. In both cases they picked for the router interfaces the address which is one below them, i.e. the last usable address. But it could have been any one in the corresponding range.
Did that help?

IP adresses of B Class: broadcast

Are the following IP adresses - 168.94.254.255 & 168.94.255.254 - used for broadcast, if they belong to B Class? (The adresses were randomly chosen). I suppose 168.94.255.255 would rather be a broadcast adress, but I'm not sure. Thanks in advance!
A class B network in CIDR notation is a /16 network. A broadcast address is where all of the host bits are 1. In your case, the last 16 bits would need to be 1 to be a broadcast address.
168.94.254.255 and 168.94.255.254 each have a zero bit in the last 16 bits, so they are not broadcast addresses.
If your class B is subnetted into /24's, then the 168.94.254.255 address may be a broadcast address if 168.94.254.0/24 is the network address.

Resources