Layer Functions, ARP Variants, Switching and CSMA/CD Explained
ECE-GY 6353
A device that is said to operate at layer "X" implements protocols and processes headers up to and including layer "X", but no higher.
- A host implements protocols and processes headers up to and including the application layer.
- A router implements protocols and processes headers up to and including the network layer.
- A link layer switch (bridge) implements protocols and processes headers up to and including the data link layer.
- A hub or an Ethernet segment only implements the physical layer.
NIC
Identifies the network interface card (NIC) in the local network that should process the frame.
MAC address in data link layer header
EtherType
EtherType is a field in the Ethernet frame header used to identify the network layer protocol carried by the frame. Different EtherType values correspond to different protocols. The difference between 0x0806 and 0x0800 is:
- 0x0806: the frame carries an ARP request or reply.
- 0x0800: the frame carries an IPv4 packet.
ARP
Proxy ARP works as follows:
- Normally, ARP is used to resolve the MAC (Media Access Control) address of a device on the local network by sending an ARP request and waiting for the target device to reply with its MAC address.
- In Proxy ARP, a router or intermediate device replies to the ARP request on behalf of the target device, sending its own MAC address as the "proxy" answer.
- The requester does not know the reply came from a proxy and believes it communicates directly with the target. It therefore forwards packets to the proxy (router), which then forwards them to the real target.
Gratuitous ARP: sends an ARP request with its own resolving IP address. The sender's IP and MAC address are broadcast, and other hosts insert this mapping into their ARP tables.
An ARP reply sent without first receiving an ARP request is a gratuitous ARP reply. Note that the destination address in the Ethernet header is the broadcast address.
Regular ARP Request: when a normal ARP request is initiated, the MAC address of the target is usually unknown, so the request is sent to all devices using the broadcast address ff:ff:ff:ff:ff:ff. This ensures every device on the network receives it, and the target then replies.
ARP Poll: unlike a regular ARP request, an ARP Poll does not use the broadcast address. It verifies whether the target device is still online and reachable by sending the request to the target's last known unicast MAC address. Its purpose is to confirm reachability through a unicast request.
ARP op code: 0001 = ARP request; 0002 = ARP reply.
Bridge forwarding table
When a switch receives a data frame, it examines the frame's source MAC address and records it in the forwarding table along with the port on which it arrived. The switch then checks the destination MAC address. If that address already exists in the forwarding table, the switch forwards the frame to the corresponding port. Otherwise, the switch floods the frame out all ports except the source port to locate the destination. When the device replies, the switch adds the destination MAC address and its port to the forwarding table, so future frames to that address can be forwarded directly.
CSMA/CD
This process describes the workflow of CSMA/CD (Carrier Sense Multiple Access with Collision Detection). Its main points are:
- Carrier sensing (Sense Channel): a device listens to the channel before transmitting to determine whether it is idle.
- If the channel is busy, the device waits until it becomes idle before sending.
- If the channel is free, the device transmits immediately.
- Transmit data and sense channel: during transmission, the device continues monitoring the channel to make sure no collision occurs.
- Collision detected: if a collision is detected, the device stops transmitting and sends a jam signal to notify other devices.
- Backoff algorithm: after a collision, the device waits a random time determined by the exponential backoff algorithm before attempting to retransmit.
- Complete transmission: if no collision occurs, the data transmission completes successfully.
Back-off procedure: after the sequence of events above, each host waits for a number of slots, selected randomly from 0 to 7, before attempting to transmit again.
SIFS (Short Interframe Space) - 短帧间间隔
English: SIFS is a short waiting time that a device must observe before transmitting a frame. It is used when the device expects a quick response from another device, such as an acknowledgment or control frame.
中文:SIFS 是一种设备在发送帧之前必须等待的短时间间隔,通常用于设备期望快速响应(例如确认帧或控制帧)时。
Function: after sending a data frame, if a device expects an immediate ACK or other control frame, it waits one SIFS. This interval is shorter than the others, which keeps transmission efficient.
DIFS (Distributed Interframe Space) - 分布式帧间间隔
English: DIFS is a longer waiting period used by devices before they can initiate a new transmission when the channel is idle.
中文:DIFS 是设备在信道空闲时启动新传输前必须等待的较长时间间隔。
Function: before transmitting a data frame, a device must check whether the channel is idle. If it is, the device waits one DIFS. If the channel remains idle throughout the DIFS, the device may begin transmitting. DIFS helps prevent multiple devices sharing the channel from transmitting simultaneously.
Summary
Before sending, wait one DIFS period (the exact number of slots depends on the definition in the problem). After sending, wait one SIFS period before replying with an ACK, and the exchange is done.