Home | Reports | Technical Documents | Tech-Blog | One-Shot Gallery | Korea ICT News | Korea Communication Market Data | List of Contributors | Become a Contributor |    
 
 
Section 5G 4G LTE C-RAN/Fronthaul Gigabit Internet IPTV/Video Streaming IoT SDN/NFV Wi-Fi KT SK Telecom LG U+ Network Protocol Samsung   Korean Vendors
 
CHANNELS HFRFRONTHAUL NetvisionMPTCP Springwave1588 PTP        
Switching and Routing for Dummies - Ethernet Switching
April 28, 2014 | By Chris Yoo (tech@netmanias.com)
Online viewer:
Comments (6)
18
 

In this and next posts, we will learn about L2 (Ethernet) switching and L3 (IP) routing. This post will cover:

  • ARP and IP packet
  • changes in Ethernet header during switching/routing process
  • entry changes in the tables for server, switch and router (i.e. routing, ARP and MAC tables)

 

Switching and Routing

 

 

Please take a close look at the figure above, especially server/router MAC address, IP address, and switch/router port (interface) numbers in it, as it illustrates the configuration of a network to be discussed here and in the next post.

 

As seen in the left side of the figure above, if both sender (e.g. SVR1 in the figure) and receiver (e.g. SVR2) are located in the same network (LAN), the two communicate with each other directly through the switch between them (e.g. S1) without having to go through the router (e.g. R1). At this time, each packet consists of the following fields:

 

   Header  Fields
 

 Ethernet Header

 

 * Destination MAC = m2, the MAC address of the receiver (SVR2)

 * Source MAC = m1, the MAC address of the sender (SVR1)

 

 IP Header

 

 * Destination IP = 1.1.1.20, the IP address of the receiver (SVR2)

 * Source IP = 1.1.1.10, the IP address of the sender (SVR1)

 

On the other hand, if the two are not located in the same network (LAN), they communicate through the router (R1). In this case, Ethernet header fields have different values on this and the other side of the router.

 

Sending packets from SVR1 to R1

   Header  Fields
 

 Ethernet Header

 

 * Destination MAC = a1, the MAC address of the router (R1 ge1/1)

 * Source MAC = m1, the MAC address of the sender (SVR1)

 

 IP Header

 

 * Destination IP = 2.1.1.30, the IP address of the receiver (SVR3)

 * Source IP = 1.1.1.10, the IP address of the sender (SVR1)

 

Sending packets from R1 to SVR3

   Header  Fields
 

 Ethernet Header

 

 * Destination MAC = m3, the MAC address of the receiver (SVR3)

 * Source MAC = a2, the MAC address of the router (R1 ge2/1)

 

 IP Header

 

 * Destination IP = 2.1.1.30, the IP address of the receiver (SVR3)

 * Source IP = 1.1.1.10, the IP address of the sender (SVR1)

 

 

Ethernet Switching

 

 

1. SVR1 sends ARP Request

  • SVR1 at IP address of 1.1.1.10 is trying to send a packet to SVR2 at IP address of 1.1.1.20.
  • To send a packet, a server must refer to the routing table first. Through routing table lookup, the server (e.g. SVR1 here) finds out that the destination address is located in the same network as itself (having no gateway at the routing entry 1.1.1.0/24 indicates both sender and receiver are in the same network), and that the Outgoing Interface (OIF) is lan1 (note that there is just one server port in the figure, lan1).
  • Now, SVR1 refers to its ARP table to find the MAC address of the destination IP address 1.1.1.20, but finds the table empty (having no related entry is called "ARP miss").
  • So, SVR1 sends an ARP request to port lan1 to obtain the MAC address of SVR2 (1.1.1.20). At this time, the ARP request packet consists of the following fields:
   Header  Fields
 

 Ethernet Header

 

 

 * Destination MAC = FF:FF:FF:FF:FF:FF (broadcasting: reaching all servers/routers in the same LAN)

 * Source MAC = m1, the MAC address of the sender (SVR1)

 

 ARP Header

 

 

 

 * Sender MAC = m1, the MAC address of the sender (SVR1)

 * Sender IP = 1.1.1.10, the IP address of the sender (SVR1)

 * Target MAC = 00:00:00:00:00:00 (the value that SVR1 wants to find out)
 * Target IP = 1.1.1.20, the IP address of the intended receiver (SVR2)
  • Now, this packet is received by S1 (Switch 1), and the source MAC address of the received packet (the switch does not care whether the received packet is IP or ARP) is learned. Then, the following is recorded in the MAC table at S1: {MAC address m1 is connected to fe1 port}.
  • Immediately after the source MAC is learned, S1 checks the destination MAC address of the received packet, and finds out it is broadcast-type. So, it performs flooding to all the ports except for the receiving port (or to all the ports belonging to the same VLAN if VLAN support is provided). That way, the ARP request packet is received by SVR2 and Router (R1).
  • From the target IP address of the received ARP request packet, R1 notices the address does not match any of the addresses that it has (i.e.1.1.1.1 or 2.1.1.1). So, it discards it.

 

