Please help - subnet masks and LANs

Node ManNode Man Member Posts: 668 ■■■□□□□□□□
Hi Everyone,
I hope i word this correctly, please fill in/correct my question as i am not even sure about the terminology.

I just got a few switch concept questions wrong because I am not sure what to do with the subnet masks (prefixes, etc). I cant even find the lesson/section in my icnd book.

The short story is, i dont understand how /24 or /25 impacts packets traveling between different ports on a switch or across different ports on a router.

Can different ports on a router have the same subnet mask/prefix. Can all hosts have the same prefix?

Please help!
Thanks.

Comments

  • superjerelmansuperjerelman Member Posts: 30 ■■■□□□□□□□
    The short story is, i dont understand how /24 or /25 impacts packets traveling between different ports on a switch or across different ports on a router.

    Layer 2 switches don't care about layer 3 IP addresses it focuses on layer 2 frames. when pc1 sends a file to pc2 on the same subnet it just goes in one port of the switch and the switch checks it's layer 2 frame/header against it's mac-address-table, if it has it in it's table it sends it out the right port to pc2 , if it doesn't, it sends a broadcast out every port except the one it came in on to find the right layer 2 destination. At the same time the router will be getting the frame and strip off the layer 2 frame/header to get to the layer 3 packet/IP address (if the router sees it belongs to the same subnet it came in on it drops the packet), if the destination of pc2 was on another subnet the router would look at its routing table for the correct route.

    /24 is one subnet that encompasses the entire Class C address range, for example 192.168.1.1 - 254, 0 is the network id/address and 255 is the broadcast address. /25 splits the address range into two different subnets with a range of 192.168.1.1 - 126 with 0 being the network id/address 127 being the broadcast address.
    then you have 192.168.1.129 - 254 with 128 being the network id/address and 255 being the broadcast address. note that those are two different subnets ranges, so if pc1 was on the first half and pc2 was on the second half they would need a router to communicate.
    Can different ports on a router have the same subnet mask/prefix. Can all hosts have the same prefix?

    If you have a router connected to two different subnets, you could use the same subnet mask/prefix for each port, but you would need two different IP address ranges. For example if subnet 1 was using 192.168.1.1-192.168.1.254 with a prefix of /24, subnet 2 would have to use something like 192.168.2.1-192.168.2.254 with a prefix of /24. The other ports on the router would not be able to use those address ranges, it would cause conflicts (most of the time the router will tell you or not even let you do it). All host within the same subnet must use the the same subnet mask/prefix, or the hosts in the same subnet won't be able to communicate, because they would believe they were on different subnets then they are currently on.


    Good luck with your studies and exams!
    BS:IT from WGU.
  • JaydenMoonJaydenMoon Member Posts: 10 ■□□□□□□□□□
    Hey Node Man :) - from what I have read so far subnetting is very important for the CCNA and up - Wendell Odom spends chapter 12 through 18 on the 3rd edition of the ICND1 - it may be good to read up on those chapters and get a better overall understanding of subnetting in general

    good luck :)
Sign In or Register to comment.