Friday, December 26, 2008

Joining Linux to Active Directory

In the computer world there is always a large number of pros and cons for every technology. Windows is very good for general purpose usage and works great in an every day workplace, but doesnt perform ideally in some high performance environments. Linux can be tuned like crazy to give some high performance, but is convoluted and confusing, and some basic Windows features are unavailable.

Recently I have been looking at Linux to run a high-performance Oracle database - but installign and setting it up is only a small part of the issue, long-term management is the big issue. The first hurdle is user accounts: I already have a windows domain and I dont want to make my admins manage different credentials on every box we run. In the past there has been NIS, some LDAP integrations and even MS Services For Unix, but I have always been dissapointed by what was available
I stumbled across some software called likewise-open that makes that first hurdle a piece of cake. I installed this in an Oracle Enterprise Linux installation in a few seconds without issue - no editing of text files, hacking of kerberos packages, or hunting down RPMs - before I knew it I was logging into my Oracle linux system with my domain credentials...

For those who use Ubuntu (my personal choice), check out this post. Just execute the following steps and your good to go
  1. sudo apt-get update
  2. sudo apt-get install likewise-open
  3. sudo domainjoin-cli join fqdn.of.your.domain Administrator
  4. sudo /etc/init.d/likewise-open start
So an entire infrastructure can now be built on Linux, but still use AD authentication like users expect. Just add these steps into your build process and all things are shiny.

Tuesday, December 23, 2008

Networking Functions and Devices

Now that we have the basics of networking theory, what does this mean to network functions and devices? Lets start at the bottom of the OSI layer and work up.
Physical
The physical layer is exactly that - the physical (or wireless) connectivity between devices. The physical layer includes the network interface cards (NIC) and cabling between the devices. The most common cabling in use today Twisted Pair and is defined in various categories based on the number of twists per inch in the cable; the more twists the less interference by external electronics. Most common ratings are category (or CAT for short) 3, 5 and 6, with some "enhanced" versions available for higher performance.
  • CAT 3 is traditionally used for phone lines and is capable of transmitting up to 10Mb/sec
  • CAT 5 is the most commonly used networking cable and is capable of transmitting up to 100Mb/sec
  • CAT 6 is fairly new and capable of transmitting up to 1Gb/sec
Other physical mediums include coaxial (not commonly used in a datacenter), fiber (used for high-speed and long distances), and wireless.
Network devices at the physical layer include: hub/bridge/repeater - an unintelligent device that rebroadcasts/repeats signals to all available ports. No addressing or routing is performed and collision of packets from multiple devices can occur frequently.

