Netmasking Transmission Control Protocol/Internet Protocol (TCP/IP)

Discussion in 'Linux Networking' started by Jarret W. Buse, Oct 8, 2013.

  1. Jarret W. Buse

    Jarret W. Buse Active Member Staff Writer

    Messages:
    162
    Likes Received:
    233
    Trophy Points:
    43
    Netmasking Transmission Control Protocol/Internet Protocol (TCP/IP)

    The ‘Netmask’, which is sometimes called the Subnet Mask, is a very complicated subject for some, so I have dedicated this whole article to it. Each IP Address has two parts: a host ID and a network ID. Put a little simpler, these are addresses for the Internet. The network ID is similar to the mailing address for your residence. The mailing address is a house number, street name, city name, state and zip code. The city, state and zip code narrow the address down to a specific city or town in a state. The street name narrows the destination even more, while the house number and/or suite/apt number narrow down the destination to a specific property on the street. The name on the package gives a specific person as the destination. Similarly, the network ID narrows down the general area for a host system, such as by ISP provider. The host ID nails the destination to a specific host.

    NOTE: For the following examples, we will use the following example addresses.

    Configure TCPIP - Figure 1.JPG

    You may be asking, ‘I don’t see where these two IDs come from?’. Well, the ‘Netmask’ is the answer. When the Netmask is changed to binary, you can see that there are two sections. One section is a section of ‘1’s while the other is a section of ‘0’s as shown:

    255.0.0.0 -> 11111111.00000000.00000000.00000000

    The first section of the ones, shows the area of the IP Address which is the network ID. The remaining sections of zeroes are to designate the host ID. To do this, you compare the IP Address to the Netmask as shown:

    Address 00001010.00000000.00000000.10011010
    Netmask 11111111.00000000.00000000.00000000

    The Network ID is 00001010 while the host ID is 00000000.00000000.10011010. Converting these to decimal again shows the network ID is 10 and the host ID is 0.0.154.

    On a Local Area Network (LAN), the whole network could have an ID of 10, and each system could have a host Id ranging from 0.0.1 – 255.255.254.

    NOTE: You may be wondering why the previous range starts with 0.0.1 and not 0.0.0. When the host ID is all zeroes, it represents the network itself for purposes of forwarding data across routers. You may also wonder why the previous range is not to 255.255.255. When a host ID is all ones in binary, it is a reserved address for broadcasting. When an IP address specifies a network ID and all ones for the host ID, the data is considered a broadcast for the specified network.

    Network addresses are arranged by classes. The Classes are arranged as Class A to Class C. Classes D and E exist, but D is for multicasting and E is an experimental range. The classes are arranged in a specific way.

    Class A has addresses denoted by ‘w.x.y.z‘ and the network ID is w, while the host ID is x.y.z. The address range is 1 to 126.x.y.z. The default Netmask is 255.0.0.0.

    For example, an address of 11.108.99.56 would be Class A since the first number (11) is between 1 and 126. Its default NetMask is 255.0.0.0. The network ID is 11 and the host ID is 108.99.56.

    Class B has addresses denoted by ‘w.x.y.z‘ and the network ID is w.x, while the host ID is y.z. The address range is 128 to 191.x.y.z. The default Netmask is 255.255.0.0.

    For example, an address of 131.118.91.75 would be Class B since the first number (131) is between 128 and 191. Its default NetMask is 255.255.0.0. The network ID is 131.118 and the host ID is 91.75.

    Class C has addresses denoted by ‘w.x.y.z‘ and the network ID is w.x.y, while the host ID is z. The address range is 192 to 223.x.y.z. The default Netmask is 255.255.255.0.

    For example, an address of 213.18.1.175 would be Class C since the first number (213) is between 192 and 223. Its default NetMask is 255.255.255.0. The network ID is 213.18.1 and the host ID is 175.


    NOTE: You may be able to see that by using a Class A IP Address, you can have more hosts on a LAN without the need for routers and/or bridges. The difference between the Classes is simply the amount of hosts on a single network ID. If you may have a lot of small networks with few hosts, a Class C network would work better than a Class A.

    NOTE: You may notice that the IP Addresses starting with 127 is missing. IP Addresses starting with 127 are for loopback. Any IP Address starting with 127, when sent from the Internet Layer (see TCP/IP), is not sent to the Network Interface Layer, but travels back up to the Transport Layer as if it has been sent and received. As you can tell, since it does not get to the Network Interface Layer, it does not truly test any hardware or connectivity.

    Looking at these addresses, you can easily tell if two IP Addresses belong to the same network. Imagine two computers located on the same physical Ethernet LAN with no bridges or routers, basically both are connected to the same hub. One has an address of 10.0.0.1 and the other is 11.0.0.2. In this instance, the two computers are on the same physical LAN, but since their network IDs are different, they are truly not on the same network. The two systems cannot communicate with one another. All network IDs must be the same. If two sets of network IDs exist, then you have two ‘virtual’ networks on one physical topology.

    Attached Files:

    Last edited: Oct 8, 2013
    DevynCJohnson and ryanvade like this.
  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,227
    Likes Received:
    415
    Trophy Points:
    83
    Thanks for this article. Explains a lot.

Share This Page