A hub is a repeater with more than two ports. For example, a hub may have four or eight ports. These ports can each connect to another device on the network such as a client computer, a server, or a printer. A port on a hub can also connect to another hub, so that (for example) an eight-port hub can connect to seven computers and another eight-port hub, which can connect to seven more computers. In this way, two eight-port hubs can connect 14 computers to each other.
There are two very important things to know about hubs.
The second most important thing to know about hubs is that an electrical signal received on any of the hub’s ports is amplified and repeated on all the other ports in the hub. So, in an eight-port hub, any electrical signals received on port 1 are amplified and then sent out on ports 2 through 8. Any devices that are connected to ports 2 through 8 see the signals that were received on port 1. The same is true for signals received on any of the other ports; for example, any signals received on port 4 will be amplified and repeated on ports 1 through 3 as well as ports 5 through 8.
That’s the second most important thing to know. The first most important thing to know about hubs is that they’re almost never used anymore. That’s because simply repeating all incoming signals on all ports is an incredibly bad idea, for reasons that will become apparent later in this chapter and in Chapter 3of this minibook. If your network still has hubs, you should seriously consider replacing them with switches, which are described in the next section and further explained in the next chapter.
A switch is a layer-2 device that is similar to a hub in that it allows you to connect more than one device, and packets received on one port are relayed to other ports. The difference, however, is that a switch is able to examine the actual contents of the data that it receives. As I explain in the “ Pondering Packets” section, later in this chapter, data is sent in units called packets that contain a destination address. A switch looks at this destination address and repeats the incoming packet only on the port that can deliver the packet to the intended destination.
For example, suppose Computer A is connected to switch port 1, and Computer D is connected to switch port 4. If Computer A sends a packet to Computer D, that packet is received on switch port 1. The switch knows that Computer D is connected to switch port 4, so the switch sends the packet out on switch port 4. In this way, Computer D receives the packet. The computers or devices that are connected to the other ports on the switch are not bothered with the packet intended for Computer D.
If that doesn’t make a lot of sense, don’t worry: It will. The next two sections in this chapter explain the concept of MAC addresses, which are how networks identify the intended recipients of data packets, as well as how data packets work. Then, in Chapter 3of this minibook, I dive deeper into how switches do their magic.
Perusing Ports, Interfaces, and MAC Addresses
A network interface is the electronic circuitry that allows a device to connect to a network. Each network interface provides a port, which is the plug-in point for the interface. Generally speaking, the terms port and interface are synonymous.
A network interface might be a separate add-on card for a computer, in which case the interface is called a network interface card (NIC). On some devices, such as printers, separate network interface cards are still common. But nearly all desktop and laptop computers have a network interface built into the computer’s motherboard, so separate NICs are rarely used on desktop computers or laptops. NICs are still widely used on servers, however, as servers are often configured with two or more interfaces; using a separate card for the interface allows for more flexibility.
The term adapter is often used as a synonym for interface. Port, interface, adapter — three words that mean the same thing.
Every network interface must have a unique identifier called a MAC address. ( MAC stands for media access control , but that won’t be on the test.) Each MAC address is unique throughout the entire world. I have no idea whether MAC addresses are unique throughout the galaxy; it’s entirely possible that the computer system on some invading alien spacecraft would have a MAC address that is the same as your laptop, but if that were to happen, I doubt you’d be too concerned about fixing your network.
MAC addresses are important because they provide the means for a network to keep track of the devices that make up the network. Without MAC addresses, it would be impossible to know what devices are on the network. And it would be impossible to send information to a particular device or to know which particular device sent information.
The term physical address is sometimes used as a synonym for MAC address. The two terms are interchangeable.
MAC addresses are a part of layer 2 of the OSI Reference Model, called the link layer. This layer is responsible for the exchange of basic information on a network. The ability to uniquely identify every device on a network is a key component of enabling that to happen.
MAC addresses are 48 bits in length, which means that more than 280 trillion devices can be assigned unique MAC addresses before we run out. When written, MAC addresses are written in six octets separated by hyphens. An octet is a group of eight binary bits, written as a two-digit number in hexadecimal notation, which uses the letters A through F in addition to the digits 0 through 9 to represent the value of each octet. A typical MAC address looks like this:
48-2C-6A-1E-59-3D
If you want to see the MAC address of your computer’s network adapter, open a command prompt and type ipconfig /all. Scroll through the output from this command to see the MAC address (ipconfig calls a physical address) for each interface on your computer. For example, here’s the ipconfig output for the built-in adapter on my SurfaceBook:
Ethernet adapter Ethernet 2: Media State ……………………………………………….. : Media disconnected Connection-specific DNS Suffix . : bcf-engr.pri Description ……………………………………………….. : Surface Ethernet Adapter Physical Address ……………………………………… : 58-82-A8-9C-A7-28 DHCP Enabled ………………………………………………. : Yes Autoconfiguration Enabled ……………… : Yes
Here, you can see the MAC address is 58-82-A8-9C-A7-28.
A MAC address is technically associated with a network interface, not with the device that uses that interface. For example, if your computer’s motherboard has a network interface built in, the MAC address of the network interface is pretty much married to the motherboard. However, if your computer has a separate NIC, the MAC address is a part of the card, not the computer that the card is plugged into. If you remove the interface card from one computer and install it in another, the MAC address travels with the card.
Читать дальше