Datalink
The datalink layer is the physical addressing of the devices on a network. Since several devices can share the same physical connection, the datalink layer utilizes the MAC address of each device to direct traffic. This is done by the hardware built into the NIC to only pickup traffic targeted for its address, thereby minimizing processor overhead on the recieving systems.
While the MAC address is normally hard-coded in a NIC, most devices today allow for a different MAC address to be configured via software. This is useful when two NICs on the same network have the same MAC address (supposedly shouldnt happen, but I have seen it occur), or when you need to pretend your a different device (sometimes referred to as spoofing or promiscuous mode).
The format of the MAC address follows a standardized format - a 12 digit hexadecimal number split into 2 parts. The first 6 digits identify the manufacturer of the network card (use http://coffer.com/mac_find/ to lookup the vendor), and the remaining 6 digits are randomly created. More information on MAC addresses can be found at http://en.wikipedia.org/wiki/MAC_address.
Network devices at the datalink layer include: switch - a somewhat intelligent device that learns the addresses of devices around it, then inspects traffic to direct it only to the appropriate target. Once a connection between two devices is setup within a switch, unhindered communication can occur between the devices.

Network
The network layer is where logical addressing of occurs, on top of the physical addressing of the datalink layer. This is where the IP address comes into play to allow a human defined separation and routing of traffic between departments, offices, or cities.
IP addressing follows a strict format defined by the IETF (Internet Engineering Task Force). The IP address is composed of 4 octets (or 32 binary digits), separated into 2 sub addresses: the network address and the machine address. The network address can be likened to the city/state/zip your mail is delivered to - a message can be sent from anywhere in the world and this unique address will deliver it to your local post office. The machine address can then be likened to the physical address of your home, once the local post office has the mail, it can deliver it to your location.
The size of the network and machine address however are not static, their size can vary from network to network based on the administrators design. This is where the subnet mask comes into play, it tells the devices how much of the IP address is the network address and how much is the machine address. The subnet mask can define as little as 1 binary digit for the network address and as many as 31, and the same goes for the machine address. More information about the history and design of IP addressing can be http://en.wikipedia.org/wiki/IPv4
Network devices at the network layer include: router - a more intelligent device that has a set of rules to direct traffic between networks. This device is not aware of the individual devices that exist on each network, but instead only about the topology of the network addresses from its point of view.


Up next - Routing...

Sunday, December 14, 2008

Networking 101

I recently was involved in several technical interviews for some technician and administrative positions, and was surprised by how little most of the prople understood networking basics. Most of the answers I got in the interviews focused on:
  1. Hubs are for home offices
  2. Switches are smart hubs, and used in businesses
  3. Routers are used to link multiple offices

These definintions show a very limited understanding of network basics, and the fact that most of the interviews thought that this was the whole answer really made me wonder.

So I am going to post several articles detailing the basics of networking from the ground up - i.e. from the cable up, not what acronyms are in use today.

Networking Basics -- The OSI Model

The first thing to know is that there is a logical sequence to how networks function. Way back in 1977 when networks began to emerge, a common model was developed to allow different systems to work together. The OSI model (Open Systems Interconnect) was created to define 7 hierarcichal layers that work together - these layers are often easiest to understand from the bottom up.

ApplicationThe application layer identifies communication partners, determines availability of resources, and synchronizes communication.
Presentation

The presenation layer is responsible for communicating between the application and the rest of the network stack. One main feature is of this layer is to convert serialized data (i.e. a long stream of numbers and characters), into structured data such as XML or documents and other files. This layer is also responsible for controlling encryption and compression of data transmitted between computers.

SessionThe session layer is responsible for controlling the sessions or connections between devices. Whenever network devices communicate, they normally start with a hello, contain several checkpoints, and end with a goodby. In theory, if a connection is lost in an ungraceful manner (such as a power loss or broken cable), the session layer could reconnect and restart communications where it left off.
Transport

The transport layer is used to control reliability, recoverability, and additional network features. Features such as checksums, packet sequencing, and retransmissions are all functions to increase reliability and recoverability.

Features such as tunneling, VPN, and IPSec are additional network features provided by the transport layer.

Network

The network layer is resonsible for directing or routing traffic from the source to the correct destination. The components on the network layer are not concerned with the ultimate delivery of the information, but simply with passing it on to the next logical step.

Similar to the post office example used in the datalink layer, the network layer can be viewed as a central routing office that takes mail from all over the country. The office then directs the mail to the correct state, county, or city - these smaller offices then direct the mail to the individual homes.

DatalinkThis layer controls the communication that occurs on the physical layer. Each physical device has a corresponding physical address - sometimes referred to as a MAC address - which is like a house address. Since traffic from multiple systems can travel on the same network cable, the address is used to determine what information belongs at which location - similar to how the post office delivers mail to a house based on its address.
Physical

Refers to the physical connectivity (for wired networks) or frequency range (for wireless networks) used to connect machines together. This connectivity can be phone lines, coaxial, Cat5, or wireless.

This also includes the frequency or speed of data transmission. This is where the speed of the network is determined.


The OSI model can be likened to a pizza with multiple layers of toppings - each layer supporting the layer above it. For instance, a pizza may have a layer of cheese on the very top, followed by a layer of sausage, then the sauce, and finally the dough. Each of these layers can be substituted for something else (Canadian bacon and pineapple?), and layers can be added or removed (Pizza Pie? Cheesey Crust?). Some of these layers however are necessary (like the dough), and while their form can change (thin crust vs. thick crust), they still exist.

The OSI model is commonly remembered by using nmonics - i.e. an easily remembered phrase that is used to refer to something else. One popular nmonic is Please Do Not Throw Sausage Pizza Away, note the capitalized letters PDNTSPA which reference Physical, Datalink, Network, and so on...

Now that we have some of the OSI basics covered, I will be following this post up with some tangible information about how the OSI model works today. If your interested, more detailed information about the OSI model can be found at http://en.wikipedia.org/wiki/OSI_model.