Source - Ravindrababu Ravula's YouTube Channel
Casting
There are 2 types of casting supported in networking:
- Unicasting
- Broadcasting
- Limited Broadcasting
- Directed Broadcasting
Unicasting
Unicasting means sending a packet from one host to only one particular host / receiver.
Let's assume we have a machine with IP 11.1.2.3 which wants to send a data packet to a machine with IP 20.1.2.3 in another network.
Here, machine with 11.1.2.3 IP address belongs to 11.0.0.0 network, and machine with IP address 20.1.2.3 belongs to 20.0.0.0 network.
Whenever there are all 0's in Host ID part (like 10.0.0.0 or 20.0.0.0), then it represends the Network ID. This is the reason we are never going to use first IP address as any valid IP address for any host.
First IP address in any network is reserved and it is used as Network ID for that entire network.
Whenever a packet is sent from machine A to machine B, the packet will look like:
Benefits of Unicast
Unicast transmission has been in use for a long time, with well-established protocols and easy to deploy techniques. Well-known and trusted applications such as http, smtp, ftp and telnet all use the unicast standard and employ the TCP transport protocol.
On a network, transmission takes place from host to host, which can reduce the traffic burden on a Local Area Network (LAN), as a whole.
Drawbacks of Unicast
If a network device is called upon to send a message to multiple nodes, it has to send multiple unicast messages, each addressed to a specific device. This first requires the sender to know the exact IP address of each destination device.
In addition, each unicast client that connects to the host server uses up some network bandwidth. If multiple clients are involved, this may introduce scaling issues as far as network and server resources are concerned. The problem becomes even more pronounced if many hosts are transmitting via unicast to many receivers, at the same time.
Broadcasting
Broadcasting means sending data from one host to multiple receivers. There are 2 types of broadcasting:
Limited Broadcasting
Limited broadcasting means sending data from one host to all the other hosts in SAME network.
To achieve this, all 1s are kept in destination address in data packet. All 1s are nothing but 255.255.255.255. So, the setup looks like:
Since 255.255.255.255 is used for limited broadcasting address, this IP should never be assigned to any machine in any network,
Directed Broadcasting
Directed broadcasting means sending data from one host in a network to all the hosts in ANOTHER network,
To achieve this, all 1s are kept in destination address in data packet for host part. All 1s are nothing but {N/W ID}.255.255.255. This setup looks like:
Benefits of Broadcast
Broadcast transmission is a “one-to-all” technique which ensures that all the nodes on a network receive a common signal or message. This can lend to economies of scale, if the equipment and resources needed for copying, refreshing, and relaying the broadcast signal to all points can be kept to within reasonable limits.
Even for cable TV systems, the source signal reaches all destinations (subscribers) – which is why some channels remain scrambled unless you have the right decoder.
Drawbacks of Broadcast
Broadcast transmission isn’t really a viable proposition for the public internet, as having every connected device receive all broadcast signals all the time would introduce unnecessary interference and tons of unwanted data.
On local networks, some configuration is needed, as switches are designed to forward broadcast traffic, while routers are designed to drop it. Routers won’t allow the broadcast of a message from one Local Area Network to another network segment. Their main function is to split up a large broadcast domain into many smaller ones.
Summary of Reserved IP Addresses
Network Class | IP Address | Network ID | Directed Broadcast Address | Limited Broadcast Address |
---|---|---|---|---|
A | 1.2.3.4 | 1.0.0.0 | 1.255.255.255 | 255.255.255.255 |
A | 10.15.20.60 | 10.0.0.0 | 10.255.255.255 | 255.255.255.255 |
B | 130.1.2.3 | 130.1.0.0 | 130.1.255.255 | 255.255.255.255 |
B | 150.0.150.150 | 150.0.0.0 | 150.0.255.255 | 255.255.255.255 |
C | 200.1.10.100 | 200.1.10.0 | 200.1.0.255 | 255.255.255.255 |
C | 220.15.1.10 | 220.15.1.0 | 220.15.1.255 | 255.255.255.255 |
E | 250.0.1.2 | N.A for Class E | N.A for Class E | N.A for Class E |
??? | 300.1.2.3 | Invalid IP | Invalid IP | Invalid IP |
Network ID is highlighted in above table.