After completing these activities, you should be able to:
The Data Link Layer interfaces with the Physical Layer by transitioning physical network signals and characteristics into logical ones and conducting error checking and building tables that contain unique identifiers that reference hardware addressing schemes. The Data Link Layer is limited to Local Area Networks (LANs) because data used within this layer is discarded during deencapsulation, going up to the Network Layer. A host's Network Interface Card (NIC) has a chip that contains its Media Access Control (MAC) address, which must be unique within a network. At Layer 2 of the TCP/IP Stack, communications take place using MAC addresses with the adoption of Ethernet for Internet Protocol (IP) networks based on Request for Comment (RFC) 894.
The Institute of Electrical and Electronics Engineers (IEEE) defines Ethernet standards under 802.3. The 802.3 Working Group provides contributions to improvements, issues, and future drafts related to Ethernet specifications. For this course, Ethernet standards will only focus on LANs that interconnect devices within a limited area such as a residence, campus, or building. Other types of data-link technologies outside of the IEEE 802 standards include Fiber Distributed Data Interface (FDDI), X.25, Frame Relay, and Asynchronous Transfer Mode (ATM).
can be configured as Point-to-Point, Bus, Ring, Star, or Mesh. All are used with
Ethernet but it's uncommon to see an Ethernet ring network implemented.
Ethernet frames are used for hosts to communicate within a LAN. Construction of an Ethernet frame is as follows:
+----------------+-------------+-------------+----+----------------------------------------+---------+ | PREAMBLE | DEST ADDR | SRC ADDR |TYPE| DATA | FCS | +----------------+-------------+-------------+----+----------------------------------------+---------+ |----8 Bytes-----|---6 Bytes---|---6 Bytes---|-2B-|---------------~48 Bytes----------------|-4 Bytes-|The purpose of the preamble is to inform a receiving host that the data being interpreted is indeed intentional and not part of interference or noise in the transmission. It contains a sequence of alternating 1's and 0's in the first seven bytes until the last byte of 10101011 to indicate the end of the preamble.
Network Interface Controller parts of
a MAC addresses used to provide
globally unique identifiers used
identification of objects.
During the manufacturing process for building NICs, the business has to request OUIs to be issued by IEEE, which is the Registration Authority for MAC addresses under EUI-48. Navigate to the WireShark OUI Lookup website and determine the manufacturer of the device of the MAC addresses in the illustration to the left.
The OUI of a MAC address can potentially identify the manufacturer of a device, an IP can be associated to an organization, and port connections the service and OS used. Operations pertaining to the TCP/IP Stack necessitate the interconnected world we live in but can also reveal a lot about the host. Putting together these artifacts and fingerprinting a system, such as the behaviors unique to an OS like ephemeral port usage, are techniques that can be employed to result in system vulnerabilities, identification of cyber-personas associated to devices, and eventually exploits that can be delivered to target systems.
The probability of duplicating MAC addresses is 248 but because of how OUIs are arranged, this is reduced to 224. OUI assignments allocate the first half of the MAC address to a specific company and the second half is used by that company for distribution. The MAC address for workstation with the MAC address below has an OUI of C0-3E-BA, which is owned by Dell, Inc., with the remaining three octets assigned by the vendor.
|Organizationally Unique Id| Network Int Controller | field | C0 | 3E | BA | AF | 5E | 43 | hex |11000000 00111110 10111010 10101111 01011110 01000011| bits | | | | | most-significant-byte least-significant-byte | most-significant-bit least-significant-bitKnowledge Check: If a MAC address is 6 bytes in length, how many bits is that?
You might have noticed that a port is much smaller than a MAC address or an IP address. Well, there's some rationale behind that. Each network interface has a unique MAC address, and MAC addresses are allocated based on the manufacturer; hardware manufacturers are assigned large blocks of MAC addresses for the hardware they make. If you were a hardware vendor, would you want to be able to produce and sell a small number or large number of devices? Obviously a large number versus a small number. Additionally, having a large address allows new networking technologies to operate using the same concepts; e.g., Wi-Fi and Bluetooth both adopted the 48-bit MAC address from Ethernet. Obviously we need a large number (32-bit for IPv4, or 128-bit for IPv6) to uniquely identify all the hosts connected to the global Internet. But how big does a port number need to be? Is 16-bits enough? Well, how much multitasking do you like to do? Better yet, how much multitasking do you think you can do? Can you manage 65 thousand processes all running at the same time? Sometimes, a single process (like a web server) can have many sockets, so the comparison of processes to ports fits clients, not servers. In practice, 16-bits to represent the processes communicating on a host has not been an issue.
processing frames for a certain number of ports, allowing for the management
of layer 2 data and isolating network traffic through collision domains, allowing
hosts to only communicate with those identified as the destination address.
Basic Small Office Home Office (SOHO) devices will leverage a Central Processing Unit (CPU) to manage MAC address tables, which are typically limited to 4-8 ports in a device as compared to commercial switches that can have 48 ports in a single device or hundreds of ports for expandable units.
Take a look at some of the Data Link layer properties, such as your MAC address, on your current system.
ipconfig /all
C:\Users\m9999>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : host01
Primary Dns Suffix . . . . . . . : academy.usna.edu
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : academy.usna.edu
usna.edu
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : academy.usna.edu
Description . . . . . . . . . . . : Realtek USB GbE Family Controller #2
Physical Address. . . . . . . . . : C0-3E-BA-AF-5E-43
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 10.60.145.241(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Wednesday, October 6, 2023 1:03:30 AM
Lease Expires . . . . . . . . . . : Friday, October 22, 2023 1:03:36 AM
Default Gateway . . . . . . . . . : 10.60.145.1
DHCP Server . . . . . . . . . . . : 10.1.74.10
DNS Servers . . . . . . . . . . . : 10.1.74.10
NetBIOS over Tcpip. . . . . . . . : Enabled
Apple is a large technology company that is involved in the manufacturing process of their own products, where the devices and OUIs match. Many systems that rely on global supply chains will likely source parts from other manufacturers, as is the case for your issued computers. Do a little more research to determine where the company that manufactured your Ethernet and wireless NICs is headquartered. What other products does that company make and who are they also likely to supply parts to?
For Layer 2 to know what MAC address to put into the destination address field of the frame, it uses ARP.
Recall that MAC addresses are associated with hardware-specific NICs, and IP has logical addresses.
Every time a host receives a frame from another host in its IP network, it caches the source MAC-IP address match in its ARP table.
If a host does not have a cached entry needed for a destination, it transmits an ARP request in which the source and destination IP and source MAC addresses are known and the destination MAC address is the broadcast address, FF:FF:FF:FF:FF:FF.
When the host with an IP address that matches an ARP request's destination IP address receives the ARP request, it replies with an ARP response in which all Layer 2 and 3 addresses are known.
Upon receiving the ARP response, the host that sent the ARP request caches the destination's IP-MAC address association in its ARP table, and then is able to form the frame for the IP packet that's been waiting to be transmitted to its next hop.
Below is an example of viewing an ARP table for your local host. Run the arp -a command in PowerShell on your computer to see how many ARP resolutions have taken place. Why aren't there more addresses in the ARP table?
PS C:\Users\m9999> arp -a Interface: 10.60.145.241 --- 0x3 Internet Address Physical Address Type 10.60.145.1 88-3a-30-a2-fc-80 dynamic 224.0.0.22 01-00-5e-00-00-16 static 224.0.0.251 01-00-5e-00-00-fb static 239.255.255.250 01-00-5e-7f-ff-fa static 255.255.255.255 ff-ff-ff-ff-ff-ff static
The network captures below illustrate an ARP request and ARP response.
broadcast to FF:FF:FF:FF:FF:FF to see what MAC has an IP of 10.60.145.241. |
All devices within the LAN receive ARP broadcasts but reply only if the IP matches.
Some network devices, including routers and printers, often send ARP broadcasts to maintain their ARP table entries in network devices.
Knowledge Check: Based on the ARP request to determine who has 10.60.145.241, what is the MAC address of the system that would respond with an ARP reply? Take a look at the screenshots above to find the answer.
ARP Poisoning (aka ARP Spoofing). ARP does not provide any inherent authentication mechanism. As a result, if an adversary can physically connect their device to a network, they can inject ARP packets claiming the target device's IP address correlates to the attacker's MAC address. By 'poisoning' the ARP caches of other devices on the network, an attacker can intercept and modify traffic intended for the target.
In the previous lesson, we explored how DHCP works at Layer 3. The process is simpler at Layer 2 because no assignments or reconfigurations occur at Layer 2. The Layer 2 addresses are already embedded in the host's NICs. As such, frames carrying DHCP traffic are addressed much like ARP request frames, that is, the Layer 2 source address is known and the destination address is the Layer 2 broadcast address, FF:FF:FF:FF:FF:FF. When the DHCP client receives a DHCP offer, it inserts the IP-MAC address pair into its ARP table.
So far, we've covered the how the Application Layer provides services, the Transport Layer connects these services end-to-end, and the Network Layer provides connectivity from one network device to another across multiple network hops. Now, we take one step deeper into the TCP/IP Stack by exploring how the Data Link Layer provides connectivity between devices within a LAN. The introduction of switching in this lesson means that our scenario now needs to incorporate switches. As our diagram continues to grow, you may need to scroll to see its right end.
Note that we've gotten to the point at which the Gmail web server has received our first HTTPS request. Now, it's the Gmail web server's turn to respond to your laptop's HTTPS request. Can you figure out how the HTTPS response gets from the Gmail web server's application layer to your laptop's application layer?
As you learned when building your own web sites, your browser will need to send an additional HTTPS request for each additional element, and for each of those additional elements that are not at mail.google.com, your laptop will need to send another DNS query to resolve each other server's IP address. Amazingly, all this happens in a fraction of a second!