Link layer: transmitting data between "directly connected" nodes. Issues:
Framing: link layer header. In some cases may include "trailer" fields. Framing should mark where frame begins and ends.
In a half-duplex link, a node can be either sending or receiving, but not both. In a full-duplex link, node can send and receive at the same time.
Network interface devices perform many link-layer functions autonomously (without explicit control by the host CPU). Host CPU programs the NIC with the address of buffers containing frame to be sent, and the NIC physically transmits the frame when the link is available. Host CPU also programs the NIC with the address of buffers where incoming frames can be placed: when a frame has arrived, the NIC interrupts the host CPU so it can handle the frame.
Parity: a 1-bit checksum. Can detect any single-bit error. If errors are rare and errors do not cluster, parity could be sufficient. However, many types of errors that occur in practice do cluster. Any two bit error in a chunk of data covered by a single parity bit does not violate parity, so it goes undetected.
Two-dimensional parity can detect all 1 and 2 bit errors, and recover from all 1 bit errors. The data bits are arranged in a grid, and parity is computed for each row and column. Example:
1 0 0 1 | 0 1 1 0 0 | 0 0 1 1 0 | 0 0 1 1 1 | 1 --------+-- 0 1 0 0 | 0
A single bit error will cause a parity violation in exactly one row and one column. The intersection of that row and column must contain the incorrect bit:
1 0 0 1 | 0 1 1 0 0 | 0 0 1 0 0 | 0 <-- does not check 0 1 1 1 | 1 --------+-- 0 1 0 0 | 0 ^ | does not check
A two bit error will cause parity violations in either:
However, none of these cases reveals enough information to precisely pinpoint the corrupted bits.
A three bit error can go undetected. For example:
1 0 0 1 | 0 1 1 0 0 | 0 0 1 0 0 | 1 0 1 1 1 | 1 --------+-- 0 1 1 0 | 0
As we saw in Lecture 11, checksums can allow multiple bit errors to go undetected. The necessary and sufficient condition for a set of errors going undetected is that the sum of the differences induced by the errors is 0.
A stronger form of error detection: an r-bit CRC will detect all errors of r bits or less, and will detect errors in a larger number of bits with high probability.
Procedure: treat data D as the integer represented by D's bit pattern. Given generator value G, compute (D * 2^r) / G. The remainder is the CRC. The division is performed in a particular way: subtraction is done using XOR (bitwise exclusive or), with no borrows.
Many LAN network technologies, e.g. ethernet, are broadcast networks. Generally, in a broadcast network if two nodes are transmitting at the same time, the result is a collision. When two transmitted frames collide, the electrical signals interfer with each other and each transmission is garbled. A multiple access protocol attempts to (1) prevent collisions, and (2) resolve collisions by allowing both senders to (eventually) transmit without interference.
Multiple access approaches:
Nodes are arranged in a ring. Frames travel in only one direction: around the ring. A node may only transmit frames when it is holding the token. The token is passed around in the same order as data is sent.
The sender is responsible for removing (not repeating) frames that it sent.
Originally a wireless broadcast network technology, it was the inspiration for ethernet.
In Slotted ALOHA, time is divided into slots. When a station has a frame to transmit, it simply sends the frame. When a collision occurs, it flips a biased coin in subsequent slots: in each slot, it retransmits with probability p. Example:
In this example, the first two slots are wasted because of collisions. The last two slots are both used successfully because only one node transmitted in those slots. In four time slots, only two nodes transmitted successfully, and node C was not able to transmit.