Read a sample: 1. The Frame's Journey Begins
When you open a web page or send a message, the information does not simply leap from one computer to another. It is prepared by software, given addressing information, placed into units suitable for the network, and represented as signals on a physical medium. At the receiving end, those steps are interpreted in reverse.
This chapter begins with one part of that journey: an Ethernet frame traveling across a local network. You do not need to memorize every field yet. The first goal is to see where a frame fits, what job it performs, and how it differs from the IP packet it carries.
As we proceed, keep one distinction in mind: an Ethernet frame handles delivery across a local link, while an IP packet provides addressing for communication across networks. Those jobs work together, but they are not interchangeable.
Imagine a small office with two computers connected to an Ethernet switch. The switch also connects to a router that provides a path to other networks.
text
Maya's computer Leo's computer
IP: 192.168.10.10 IP: 192.168.10.20
MAC: 02:00:00:00:00:10 MAC: 02:00:00:00:00:20
| |
+----------- Switch ------------+
|
Router
Local IP: 192.168.10.1
Local MAC: 02:00:00:00:00:01
|
Other networks
For the examples in this chapter, the computers and the router’s local interface are on the same IPv4 subnet, 192.168.10.0/24. Maya’s computer uses the router at 192.168.10.1 as its default gateway. The addresses are hypothetical, chosen to make the journey easy to follow.
Each computer has an Ethernet interface connected to the switch. An interface is a point where a device connects to a network. Each of the interfaces shown has an IP address and a MAC address, but those addresses serve different purposes.
An IP address helps identify where a packet is going in an IP network. A MAC address identifies an interface for Ethernet delivery on the local network. The switch makes forwarding decisions using Ethernet information; the router connects different IP networks and makes forwarding decisions using IP information.
That description is deliberately broad. Later chapters will examine how a switch learns MAC addresses and how a router handles traffic bound for a remote network. For now, the diagram gives us a consistent setting for following a single piece of data.
Suppose Maya uses an application to send Leo the text:
text
Meet at 3.
The text is meaningful to the people using the application, but the network does not need to understand the appointment. The application represents its information as data that can be passed down through the networking stack.
A real application exchange may involve several messages, transport-layer information, and more than one packet. To keep our first journey readable, imagine that the relevant application data fits into one unit of transport data and then into one IP packet. We will concentrate on that packet and the Ethernet frame carrying it.
The networking stack adds information needed by different protocols. This process is called encapsulation. A useful first picture is:
text
Application data
carried inside transport data
carried inside an IP packet
carried inside an Ethernet frame
represented as signals on a medium
Each level has a different responsibility. The application creates or interprets the message. A transport protocol, such as TCP or UDP, provides information used for communication between applications. IP supplies source and destination IP addresses. Ethernet supplies information for local frame delivery.
The exact structure is more detailed than the picture suggests. For example, headers contain multiple fields, and an Ethernet frame also includes a trailer. Still, the nesting idea is valuable: the data used by an upper layer becomes part of what a lower layer carries.
Networking discussions often use the word packet loosely. For study purposes, it helps to be more specific.
An IP packet is the unit that includes an IP header and the data it carries. In our example, the packet has Maya’s IP address as its source and Leo’s IP address as its destination.
An Ethernet frame is the Layer 2 unit used to carry data over an Ethernet network. For this example, the frame contains the IP packet along with Ethernet addressing and error-detection information.
A signal is the physical representation used to transmit bits over a medium. Depending on the Ethernet technology, those signals may be electrical or optical. The receiving interface interprets the signals as bits and uses them to reconstruct the transmitted frame.
A simplified view of Maya’s outgoing data looks like this:
text
Ethernet frame
Destination MAC: 02:00:00:00:00:20
Source MAC: 02:00:00:00:00:10
Ethernet type: IPv4
Payload: IP packet
Trailer: Frame check sequence
IP packet inside the frame
Source IP: 192.168.10.10
Destination IP: 192.168.10.20
Data: Transport information and application data
The labels are descriptions, not a complete byte-by-byte capture. We will inspect the actual Ethernet fields in Chapter 3. At this stage, notice that both the frame and the packet have source and destination addresses, but they contain different kinds of addresses.
The frame’s destination MAC address tells the local Ethernet network which interface should receive it. The packet’s destination IP address identifies the IP destination. In this same-subnet example, both addresses point toward Leo’s computer, but they do so at different layers.
Before Maya’s computer can send the frame, it must decide whether Leo is local or whether the packet needs to go to a router.
Maya’s computer compares the destination IP address with its own subnet information. Because 192.168.10.20 is in the same 192.168.10.0/24 subnet as 192.168.10.10,…