Chapter 1
IN THIS CHAPTER
Discovering protocols
Deciphering the layers of the OSI Reference Model
Understanding an Ethernet
Getting the inside scoop on TCP/IP and IPX/SPX
Finding out about other important protocols
Protocols and standards make networks work together. Protocols make it possible for the various components of a network to communicate with each other, and standards make it possible for different manufacturers’ network components to work together. This chapter introduces you to the protocols and standards that you’re most likely to encounter when building and maintaining a network.
A protocol is simply a set of rules that enable effective communications to occur. You encounter protocols every day and probably don’t even realize it. When you pay for groceries with a debit card, the clerk tells you how much the groceries cost, and then you swipe your debit card in the card reader, punch in your security code, indicate whether you want cash back, enter the amount of the cash back if you so indicated, and verify the total amount. You then cross your fingers behind your back and say a quiet prayer while the machine authorizes the purchase. Assuming the amount is authorized, the machine prints out your receipt.
Here’s another example of an everyday protocol: making a phone call. You probably take most of the details of the phone-calling protocol for granted, but it’s pretty complicated if you think about it:
You get the point. Exchanges — using a debit card or making a phone call — follow the same rules every time they happen.
Protocols come in many different types. At the lowest level, protocols define exactly what type of electrical signal represents a 1 and what type of signal represents a 0. At the highest level, protocols allow (say) a computer user in the United States to send an email to another computer user in New Zealand — and in between are many other levels of protocols. You find out more about these levels of protocols (often called “layers”) in the upcoming section, “Seeing the Seven Layers of the OSI Reference Model.”
As I mention earlier, a standard is an agreed-upon definition of a protocol. In the early days of computer networking, each computer manufacturer developed its own networking protocols. As a result, you couldn’t easily mix equipment from different manufacturers on a single network.
Then along came standards to save the day. Hurrah! Because standards are industry-wide protocol definitions not tied to a particular manufacturer, you can mix and match equipment from different vendors. As long as the equipment implements the standard protocols, it should be able to coexist on the same network.
Many organizations are involved in setting standards for networking. The five most important organizations are
www.ansi.org
www.ieee.org
www.iso.org
www.ietf.org
www.w3.org
“OSI” sounds like the name of a top-secret government agency you hear about only in Tom Clancy novels. What it really stands for in the networking world is Open Systems Interconnection, as in the Open Systems Interconnection Reference Model, affectionately known as the OSI model.
The OSI model breaks the various aspects of a computer network into seven distinct layers. These layers are kind of like the layers of an onion: Each successive layer envelops the layer beneath it, hiding its details from the levels above. The OSI model is also like an onion in that if you start to peel it apart to have a look inside, you’re bound to shed a few tears.
The OSI model is not a networking standard in the same sense that Ethernet and TCP/IP are networking standards. Rather, the OSI model is a framework into which the various networking standards can fit. The OSI model specifies what aspects of a network’s operation can be addressed by various network standards. So, in a sense, the OSI model is sort of a standard of standards.
Table 1-1 summarizes the seven layers of the OSI model.
TABLE 1-1 The Seven Layers of the OSI Model
Layer |
Name |
Description |
1 |
Physical |
Governs the layout of cables and devices, such as repeaters and hubs. |
2 |
Data Link |
Provides MAC* addresses to uniquely identify network nodes and a means for data to be sent over the physical layer in the form of packets. Bridges and switches are layer 2 devices. |
3 |
Network |
Handles routing of data across network segments. |
4 |
Transport |
Provides for reliable delivery of packets. |
5 |
Session |
Establishes sessions between network applications. |
6 |
Presentation |
Converts data so that systems that use different data formats can exchange information. |
7 |
Application |
Allows applications to request network services. |
* MAC = Media Access Control. Read more about MAC and bridges and switches in “The data link layer.”
The first three layers are sometimes called the lower layers. They deal with the mechanics of how information is sent from one computer to another over a network. Layers 4–7 are sometimes called the upper layers. They deal with how application software can relate to the network through application programming interfaces.
The following sections describe each of these layers in greater detail.
The bottom layer of the OSI model is the physical layer. It addresses the physical characteristics of the network, such as the types of cables used to connect devices, the types of connectors used, how long the cables can be, and so on. For example, the Ethernet standard for 10BaseT cable specifies the electrical characteristics of the twisted-pair cables, the size and shape of the connectors, the maximum length of the cables, and so on. The star, bus, ring, and mesh network topologies described in Chapter 1 of this minibook apply to the physical layer.
Another aspect of the physical layer is the electrical characteristics of the signals used to transmit data over the cables from one network node to another. The physical layer doesn’t define any meaning to those signals other than the basic binary values of 1 and 0. The higher levels of the OSI model must assign meanings to the bits that are transmitted at the physical layer.
One type of physical layer device commonly used in networks is a repeater, which is used to regenerate the signal whenever you need to exceed the cable length allowed by the physical layer standard. 10BaseT hubs are also physical layer devices. Technically, they’re known as multiport repeaters because the purpose of a hub is to regenerate every packet received on any port on all the hub’s other ports. Repeaters and hubs don’t examine the contents of the packets that they regenerate, though. If they did, they would be working at the data link layer, and not at the physical layer.
The network adapter (also called a network interface card; NIC) installed in each computer on the network is a physical layer device. You can display information about the network adapter (or adapters) installed in a Windows computer by displaying the adapter’s Properties dialog box, as shown in Figure 1-1. To access this dialog box in Windows, open the Control Panel, choose Network and Sharing Center, and then choose Change Adapter Settings. Then right-click the Local Area Connection icon and choose Properties from the menu that appears.
The data link layer is the lowest layer at which meaning is assigned to the bits that are transmitted over the network. Data link protocols address things, such as the size of each packet of data to be sent, a means of addressing each packet so that it’s delivered to the intended recipient, and a way to ensure that two or more nodes don’t try to transmit data on the network at the same time.
The data link layer also provides basic error detection and correction to ensure that the data sent is the same as the data received. If an uncorrectable error occurs, the data link standard must specify how the node is to be informed of the error so that it can retransmit the data.
At the data link layer, each device on the network has an address: the Media Access Control (MAC). This address is hard-wired into every network device by the manufacturer. MAC addresses are unique; no two network devices made by any manufacturer anywhere in the world can have the same MAC address.
You can see the MAC address for a computer’s network adapter by opening a command window and running the ipconfig /all
command, as shown in Figure 1-2. In this example, the MAC address of the network card is 00-40-F4-CD-A9-50. (The ipconfig
command refers to the MAC address as the physical address.)
Two types of data link layer devices are commonly used on networks:
The network layer handles the task of routing network messages from one computer to another. The two most popular layer 3 protocols are IP (which is usually paired with TCP) and IPX (typically paired with SPX for use with Novell and Windows networks).
Network layer protocols provide two important functions: logical addressing and routing. The following sections describe these functions.
As I mention earlier, every network device has a physical address — a MAC address — assigned to the device at the factory. When you buy a network interface card to install into a computer, the MAC address of that card is fixed and can’t be changed. So what happens if you want to use some other addressing scheme to refer to the computers and other devices on your network? This is where the concept of logical addressing comes in; with a logical address, you can access a network device by using an address that you assign.
Logical addresses are created and used by network layer protocols, such as IP or IPX. The network layer protocol translates logical addresses to MAC addresses. For example, if you use IP as the network layer protocol, devices on the network are assigned IP addresses, such as 207.120.67.30. Because the IP protocol must use a data link layer protocol to send packets to devices, IP must know how to translate the IP address of a device to the device’s MAC address.
Although the exact format of logical addresses varies depending on the protocol being used, most protocols divide the logical address into two parts:
In a typical IP address — say, 192.168.1.102 — the network address is 192.168.1, and the device address (called a host address in IP) is 102.
Similarly, IPX addresses consist of two parts: a network address and a node address. In an IPX address, the node address is the same as the MAC address. As a result, IPX doesn’t have to translate between layer 2 and layer 3 addresses.
Routing comes into play when a computer on one network needs to send a packet to a computer on another network. In this case, a router is used to forward the packet to the destination network. In some cases, a packet may have to travel through several intermediate networks in order to reach its final destination network. You can find out more about routers in Chapter 4 of this minibook.
An important feature of routers is that you can use them to connect networks that use different layer 2 protocols. For example, a router can be used to send a packet from an Ethernet to a token ring network. As long as both networks support the same layer 3 protocol, it doesn’t matter whether their layer 1 and layer 2 protocols are different.
The transport layer is where you find two of the most well-known networking protocols: TCP (typically paired with IP) and SPX (typically paired with IPX). As its name implies, the transport layer is concerned with the transportation of information from one computer to another.
The main purpose of the transport layer is to ensure that packets are transported reliably and without errors. The transport layer does this task by establishing connections between network devices, acknowledging the receipt of packets, and resending packets that aren’t received or are corrupted when they arrive.
In many cases, the transport layer protocol divides large messages into smaller packets that can be sent over the network efficiently. The transport layer protocol reassembles the message on the receiving end, making sure that all the packets that make up a single transmission are received so that no data is lost.
For some applications, speed and efficiency are more important than reliability. In such cases, a connectionless protocol can be used. As you can likely guess, a connectionless protocol doesn’t go to the trouble of establishing a connection before sending a packet: It simply sends the packet. TCP is a connection-oriented transport layer protocol. The connectionless protocol that works alongside TCP is User Datagram Protocol (UDP).
You can view information about the status of TCP and UDP connections by running the Netstat
command from a command window, as Figure 1-4 shows. In the figure, you can see that several TCP connections are established.
In fact, you can use the command Netstat /N
to see the numeric network addresses instead of the names. With the /N
switch, the output in Figure 1-4 would look like this:
Active Connections
Proto Local Address Foreign Address State
TCP 127.0.0.1:2869 127.0.0.1:54170 ESTABLISHED
TCP 127.0.0.1:5357 127.0.0.1:54172 TIME_WAIT
TCP 127.0.0.1:27015 127.0.0.1:49301 ESTABLISHED
TCP 127.0.0.1:49301 127.0.0.1:27015 ESTABLISHED
TCP 127.0.0.1:54170 127.0.0.1:2869 ESTABLISHED
TCP 192.168.1.100:49300 192.168.1.101:445 ESTABLISHED
The session layer establishes conversations — sessions — between networked devices. A session is an exchange of connection-oriented transmissions between two network devices. Each transmission is handled by the transport layer protocol. The session itself is managed by the session layer protocol.
A single session can include many exchanges of data between the two computers involved in the session. After a session between two computers has been established, it's maintained until the computers agree to terminate the session.
The session layer allows three types of transmission modes:
The presentation layer is responsible for how data is represented to applications. The most common representation for representing character data today is called UTF-8, which uses 8-bit sets to represent most characters found in western alphabets. UTF-8 is compatible with an older standard called ASCII.
Besides simply converting data from one code to another, the presentation layer can also apply sophisticated compression techniques so that fewer bytes of data are required to represent the information when it’s sent over the network. At the other end of the transmission, the presentation layer then uncompresses the data.
The presentation layer can also scramble the data before it’s transmitted and then unscramble it at the other end by using a sophisticated encryption technique that even Sherlock Holmes would have trouble breaking.
The highest layer of the OSI model, the application layer deals with the techniques that application programs use to communicate with the network. The name of this layer is a little confusing. Application programs (such as Microsoft Office or QuickBooks) aren’t a part of the application layer. Rather, the application layer represents the programming interfaces that application programs use to request network services.
Some of the better-known application layer protocols are
Figure 1-5 shows how a packet of information flows through the seven layers as it travels from one computer to another on the network. The data begins its journey when an end-user application sends data to another network computer. The data enters the network through an application layer interface, such as SMB. The data then works its way down through the protocol stack. Along the way, the protocol at each layer manipulates the data by adding header information, converting the data into different formats, combining packets to form larger packets, and so on. When the data reaches the physical layer protocol, it’s placed on the network media (in other words, the cable) and sent to the receiving computer.
When the receiving computer receives the data, the data works its way up through the protocol stack. Then, the protocol at each layer reverses the processing that was done by the corresponding layer on the sending computer. Headers are removed, data is converted back to its original format, packets that were split into smaller packets are recombined into larger messages, and so on. When the packet reaches the application layer protocol, it’s delivered to an application that can process the data.
As I mention earlier, the first two layers of the OSI model deal with the physical structure of the network and the means by which network devices can send information from one device on a network to another. By far, Ethernet is the most popular set of protocols for the physical and data link layers.
Ethernet has been around in various forms since the early 1970s. (For a brief history of Ethernet, see the sidebar, “Ethernet folklore and mythology.”) The current incarnation of Ethernet is defined by the 802.3 IEEE standard. Various flavors of Ethernet operate at different speeds and use different types of media. However, all the versions of Ethernet are compatible with each other, so you can mix and match them on the same network by using devices such as bridges, hubs, and switches to link network segments that use different types of media.
Ethernet operates at the first two layers of the OSI model — the physical and the data link layers. However, Ethernet divides the data link layer into two separate layers: the Logical Link Control (LLC) layer and the Medium Access Control (MAC) layer. Figure 1-6 shows how the various elements of Ethernet match up to the OSI model.
The following sections describe Standard Ethernet, Fast Ethernet, and Gigabit Ethernet in more detail.
Standard Ethernet is the original Ethernet. It runs at 10 Mbps, which was considered fast in the 1970s but is excruciatingly slow by today’s standards. Although plenty of existing Standard Ethernet is still in use, it’s considered obsolete and should be replaced by Gigabit Ethernet as soon as possible.
Standard Ethernet came in three incarnations, depending on the type of cable used to string the network together:
10BaseT: Unshielded twisted-pair (UTP) cable became popular in the 1990s because it’s easier to install, lighter, and more reliable, and also it offers more flexibility in how networks are designed. 10BaseT networks use a star topology with hubs at the center of each star. Although the maximum length of 10BaseT cable is only 100 meters, hubs can be chained to extend networks well beyond the 100-meter limit.
10BaseT cable has four pairs of wires twisted together throughout the entire span of the cable. However, 10BaseT uses only two of these wire pairs, so the unused pairs are spares.
Fast Ethernet refers to Ethernet that runs at 100 Mbps, which is ten times the speed of Standard Ethernet. Although there are several varieties of Fast Ethernet, the most common is 100BaseTX, which transmits at 100 Mbps over just two pairs of a UTP cable. 100 Mbps Ethernet requires at least Cat-5 cable, but most networks are now wired with Cat-5e or Cat-6 cable, both of which are capable of gigabit speeds.
Gigabit Ethernet is Ethernet running at a 1,000 Mbps, or 1 Gbps. Gigabit Ethernet was once considerably more expensive than Fast Ethernet, so it was used only when the improved performance justified the extra cost. However, today Gigabit Ethernet is the standard for nearly all desktop and laptop PCs. Two grades of cable are commonly used: Cat-5e and Cat-6; Cat-6 is preferred because it can be used for even faster networks.
Several varieties of Ethernet faster than 1 Gbps are available:
TCP/IP, the protocol on which the Internet is built, is not a single protocol but rather an entire suite of related protocols. TCP is even older than Ethernet. It was first conceived in 1969 by the Department of Defense. For more on the history of TCP/IP, see the sidebar, “The fascinating story of TCP/IP,” later in this chapter. Currently, the Internet Engineering Task Force (IETF) manages the TCP/IP protocol suite.
The TCP/IP suite is based on a four-layer model of networking similar to the seven-layer OSI model. Figure 1-7 shows how the TCP/IP model matches up with the OSI model and where some of the key TCP/IP protocols fit into the model. As you can see, the lowest layer of the model, the network interface layer, corresponds to the OSI model’s physical and data link layers. TCP/IP can run over a wide variety of network interface layer protocols, including Ethernet, as well as other protocols, such as token ring and FDDI (an older standard for fiber optic networks).
The application layer of the TCP/IP model corresponds to the upper three layers of the OSI model — the session, presentation, and application layers. Many protocols can be used at this level. A few of the most popular are HTTP, FTP, Telnet, SMTP, DNS, and SNMP.
In the following sections, I point out a few more details of the three most important protocols in the TCP/IP suite: IP, TCP, and UDP.
Internet Protocol (IP) is a network layer protocol responsible for delivering packets to network devices. The IP protocol uses logical IP addresses to refer to individual devices rather than physical (MAC) addresses. Address Resolution Protocol (ARP) handles the task of converting IP addresses to MAC addresses.
Because IP addresses consist of a network part and a host part, IP is a routable protocol. As a result, IP can forward a packet to another network if the host isn’t on the current network. After all, the capability to route packets across networks is where IP gets its name. An Internet is a just a series of two or more connected TCP/IP networks that can be reached by routing.
Transmission Control Protocol (TCP) is a connection-oriented transport layer protocol. TCP lets a device reliably send a packet to another device on the same network or on a different network. TCP ensures that each packet is delivered, if at all possible, by establishing a connection with the receiving device and then sending the packets. If a packet doesn’t arrive, TCP resends the packet. The connection is closed only after the packet has been successfully delivered or an unrecoverable error condition has occurred.
One key aspect of TCP is that it’s always used for one-to-one communications. In other words, TCP allows a single network device to exchange data with another single network device. TCP isn’t used to broadcast messages to multiple network recipients. Instead, UDP is used for that purpose.
Many well-known application layer protocols rely on TCP. For example, when a user running a web browser requests a page, the browser uses HTTP (HyperText Transfer Protocol) to send a request via TCP to a web server. When that web server receives the request, it uses HTTP to send the requested web page back to the browser, again via TCP. Other application layer protocols that use TCP include Telnet (for terminal emulation), FTP (for file exchange), and SMTP (for email).
User Datagram Protocol (UDP) is a connectionless transport layer protocol used when the overhead of a connection isn’t required. After UDP has placed a packet on the network (via the IP protocol), it forgets about it. UDP doesn’t guarantee that the packet arrives at its destination. Most applications that use UDP simply wait for any replies expected as a result of packets sent via UDP. If a reply doesn’t arrive within a certain period of time, the application either sends the packet again or gives up.
Probably the best-known application layer protocol that uses UDP is the Domain Name System (DNS). When an application needs to access a domain name (such as www.wiley.com
), DNS sends a UDP packet to a DNS server to look up the domain. When the server finds the domain, it returns the domain’s IP address in another UDP packet.
Although the vast majority of networks now use Ethernet and TCP/IP, a few other networking protocols are still in use and are therefore worth knowing about. In particular: