Short Notes: Network Devices and Protocols

Networking devices and related protocols

Krishanu Konar

6 minute read

Networking Devices

Hub

  • Contains multiple ports; When a packet arrives at one port, it’s sent to all the other ports.
  • Acts as a common connection point for devices in a network.
  • Non Intelligent device working on physical layer; Transmission units are signals/bits.

Switch

  • Intelligent device working at the data link layer (and sometimes the network layer).
  • Transmission units are frame/packet.
  • Contains multiple ports; it is the device that filters and forwards packets between LAN segments.

Router

  • Router is connected to at least two networks, commonly two LANs, WANs or a LAN and its ISP.
  • Generally located at gateways, routes traffic from one network to another.
  • Using headers and forwarding tables, router determines the best path to forward the packets.
  • In addition, router uses protocols such as ICMP (Internet Control Message Protocol) to communicate with each other and configures the best route between any two hosts.
  • Intelligent device working at the network layer; Transmission units is packet.

Dynamic Trunking Protocol (DTP)

The Dynamic Trunking Protocol (DTP) is a proprietary networking protocol developed by Cisco Systems for the purpose of negotiating trunking on a link between two VLAN-aware switches, and for negotiating the type of trunking encapsulation to be used. It works on Layer 2 of the OSI model.

Port Modes

  • Access — Puts the Ethernet port into permanent nontrunking mode and negotiates to convert the link into a nontrunk link. The Ethernet port becomes a nontrunk port even if the neighboring port does not agree to the change.
  • Trunk — Puts the Ethernet port into permanent trunking mode and negotiates to convert the link into a trunk link. The port becomes a trunk port even if the neighboring port does not agree to the change.
  • Dynamic Auto — Makes the Ethernet port willing to convert the link to a trunk link. The port becomes a trunk port if the neighboring port is set to trunk or dynamic desirable mode. This is the default mode for some switchports.
  • Dynamic Desirable — Makes the port actively attempt to convert the link to a trunk link. The port becomes a trunk port if the neighboring Ethernet port is set to trunk, dynamic desirable or dynamic auto mode.
  • No-negotiate — Disables DTP. The port will not send out DTP frames or be affected by any incoming DTP frames.

Spanning Tree Protocol

STP (Spanning Tree Protocol) automatically removes layer 2 switching loops by shutting down the redundant links. A redundant link is usually created for backup purposes.

  • It actively monitors all links of the network.
  • The STA algorithm first creates a topology database then it finds and disables the redundant links. Once redundant links are disabled, only the STP-chosen links remain active.
  • If a new link is added or an existing link is removed, the STP re-runs the STA algorithm and re-adjusts all links to reflect the change.

Root Bridge

  • A Root Bridge is the starting point of the STP network topology.

  • To elect a Root Bridge, STP uses two parameters ;bridge priority and the MAC addresses of participating switches.

  • A switch that has the lowest bridge priority value, is elected as the root bridge.

  • If the bridge priority value is the same in all switches, the switch which has the lowest MAC address is elected as the Root Bridge.

  • The selection process of the Root Bridge happens each time when a network change occurs

  • If other switches of the network do not receive BPDUs from the Root Bridge within 20 seconds, they assume that the Root Bridge has failed. If the current Root Bridge fails, remaining switches automatically start the election process to choose a new Root Bridge again.

  • Except the Root Bridge, all remaining switches of the network are considered as the Non-Root Bridges. Non-Root Bridges receive updates from the Root Bridge and update their STP databases relatively.

  • Path cost is an accumulated value of the port costs from the Root Bridge to other switches in the network.

  • It is always calculated from the Root Bridge. Default path cost at the Root Bridge is 0. BPDU contains the path cost information.

  • When the Root Bridge advertises BPDU out from its interfaces, it sets the path cost to 0. The switch which receives this BPDU increments the path cost by adding the port cost value of the port on which the BPDU arrived. The next switch which is connected with this switch follows the same rule.

Ports

  • Root Port: The port that directly connects to the Root Bridge, or has the shortest path to the Root Bridge. The shortest path is the path that has the lowest path cost value.
  • Designated Port: A port that has the lowest port cost value to get on a given network, compared to other ports on that segment. STP marks the designated ports as the forwarding ports. Forwarding ports are used to forward the frames.
  • Non-Designated Ports: A port that has the higher port cost than the designated port. STP marks the non-designated port as the blocking port. Blocking ports are used to remove loops.

STP port states

  • All ports on a STP running switch, go through the four different states; blocking, listening, learning, and forwarding.
  • STP Blocking state: In this state, the switch only listens and processes the BPDUs. Except the BPDUs, it drops all other frames.
    • From the incoming BPDUs, it learns the network topology and determines the ports which will work as the root ports, as the designated ports, and as the blocked ports.
    • All ports remain in this state for twenty seconds. After twenty seconds, only the root port and designated ports move into the next state. Remaining ports stay in this state.
  • STP Listening state: In this state, ports still listen and process only BPDUs. All other frames except BPDUs are dropped. The switch double checks the layer 2 topology to make sure that no loops occur in the network before processing the data frames. Ports remain in this state for fifteen seconds.
  • STP Learning state: Only the root port and designated ports enter into the learning state from the listening state. In this state, ports still listen and process BPDUs. However, in this state, ports start processing user frames. Switch examines the source address of user frames and updates its CAM table but it does not forward any user frame to the destination port. Ports stay in this state for fifteen seconds.
  • STP Forwarding state: In this state, the switch listens and processes both BPDUs and user frames. It uses BPDUs to monitor the network topology. By reading the source address field of users’ frames it also builds and updates CAM table entries. This state is also referred as the convergence.

Sources:

comments powered by Disqus