Networking All-in-One For Dummies. Doug Lowe

Чтение книги онлайн.

Читать онлайн книгу Networking All-in-One For Dummies - Doug Lowe страница 29

Networking All-in-One For Dummies - Doug Lowe

Скачать книгу

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.

      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 3 of this minibook, I dive deeper into how switches do their magic.

      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.

      

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.

The key points to remember here are that in order for a computer, printer, or any other device to connect to a network, that device must contain a network interface. That interface has a unique MAC address, which is the primary way that the network can distinguish one device from another.

      When two or more devices are connected to a network via cables plugged into their network interfaces, those devices can exchange information with one another. This bit of magic is accomplished through the use of packets, which are relatively small units of data that are sent and received through the network interface and cables. A network packet always originates at a single network interface, called the sender, and it’s usually (but not always) sent to a single network interface, called the destination.

      A packet is very similar to an envelope that you would send through standard mail delivery. It includes the MAC address of both the sender and the destination, as well as some other interesting header information, along with a payload that contains the actual data being sent by the packet. You can think of the payload as what you would put in an envelope you want to send through the mail. You wouldn’t dream of dropping an envelope in the mail without writing the recipient’s address, as well as your own address, on the envelope. So it is with packets.

      The payload of an Ethernet packet may be a packet created by some higher-level protocol, such as IP. This is analogous to putting a letter in an envelope, putting that envelope in a larger envelope, and sending it through the mail. When the recipient receives your mail, she opens the envelope only to find another envelope that must be opened. That envelope may itself contain another envelope and so on, like Russian nesting dolls.

      

The term frame is often used instead of packet, but technically they’re not quite the same. Every packet begins with a preamble, which consists of 56 bits of alternating zeros and ones. This preamble is used by

Скачать книгу