Switching – Connecting On-Premises Networks – ANS-C01 Study Guide

Switching

Layer 2 switching forwards Ethernet frames at the data link layer, which is layer 2 of the OSI model. The switch examines the Media Access Control (MAC) address of each frame and builds a forwarding table based on the source MAC address to determine the interface where the frames are to be forwarded. All layer 2 switches require that they learn the MAC address of the NIC on each connected node to transmit data. Ethernet switches break up one large collision domain into multiple smaller ones. The layer 2 switch learns which device is connected to which port and forwards a frame based on the destination MAC address in each frame. This reduces network traffic on the LAN and increases security since the frame is not sent out all its interfaces.

The layer 2 switch is a multiport bridge where each switch port is a separate collision domain. Layer 2 switches support the Spanning Tree Protocol (STP), and its many variants, which provides loop prevention when multiple switches are interconnected, to prevent switching loops. The switch builds and updates its own internal database of the known MAC addresses connected to each port. Switches reduce the amount of Ethernet frame flooding by sending out frames only to the interface of the connected destination MAC address. Management features include support for virtual LANs (VLANs), diagnostics, and metric collections. Some switches have layer 3 router support, making them layer 2/3 devices. Switches use hardware forwarding based on ASICs for wire, speed, and low-latency performance. Figure 7.3 shows a simple layer 2 switched network.

FIGURE 7.3 Layer 2 switch

Switches increase the number of collision domains to one per interface, reducing the chances of a collision to zero.

Routing

While it is presumed that you have extensive prior knowledge of routing before taking the AWS Advanced Networking exam, we will briefly go over the basics here. A router is a network device that routes packets from one network to another. Routers are used to interconnect and forward traffic between two or more networks. Routers operate at layer 3 of the OSI model, and its forwarding decisions are based on the information present in layer 3, such as the destination IP address. Routers divide broadcast domains, provide full-duplex communication, and have traffic filtering capabilities.

When an IP packet arrives at a router’s interface, the router reads the IP destination address information in the packet to determine on which port the packet will be sent out. Routers reference their locally stored forwarding table that is derived from its routing table that maps destination networks to outgoing ports.

When two endpoints that are on different networks need to send data between each other, a router is required to forward packets between the two different subnets. Figure 7.4 shows a simple routed network with three different subnets.

FIGURE 7.4 Basic routing

In this example, Host A is sitting on the 192.168.0.0 network with the host address of 192.168.0.15 and wants to send data to Host B at 10.0.0.20 on the 10.0.0.0 subnet. Host A will recognize that the network subnets are different, and it will need to hand the packet off to its locally connected router, which knows how to reach Host B. The router will receive the packet from Host A, do a lookup in its route forwarding table, and forward the packet out the correct egress interface to reach Host B. The process reverses itself when Host B replies to Host A. Host C will not see the traffic since it is on a different network, and the router does not forward to that segment since the network address is on a different subnet.