Skip to main content

How switches and bridges learn addresses

How switches and bridges learn addresses 
4.3.3 This page will explain how bridges and switches learn addresses and forward frames.
Bridges and switches only forward frames that need to travel from one LAN segment to another. To accomplish this task, they must learn which devices are connected to which LAN segment. 
A bridge is considered an intelligent device because it can make decisions based on MAC addresses. To do this, a bridge refers to an address table. When a bridge is turned on, broadcast messages are transmitted asking all the stations on the local segment of the network to respond. As the stations return the broadcast message, the bridge builds a table of local addresses. This process is called learning.
Bridges and switches learn in the following ways:
  • Reading the source MAC address of each received frame or datagram
  • Recording the port on which the MAC address was received
In this way, the bridge or switch learns which addresses belong to the devices connected to each port.
The learned addresses and associated port or interface are stored in the addressing table. The bridge examines the destination address of all received frames. The bridge then scans the address table searching for the destination address.
The switching table is stored using Content Addressable Memory (CAM). CAM is used in switch applications to perform the following functions:
  • To take out and process the address information from incoming data packets
  • To compare the destination address with a table of addresses stored within it
The CAM stores host MAC addresses and associated port numbers. The CAM compares the received destination MAC address against the CAM table contents. If the comparison yields a match, the port is provided, and the switch forwards the packet to the correct port and address. 
An Ethernet switch can learn the address of each device on the network by reading the source address of each frame transmitted and noting the port where the frame entered the switch. The switch then adds this information to its forwarding database. Addresses are learned dynamically. This means that as new addresses are read, they are learned and stored in CAM. When a source address is not found in CAM, it is learned and stored for future use.
Each time an address is stored, it is time stamped. This allows for addresses to be stored for a set period of time. Each time an address is referenced or found in CAM, it receives a new time stamp. Addresses that are not referenced during a set period of time are removed from the list. By removing aged or old addresses, CAM maintains an accurate and functional forwarding database.
The processes followed by the CAM are as follows:
  1. If the address is not found, the bridge forwards the frame out all ports except the port on which it was received. This process is called flooding. The address may also have been deleted by the bridge because the bridge software was recently restarted, ran short of address entries in the address table, or deleted the address because it was too old. Since the bridge does not know which port to use to forward the frame, it will send it to out all ports, except the one from which it was received. It is clearly unnecessary to send it back to the same cable segment from which it was received, since any other computer or bridges on this cable must already have received the packet.
  2. If the address is found in an address table and the address is associated with the port on which it was received, the frame is discarded. It must already have been received by the destination.
  3. If the address is found in an address table and the address is not associated with the port on which it was received, the bridge forwards the frame to the port associated with the address.
If the address is found in an address table and the address is not associated with the port on which it was received, the bridge forwards the frame to the port associated with the address.
The next page will describe the process that is used to filter frames. 

Comments

Popular posts from this blog

OSI layers / Peer-to-peer communications / TCP/IP model

OSI layers 2.3.4 This page discusses the seven layers of the OSI model. The OSI reference model is a framework that is used to understand how information travels throughout a network. The OSI reference model explains how packets travel through the various layers to another device on a network, even if the sender and destination have different types of network media. In the OSI reference model, there are seven numbered layers, each of which illustrates a particular network function. - Dividing the network into seven layers provides the following advantages: • It breaks network communication into smaller, more manageable parts. • It standardizes network components to allow multiple vendor development and support. • It allows different types of network hardware and software to communicate with each other. • It prevents changes in one layer from affecting other layers. • It divides network communication into smaller parts to make learning it easier to understand. In the foll...

Advantages and disadvantages of link-state routing

Advantages and disadvantages of link-state routing 2.1.5  This page lists the advantages and disadvantages of link-state routing protocols. The following are advantages of link-state routing protocols:  Link-state protocols use cost metrics to choose paths through the network. The cost metric reflects the capacity of the links on those paths. Link-state protocols use triggered updates and LSA floods to immediately report changes in the network topology to all routers in the network. This leads to fast convergence times. Each router has a complete and synchronized picture of the network. Therefore, it is very difficult for routing loops to occur. Routers use the latest information to make the best routing decisions. The link-state database sizes can be minimized with careful network design. This leads to smaller Dijkstra calculations and faster convergence. Every router, at the very least, maps the topology of it...

Ports for services

Ports for services 10.2.2  Services running on hosts must have a port number assigned to them so communication can occur. A remote host attempting to connect to a service expects that service to use specific transport layer protocols and ports. Some ports, which are defined in RFC 1700, are known as the well-known ports. These ports are reserved in both TCP and UDP.  These well-known ports define applications that run above the transport layer protocols. For example, a server that runs FTP will use ports 20 and 21 to forward TCP connections from clients to its FTP application. This allows the server to determine which service a client requests. TCP and UDP use port numbers to determine the correct service to which requests are forwarded. The next page will discuss ports in greater detail.