Monday, 27 July 2015

IPv4 address types

Here are some of the address types you must know about :


Loopback (localhost) address : 

For some of you localhost word might sound more familiar than loopback. It is used to test the IP stack on the local computer. It can be any address from 127.0.0.1 through 127.255.255.254 . Does 127.0.0.1 ring a bell ?? PHP developers write localhost or 127.0.0.1 in their browser  to test if XAMP is properly installed, if you ever wondered why this was the reason. Now, try writing IP address from the above range and it shall work the same way.


Layer 2 Broadcasts:

First you must know that Layer 2 broadcasts are also known as hardware broadcasts - they only go out on a LAN, but they don't go past the LAN boundary(router). A typical hardware address is 6 bytes (48 bits) and looks something like 23:AC:0B:A3:45:E5. The broadcast as explained earlier would be all 1s which would be all Fs in hexadecimal, as in ff:ff:ff:ff:ff:ff.
So, this broadcast wouldn't pass the boundary(router) but will be recieved by every host/device on the local network. This frame will be received by every NIC(Network Interface Card) including the router, but router will never forward it.

Layer 3 Broadcasts:


You must be familiar with this from my previous post on valid host IDs. These are the network broadcast that have all host bits on.
Here's an example the network address 10.0.0.0 will have broadcast address of 10.255.255.255
Layer 3 broadcasts can also be "any network and all hosts" as indicated by 255.255.255.255.


Unicast Address:


A unicast is defined by a single IP address that's assigned to a network interface card, and is the destination IP address in a packet - in other words it is used to direct packet to a specific host, if for understanding you want to call it specific host address.


Multicast Address:


Multicast is totally different from broadcast an unicast, as we saw a broadcast is received by all the hosts, but Multicast enables multiple recipients to receive messages without flooding the messages to all hosts on a broadcast domain.
However this is not the default behaviour- it's what we can do with multicasting if configured correctly.
So it's like broadcast which is not received by every host :P (Just kidding, You understood what it is !!! )
Unlike broadcasts, Multicasts are forwarded by routers to all the interfaces where hosts have subscribed to that multicast address. (If not now, you will understand last line later)

No comments:

Post a Comment