Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Switching - the process of connecting subscribers through intermediate devices. In most modern networks, frame switching is performed using the Ethernet header, based on the destination MAC address and on the vlan ID. In the example in (Figure 1a), the data exchange between PC-1 and PC-2 is performed based on the MAC addresses. In this article, the terms switching and L2 data transmission technology are identical.
  • Switch - the device that performs switching.
  • Routing - the process of determining the best data transmission path between nodes belonging to different networks, according to a certain criteria. Most modern networks route packets based on the IP header (destination IP address). In the example in (Figure 1b) the data exchange between PC-1 and PC-2 is performed based on the IP addresses. In this article, the terms routing and L3 data transmission technology are identical.
  • Router - the device that performs routing.
  • Local network - the network part that is in the responsibility of the organization. The organization's employees are responsible for assigning IP addresses to the devices in this network and an IP address conflict is very unlikely.
  • Global network -  global scale network. Usually, the Internet is understood as a global network. Since many local networks are connected to the global network, the allocation of the IP addresses is performed centrally, by special organizations.

...

Let's look at the differences in the processing of the service headers when performing switching compared to routing. The example in (Figure 1) will be used for this purpose.

In the scenario when When PC-1 sends data to PC-2 (Figure 1a), PC-1 fills in the service fields in the following way:

  • Destination MAC address: the MAC address of PC-2 - MAC-2;
  • Source MAC address: the MAC address of PC-1 - MAC-1;
  • Destination IP address: the IP address of PC-2 - IP-2;
  • Source IP address: the IP address of PC-1 - IP-1.

The switch receives a the frame from PC-1 and redirects it to PC-2 in accordance with according to the switching table. Thus, The data transmission is performed based on the Ethernet service header, since the transmission is takes place at the data link level. This mechanism is called switching.

In the scenario when PC-1 sends data to PC-3 (Figure 1b), PC-1 fills in the frame service fields in the following way:

  • Destination MAC address: the router's MAC address - MAC-R2R1;
  • Source MAC address: the MAC address of PC-1 - MAC-1;
  • Destination IP address: the IP address of PC-3 - IP-3;
  • Source IP address: the IP address of PC-1 - IP-1.

The switch receives such a frame and transmits it to the router in accordance with according to the switching table. The router receives the frame, decapsulates the IP packet and transmits it to LAN-2. In this case, the service headers will be set in the following way:

  • Destination MAC address: the MAC address of PC-3 - MAC-3;
  • Source MAC address: the outer MAC address address of the router - MAC-R2;
  • Destination IP address: the IP address of PC-3 - IP-3;
  • Source IP address: the IP address of PC-1 - IP-1.

Note that the IP packet header is left unchanged, while the receiver and sender MAC addresses in the Ethernet frame header are changed. This operation was performed because the MAC addresses are used to transfer data within the same local network, i.e. when transferring data between different local networks, the MAC addresses will always be replaced. This data transfer mechanism is called routing.

...