Data link and Ethernet switching
A link must deliver a bounded frame before a router can inspect its packet. Missing boundaries, damaged bits and mistaken interface identities can each break delivery before the application participates. We will construct a frame, distinguish local addresses, compute an error check and follow Ethernet forwarding through a switch.
#Section 5Data link framing and medium access
The data link layer frames a bounded transfer between neighboring interfaces. Its local wrapper carries delivery and error-detection information around a network packet.
Framing, headers and payload
An Ethernet frame names destination and source interfaces, identifies the carried protocol and ends with a frame check sequence. The preamble helps receivers synchronize before the frame itself. Length fields, delimiter patterns or fixed formats let other link protocols find boundaries. If a delimiter can appear inside data, the format needs an escaping or coding rule so payload bytes cannot masquerade as a boundary.
The declared untagged Ethernet layout uses 14 header bytes, a 1,500-byte IP packet and four frame-check bytes:
Read F as the frame count under this convention, excluding preamble and the gap between transmissions. The 1,500-byte IP allowance is the link MTU, not the entire frame count. The Ethernet IP encapsulation specification defines that distinction with its published errata.
Flow control and medium access control
Link flow control can stop a neighbour from overwhelming its receiver. Medium access control decides who may transmit when several stations share a channel. Neither function is the same as TCP's end-to-end control. Ethernet pause signalling, where configured, can spread waiting to unrelated traffic sharing the paused link; a successful local pause does not prove an application made progress.
The failure case is a receiver that accepts the frame boundary but rejects its check. It discards the damaged frame rather than supplying partial payload to IP. Higher layers may recover the lost data, but a link cannot assume that every carried protocol has a retransmission mechanism. Specify which layer repairs loss when explaining the complete request.
#Section 6MAC addresses, unicast and broadcast
A MAC address identifies an interface in local link forwarding. The campus client needs its gateway's MAC, not the remote portal's. A MAC is not trustworthy user identity.
Unicast names one interface. Multicast names a selected group under the link's delivery rules. Broadcast addresses all eligible interfaces in the broadcast domain. A router normally ends that local broadcast reach, while switches extend it within the selected VLAN. A switch receiving an unknown unicast can also flood it, but that forwarding action does not change the frame's destination into a broadcast address.
For the running request, source MAC belongs to Finch and destination MAC belongs to the gateway. The IP destination still names 203.0.113.20. At the next routed link, the gateway supplies different local MAC fields. This is why a captured frame can name a nearby interface while carrying a packet destined for a distant machine.
A virtual interface can acquire a new address when recreated, and an administrative configuration can override an address. Duplicate addresses on the same learning domain make the switch's location change between ports. A MAC therefore does not prove the owner's identity, durability or permission. Authorization belongs to a higher-layer contract.
The interview distinction is between a MAC table, a route table and an application session. The MAC table finds a local forwarding port; the route table finds a next hop for an IP prefix; the session supplies the caller's application state. Changing one does not necessarily invalidate the others, though their operational state must agree well enough for the request to reach its destination.
#Section 7Error detection, checksum and CRC
Error detection identifies specified corruption patterns; error correction can reconstruct some damaged messages. Rejecting a bad frame is different from recovering its payload.
Parity makes the number of set bits even or odd; it detects an odd number of flips but can miss an even number. A checksum combines words under its declared arithmetic. A CRC, or cyclic redundancy check, divides a binary polynomial by a chosen generator using XOR instead of ordinary subtraction. The receiver repeats the check under the same generator.
Worked polynomial division
The declared data is 1101, the generator is 1011, and the generator's degree requires three appended zeroes. Divide 1101000 using XOR. The successive working strings are 0110000, 0011100, 0001010 and 0000001. The last three positions give remainder 001, so the transmitted codeword is 1101001.
1101 uses generator 1011 and remainder 001. Orange marks the receiver's zero remainder after dividing the transmitted codeword 1101001.Read polynomial remainder as the part left after cancelling every permitted leading generator term. Dividing the transmitted codeword produces 000, which is the expected remainder for this teaching code. These steps are asserted in scripts/fundamentals/cn-early-numbers.py; swapping the data and generator changes the problem.
A valid remainder is not proof that the frame is the intended message. Some altered patterns share the check, and an attacker can recompute a public CRC after changing data. A link check protects an accidental-corruption boundary, while TLS authentication protects a different adversarial boundary. The actual Ethernet check uses its standardized generator rather than this small teaching polynomial.
#Section 8Ethernet, CSMA/CD and duplex
Ethernet is the IEEE 802.3 link family. Finch's switched full-duplex link can send and receive simultaneously; historical shared-medium collision rules describe another setup.
Ethernet frame structure
Destination MAC, source MAC, EtherType, payload and frame check sequence give the receiver local delivery and integrity information. The declared 1,518-byte count includes the frame check but excludes synchronization and idle-gap costs. Adding the declared VLAN tag makes bytes. Real frame budgets must also consider configured encapsulation and link capability.
Broadcast and collision domains
A broadcast domain describes which interfaces receive a local broadcast. A collision domain describes stations sharing a medium on which simultaneous transmissions interfere. Those sets need not match. Separate full-duplex switch ports can belong to the same VLAN broadcast domain without competing for one shared host-to-switch wire.
CSMA/CD and full-duplex Ethernet
Historical shared Ethernet used carrier-sense multiple access with collision detection, or CSMA/CD. A sender listened, transmitted on an apparently idle medium, detected a collision and retried after randomized backoff. Detecting a collision required a shared-medium timing model. A full-duplex point-to-point link does not run that collision procedure.
The remaining failure modes include damaged frames, exhausted buffers and incorrect link configuration. Full duplex removes shared-medium collisions, not every source of loss or waiting. The switch may receive traffic faster than an egress link can drain it even when every cable is healthy. In an interview, distinguish the medium’s access rule from the switch’s queueing and the higher layer’s recovery rule before claiming that Ethernet cannot lose packets.
#Section 9Hubs, bridges, switches and routers
A switch forwards local frames; a router chooses an IP next hop. A hub repeats signals, while a bridge learns locations across link segments.
The distinction is easiest to see in the running request. Finch’s switch sees the gateway MAC and chooses its port. The gateway removes the Ethernet frame, sees remote IP 203.0.113.20, selects a route and forwards through another interface. It does not forward globally by that remote server’s MAC, because the server is outside the local link.
A gateway is a boundary role rather than one universal device type. The same appliance can include an Ethernet switch, IP router, address translator, firewall, DHCP service and radio access point. A product advertised as a switch can also route. Asking which feature is active avoids arguing about the label on the chassis.
Repeating a signal can expose traffic and extend shared-medium contention. Learning a MAC location narrows known-unicast delivery but requires changing local state. Routing introduces prefix selection, hop limits and a new broadcast boundary. None of those operations establishes that the destination application authorized Finch or produced a correct response.
The failure trace follows the interpreted table. If the switch has the wrong port, inspect MAC learning and VLAN membership. If the router lacks a route, inspect the destination prefix and next hop. If forwarding succeeds but the server refuses the request, continue upward to transport and application evidence. This division connects the layer model from Part I to actual devices instead of treating layers as a memorized list.
#Section 10Switching, learning and flooding
A MAC table maps source address and VLAN to a learned port. Learn from where a frame arrived; its destination does not prove that destination’s location.
If destination B is known on port 2, the switch forwards through that eligible port. If B is unknown, the switch floods through eligible ports in the same VLAN, excluding port 1 where the frame arrived. When B replies, its source supplies the missing location. Subsequent known-unicast frames can then take the narrower path.
Filtering, forwarding and ageing
Filtering prevents a frame from leaving through a port that should not carry it. Forwarding chooses a known destination path. Flooding distributes an unknown destination within its permitted domain. Entries age out because silent interfaces can move or disappear; observing another source frame refreshes the evidence.
When Finch moves from port 1 to port 3, the next source frame updates its location. Before that update, a cached entry can direct traffic to the old port. Duplicate source addresses can repeatedly replace one another, producing intermittent failures that resemble packet loss elsewhere. Look for the changing local mapping before changing the server.
Learning alone also cannot make an arbitrary looped topology safe. A broadcast can circulate through redundant links without reaching an IP router that would decrement TTL, because switches are forwarding frames inside one link domain. Loop prevention or a deliberately controlled fabric supplies that missing rule. A switch table reduces routine fan-out, but it does not prove a safe physical topology or a correct remote route.