2. SVR2 responds with ARP Reply

  • SVR2 also checks the target IP address of the received ARP request packet, and finds out the address matches its own address. So, it enters the MAC address corresponding to 1.1.1.20 in the Sender MAC field of an ARP reply packet, and sends the ARP reply packet to lan1 port. At this time, the ARP reply packet includes the following fields:
   Header  Fields
 

 Ethernet Header

 

 

 * Destination MAC = m1, the MAC address of SVR1 to which ARP reply is to be delivered

 * Source MAC = m2, the MAC address of the sender (SVR2)

 

 ARP Header

 

 

 

 * Sender MAC = m2, the MAC address of the sender (SVR2)

 * Sender IP = 1.1.1.20, the IP address of the sender (SVR2)

 * Target MAC = m1, the MAC address of the intended receiver (SVR1)
 * Target IP = 1.1.1.10, the IP address of the intended receiver (SVR1)
  • S1, upon receiving the packet, learns the source MAC and records the following in the MAC table: {MAC address m2 is connected to fe2 port}.
  • Then, it sends (unicasts) the packet to fe1 port by referring to the MAC table where m1, the destination MAC address of the received packet, is mapped to fe1.
  • Next, SVR1 records the received value (m2, the MAC address assigned for 1.1.1.20) in its ARP table.

 

3. SVR1 sends IP Packet to SVR2

  • SVR1, now ready to send an IP packet to SVR2, sends one with the following fields to lan1 port:
   Header  Fields
 

 Ethernet Header

 

 * Destination MAC = m2, the MAC address of the receiver (SVR2)

 * Source MAC = m1, the MAC address of the sender (SVR1)

 

 IP Header

 

 * Destination IP = 1.1.1.20, the IP address of the receiver (SVR2)

 * Source IP = 1.1.1.10, the IP address of the sender (SVR1)
  • Upon receiving the packet, S1 (Switch 1) attempts to learn the source MAC address, and finds out the address m1 has already been learned. So, no MAC learning is needed. now, it checks for m2, the destination MAC address, in the MAC table, and finds out it is mapped to fe2 port.
  • Accordingly, the packet is sent to fe2 port and received by SVR2.

 

Ajay Kashyap 2014-04-28 16:03:51
NEtmanias!!!! very well explained,everything is crystal clear.. waiting for next part...
learncisco.net 2014-12-31 22:45:06

NEtmanias! Another well explained post by you. As switching and routing both are the most important  when you are engaged with networks. I've learned a lot and definitely it will help me out in my final semester project.

noname 2015-05-09 23:21:06

"1. SVR1 sends ARP Request

Now, this packet is received by S1 (Switch 1), and the source MAC address of the received packet (the switch does not care whether the received packet is IP or ARP) is learned. Then, the following is recorded in the MAC table at S1: {MAC address m2 is connected to fe2 port}."

 

I think should be: {MAC address m1 is connected to fe1 port}.

Netmanias 2015-05-10 03:49:21

The typo has been fixed, thanks.

James Kang 2017-04-22 12:48:56

Very useful to teach students.

cheers,

Gita 2018-06-07 15:23:51

such a wonderful explaination.

Thank you for visiting Netmanias! Please leave your comment if you have a question or suggestion.
View All (792)
4.5G (1) 5G (81) AI (6) AR (1) ARP (3) AT&T (1) Akamai (1) Authentication (5) Big Data (2) Blockchain (3) C-RAN/Fronthaul (17) CDN (4) CPRI (4) Carrier Ethernet (3) China (1) China Mobile (2) Cisco (1) Cloud (5) CoMP (6) Connected Car (4) DHCP (5) Edge Computing (1) Ericsson (2) FTTH (6) GSLB (1) GiGAtopia (2) Gigabit Internet (19) Google (7) Google Global Cache (3) HLS (5) HSDPA (2) HTTP Adaptive Streaming (5) Handover (1) Huawei (1) IEEE 802.1 (1) IP Routing (7) IPTV (21) IoST (3) IoT (54) KT (41) Korea (19) Korea ICT Market (1) Korea ICT Service (13) Korea ICT Vendor (1) LG U+ (18) LSC (1) LTE (78) LTE-A (16) LTE-B (1) LTE-H (2) LTE-M (3) LTE-U (4) LoRa (7) MPLS (1) MPTCP (3) MWC 2015 (8) NB-IoT (6) Netflix (2) Network Protocol (20) Network Slicing (4) New Radio (9) Nokia (1) OSPF (2) OTT (3) PCRF (1) Platform (2) QoS (3) RCS (3) SD-WAN (15) SDN/NFV (66) SK Broadband (2) SK Telecom (33) Samsung (5) Security (16) Self-Driving (1) Small Cell (2) Spectrum Sharing (2) Switching (6) TAU (2) UHD (5) VR (2) Video Streaming (12) VoLTE (8) VoWiFi (2) Wi-Fi (29) YouTube (6) blockchain (1) eICIC (1) eMBMS (1) iBeacon (1) security (1) telecoin (1) uCPE (2)
Password confirmation
Please enter your registered comment password.
Password