At some point in your career as a system administrator you will be called upon to gather network traffic to find out where a system is failing. Sure ping and traceroute are wonderful tools that are down and dirty. They will tell you whether or not you have a basic IP connection and where it is failing BUT it doesn’t tell you much more than that. We at times will need to find out what is failing. Is it a mis-configured application? Are we sending data in cleartext when it should be encrypted? Are we “speaking” to the right DNS server? There are many ways to skin a cat in our profession BUT getting a packet dump really gives you insight to what is being put out onto the wire. There are a couple of things to consider before you actually start to collect data.
1. What data are you trying to collect?
2. What does the network topology look like?
It’s important to know what data you’re looking to collect because it will determine where to place your network-monitoring tool. Are you looking to collect the traffic between your web server (in a DMZ) and your internal network? Or are you looking to collect the traffic from that web server out to the world? If you’re using 2 NICs to separate out your traffic the monitoring tool will need to be placed on the interface that you are looking to capture the data of. Now this may sound simple (and in this case it is) BUT your typical SMB (small or medium business) network is often a lot more complicated. Another scenario is the ever-popular WLAN. What traffic are you looking to collect? Do you want to capture beacon frames or are you only looking at higher layer traffic? Hopefully you get the idea…
Next… How is the network laid out? Is it a HUB based network or is it a switched environment. Why is this important? Well let’s look at the mechanics of each. A Hub takes a packet that is received on one port and passes it to every other port on that port regardless if the packet’s final destination lies connected to that port. So in essence, any NIC that is connected to a hub can see all the network traffic that passes through the hub. If the traffic you are looking to capture all takes place on that hub your job is made easy. Practically speak… this is not realistic. The network issues surrounding a hub based environment (packet collisions) and the ever-dropping cost of switch technology makes this scenario highly unlikely.
Switches have all but replaced hubs in SMB environments. This presents some obstacles in gathering the traffic we are looking for. The Data Link Layer of the OSI model is where we tie the Network layer (IP address) to a physical attribute (MAC) of the machine we are working with. And while there is one additional layer to the OSI, all traffic is really run through the Data Link layer. SO what does this have to do with the price of rice in China? Well, a switch builds what’s called ARP tables. ARP (or address resolution protocol) matches an IP address with a computers MAC address. The switch then directs traffic received on one port to the port where the final destination resides! That destination is based on the MAC address of the host in question.
Remember… we are talking about hubs and switches. These are pieces of hardware! That being said because the traffic is directed between the receiving port and the destination port, other ports are not privy to the conversation between the two. Because there is still a need to ‘see’ the traffic that is passed between two ports (think network monitoring!), switch manufacturers have come up with a solution can the SPAN port (Switched Port ANalysis). This allows traffic to destined or sent from one port to be mirrored on another. There is a down side to this. Under heavy loads, packets can and will be dropped! This could and often does cause for the misinterpretation for the data collected.
The last option is called a TAP. Taps are hardware devices that are placed on the network and used when the need arises. Adding or removing the TAP from the network will result in network outages. The benefit to a TAP is that it preserves the full-duplex nature of a switched environment! It will not drop packets (that is if the line being monitor is NOT over-utilized). TAPs need to be strategically placed. Remember… What traffic are we looking to capture? There is a downside to TAPs. They are more difficult to set up! In order to properly implement these devices special configuration for NIC and/or the purchase of specialized hardware is required to combine the trace together. TAPs are usually used in places where putting a switch doesn’t make sense and you want to maintain the full bandwidth of the line!