140 likes | 211 Views
Explore the basics of transparent bridges, including MAC layers, forwarding functions, and learning mechanisms in Internet Protocols. Dive into implementation details and data structures for efficient bridge operation.
E N D
Transparent Bridges Reading: Chapter 12 FSU CIS 5930 Internet Protocols
Basics of Transparent bridges • Work at Data-Link Layer • Different MAC layers can be used on different subnet (port) of a bridge • Transparent • Stations/routers need not to know the existence of a bridge • Forwarding and filtering • Only forward packet to necessary subnet FSU CIS 5930 Internet Protocols
Linux bridge LAN 1802.3 LAN 2 802.3u Station A Station B LAN 3 802.11 An example FSU CIS 5930 Internet Protocols
Forwarding function • Forwarding table • MAC address • If destination MAC is in table • Forward to the corresponding subnet ONLY • Otherwise • Flooding to all ports except the incoming port FSU CIS 5930 Internet Protocols
A A B B Station A Station B Station C LAN 1 LAN 2 LAN 3 Forwarding function (example 1) FSU CIS 5930 Internet Protocols
LAN 1 LAN 2 LAN 3 A C Station A Station B Station C Forwarding (example 2) FSU CIS 5930 Internet Protocols
LAN 1 LAN 2 LAN 3 A A A E E E Station A Station B Station C Forwarding (example 3) FSU CIS 5930 Internet Protocols
Learning Function • How the forwarding table is populated • Static configuration • Self-learning • Backward learning • Learning the address of someone when he is talking • MAC address, no hierarchical structure • Time stamp to delete “old” entries FSU CIS 5930 Internet Protocols
Implementation • Architecture • Data structures • Forwarding function • Learning new MAC address FSU CIS 5930 Internet Protocols
Higher layers dev.c br_fdb.c, br_if.c, br_stp.c, br_stp_bpdu, ... br_ioctl.c netif_rx SpanningTree Protocol ForwardingDataBase br_ioctl br_input.c Bridge Configuraion br_handle_stp_pdu br_pass_frame_up br_send_tcn_bpdu(..) br_send_config_bpdu(..) br_fdb_get(..) br_forward.c br_handle_frame br_forward br_flood dev.c dev.c dev_queue_xmit net_rx_action Architecture of Bridge Implementation FSU CIS 5930 Internet Protocols
bridge_list net_bridge net_bridge next lock port_list net_bridge_fdb_entry net_bridge_fdb_entry 0 dev next_hash statistics pprev_hash 1 hash_lock use_counter 2 hash[BR_HASH_SIZE] addr Spanning Tree ... ... dst timer1 aging_timer forward_delay_timer is_local hold_timer is_static message_age_timer BR_HASH-SIZE -1 net_bridge_fdb_entry net_bridge_fdb_entry next_hash pprev_hash use_counter net_bridge_port addr net_bridge_port next dst net_bridge aging_timer net_device is_local port_no is_static Spanning Tree ... forward_delay_timer hold_timer message_age_timer Data structures FSU CIS 5930 Internet Protocols
Bridge forwarding function • net_rx_action() when soft IRQ is handled • For a bridge, it calls br_handle_frame_hook(), which points to br_handle_frame() • Check if the packet needs to be forwarded • By br_fdb_get() • If so, br_forward() • Learning the position of the source by br_fdb_put() • If the packet is for ourselves, br_pass_frame_up() FSU CIS 5930 Internet Protocols
Forwarding fuctions • br_handle_frame() • br_forward() • br_flood() • br_pass_frame_up() • br_fdb_get() FSU CIS 5930 Internet Protocols
Learning MAC addresses • br_fdb_insert() • br_mac_hash() • br_fdb_cleanup() • gc_timer • gc_interval FSU CIS 5930 Internet Protocols