What's a Network?
Hey BAM Nation,
This is the second article in the Building Automation IT Guide series.
In my last article, All About IP Addresses, we discussed core fundamentals about IP Addressing, Subnets, Dynamic Host Configuration Protocol, and Domain Name Servers. In this article, we are going to begin to unpack the mysterious network!
Ok, maybe networks aren't all that mysterious and awe-inspiring but they do have a very important place in the building automation space. Up until recently, most building automation systems existed on their own private networks and rarely had to interact with business networks.
Well my friends, times are changing. With the introduction of IP-based controllers, cloud based services, and "IoT" the need for networking knowledge is at an all time high.
So what can you expect from this article?
In this article, I am going to teach you the fundamentals of networking. When I write an article like this, I look back at the areas that caused me trouble early in my career. My goal is by the end of this article, you will be functionally proficient in networking fundamentals and will be able to communicate your needs clearly to other networking professionals.
So let's dive into to the topic.
What you will learn
In this article you are going to learn.
- What is a network
- How do networks communicate
- What is a Media Access Control (MAC) address
- What is the Address Resolution Protocol (ARP)
As I mentioned in my previous article, All About IP Addresses, to some of you this may seem like techie, nerd crap. If that's you that's ok!
Just read the Phil Why Should I Give a Damn sections and if you find yourself intrigued re-read the section!
Table of Contents
What is a network
Simply put, a network is two or more devices that are linked together in order to share resources or communicate with one another. These devices utilize a variety of communication methods (Ethernet, wireless, fiber-optic, etc.) for their communications.
It is generally accepted that there are three types of networks in the building automation space and those are Local Area Networks (LAN's), Wide Area Networks (WAN's), and Personal Area Networks (PAN's). For the sake of today's conversation we will be focused primarily on LAN's.
Local Area Network
A local area network is just that, a network that is local (aren't I witty :-D ). LAN's are often confused with a subnet. The difference is a local area network is a physical topology, where as a subnet is a logical topology.
What does the word topology mean?
A topology quite simply means the way things are arranged. So when I say a LAN is a physical topology, what I am saying is that a LAN is how a network is physically arranged. Contrast that to a subnet which could stretch across several LAN's and represents a virtual network of sorts.
Ok, with that interesting :-D phraseology lesson over with let's dig into what a LAN really is. A LAN is a network segment that represents a single network. To give you an example of this you can see three separate LAN's in the image below.
Now, when one of the networks wants to communicate with another network it uses a router to communicate outside its network (the concept of routing will be discussed in a future article). In the world of building automation systems there are really two types of LAN's. The first would is a field bus and the second is a supervisory network.
Field Bus
A field bus is a network that connects field controllers. Typically, a field bus will use one of three structures to connect individual field controllers:
- Wireless
- Daisy chain
- Star pattern
Wireless
A wireless field bus uses a coordinator, think of this as your typical wireless access point, to connect between the field controllers and the coordinator. In some cases a technology called mesh networking will be used.
In mesh networking, all of the field controllers communicate with one another and signals are routed (not to be confused with routing) back to the coordinator using the "best path". The coordinator then connects to the physical network using a up-link connection.
Daisy Chain
A daisy chain network is common in BACnet MS/TP and other serial communication protocols. In a daisy chain network all of the controllers are connected in series, or daisy chained, to one another. The network starts at the supervisory device and works its way to the last controller in the daisy chain. When a controller wants to communicate it needs to wait its turn or it could potentially damage other communications. You can see a, daisy chain network represented by the FC and SA bus in the previous image.
Star Network
The last network type is a newer structure in the BAS space and that is the star pattern. While the star pattern is not new to the networking world, it is a newer structure at the field controller level. Since the introduction of IP-based controllers, we are beginning to see BAS systems utilizing the star pattern. In the star pattern each controller has a direct connection, or home run, to a network switch.
Each of these networks needs to connect to a supervisory device that directs communication to and from field devices. This naturally brings us the supervisory network.
Supervisory Network
A supervisory network utilizes the star pattern as mentioned previously. In a local area network each supervisory device is connected to other supervisory devices via a switch. The individual supervisory devices have IP Addresses and MAC addresses (a concept discussed later) which are used to route communications between each other.
Phil Why Should I Give a Damn Section
What I just described to you above are the fundamentals of network structures. If you are trying to communicate to an IT group, troubleshoot a BAS, or design a new BAS installation you need to understand these network structures and what they mean. Without a thorough understanding of these structures, there is a high likelihood that you will create networks that have communication and/or redundancy problems.
Granted you could just outsource all of the responsibility to your IT group, if you have one. However, the problem with that, is that controls are becoming increasingly IP-based. This will require that you understand networking in order to stay relevant.
How do networks communicate
If you are familiar with the OSI model, you know that local area networks use 2 different layers to communicate (barring the transport layer which adds a third layer).
Obviously, there is a physical connection, whether that connection is wireless or wired, the communication flow is pretty much the same. In addition to the physical connection there is the logical connection, or the "link" that is created between devices on a local area network.
In a local area network packets, also known as messages, are switched between devices using the address resolution protocol (ARP). In most cases, a device on the network will form a packet that is sent to a port, (input) on a switch and then that packet is "switched" to another port where it is sent out to the destination device.This is called packet switching, which will be covered in the next article in this series.
Suffice to say, switching is how network communications are "done" at the local area network level. However, as I mentioned some devices use serial or "daisy chain" connections. While these connections still form a logical link, they use a different method to communicate between one another.
This method that is commonly used in the BAS space is token passing. In token passing, a device cannot speak until it has a token, similar to an ethernet frame. The token is passed device to device and when the device has a token it can add its message to the token. The token is then sent to its destination device.
If all this is making your head spin it's not as confusing as it sounds.
Essentially, when two devices want to talk they form a logical link. That link provides the path for the message and then the message is sent using the physical connection. It is important to understand the logical link and addressing aspects of communication as these two subjects cause the majority of communication issues.
Phil Why Should I Give a Damn Section
Networks are the circulatory system of your BAS.
Without network communications your BAS will be unable to communicate. Without that communication you might as well just convert all your systems to time clocks and indicator dials because you won't be getting any data. You don't have to be a network expert to be successful in the BAS world but you do need to know how they communicate.
What is a Media Access Control (MAC) address
You may have heard of a MAC address during your BAS career, but do you really know what it is?
In this section I will cover the MAC address, what it is, how it is created, and what it is used for.
The MAC Address
The Media Access Control or MAC address is the physical address of a device. In the networking world this address is used to make sure that messages get to the correct device. Almost every networking device has a MAC address, and it is used in almost all communications.
The MAC address is a unique address consisting of six groups of two hexadecimal digits. A hexadecimal digit is a numbering system that uses 16 bits to represent a value. The first of 10 of the 16 bits are represented by 0-9 with the last 6 bits being represented by the letters A,B,C,D,E,F.
Therefore, a MAC address has 6 sets of 2 hexadecimal digits. As we stated each hexadecimal digit can hold 16 different values.
Fun...
Ok, so we understand what MAC addresses are now, but how do we come up with the addresses?
This is where the Institute of Electrical and Electronics Engineers or IEEE comes in. The IEEE runs a standard called MAC-48 that allows for the registration of MAC addresses. Now according to the MAC-48 standard, the first three sets of two hexadecimal digits are organizationally specific and the last three sets of two hexadecimal digits are specific to the network interface card.
This specificity allows a switch to use something called ARP to match MAC addresses to IP addresses.
One quick note before we move onto ARP.
MAC addresses are finite. The IEEE has stated that with MAC-48 there are 281,474,976,710,656 potential addresses. That may seem like a lot but with the advent of IoT there is a growing concern that we will run out of MAC addresses. To address this issue the IEEE has created a new standard called MAC-64 which has a ridiculously large amount of addresses.
Phil Why Should I Give a Damn Section
It is critical for you to know what a MAC address is.
How will you troubleshoot your network when there are multiple devices using the same IP Address without this knowledge?
Or when IT wants the MAC address of your device in order to add it to the network, what will you tell them?
You need to know this in order to have a successful BAS career.
What is the Address Resolution Protocol (ARP)
There's a lot to the address resolution protocol but here is what you really need to know.
When a device communicates on a network it does so using a process called encapsulation. As counter-intuitive as this may sound, when a message is sent to a device the higher level communication layers are actually wrapped (encapsulated) in the lower level layers.
This is done for a very specific reason.
At the end of the day data across a wire is a series of bits, 1's and 0's. In order to ensure the maximum amount of compatibility, the lower level messages wrap (encapsulate) the higher level messages. Ok, if that is confusing (it was to me at first) take a look at the OSI model chart below that describes this process.
If it is still confusing after that just know, the closer you get to the wire the more the message is encapsulated.
So how does your network know what device to send messages to? If you said the IP address you would be partially correct! The thing is, an IP packet (Layer 3) or UDP Segment (Layer 4) are both wrapped inside a frame.
So how does your network know where to send a message if the IP address is encapsulated?
That my friends is where the ARP comes in.
The Address resolution protocol allows you to map a IP address into a MAC address. ARP does this through a concept known as the ARP table. An ARP table, is a table that matches all MAC addresses to a specific IP address. When a network starts up or the ARP table timer runs out, a broadcast message will be sent to discover the MAC address associated with a specific IP Address.
Once the ARP table has this MAC address it can be used to forward traffic to the right device.
That is why ARP is so powerful, without it you would have no way to map IP Address to MAC addresses. This would leave you unable to communicate to devices on your network.
Phil Why Should I Give a Damn Section
You should care about ARP because it is how the "last few feet" of messaging happen. There have been so many times in my career where a BAS system got installed and I didn't know its IP address. Fortunately, I could watch the ARP broadcast in Wireshark and see the specific IP address that matched the MAC address for that device. This has proven invaluable to me in saving time on BAS setup.
And that's a wrap
We are done, in this short little post you learned:
- What is a network
- How do networks communicate
- What is a Media Access Control (MAC) address
- What is the Address Resolution Protocol (ARP)
In my next post for this series, we will be discussing the concept of switching. I briefly exposed you to switching in this article but in my next article we will dive deep into what switches are, how they work and what they mean to you!
Here is Your Homework!
As you know I'm always trying things out here. I'm a firm believer that the best way to help you learn is to assign some "homework". So here is my challenge to you, I'd like you to pick one of the 4 bullets in the summary and provide your thoughts on how that applies to a building automation system. Share your experience with the BAM Nation we'd love to hear it!