Saturday, November 29, 2014

Packet forwarding in bridges

Before we start learning about how bridges forward the packets , we need to first understand what is "transparent bridging".

Transparent bridging: From the name we can try to imagine what would be the functionality of these type of bridges. They tend to be transparent to network -meaning their presence and operation is transparent to hosts . These bridges will learn the locations of the hosts connected by analyzing the source address of the incoming packets.

For example : if a bridge receives packet from Host A on Port 1 , it will conclude and in its data base that "Host A can be reachable via Port 1 "

Now that we have understood the basic concept of transparent bridging , let us try to use it for understanding the packet flow among bridges.


Case 1 : Single bridge multiple hosts 



Assume Bridge forwarding table is empty .

When Host A tries to send packet to Host D ,

  • It learns the source address , and adds in its forwarding table.
  • The Bridge checks for destination port based on destination address , Since it does not have any entry corresponding to Host D it forwards packets to all of the ports (except on port where packet has been received).
  • All the ports receive the packets but since it is not intended for that hosts , All the ports silently discards the packet except Host D.
  • Now , when Host D wants to send a packet to Host A , bridge would directly send on to port connected Host A as it has got entry corresponding to Host A .


Case 2 : Multiple Bridges, Multiple hosts 



As described in the above diagram , now we have two bridges Bridge 1 & Bridge 2 connected to each other and each has got three hosts connected on different ports .

  • When Host A wants to send packet to Host F , Bridge 1 will see its own forwarding table and do not find it there , Hence it forwards the packet to all of its connected ports including port 1 to which other bridge is connected . 
  • Bridge 2 receives the packet and "learns" that Host A is reachable on its port 2 ( even though there is a different bridge connected to port 2 , for bridge 2 it does not matter ! ) 
  • Bridge 2 forwards the packet to all of its ports and Host F also receives the packet .
  • Now when host F wants to send packet back to Host A  , Since Bridge 2 has already got information about Host A ( reachable on port 2 ) it just forwards the packet on to port 1 
  • Since Bridge 1 has already learnt about Host A location , it forwards the packet to port connected to Host A .
  • Once all the hosts start sending some packets  , both the bridges would have learned about the all the Hosts connected .


Looking from Bridge 1 point of view , the forwarding table would be some thing similar to below 

Similarly from Bridge 2 point of view , it looks like some thing like this 

 I have tried to put down my thoughts  about the bridge learning and how it forwards the packet in a simpler way , not to complicate things !

I shall take you to next step , which is bridging loops and how to avoid them !





No comments:

Post a Comment