Options

What Determines a Subnet?

SyliceSylice Member Posts: 100
And what is a Subnet Mask, what does it do, in detail?

Comments

  • Options
    clintoniaclintonia Member Posts: 41 ■■□□□□□□□□
    The DHCP server usually determines what your subnet mask is. The DHCP server is the device that hands out the IP address that you will be using on that particular network. Your router is most likely your DHCP server on your local network, so any new computer/device that jumps onto your network gets a DHCP "configuration file" from your router which gives that device a specific IP address and subnet mask.

    The subnet mask tells you how many IP addresses are in a particular network. This is important for routing. Say your system's IP address is 192.168.1.3 with a subnet mask of 255.255.255.0. If you want to reach another device on your network that has the IP 192.168.1.22, your computer knows the device you are trying to reach is in your same local network, based on the subnet mask that your DHCP server gave your local machine.

    Now lets say that you want to reach a device with the IP address 192.168.3.1. Based on the subnet mask that your DHCP server gave your local machine, your computer knows the IP 192.168.3.1 is not on your local network, so it will send any packets destined for that IP to your router, who will then deliver the packet to the 192.168.3.x network and it will reach its intended target of 192.168.3.1

    So TL;DR, the subnet mask defines how many IPs are in a particular network and the subnet mask is given by the DHCP server. When your computer goes to speak to another IP, it references the subnet mask to see if the target IP is in its local network or not. If its in the local network, it can just broadcast and find that target machine on the local network. If the IP isn't on the local network, it will have to deliver the packet to the router who will then properly deliver the packet to the intended recipient.
  • Options
    mikeybinecmikeybinec Member Posts: 484 ■■■□□□□□□□
    Simply put, using an analogy, it determines the size of your gang or club. If you are 192.168.1.2 and the subnet mask is a /28 (255.255.255.240), the name of your gang is 192.168.1.0, and the number of members is 14 (192.168.1.1-14 inclusive). Now as for the broadcast address, 192.168.1.15, I'll let you come up with an analogy to represent him or her icon_cheers.gif
    Cisco NetAcad Cuyamaca College
    A.S. LAN Management 2010 Grossmont College
    B.S. I.T. Management 2013 National University
  • Options
    OfWolfAndManOfWolfAndMan Member Posts: 923 ■■■■□□□□□□
    clintonia wrote: »
    The DHCP server usually determines what your subnet mask is.
    Unless the address is statically defined. Then you must know the mask off hand.
    clintonia wrote: »
    Your router is most likely your DHCP server on your local network
    In a large corporate network, this is highly doubtful. Modularity should be applied to prevent excess loads on the hardware. Using the routers for the routing and a linux or windows-based server for DHCP services is more ideal. Unless your network is relatively small, then go for it.
    clintonia wrote: »
    The subnet mask tells you how many IP addresses are in a particular network.

    This is partially correct

    Since clintonia already answered the question about subnet mask, what determines a subnet is the subnet mask, and host network, in combination. This is the range of IPs on the local segment you don't need to rely on a router to send traffic. Initially, the switch that connects devices in a segment (Or switches) will need to populate the MAC address table to encapsulate their data link headers with the proper destination MAC. This is done by using ARP, which sets the destination MAC to ff:ff:ff:ff:ff:ff, which is broadcast to all clients on the link, when it already knows its destination IP. Even when traversing to a separate subnet, this process is required to find the first hop router's destination MAC address, which is the next point in which the packet's data link header is re-encapsulated with a new source and destination MAC.

    Now if the end devices do not support classless networking, such that a device can only have the classful mask of a device, 10.1.1.1, set to /8 (Since that's the default), a router's interface will have to be configured for proxy ARP, as this is a special case. However, this is not common in the modern day (Although I will say working in the medical industry, there are still many medical IP devices that do not support classless addressing).
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
  • Options
    gorebrushgorebrush Member Posts: 2,743 ■■■■■■■□□□
    clintonia wrote: »
    The DHCP server usually determines what your subnet mask is.

    No, not really. The DHCP Server assigns you an IP address out of a predetermined scope, depending on what VLAN, remote network, etc you are connected to. The DHCP Server itself doesn't determine the subnet mask. It is told what to give out.
    clintonia wrote:
    The DHCP server is the device that hands out the IP address that you will be using on that particular network. Your router is most likely your DHCP server on your local network, so any new computer/device that jumps onto your network gets a DHCP "configuration file" from your router which gives that device a specific IP address and subnet mask.

    It isn't a "file" that is sent to the client. It is just sent across in DHCP packets.
    clintonia wrote:
    The subnet mask tells you how many IP addresses are in a particular network. This is important for routing. Say your system's IP address is 192.168.1.3 with a subnet mask of 255.255.255.0. If you want to reach another device on your network that has the IP 192.168.1.22, your computer knows the device you are trying to reach is in your same local network, based on the subnet mask that your DHCP server gave your local machine.

    The subnet mask by itself does not. It is the combination of the network address AND the subnet mask that determines the number of available addresses that could be assigned by the DHCP Server. Also, just because you have, for example a /24 subnet, you don't have or you are not forced to use all 254 addresses as DHCP client addresses. A DHCP Scope can be 10 addresses long if you wish.
    clintonia wrote:
    Now lets say that you want to reach a device with the IP address 192.168.3.1. Based on the subnet mask that your DHCP server gave your local machine, your computer knows the IP 192.168.3.1 is not on your local network, so it will send any packets destined for that IP to your router, who will then deliver the packet to the 192.168.3.x network and it will reach its intended target of 192.168.3.1

    The computer doesn't automatically "know" - it has to perform a logical AND lookup based upon it's own address and subnet mask and THEN determines whether the generated frames need to go towards the router, or directly to the host. It performs this lookup every time.
    clintonia wrote:
    So TL;DR, the subnet mask defines how many IPs are in a particular network and the subnet mask is given by the DHCP server. When your computer goes to speak to another IP, it references the subnet mask to see if the target IP is in its local network or not. If its in the local network, it can just broadcast and find that target machine on the local network. If the IP isn't on the local network, it will have to deliver the packet to the router who will then properly deliver the packet to the intended recipient.

    I've addresses these points above.

    Honestly while I know where you were coming from, some of your terminology is misleading.
  • Options
    clintoniaclintonia Member Posts: 41 ■■□□□□□□□□
    In a large corporate network, this is highly doubtful. Modularity should be applied to prevent excess loads on the hardware. Using the routers for the routing and a linux or windows-based server for DHCP services is more ideal. Unless your network is relatively small, then go for it.

    That's very true, but when I was responding to OP, I was thinking of how to relate it to the equipment around them. Their DHCP server is very likely their D-Link/Asus/Netgear/Linksys router that they are running at home. I wouldn't imagine that OP has a corporate setup at home but is asking about subnetting. I suppose I could have been more technical in my explanation though.

    gorebrush wrote: »
    No, not really. The DHCP Server assigns you an IP address out of a predetermined scope, depending on what VLAN, remote network, etc you are connected to. The DHCP Server itself doesn't determine the subnet mask. It is told what to give out.

    Also very true and see my response above. My answer, while not completely technical, was just done to explain subnetting in a simple way that OP, or anyone really, could grasp. Perhaps I was projecting a bit, but when I first started learning networking/subnetting years ago I had no way to make it "click" until it was explained to me in the way above. Of course later on I learned the real terminology, but to me understanding a watered down concept goes a long way in setting you up to learn and understand the true technical concepts
Sign In or Register to comment.