What is the difference between subnet mask and gateway




















The address Its first octet is 10, which is between 1 and , inclusive. Class B networks use a default subnet mask of Its first octet is , which is between and , inclusive.

Class C networks use a default subnet mask of In some scenarios, the default subnet mask values don't fit the organization needs for one of the following reasons:. It becomes necessary as you reconcile the logical address scheme of the Internet the abstract world of IP addresses and subnets with the physical networks in use by the real world.

A system administrator who is allocated a block of IP addresses may be administering networks that aren't organized in a way that easily fits these addresses. Each of these three networks has 50 hosts.

You are allocated the class C network For illustration, this address is actually from a range that isn't allocated on the Internet. It means that you can use the addresses Two addresses that can't be used in your example are The zero address is invalid because it's used to specify a network without specifying a host.

The address in binary notation, a host address of all ones is used to broadcast a message to every host on a network. Just remember that the first and last address in any network or subnet can't be assigned to any individual host. You should now be able to give IP addresses to hosts.

It works fine if all computers are on a single network. However, your computers are on three separate physical networks. Instead of requesting more address blocks for each network, you divide your network into subnets that enable you to use one block of addresses on multiple physical networks. In this case, you divide your network into four subnets by using a subnet mask that makes the network address larger and the possible range of host addresses smaller.

In other words, you are 'borrowing' some of the bits used for the host address, and using them for the network portion of the address. The subnet mask It works because in binary notation, The first two digits of the last octet become network addresses, so you get the additional networks 0 , 64 , and Some administrators will only use two of the subnetworks using For more information on this topic, see RFC In these four networks, the last six binary digits can be used for host addresses.

Using a subnet mask of These four networks would have as valid host addresses:. Remember, again, that binary host addresses with all ones or all zeros are invalid, so you can't use addresses with the last octet of 0, 63, 64, , , , , or You can see how it works by looking at two host addresses, If you used the default Class C subnet mask of However, if you use the subnet mask of The result of this comparison tells the computer whether the destination is a local host or a remote host.

If the result of this process determines the destination to be a local host, then the computer will send the packet on the local subnet.

It's then the responsibility of the router to forward the packet to the correct subnet. Incorrect Subnet Mask: If a network uses a subnet mask other than the default mask for its address class, and a client is still configured with the default subnet mask for the address class, communication will fail to some nearby networks but not to distant ones. As an example, if you create four subnets such as in the subnetting example but use the incorrect subnet mask of In this situation, packets destined for hosts on different physical networks that are part of the same Class C address won't be sent to a default gateway for delivery.

A common symptom of this issue is when a computer can communicate with hosts that are on its local network and can talk to all remote networks except those networks that are nearby and have the same class A, B, or C address.

Every device has an IP address with two pieces: the client or host address and the server or network address. The subnet mask splits the IP address into the host and network addresses, thereby defining which part of the IP address belongs to the device and which part belongs to the network. The device called a gateway or default gateway connects local devices to other networks. This means that when a local device wants to send information to a device at an IP address on another network, it first sends its packets to the gateway, which then forwards the data on to its destination outside of the local network.

A subnet mask is a bit number created by setting host bits to all 0s and setting network bits to all 1s. In this way, the subnet mask separates the IP address into the network and host addresses.

Neither can be assigned to hosts, as they are reserved for these special purposes. The IP address, subnet mask and gateway or router comprise an underlying structure—the Internet Protocol—that most networks use to facilitate inter-device communication. When organizations need additional subnetworking, subnetting divides the host element of the IP address further into a subnet. The goal of subnet masks are simply to enable the subnetting process. A bit IP address uniquely identifies a single device on an IP network.

The 32 binary bits are divided into the host and network sections by the subnet mask but they are also broken into four 8-bit octets. Because binary is challenging, we convert each octet so they are expressed in dot decimal.

This results in the characteristic dotted decimal format for IP addresses—for example, The range of values in decimal is 0 to because that represents to in binary. Since the internet must accommodate networks of all sizes, an addressing scheme for a range of networks exists based on how the octets in an IP address are broken down. The location of the gateway address can be found by typing netstat -rn at the command line.

The output will look similar to:. DNS information is most often found in a text file called resolv. This file can be read using the cat command. A common place for this DNS file is:. May show the IP address of a firewall instead of the local machine, if the local machine is behind a firewall. All rights reserved. Reviewed January 3, Contact techsupp more. DMCA and other copyright information. Site Information: Copyright, accessibility, privacy and other information about this site. PageMinder: Receive an e-mail notice when this page updates.

Submenu Header. Search MOREnet.



0コメント

  • 1000 / 1000