Link Layer

Link layer sends datagram between adjacent nodes over single link.

Link-layer frames are used for transmitting IP datagrams as payload.

Each link layer protocols used for different types of links, and may have different extra services, but have a same basic set of services.

Examples of Link layer protcols:

Implementation

Needs an adapter on each end of a link.

Network interface controller (NIC) chip:

Error Detection and Correction (EDC)

Schemes

Not 100% reliable. Larger EDC field yields better detection

Parity Checking

Single bit: Append a single bit $x$ to the end.

2D bit parity:

Cyclic redundancy check (CRC)

Powerful ED coding

  1. Sender sends $(D, R)$
  2. Receiver knows $G$, divides $(D, R)$ by $G$
  3. If non-zero remainder: error detected.

Multiple access protocols

Type 1: Point-to-point link (Sender and receiver connected by dedicated link)

There is no need for multiple access control in a PtP link, each link is dedicated.

Type 2: Broadcast link (many nodes using same broadcast channel)

How to prevent collisions in a broadcast channel?

Multiple Access Protocols are:

Channel Partitioning

Divide a channel into smaller pieces, allocate each piece for exclusive use.

Taking turns

Nodes take turns to transmit.

Polling: Master node “invite” each slave nodes to transmit.

Cons:

Token passing: Special frame/signal that is passed from node to node sequentially. When it has the token, it is eligible for transmission.

The network is usually run as a ring.

Cons:

Random Access

No coordination between nodes. Collision handling instead.

Collision

When two or more hosts are trying to transmit signals over the same link at the same time.

Slotted ALOHA:

Has empty slots, collisions aside from success.

Problems: synchronization of clocks.

Pure (unslotted) ALOHA:

Pure ALOHA

Carrier sense

What if when detecting someone else is using the channel, don’t use it?

Carrier sense detects if the link is currently used for transmission.

However for the transmmission signal to propagate to the endpoint of a node, some extra time (propagation delay) will be incurred, leading to the pattern below.

Carrier Sense Multiple Access (CSMA):

CSMA/CD (Collision detection):

Limits on Frame Size

What if the frame size is too small?

Suppose minimal frame size = 512 bits. Link speed = 100Mbps.

Early ethernet used CSMA/CD, but today ethernet uses star topology with point-to-point connections so no need for multiple access protocol.

Early ethernet used a shared coaxial cable, which computers connected to using vampire taps.

CSMA/CA (Collision Avoidance):