First, the principle of exchange
1. floor of the exchange
Switching devices that operate in the data link layer of the OSI model, and the learning data frame by parsing the source MAC address MAC address table is formed, in the MAC address table entry to forward the data frame according to the MAC address. The basic process is as follows:
(1) receive the data frames of switching devices, to interfaces written to the source MAC address and receive data frames in the data frame MAC address table. If the same MAC address table entry already, the aging time of the entry is refreshed.
(2) If the destination MAC address is a broadcast address, from all other interfaces to forward the data frame; if the destination MAC address is not the broadcast address, the MAC address lookup table, a matching entry if found, from the corresponding interface to forward data frames, If no matching entry, from all other interface to forward data frames.
2. The three-tier exchange
Layer Layer 2 network switching equipment is divided by VLAN and implement Layer switching, Layer 3 IP to achieve the exchange of visits between different VLAN.
(1) If the source and destination IP in the same network segment, the source host sends an ARP request to obtain the MAC address of the destination host after receipt of the ARP response object, a data packet forwarding based on MAC address of the destination host.
(2) If the source and destination IP in different segments, to forward packets through the gateway. Sending an ARP request to obtain the MAC address corresponding to the IP gateway, after receiving the ARP response sent by the gateway, the gateway using the MAC address as the destination MAC packet transmission.
Two, VLAN
1. VLAN Introduction
VLAN is the physical LAN is divided into a plurality of logical broadcast domains in communications technology. VLAN works in the data link layer of the OSI reference model. All devices are a VLAN in the same broadcast domain, different for different VLAN broadcast domain. Isolated from each other VLAN, VLAN broadcast packets can not cross spread. Require different VLAN communicate with each other through a three-layer device. The advantage of using a VLAN:
- Confining broadcast
- Enhance LAN security
- Improve the robustness of the network
2. The interface type and link type
Link Type
VLAN link type is divided into: the trunk link and the access link
- Access link
access link can only carry data frame is a VLAN, and a switch for connecting a user terminal- Trunk link
trunk link may carry a plurality of data frames of different VLAN for inter-switch connection switches and routers interconnect Huo
Interface Type
Access interface type into the interface, Trunk Hybrid interfaces and interfaces
-
Access opening
Access interfaces are typically used to connect a user terminal. Access Interface packets as follows:
Inbound:
If Untagged Access interface receives a data frame receive the data frame and adds the default VLAN ID (PVID); if the interface receives a data frame with an Access Tag tag to the data frame the PVID and the same VLAN ID, Access interface to receive the data frame, otherwise discarding the data frame
out direction:
peel label retransmission packets PVID -
Trunk Interface
Trunk interface is generally connected to switches, routers and AP. Trunk interface packets as follows:
Inbound:
If Untagged Trunk interface receives a data frame, the data frame marked PVID tag, if allowed by the VLAN ID, then the received data frame, otherwise discarding the data frame; Trunk interface if a data frame is received Tag If allowed to flush through VLAN ID, then the received data frame, otherwise discarding the data frames
that direction:
when the same VLAN ID and the default VLAN ID, and when the interface allows VLAN ID through, removing the Tag, sending the packet; if VLAN ID different from the default VLAN ID, VLAN ID and is allowed through the interface, the Tag remains the original, sends the packet. - Hybrid Interface
Hybrid interface can then be used to connect the user terminal, the leaves can be used to connect switches and other network equipment. Hybrid Interface packets as follows:
Inbound:
If Untagged Hybrid interface receives a data frame, the data frame marked PVID tag, if allowed by the VLAN ID, then the received data frame, otherwise discarding the data frame; if the interface receives Hybrid Tag data frames If allowed to flush through VLAN ID, then the received data frame, the data frame is discarded and vice versa.
Outbound:
if the transmission data frame carries the label, the label maintain the original, whereas the release tag to transmit.
3. VLAN encapsulation
Standard IEEE 802.1Q encapsulation protocol encapsulation format
TPID: tag protocol identifier, data representing the frame type, 802.1Q encapsulated packet TPID value of 0x8100
the PRI: priority, the 802.1p priority data frame represents the range 0-7, the greater the priority value. When the network is congested, switches preferentially transmit high priority data frame
CFI: standard format indication bits, the MAC address indicates whether the transmission medium encapsulated in a standardized format, for compatibility with Ethernet and Token Ring
VID: i.e. VLAN ID, It represents the data frame the VLAN
4. VLAN communication between
Single-arm routing
Communication is achieved through a router or Layer 3 switches between different VLAN.
Cisco device configuration
verification PC1 host host ping PC2
Huawei Device Configuration
Verify PC1 host host ping PC2
Layer 3 virtual interfaces
In the three switches are three different VLAN virtual interface, respectively, to configure the IP address.
interface Vlanif10
ip address 10.1.10.254 255.255.255.0
interface Vlanif20
ip address 10.1.20.254 255.255.255.0