Broadcast IP
공부를 해보자/프로그래밍 2010. 4. 22. 10:18- BROADCAST IP address는 255.255.255.255를 쓰거나 IP address의 SUBNET 부분을 제외한 호스트 자리를 2진수 1로 채운 것입니다.
- 예를 들어 10.1.10.100 이라는 IP Address를 가지는 호스트가 255.255.255.0 이라는 SUBNET MASK를 사용한다면 이 SUBNET의 BROADCAST IP는 10.1.10.255 가 됩니다.
- 이런 BROADCAST IP를 사용하면 해단 SUBNET의 모든 호스트에 패킷을 전달할 수 있습니다.
- 이러한 BROADCAST는 네트웍을 관리하는 특정 목적의 PROTOCOL과 UDP를 사용한 통신에서만 사용이 됩니다.
How a Broadcast Address Works
Imagine you’re Paul Revere, riding from Boston to Lexington to warn citizens that the redcoats were coming. He may not be as fast as computer networks today, but Paul Revere was essentially acting much like a broadcast would- he was relaying his message to the entire town of Lexington.
A broadcast, in particular, is a simple message that is sent to all clients on a local area network. But just exactly what enables a network to broadcast a message to every single client on the network?
What is a Broadcast Address?
A broadcast address is an address used to indicate that information being sent out should be delivered to every client on the local area network. These addresses are always the highest number possible in a particular network address or subnet. We’ll cover subnets later, for now let’s take a closer look at the most common broadcast address: Data Link Layer broadcasts.
Broadcasts on the Data Link Layer correspond to MAC addresses. MAC address broadcasts are generally the easiest to understand, since they aren’t affiliated with IP addresses or subnetting. In fact, all you really need to remember is FF:FF:FF:FF:FF:FF. Whereas this MAC address would normally be comprised of different hexadecimal values, it is instead simply all F’s. (As we know, each F stands for the highest number in hexadecimal: 15)
When a MAC address broadcast is sent out, each network interface card on the local area network will see the broadcast address and automatically pass the information up to the upper layers of the OSI model. So far it’s simple- right? Now let’s get back to the subnetting and IP address topics that are present on the Network Layer.
How IP Broadcasts are Sent via the Network Layer
Remember how we stated that broadcast addresses are always the highest-most number in an address range? IP broadcasts are no exception! On a network that isn’t subnetted, we can simply place 1’s in place for each bit in the host portion. The result: our very own broadcast address!
Things are still fairly simple: simply replace each host portion with the highest number you can create with 8 bits: 255. Notice that the network portions do not change- just the host portions.
Sadly, this is where things start to get a little trickier: we need to find the broadcast address of a subnetted network.
How to Find the Broadcast Address of a Subnetted Network
We need two things to find the broadcast address of a subnetted network: an IP address, and the subnet mask. The process is simple: find the inverse of the subnet mask. Then take the result, and logically OR it with the IP address to get the broadcast address.
Of course, we can convert the above binary result to decimal and get the broadcast address of 192.168.16.31. If you aren’t familiar with the OR process, it’s rather simple. If there is a 1 in either the IP or subnet field, then the result will always be a 1. (Otherwise, the result is 0)
Now we know how to find the broadcast address and how it works- but what is it used for?
What are Broadcast Addresses used for?
Broadcasts are generally used for several reasons:
- Address Resolution Protocol (ARP) uses broadcasts to map physical addresses to logical addresses. To build the table of hosts, a device needs to send a broadcast to every other device on the network to essentially find out who is where.
- Several types of network protocols and services use broadcasts in the same way. Dynamic Host Configuration Protocol (DHCP), for instance, requires that broadcasts be used to dynamically assign an IP address to computers on a network.
- Routing protocols such as Routing Information Protocol (RIP) use broadcasts to send out “advertisements.” This advertisement is used by routers to map out the topology of a network, so that data can be routed to the appropriate place accordingly. (Interesting enough, this protocol will attempt to find the fasted route through a network to a destination, based on how many “hops” it takes to get from the sender to the receiver.)
Final Points of Interest on Broadcasts
Keep in mind that broadcasts will travel to every single client on a network- at least, until a router is encountered. A router is the only device that can separate a broadcast domain. Logically, this is mandatory for the internet to exist. What do you think would happen if broadcasts were being sent from network to network- all over the internet? (Hint: no more Internet.)
Also make note that broadcast addresses should never be used as host addresses. This can be confused in subnetting, where it isn’t always clear where the host portion starts and ends. The broadcast address is reserved as the highest value- and likewise, no IP address should use a broadcast address or problems will arise.
'공부를 해보자 > 프로그래밍' 카테고리의 다른 글
GDB관련 (0) | 2010.08.05 |
---|---|
Apache - httpd.conf 한글 주석 (0) | 2010.07.16 |
[Link]정규표현식 (0) | 2010.04.06 |
Lighttpd + FastCGI (0) | 2010.03.30 |
IPC:Message Queues (0) | 2010.03.26 |