A quick review of Ethernet encapsulation might be helpful.
Other layers' protocols add only a header when they encapsulate data. However,
data link layer protocolsEthernet includedadd both a header and a trailer, with
the IP packet being placed between the header and trailer. The Ethernet header
contains several fields, including both the source and destination Ethernet
address fields. The trailer contains the frame check sequence (FCS) field,
which determines whether errors occurred during physical transmission; if errors
did occur, the receiver discards the frame.
In Figure 11-3, Hannah's
PC takes the following steps to encapsulate and send the IP packet into an
Ethernet frame:
|
1. |
Create a new Ethernet header.
|
|
2. |
Set the source Ethernet address to Hannah's Ethernet
address.
|
|
3. |
Set the destination Ethernet address to R1's
address.
|
|
4. |
Create a new trailer.
|
|
5. |
Insert an IP packet into the frame.
|
|
6. |
Send the frame.
|
By encapsulating the IP packet in an Ethernet frame, Hannah has
created something that can be transmitted across the Ethernet LAN. Now Hannah
just has to solve the other problem of making sure that the frame gets to R1 and
making sure that R1 processes the frame when it is received.
While you're thinking about encapsulation, it's a good idea to
review encapsulation at the other layers. All layers of the TCP/IP model use
encapsulation, but now you've seen how it works at each layer. For instance, the
HTTP protocol defines headers, and when a web browser or web server sends data,
HTTP encapsulates the data inside an HTTP header. It's useful to see all the
headers in at least one example, as shown in Figure 11-4. This figure shows the Ethernet, IP, TCP, and
HTTP headers, along with the end user data (a web page) in the response from the
web server.