• Save
Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch

  • 247 views
Uploaded on

Download a PDF file: http://www.netmanias.com/en/?m=view&id=blog&no=6348 ...

Download a PDF file: http://www.netmanias.com/en/?m=view&id=blog&no=6348
You can also find and download more materials from http://www.netmanias.com

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
247
On Slideshare
198
From Embeds
49
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 49

http://www.netmanias.com 49

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 1 NETMANIAS TECH-BLOG Please visit www.netmanias.com to view more posts Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch July 11, 2014 | By Netmanias (tech@netmanias.com) The previous post was about IP routing by router. This and next posts are about Ethernet switching (L2 bridging) and IP routing (IP forwarding) by L3 switch. Before we start, please take a look at the following terms:  IP Router: Delivers packets based on their destination IP addresses, and generally has not only Ethernet, but also various interface (port) types like SONET/SDH (POS), ATM, Serial, etc. Commonly known as L3 device (L3 = IP).  Ethernet Switch: Delivers Ethernet packets based on their destination MAC addresses, and has only one type of port, Ethernet. Commonly known as L2 device (L2 = Ethernet).  L3 Switch: Performs (1) IP forwarding (delivering packets based on destination IP address) or (2) Ethernet switching (delivering based on destination MAC address) according to the destination address (destination MAC address) of a received Ethernet packet. It has only one type of port, Ethernet. Commonly known as L2/L3 device or multi-layer switch (L2 = Ethernet, L3 = IP).  To simply put it, an L3 switch is a combination of an Ethernet switch and IP router.  Juniper's M/T and EX series are a series of IP routers and L3 switches, respectively. Network Topology Below is a network topology, similar to the one in the previous post, but with different configurations.  SVR1, SVR2 and SVR3 are connected to R1 through ge1/1, ge1/2 and ge2/1 ports, respectively. In R1's perspective, ge1/1, ge1/2 and ge2/1 ports belong to VLAN 10 (same bridge domain), and this VLAN has been assigned an IP address of 1.1.1.1/24 and MAC address of a1.  SVR4, SVR5 and SVR6 are connected to R1 through ge1/3, ge2/2 and ge2/3 ports, respectively. In R1's perspective, ge1/3, ge2/2 and ge2/3 ports belong to VLAN 20, and this VLAN 20 has been assigned an IP address of 2.1.1.1/24 and MAC address of a2.  So, SVR1 and SVR3, in the same VLAN, communicate with each other through Ethernet switching, whereas SVR1 and SVR4, in different VLANs, communicate through IP routing.  Cisco calls this type of interface (i.e. one port/interface supporting both switching and routing at the same time) a Switch Virtual Interface (SVI), and Juniper calls it a Routed VLAN Interface (RVI).
  • 2. Netmanias Tech-Blog: Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch 2 In the L3 switch shown in the figure above, we can see VLAN and MAC tables - which were not shown in the router illustration presented in the previous post - in both the control module and line card. These tables are used for Ethernet switching between ports within the same VLAN. 1. Ethernet Switching 1.1 Delivering a Packet from SVR1 to SVR3 - Unknown MAC (Flooding) IP: 2.1.1.30 MAC: m4 IP: 1.1.1.20 MAC: m3 IP: 1.1.1.10 MAC: m1 SVR1 SVR3 SVR4 100.1.1/24 200.1.1/24 ge3/2 ge3/1 .2.2 .1.1 30.1.1.0/3020.1.1.0/30 MAC: b2 MAC: b3 R2 R3 MAC: a3 MAC: a4 R1 VLAN ID: 10 IP: 1.1.1.1/24 MAC: a1 VLAN ID: 20 IP: 2.1.1.1/24 MAC: a2 ge1/1 ge2/1 ge1/3 ge1/2 ge2/3 ge2/2 SVR2 SVR5 SVR6 Switching Fabric Switch Module ge1/4 ge1/3 ge1/2 ge1/1 Ingress Packet Buffer Line Card #1 ARP Table R1: Control Module RIB Table OSPF Process LSDB (Link-State Data Base) SVR1 MAC Table Egress Packet Buffer ARP Table MAC Table VLAN Table FIB Table Packet Processor (Ingress Lookup/Egress Scheduling) VLAN Table SVR4 SVR2 ge2/4 ge2/3 ge2/2 ge2/1 SVR3 SVR5 SVR6Egress Packet Buffer Line Card #2 Ingress Packet Buffer ARP Table MAC Table VLAN Table FIB Table Packet Processor (Ingress Lookup/Egress Scheduling)
  • 3. Netmanias Tech-Blog: Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch 3 ① SVR1 needs to send a packet to the destination network 1.1.1.30 (the packet is assumed to be pinged). ② SVR1, through routing table lookup, finds out the destination address 1.1.1.30 is located in the network that SVR1 (1.1.1.10) belongs to. ③ SVR1, now through ARP table lookup, knows the MAC address of destination address 1.1.1.30 is m3 (For easier explanation, we assume there is a matching entry in the ARP table). ④ SVR1 sends a packet containing the followings to the destination address 1.1.1.30: OIFDestination Network Next Hop Control Module (CM): RIB IP Addr MAC Addr CM: ARP Table VLAN10 VLAN20 ge3/1 ge3/2 ge3/1 ge3/2 1.1.1.0/24 2.1.1.0/24 20.1.1.0/30 30.1.1.0/30 100.1.1.0/24 200.1.1.0/24 - - - - 20.1.1.1 30.1.1.1 OIFDestination Network Next Hop Line Card (LC) #1 & #2: FIB VLAN10 VLAN20 ge3/1 ge3/2 ge3/1 ge3/2 1.1.1.0/24 2.1.1.0/24 20.1.1.0/30 30.1.1.0/30 100.1.1.0/24 200.1.1.0/24 - - - - 20.1.1.1 30.1.1.1 Switching Fabric Switch Module ge1/4 ge1/3 ge1/2 ge1/1 Ingress Packet Buffer Line Card (LC) #1 ARP Table R1: Control Module (CM) RIB Table OSPF Process LSDB (Link-State Data Base) SVR1 MAC Table Egress Packet Buffer ARP Table MAC Table VLAN Table FIB Table Packet Processor (Ingress Lookup/Egress Scheduling) VLAN Table SVR4 SVR2 ge2/4 ge2/3 ge2/2 ge2/1 SVR3 SVR5 SVR6Egress Packet Buffer Line Card (LC) #2 Ingress Packet Buffer ARP Table MAC Table VLAN Table FIB Table Packet Processor (Ingress Lookup/Egress Scheduling) IP: 2.1.1.40 MAC: m4 IP: 1.1.1.30 MAC: m3 IP: 1.1.1.10 MAC: m1 SVR1 SVR3 SVR4 100.1.1/24 200.1.1/24 ge3/2 ge3/1 .2.2 .1.1 30.1.1.0/3020.1.1.0/30 MAC: b2 MAC: b3 R2 R3 MAC: a3 MAC: a4 R1 ge1/3 ge2/3 ge2/2 SVR2 SVR5 SVR6 ge1/1 ge1/2 ge2/1 OIF lan1 lan1 Destination Network 1.1.1.0/24 0.0.0.0/0 - 1.1.1.1 Gateway SVR1: Routing Table IP Address MAC Address SVR1: ARP Table 15 15 VLAN MAC Addr CM: MAC Table Port 10 m1 ge1/1 VLAN Member Port CM: VLAN Table 10 20 ge1/1, ge1/2, ge2/1 ge1/3, ge2/2, ge2/3 IP Addr MAC Addr LC #1: ARP Table IP Addr MAC Addr LC #2: ARP Table VLAN Member Port LC #1: VLAN Table 10 20 ge1/1, ge1/2, ge2/1 ge1/3, ge2/2, ge2/3 VLAN Member Port LC #2: VLAN Table 10 20 ge1/1, ge1/2, ge2/1 ge1/3, ge2/2, ge2/3 VLAN MAC Addr LC #1: MAC Table Port VLAN MAC Addr LC #2: MAC Table Port VLAN MAC Addr LC #1: MAC Table Port 10 m1 ge1/1 VLAN MAC Addr LC #2: MAC Table Port 10 m1 ge1/1 1.1.1.30 m3 m3 m1 1.1.1.30 1.1.1.10 4 VLAN ID: 10 IP: 1.1.1.1/24 MAC: a1 VLAN ID: 20 IP: 2.1.1.1/24 MAC: a2 Application in SVR1 sends IP Packet destined to 1.1.1.30 1 ARP Lookup to find MAC address of Destination IP 1.1.1.30 à MAC is m3 3 Send IP Packet (Destination IP=1.1.1.30) 4 Destination IP 1.1.1.30 is matched to 1.1.1.0/24 2 Send IP Packet to ge 1/2 15 Send(Flooding) Packet to Line Card #1 & #2 14 Check Source MAC6 Source MAC Learning Event (VLAN=10, Source MAC=m1, Port=ge1/1) 7 Lookup VLAN Table13 Store Packet in Ingress Buffer 5 Destination MAC Lookup12 Source MAC Learning8 Enter MAC entry into MAC Table in Line Card(s) 10 Send IP Packet to ge2/1 15 VLAN Table Lookup Result: ge1/1, ge1/2, ge2/1 13 Check Source MAC Result: No Source MAC=m1 entry 6 Destination MAC Lookup Result: No Destination MAC=m3 entry 12 Insert Source MAC10 Insert Source MAC10 VLAN MAC Addr CM: MAC Table Port 10 m1 ge1/1 Source MAC Learning8 Lookup VLAN Table9 VLAN Table Lookup Result: ge1/1, ge1/2, ge2/1 9 Check Destination MAC à Bridging 11
  • 4. Netmanias Tech-Blog: Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch 4 [Ethernet Header] Destination MAC address = m3 (SVR3's MAC address), Source MAC address = m1 (SVR1's MAC address) [IP Header] Destination IP address = 1.1.1.30 (SVR3's IP address), Source IP address = 1.1.1.10 (SVR1's IP address) ⑤ The line card #1 in R1 that received the packet through ge1/1 port momentarily keeps the packet in the ingress packet buffer. Source MAC Learning ⑥ Now it's time to learn the source MAC address of the received packet. The packet processor in the line card #1 checks its MAC table to see if there is an entry that matches m1, the source MAC address of the received packet. In this example, there is no matching entry. ⑦ So, the packet processor informs the control module about the source MAC learning event (VLAN=10, Source MAC=m1, Port=ge1/1). ⑧ The control module then records the following in its MAC table: m1, the source MAC address, is connected to ge1/1 port, which belongs to VLAN 10 (source MAC learning) ⑨ The control module needs to forward the learned MAC address to line cards. But, as noted earlier, the learned MAC address is not needed by all the line cards, but shared by only those with the same VLAN. So, the control module checks the VLAN table. Now it finds out that ge1/1, ge1/2 and ge2/1 belong to VLAN 10, and that the line cards #1 and #2 support the VLAN. Entries in the VLAN table are created when VLAN values are assigned to each port through CLI. ⑩ The control module sends the MAC information (VLAN=10, Source MAC=m1, Port=ge1/1) to the line cards #1 and #2 so that the same is saved in their MAC tables (allowing for source MAC learning). IP Routing or Ethernet Switching ⑪ Next, the control module checks the destination MAC address of the received packet to decide whether to perform IP routing (delivering through FIB lookup) or Ethernet switching (delivering through MAC table lookup).  If the destination MAC address is a1, the MAC address of L3 switch R1, then IP routing is performed  If not, Ethernet switching is performed. In this example, Ethernet switching is performed because the destination MAC address is m3. Ethernet Switching based on Destination MAC ⑫ Now it's time to perform Ethernet switching (packet delivery). So the packet processor at the line card #1 checks its MAC table to see if there is an entry that matches the destination MAC address of the received packet, m3. In this example, there is no matching entry. ⑬ In case of Ethernet switching, if there is no matching entry (destination MAC address) in the MAC table, received packets are flooded to all the ports - except for the one where the packets were received - in the same VLAN. So, the packet processor refers to the VLAN table, and knows it should flood the packet to ge1/2 and ge2/1, but not to ge1/1. ⑭ The packet processor in the line card #1 moves the packet kept in the ingress packet buffer to the egress packet buffer to forward it to ge1/2 port, which also is in the same line card. Then, it forwards the packet to the egress packet buffer in the line card #2 through the switching fabric in order to send the packet to ge2/1, which is in a different line card. ⑮ The packet is now flooded to ge1/2 and ge2/1, either immediately or a bit later according to the QoS policy, and then received by SVR2 and SVR3.
  • 5. Netmanias Tech-Blog: Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch 5 1.2 Delivering a Packet from SVR3 to SVR1 - Known MAC (Unicasting) ① Upon receiving the packet, SVR2 discards it because the destination MAC address, m3, does not match its own. However, SVR3 forwards the packet to the destination address 1.1.1.10 as a response to Ping (again, we assume that SVR3 knew that the MAC address of SVR1 was m1). At this time, the packet consists of the following values: OIFDestination Network Next Hop Control Module (CM): RIB IP Addr MAC Addr CM: ARP Table VLAN10 VLAN20 ge3/1 ge3/2 ge3/1 ge3/2 1.1.1.0/24 2.1.1.0/24 20.1.1.0/30 30.1.1.0/30 100.1.1.0/24 200.1.1.0/24 - - - - 20.1.1.1 30.1.1.1 OIFDestination Network Next Hop Line Card (LC) #1 & #2: FIB VLAN10 VLAN20 ge3/1 ge3/2 ge3/1 ge3/2 1.1.1.0/24 2.1.1.0/24 20.1.1.0/30 30.1.1.0/30 100.1.1.0/24 200.1.1.0/24 - - - - 20.1.1.1 30.1.1.1 Switching Fabric Switch Module ge1/4 ge1/3 ge1/2 Ingress Packet Buffer Line Card (LC) #1 ARP Table R1: Control Module (CM) RIB Table OSPF Process LSDB (Link-State Data Base) SVR1 MAC Table Egress Packet Buffer ARP Table MAC Table VLAN Table FIB Table Packet Processor (Ingress Lookup/Egress Scheduling) VLAN Table SVR4 SVR2 ge2/4 ge2/3 ge2/2 ge2/1 SVR3 SVR5 SVR6Egress Packet Buffer Line Card (LC) #2 Ingress Packet Buffer ARP Table MAC Table VLAN Table FIB Table Packet Processor (Ingress Lookup/Egress Scheduling) IP: 2.1.1.40 MAC: m4 IP: 1.1.1.30 MAC: m3 IP: 1.1.1.10 MAC: m1 SVR1 SVR3 SVR4 100.1.1/24 200.1.1/24 ge3/2 ge3/1 .2.2 .1.1 30.1.1.0/3020.1.1.0/30 MAC: b2 MAC: b3 R2 R3 MAC: a3 MAC: a4 R1 ge1/3 ge2/3 ge2/2 SVR2 SVR5 SVR6 ge1/1 ge1/2 ge2/1 VLAN MAC Addr CM: MAC Table Port 10 m1 ge1/1 VLAN Member Port CM: VLAN Table 10 20 ge1/1, ge1/2, ge2/1 ge1/3, ge2/2, ge2/3 IP Addr MAC Addr LC #1: ARP Table IP Addr MAC Addr LC #2: ARP Table VLAN Member Port LC #1: VLAN Table 10 20 ge1/1, ge1/2, ge2/1 ge1/3, ge2/2, ge2/3 VLAN Member Port LC #2: VLAN Table 10 20 ge1/1, ge1/2, ge2/1 ge1/3, ge2/2, ge2/3 VLAN MAC Addr LC #1: MAC Table Port VLAN MAC Addr LC #2: MAC Table Port VLAN MAC Addr LC #1: MAC Table Port 10 10 m1 m3 ge1/1 ge2/1 VLAN MAC Addr LC #2: MAC Table Port 10 10 m1 m3 ge1/1 ge2/1 m1 m3 1.1.1.10 1.1.1.30 1 10 m1 ge1/1 10 m1 ge1/1 ge1/1 OIF lan1 lan1 Destination Network 1.1.1.0/24 0.0.0.0/0 - 1.1.1.1 Gateway SVR3: Routing Table IP Address MAC Address SVR3: ARP Table 1.1.1.10 m1 11 VLAN ID: 10 IP: 1.1.1.1/24 MAC: a1 VLAN ID: 20 IP: 2.1.1.1/24 MAC: a2 Send IP Packet (Destination IP=1.1.1.10) 1 Send IP Packet to ge1/111 Send(Unicasting) Packet to Line Card #1 10 Enter MAC entry into MAC Table in Line Card(s) 7 Check Destination MAC à Bridging 8 Source MAC Learning Event (VLAN=10, Source MAC=m3, Port=ge2/1) 4 Store Packet to Ingress Buffer 2 Source MAC Learning5 Lookup VLAN Table6 Check Source MAC3 Destination MAC Lookup9 VLAN Table Lookup Result: ge1/1, ge1/2, ge2/1 6 Insert Source MAC7 Insert Source MAC7 VLAN MAC Addr CM: MAC Table Port 10 10 m1 m3 ge1/1 ge2/1 Source MAC Learning5 Destination MAC Lookup Result: MAC=m1 is on ge1/1 9 Check Source MAC Result: No Source MAC=m3 entry3
  • 6. Netmanias Tech-Blog: Switching and Routing - Part 3. L2 (Ethernet) Switching by L3 Switch 6 [Ethernet Header] Destination MAC address = m1 (SVR1's MAC address), Source MAC address = m3 (SVR3's MAC address) [IP Header] Destination IP address = 1.1.1.10 (SVR1's IP address), Source IP address = 1.1.1.30 (SVR3's IP address) ② The packet processor at the line card #2 keeps the received packet in the ingress packet buffer for a while. ③ It checks the source MAC address of the packet, and finds out it has no matching entry in its MAC table. ④ So, it informs the control module about the "source MAC learning" event. ⑤ Based on the received event, the control module records the values (VLAN=10, Source MAC=m3, Port=ge2/1) in its MAC table. ⑥ It refers to the VLAN table, and finds out to which line cards the MAC information should be forwarded. ⑦ Then, it forwards the MAC information to the line cards #1 and #2 so that the same can be copied into their MAC tables. ⑧ The packet processor notices the destination MAC address is not a1, the MAC address of L3 switch R1. So, Ethernet switching should be performed. ⑨ Now, the packet processor checks its MAC table to see if there is an entry that matches m1, the destination MAC address of the received packet, and finds one. In the MAC table, m1 is mapped to ge1/1. ⑩ Accordingly, the packet processor sends the packet to the line card #1 through the switching fabric. Then, the packet processor in the line card #1 keeps it in the egress packet buffer. ⑪ The packet is now forwarded to ge1/1 (i.e. unicasted as it is sent to a single matching port in the MAC table), immediately or after a while according to the QoS policy, and then received by SVR1. This is how SVR1 and SVR3 communicate with each other through Ethernet switching by L3 switch. In the next post, we will discuss IP forwarding by L3 switch, i.e. packet delivery from SVR1 to SVR4 in the figure above.
  • 7. About NMC Consulting Group (www.netmanias.com) NMC Consulting Group is an advanced and professional network consulting company, specializing in IP network areas (e.g., FTTH, Metro Ethernet and IP/MPLS), service areas (e.g., IPTV, IMS and CDN), and wireless network areas (e.g., Mobile WiMAX, LTE and Wi-Fi) since 2002. Copyright © 2002-2014 NMC Consulting Group. All rights reserved. 7 Carrier WiFi Data Center Migration Wireline Network LTE Mobile Network Mobile WiMAX Carrier Ethernet FTTH Data Center Policy Control/PCRF IPTV/TPS Metro Ethernet MPLS IP Routing 99 00 01 02 03 04 05 06 07 08 09 10 11 12 13 eMBMS/Mobile IPTV Services CDN/Mobile CDN Transparent Caching BSS/OSS Cable TPS Voice/Video Quality IMS LTE Backaul Netmanias Research and Consulting Scope Visit http://www.netmanias.com to view and download more technical documents. Future LTE IP/MPLS CarrierEthernet Networks Consulting POC Training Wi-Fi Infrastructure Services CDN Transparent Caching IMS Concept Design DRM eMBMS protocols Analyze trends, technologies and market Analysis Report Technical documents Blog One-Shot gallery We design the future We design the future We design the future