Welcome to the ITFreeTraining video on NIC teaming. NIC teaming allows multiple network
cards to be combined together to form one network card. This video will look at what
can be achieved using NIC teaming and some of the limitations. The video, at times, will
refer to options that are available in Windows Server 2012 R2. However, the theory applies
to other operating systems and network hardware.
NIC teaming is the process of combining multiple network cards together to form one network
card. This is done for performance and redundancy reasons. Although Windows Server refers to
this as NIC Teaming, other vendors may refer to this as bonding, balancing or aggregation.
Regardless of which modern operating system you use, the result is the same. That is,
multiple physical network cards are combined together using a teaming solution. The teaming
solution will then present these multiple network cards to the operating system as the
one virtual network adapter. You then would configure this virtual adapter just like a
standard physical network card.
If you consider this example, in this case the server has 3 network cards in it. If all
3 network cards are added to a network team solution, the server can distribute the outgoing
network packets between the 3 network cards.
If one of the network cards were to fail, the team solution would then distribute the
load between the remaining two network cards. By using a system like this, any application
running on the server using networking does not need to know how the teaming solution
is configured and which network cards are currently being used in that teaming solution.
The teaming solution handles additional network cards that may be added or removed. For example,
a network card is disconnected from the network. For this reason the administrator never needs
to worry about configuring the physical network card other than configuring it to be part
of the teaming solution.
When creating a NIC team, you will need to decide if you want to use all the available
network adapters at the same time or if you want one or more network cards as standbys.
There are a number of different reasons that may affect your choice.
All things considered equal, using multiple network adapters together will improve the
max throughput of your server. In practice this may not happen as much as you would expect
and the reasons for this I will look at later in the video.
In the left example, two networks card have been combined to improve throughput. In the
right example notice that the server is connected to a fast network switch and a slow network
switch. In this case, you would want to use the slow network switch as a backup in case
the connection to the fast network switch were to fail. This is one example of why you
would want to use a standby network adapter, but later in the video I will show you some
more reasons why you would want to use standby network adapters rather than making all the
network adapters active.
When creating a NIC team in Windows Server 2012, there are two settings that can be configured
for the NIC team. The first is load balancing mode. Windows can support up to 32 network
adapters in the one NIC team and the load balancing mode determines how traffic will
be distributed between the different network cards in the NIC team when it leaves the server.
There are 3 different load balancing modes that are supported. Each of these I will go
into more detail in just a moment. The first is address hash. This mode essentially uses
attributes of the network traffic - like the IP Address and port - to determine which network
adapter will be used. Given the same input values the same network adapter will always
be used.
If you are using virtual machines the second setting - Hyper-V switch port - can be used
and can control incoming and outgoing traffic. It does this by routing each virtual machine
through the same network adapter each time.
The third setting, dynamic, this is a new setting that was added in Windows Server 2012
R2. This setting combines the features of the previous two balancing options and can
change network streams from one network card to another as required.
The next setting is the teaming mode. Some network switches have support for load balancing.
If your network switch does not have that ability or you do not want to use it, the
first mode, switch independent, should be used. This mode does not require any hardware
support on the switch.
The next two modes are static teaming and LACP. Both these modes require your network
switches to support the required load balancing protocol. If you are prepared to configure
your network switches, these options allow better utilization of your network cards.
I will now have a closer look at these settings, starting with the load balancing option followed
by the teaming mode options.
The first load balancing mode that I will look at is address hash. This mode creates
a hash value from values like the mac, IP Address and port used in the network connection.
This essentially means that given the same input values, the same network adapter will
always be used.
Let’s consider the example of a server with 4 network cards communicating with 4 desktops
on the network. If you consider the server is sending web traffic to 4 computers on the
network, the traffic for each desktop will use the same network adapter each time. In
this case, you will notice that one network card was not used at all. The more traffic
that the server sends the more the traffic should even itself between all the network
cards. However this only works best if all network streams from the server have about
the same amount of data in them. If you have a network stream that has a lot of data in
it compared with the other network streams, this network stream will always use the same
network adapter. This means the data leaving the server will not be well balanced between
the available network cards.
If I were to have a look at incoming traffic, all packets arrive using the same network
card. Using Address hash The Server has no control over incoming packets and thus if
you use this load balancing mode, this needs to be taken into account. You can start to
see why some administrators may decide to use standby network cards rather than combine
multiple network cards together. This is because if there is no advantage to incoming data,
a network adapter may be set up as a standby network card for redundancy reasons rather
than for performance reasons. It all depends on how much traffic the server is receiving.
To address these issues the next algorithm - Hyper-V switch port - can be used. To some
degree Hyper-V switch port provides load balancing for incoming traffic. Unfortunately, it is
aimed at virtual machines using Hyper-V so is limited to where it can be used. Essentially
each virtual machine has its traffic routed out the same network card. This is for incoming
and outgoing traffic.
Let’s consider an example where the server has two network cards. Each virtual machine
will use the same network card for incoming and outgoing traffic. This is achievable as
each virtual machine has its own Mac address. Hyper-V switch port uses this Mac address
to determine which network card to send the traffic out on. Clients on the network use
this Mac address to communicate back to the server and thus incoming traffic is also routed
back through the same network adapter.
Notice however that in this example the bottom network card is being utilized a lot more
than the top network card. If you have a number of bandwidth heavy virtual machines that are
allocated to the same network adapter, this will reduce the effective throughput of the
NIC team. The more virtual machines you have, the more the traffic should balance out assuming
that they have similar network needs.
Before I look at the last load balancing option, I first want to answer a question that some
of you may have been wondering and that is, why can’t outgoing traffic be load balanced
out the available network adapters on a packet to packet basis?
To understand why, consider this. Network administrators will attempt to have a single
flow of traffic through the network. This is done to reduce the amount of reassembly
when the traffic reaches its destination.
Let’s consider an example where there are 4 network adapters connected to the network.
Each network adapter transmits one packet to the destination. Notice that when the packets
arrive, they arrive in the reverse order. Having packets arrive out of order means the
destination device needs to hold these packets in memory until the first packet arrives.
Once this packet arrives, it can process the other packets. This increases the amount of
RAM and processing power required on the device. Although at times it is impossible to prevent
packets arriving out of order, network administrators will do their best to prevent this from happening.
You can see why load balancing algorithms cannot simply divide up the outgoing packets
amongst the available network cards in the NIC team.
The last load balancing algorithm, dynamic, attempts to address some of these issues by
combining the best features of address hash and Hyper-V switch port. This algorithm is
only available on Windows Server 2012 R2. The difference between this algorithm and
the others is that it can dynamically change which network card a network stream is using.
Let’s consider an example. The server has 3 network streams in use on the server. Currently
the network traffic is about even. Even though one network card has two network streams and
the second one has one, they are sending about the same amount of packets so there is good
load balancing occurring.
If the top network stream was suddenly to become a lot more utilized, the traffic is
no longer divided equally between the network adapters. Although dynamic is not a true load
balancing solution, it can make changes as required to help even out the load.
It does this by looking for what are referred to as flowlets. If you consider me speaking
out loud… at times I will pause like I just did… and just did again. Network traffic
has similar breaks in it called flowlets - Either a brief break in transmission or some sort
of logical change to the transmission. When Windows detects one of these it will change
the network stream to use another network card. This helps prevent packets arriving
out of order at the destination.
Notice that the network traffic is now more evenly distributed. Traffic can only be redistributed
based on network streams. If you have one stream sending 90% of the traffic from a server
you will still have 90% of traffic travelling over the one network card.
Inbound traffic works the same as Hyper-V Switch port. If you are using virtual machines
with different Mac addresses on the server, traffic can be routed using the same network
adapter just like it could with Hyper-V port. If you want better load balancing control
over incoming and outgoing packets you will need to consider a hardware based solution.
This brings me into the next topic, teaming modes.
The first teaming mode is switch independent. This teaming mode does not require any configuration
of your network switches or any special hardware support. It can use one or multiple switches.
That is, you can plug your server network cards into the one switch or into individual
switches or anything in between.
This is the simplest teaming mode to configure since it requires no special hardware configuration.
If you are new to NIC teaming, you should try this mode first. The problem with this
mode is that true load balancing cannot be achieved as I have highlighted already in
the video. In order to do this, you need hardware support.
The first hardware team mode is static teaming. This protocol uses the network protocol 802.3ad
to combine multiple ports on a switch together. When this protocol is used, the switch ports
need to be configured to use this protocol and the server plugged into the correct ports
on the switch.
Depending on which switch you are using, this may or may not need to be configured. Sometimes
the port may be pre-configured and other times it may need to be enabled on the switch before
it can be used.
Since the ports on the switch need to be configured, all network adapters on that server in that
NIC team need to be plugged into the same switch. You cannot use multiple switches like
the previous teaming mode of switch-independent.
In some cases, some vendors may allow you to combine multiple switches together to form
a single virtual switch. This feature will generally only be found on high-end network
equipment. You would need to check the specifications of the switch to see if it can do this.
The advantage of static teaming is that it allows incoming packets to be load balanced.
As shown, half of the incoming packet data is going to one network card and half to the
other. The switch is able to control the incoming packet flow using both network cards. In the
real world, how balanced the incoming traffic is depends on the algorithm used in the switch
and the switch’s effectiveness. This is something that Windows has no control over.
The last teaming mode is LACP which standards for Link Aggregation Control Protocol. LACP
uses the 802.1ax protocol which is effectively a newer version of the protocol used for static
teaming. Like static teaming, this creates a single incoming pipe for multiple ports.
Just like static teaming, the network switch needs to be configured. LACP is harder to
configure and get working than static teaming; so is generally only used in high availability
enterprise environments. You will also tend to find less switches support it when compared
with static teaming.
Well that covers it for all the theory for NIC Teaming. In the next video I will perform
a demonstration on Windows Server 2012 R2 to show how you configure NIC teaming. I hope
you have found this video useful and I hope to see you in the next one. Thanks and see
you next time.