Computer Network: Link Layer

Rahul Singh Sengar
6 min readSep 24, 2021

— — — —

By Rahul Singh Sengar

Note: This is the fifth blog of the Short & Simple computer network blog series. If you haven’t read the others, it is highly recommended that it won’t take more than 7 minutes.

property of dribble
(Property of dribble)

Introduction:

In the previous network layer blog, we learned that the network layer provides a communication service between any two network hosts. Between the two hosts, datagrams travel over a series of communication links, some wired and some wireless passing through a series of packet switches (switches and routers). As we continue down the protocol stack, from the network layer to the link layer, we naturally wonder how packets are sent across the individual links that make up the end-to-end communication path.

The Services Provided by the Link Layer

Although the basic service of any link layer is to move a datagram from one node to an adjacent node over a single communication link, the details of the provided service can vary from one link-layer protocol to the next. Possible services that can be offered by a link-layer protocol include:

• Framing: Almost all link-layer protocols encapsulate each network-layer datagram within a link-layer frame before transmission over the link. A frame consists of a data field, in which the network-layer datagram is inserted, and a number of header fields. The structure of the frame is specified by the link-layer protocol.

• Link access: A medium access control (MAC) protocol specifies the rules by which a frame is transmitted onto the link cases when multiple nodes share a single broadcast link — the so-called multiple access problem. Here, the MAC protocol serves to coordinate the frame transmissions of the many nodes.

• Reliable delivery: When a link-layer protocol provides reliable delivery service, it guarantees to move each network-layer datagram across the link without error.

• Error detection and correction: The link-layer hardware in a receiving node can incorrectly decide that a bit in a frame is zero when it was transmitted as a one, and vice versa.

The link layer is implemented in a network adapter, also sometimes known as a network interface card (NIC). At the heart of the network adapter is the link-layer controller, usually a single, special-purpose chip that implements many of the link-layer services (framing, link access, error detection, etc).

(Network adapter)

Multiple Access Links and Protocols:

There are two types of network links and they are described followings:

  • point-to-point link: a point-to-point link consists of a singlevsender at one end of the link and a single receiver at the other end of the link. Many link-layer protocols have been designed for point-to-point links; the point-to-point protocol (PPP) and high-level data link control (HDLC) are two such protocols.
  • Broadcast Link: a broadcast link, can have multiple sending and receiving nodes all connected to the same, single, shared broadcast channel. The term broadcast is used here because when any one node transmits a frame, the channel broadcasts the frame and each of the other nodes receives a copy. Ethernet and wireless LANs are examples of broadcast link-layer technologies.

Switched Local Area Networks:

As Link-Layer uses MAC addresses, there is a need to translate between them. For the Internet, this is the job of the Address Resolution Protocol (ARP) [RFC 826]. Each host and router has an ARP table in its memory, which contains mappings of IP addresses to MAC addresses. The ARP table also contains a time-to-live (TTL) value, which indicates when each mapping will be deleted from the table. A typical expiration time for an entry is 20 minutes from when an entry is placed in an ARP table. ARP for Ethernet is defined in RFC 826. A nice introduction to ARP is given in the TCP/IP tutorial, RFC 1180.

Link-Layer Switches:

The role of the switch is to receive incoming link-layer frames and forward them onto outgoing links. the switch itself is transparent to the hosts and routers in the subnet; that is, a host/router addresses a frame to another host/router (rather than addressing the frame to the switch) and happily sends the frame into the LAN, unaware that a switch will be receiving the frame and forwarding it. The rate at which frames arrive at any one of the switch’s output interfaces may temporarily exceed the link capacity of that interface. To accommodate this problem, switch output interfaces have buffers, in much the same way that router output interfaces have buffers for datagrams.

  • Forwarding and Filtering: Filtering is the switch function that determines whether a frame should be forwarded to some interface or should just be dropped. Forwarding is the switch function that determines the interfaces to which a frame should be directed, and then moves the frame to those interfaces. Switch filtering and forwarding are done with a switch table. The switch table contains entries for some, but not necessarily all, of the hosts and routers on a LAN.
  • A switch has the wonderful property (particularly for the already-overworked network administrator) that its table is built automatically, dynamically, and autonomously — without any intervention from a network administrator or from a configuration protocol. In other words, switches are self-learning.
  • Switches are plug-and-play devices because they require no intervention from a network administrator or user. A network administrator wanting to install a switch need do nothing more than connect the LAN segments to the switch interfaces. The administrator need not configure the switch tables at the time of installation or when a host is removed from one of the LAN segments. Switches are also full-duplex, meaning any switch interface can send and receive at the same time.
(Packet Processing with switches and routers)

Virtual Local Area Networks (VLANs)

A switch that supports virtual local area networks (VLANs) solves the three drawbacks with the modern institutional LANs are often configured hierarchically, with each workgroup (department) having its own switched LAN connected to the switched LANs of other groups via a switch hierarchy.Such as lack of traffic isoloation, Inefficient use of switches and managing users(the physical cabling must be changed to connect the employee, moving to another group, to a different switch).

(A single switch with two configured VLANs)

Data Center Networking:

In recent years, Internet companies such as Google, Microsoft, Facebook, and Amazon have built massive data centers. Each data center has its own data center network that interconnects its hosts with each other and interconnects the data center with the Internet.

The worker bees in a data center are the hosts: They serve content (e.g., Web pages and videos), store emails and documents, and collectively perform massively distributed computations (e.g., distributed index computations for search engines). The hosts in data centers, called blades and resembling pizza boxes, are generally commodity hosts that include CPU, memory, and disk storage. The hosts are stacked in racks, with each rack typically having 20 to 40 blades. At the top of each rack there is a switch, aptly named the Top of Rack (TOR) switch, that interconnects the hosts in the rack with each other and with other switches in the data center. Specifically, each host in the rack has a network interface card that connects to its TOR switch, and each TOR switch has additional ports that can be connected to other switches.

The data center network supports two types of traffic: traffic flowing between external clients and internal hosts and traffic flowing between internal hosts. To handle flows between external clients and internal hosts, the data center network includes one or more border routers, connecting the data center network to the public Internet.

(A data center network with a hierarchical topology)

Closing Note: This blog is solely made for the simplest general introduction to the transportation layer. It has left many important pieces of the Link layer like Parity Checks, Checksumming Methods, Cyclic Redundancy Check (CRC), Channel Partitioning Protocols, Random Access Protocols, Taking-Turns Protocols, which I strongly recommend you to study for further knowledge. For my upcoming blogs of this series, please subscribe to our website Learn2Build.

--

--

Rahul Singh Sengar

Engineer @ avua | CS Undergrad | Inspired by Alan Turing😊