Subnet Mask: An address that enables distinction between networks
by “masking” IP address bits that denote the same network and “exposing” bits that denote different networks:
Networks are often divided up into smaller units called subnets.
Network administrators create subnets as a management tool:--
Routes packets to the appropriate subnetwork based on IPaddresses
--
Easier to monitor the health of the entire network--
Minimizes effort required to troubleshoot and isolate problems--
Capable of isolating users based on:--
Geography--
Departments--
Media protocols--
Communication needs (e.g., plant floor I/O vs office email).
Plant environment communications benefit when plant floor communications operate on a separate subnet from the office communications:--
Accommodates timeliness of operations--
Enhances system maintenance and upgrade options--
Adds levels of security.Inform students that they should obtain a list of available private IP addresses from their IT department before randomly using one. The ability to reuse an IP number extends between different enterprises but not necessarily within a subnet.
Inform the students that they will be shown how to identify if two devices are on the same network later in this lesson. This section may confuse your students. Network administrators are often stymied by this topic.
If pressed for additional information, refer them to the Internet. Entering the terms subnet or subnet mask into their favorite search engine will reward them with a plethora of information. The search results will provide them background information, subnet calculators, and web and classroom learning opportunities.
9--4 Configuring Logix5000 Controllers to Share Data over an EtherNet/IP Network
E2012 Rockwell Automation, Inc. All rights reserved. Rev. August 2012 ENTsb56r
Subnet masks allow for two devices to determine whether or not they exist on the same subnet:
If two devices are on the same subnet, they are able to communicate directly with one another.
If two devices are on different subnets, the data must first be sent to a router before the targeted device receives the data sent by the source device.How a Subnet Mask Operates
A subnet mask, like an IP address, is a 32-bit address that is normally grouped into 4 bytes for ease of communication and understanding:
Binary Equivalent: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . x x x x x x x x . x x x x x x x x Typical Subnet Mask
2 5 5 . 2 5 5 . X X X . X X X
Consecutive “1’s” Represent Network Portion of IP Address
A subnet mask uses the “1’s” to do a bit-by-bit comparison of two IP addresses to see if the devices associated with the IP address are on the same subnet:
As long as the IP address bits match each other (independent of the subnet mask value) whenever there is a corresponding “1” in the subnet mask, the devices are on the same subnet.
If the network portions:--
Match up, the devices communicate directly with each other.--
Don’t match up, they are on separate networks and thencommunicate through a router (commonly referred to as a gateway).
Example
Compare the EtherNet/IP addresses of two devices and determine if they are on the same subnet:
EtherNet/IP Address: 165.88.73.129 EtherNet/IP Address: 165.88.74.187 Subnet Mask: 255.255.240.0
?
How would using subnets on a plant floor assist your company’s operations? Answer: Subnets would make it possible to isolate different plant floor operations (e.g., welding, milling) from each other and from theoffice/administrative systems. This allows one operation to be shut down without directly impacting the whole plant. Subnets will reduce the risk of security threats (e.g., Trojan horse attacks).
?
How many of you have ever programmed an MVM instruction? How does it work?Inform the students that a subnet mask operates in a manner similar to an MVM instruction; hopefully they will be able to translate some of that familiarity when identifying if two IP addresses are on the same subnet.
9--5
Configuring Logix5000 Controllers to Share Data over an EtherNet/IP Network
E2012 Rockwell Automation, Inc. All rights reserved. Rev. August 2012
ENTsb56r
Converting these decimal values to their binary equivalent yields:
EtherNet/IP Address: 1 0 1 0 0 1 0 1 . 0 1 0 1 1 0 0 0 . 0 1 0 0 1 0 0 1 . 1 0 0 0 0 0 0 1 EtherNet/IP Address: 1 0 1 0 0 1 0 1 . 0 1 0 1 1 0 0 0 . 0 1 0 0 1 0 1 0 . 1 0 1 1 1 0 1 1 Subnet Mask: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0 . 0 0 0 0 0 0 0 0
Corresponding bits match each other; therefore, these two devices are on the same subnet.
Compare the same two EtherNet/IP addresses of two devices using a different subnet mask and determine if they are on the same subnet:
EtherNet/IP Address: 165.88.73.129 EtherNet/IP Address: 165.88.74.187 Subnet Mask: 255.255.255.0
Converting these decimal values to their binary equivalent yields:
EtherNet/IP Address: 1 0 1 0 0 1 0 1 . 0 1 0 1 1 0 0 0 . 0 1 0 0 1 0 0 1 . 1 0 0 0 0 0 0 1 EtherNet/IP Address: 1 0 1 0 0 1 0 1 . 0 1 0 1 1 0 0 0 . 0 1 0 0 1 0 1 0 . 1 0 1 1 1 0 1 1 Subnet Mask: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0
Corresponding bits do not match each other; therefore, these two devices are not on the same subnet.
As demonstrated by these examples, it is possible to expand (or contract) the network environment by changing the subnet masks associated with the devices on a network.
Gateways
Gateways: Nodes on a network that act as entrance and exit portals
between external networks:
Data packets being shared between internal and external devices must pass-through at least one gateway in establishingcommunications.
Gateways often act as a firewall and protect the resources of a private network from users from other networks.
Gateways may have more than one IP address associated with them -- one for internal users and one for external users.?
What are some reasons you may want to expand your network? Contract it?Answer: Isolate devices, processes, and enhance security. Limiting the number of subnets you have increases the likelihood that two devices can communicate directly with each other. This may reduce the number of routers you must purchase, maintain, and monitor.
Gateways are glorified routers that control the flow of data between external networks and an enterprise’s internal network.
9--6 Configuring Logix5000 Controllers to Share Data over an EtherNet/IP Network
E2012 Rockwell Automation, Inc. All rights reserved. Rev. August 2012 ENTsb56r
Default Gateway: The router (gateway) to which all remote packets
must be sent in order to be routed to their final destination (i.e., if two devices are not on the same network, the packet will be sent to the gateway).
Gateway Address: The IP address of a device’s default gateway.