Introduction to Cisco Port Channel)

Source: Internet
Author: User
Tags cisco switch

Introduction to Cisco Port Channel)
Port trunking is used to bind multiple low-bandwidth ports of a vswitch to a high-bandwidth link to achieve load balancing. Avoid link congestion. Through configuration, You can bind two or four ports to forward data on specific ports to prevent packet loss when the forwarding rate of a single link is too low. Advantages of Trunking: The price is low, and the performance is close to that of Gigabit Ethernet. You do not need to reWiring or consider the limitations of gigabit network transmission distance. trunking can bind any related ports, you can also cancel the settings at any time, which provides high flexibility and load balancing capabilities and system fault tolerance.


Port channel
First, we will introduce the concept of port group: port group is a physical port group at the configuration level. Only physical ports configured in the port group can participate in link aggregation, and become a member port in the port channel. Logically, a port group is not an end port, but a port sequence. When the physical ports added to the port group meet certain conditions, port aggregation is performed to form a port channel. This port channel has the attribute of the logical port, and is truly an independent logical port. Port aggregation is a logical abstraction process that abstracts a set of port sequences with the same attributes into a logical port. A port channel is a collection of physical ports and is logically considered as a physical port. Users can use this port channel as a port, which not only increases network bandwidth, but also provides the link backup function.

The port aggregation function is usually used when a vswitch connects to a vro, host, or other vswitches.

The bandwidth of the port channel is the sum of the bandwidth of the four ports. If s1 has traffic to be transmitted to s2 through the port channel, the port channel of s1 will be based on the source mac address and destination of the traffic.
The bitwise of the mac address is used to distribute traffic. Based on the calculation result, a member port in the port channel is used to distribute the traffic. When a port in the port channel fails to be connected, the traffic originally assumed by the port will be allocated to other normal ports through the traffic distribution algorithm again. The traffic distribution algorithm is determined by the switch hardware.
To make the port channel work normally, the member ports of the port channel must have the following attributes:

  1. All ports are in full duplex mode;
  2. The port speed is the same;
  3. The port type must be the same, for example, the same Ethernet port or the same optical fiber port;
  4. The port is the same as the access port and belongs to the same vlan or the same trunk port;
  5. If the port is a trunk port, the allowed vlan and native vlan attributes should also be the same.
EtherChannel is automatically configured using the port aggregation protocol (PAgP) or link aggregation Control Protocol (LACP. PAgP is a Cisco proprietary protocol and can only run on a Cisco switch and a licensed vendor authorized switch that supports PAgP. IEEE 802.3ad defines LACP. LACP allows Cisco switches to manage Ethernet channels between switches that comply with the 802.3ad protocol.

LACPIEEE 802.3ad standard LACP (Link Aggregation Control Protocol, Link Aggregation Control Protocol) is a Protocol for Dynamic Link Aggregation. It uses the Protocol message LACPDU (Link Aggregation Control Protocol Data Unit, link aggregation control protocol data unit) and connected device interaction information.
When LACP is enabled, the port sends LACPDU to advertise its system priority, system MAC, port priority, port number, and Operation key. After receiving the report, the connected device selects the port based on the information of the other ports it stores for corresponding aggregation operations, so that both parties can exit the port or join the aggregation group to achieve consistency.
There are three aggregation modes for ports: Active mode, Passive mode, and static mode.
The active mode port initiates LACP packet negotiation. The Passive mode port only responds to the received LACP packet. The static mode does not send LACP packets for negotiation.

The member ports in the aggregation group may be in three states:
1. When the link status of the port is Down, it is impossible for the port to forward any data packets, which is displayed as "down.
2. after the Port Link is in the Up state and LACP negotiation, the port is put in the aggregation state (the port is forwarded as a member of an aggregation group to participate in the aggregation group ), displayed as "bndl" status.
3. when the Port Link is in the UP state, but the peer end does not enable LACP, or, because the port attributes are inconsistent with the master port and other factors, the packet negotiation port is put in the suspended status (the port in the suspended status does not participate in data packet forwarding ), it is displayed as "susp.

LACP negotiation process analysis:
After receiving the peer LACP message, select a system with a higher priority. At one end with a higher priority of the System ID, set the ports in the aggregation group to be in the aggregation state according to the order in which the priority of the port ID ranges from high to low. After the peer receives the updated LACP packet, it also sets the corresponding port to the aggregation status.


TRUNK Port
TRUNK (Port aggregation) is a relatively economical method to increase bandwidth between a vswitch and a network device, such as a server, router, workstation, or other vswitch. The method to increase the bandwidth is effective when the connection between a single switch and a node cannot meet the load.

The main function of TRUNK is to bind multiple physical ports (generally 2-8) to a logical channel to make it work like a channel. Bundling multiple physical links not only improves the bandwidth of the entire network, but also data can be transmitted through multiple bound physical links at the same time, which has the function of link redundancy, when one or more links are disconnected due to network faults or other causes, the remaining links can also be operated. However, in VLAN data transmission, different manufacturers use different technologies. For example, Cisco products use vlan trunk technology. Most products of other manufacturers support the 802.1q protocol with the TAG header, in this way, a small giant frame is generated and must be identified using the same port protocol. Because the size of a small giant frame exceeds the 1518-byte limit of the standard Ethernet frame, it cannot be identified by a common Nic and requires a switch to remove the TAG.

The TRUNK function is suitable for the following applications:
1. The TRUNK function is used to connect to the server and provide the server with an exclusive high bandwidth.
2. The TRUNK function is used for cascade between vswitches. It sacrifices the number of ports to provide bundled high bandwidth for data exchange between vswitches, improving network speed and breaking through network bottlenecks, this greatly improves network performance.
3. Trunk can provide load balancing capabilities and system error tolerance. As Trunk balances the traffic of each switch port and server interface in real time, once a port fails, it will automatically remove the faulty port from the Trunk group, and then re-allocate the traffic of each Trunk port, so as to realize system fault tolerance.

To set the TRUNK, you must specify a port as the Trunk, for example, 2/24. To set a port to the TRUNK mode, run the following command:
Set trunk mod/port [on | off | desirable | auto | nonegotiate] [vlan_range] [isl | dot1q dot10 | lane | negotiate].


This command can be divided into the following four parts:
Mod/port: Specifies the port on which the user wants to run Trunk;
Trunk running modes: on | off | desirable | auto | nonegotiate.

To automatically identify the Trunk over fast Ethernet and Gigabit Ethernet, you must ensure that the Trunk is in the same VTP domain. You can also use the On or Nonegotiate mode to force a Trunk On a port, regardless of whether it is in the same VTP domain. VLAN range. The default value is 1 ~ 1005, which can be modified, but must have the TRUNK protocol. When TRUNK is used, the protocol on the adjacent ports must be consistent.

In addition, you need to set the port connected to the following switch to TRUNK on the central switch, so that multiple VLANs in the following switch can communicate with the central switch through one link.


Port Channel configuration command
1. port-group command: port-group [port-group-number] [load-balance {src-mac | dst-src-mac | src-ip | dst-src -ip}]
No port-group [port-group-number] [load-balance]
Function: Create a port group and set the Traffic Sharing Mode for the group. If no traffic sharing method is specified, the default traffic sharing method is set. The no operation of this command is to delete the group or restore the default value of the group's traffic share. If you type load-balance, the default traffic share will be restored. Otherwise, the group will be deleted.
Parameter: [port-group-number] indicates the group number of the port channel, ranging from 1 ~ 16. If this group number already exists, an error is returned. Dst-mac shares traffic based on the target mac address; src-mac shares traffic based on the source mac address; dst-src-mac shares traffic based on the target mac address and source mac address; dst-ip shares traffic based on the destination ip address; src-ip shares traffic based on the source ip address; dst-src-ip shares traffic based on the destination ip address and source ip address. If you modify the traffic sharing mode and the port-group has already formed a port-channel, the modified traffic sharing method will take effect only when the next aggregation occurs.
Default: the default vswitch port does not belong to the port channel and does not start the lacp protocol.
Command mode: Global Switch configuration mode

For example, create a port group and use the default traffic sharing method.
Switch (config) # port-group 1
Delete a port group
Switch (config) # no port-group 1

2. port-group mode command: port-group [port-group-number] mode {active | passive | on}
No port-group [port-group-number]
Function: adds a physical port to the port channel. The no operation of this command is to remove the port from the port channel.
Parameter: [port-group-number] indicates the group number of the port channel, ranging from 1 ~ 16; active (0) Start port lacp protocol, and set to active mode; passive (1) Start port lacp protocol, and set to passive mode; on (2) force the port to join the port channel without starting the lacp protocol.
Command mode: Interface Configuration Mode
Default: the default vswitch port does not belong to the port channel and does not start the lacp protocol.
User Guide: if this group does not exist, the group is created first, and then the port is added to the group. All ports in a port-group must be in the same mode. The first port mode to be added to the group prevails. It is mandatory to add a port to a group in on mode. It is mandatory to indicate that the local switch port aggregation does not depend on peer information. As long as there are more than two ports in the group, if the vlan information of these ports is consistent, the ports in the group can be aggregated successfully. The lacp protocol is run when the port is added to a group in active and passive mode, but the port in the group must be added in active mode at both ends. If both ends are passive, ports will never converge.

For example, in port ethernet0/0/1 mode, add this port to port-group 1 in active mode.
Switch (config-ethernet0/0/1) # port-group 1 mode active

3. interface port-channel command: interface port-channel [port-channel-number]
Function: Enter the aggregation interface configuration mode.
Command mode: global configuration mode
Default:

User Guide: when you enter the aggregation port mode, if you configure gvrp and the spanningtree module, the aggregation port will take effect. If the aggregation port does not exist, that is to say, when the port is not aggregated, an error message is first prompted to record the user configuration operation. When the port is actually aggregated, the user can resume the Configuration action for the not-formed aggregation port. Note that the Configuration action can only be restored once, if, for some reason, the aggregation group is split and then aggregated, the user's initial configuration cannot be restored. If you configure other modules, such as shutdown and speed, the configuration takes effect for all member ports in the port-channel and serves as a group configuration.
Example: Entering port-channel1 Configuration Mode
Switch (config) # interface port-channel 1
Switch (config-if-port-channel1 )#

  1. Configuration example:
  2. Set LACP system priority to 61440 on CISCO_1, enable dynamic link aggregation protocol on ports E 0/1, E 0/2, and E 0/3, and set the LACP port priority to 61440.
  3. CISCO_1 # configure terminal
  4. CISCO_1 (config) # lacp system-priority 61440
  5. CISCO_1 (config) # interface range, Ethernet, 0/1-3
  6. CISCO_1 (config-if-range) # lacp port-priority 61440
  7. CISCO_1 (config-if-range) # channel-group 1 mode active
  8. CISCO_1 (config-if-range) # end

  9. Set LACP system priority to 4096 on cisco2, enable dynamic link aggregation protocol on ports E 0/1, E 0/2, and E 0/3, and set the LACP port priority to 4096.
  10. CISCO_2 # configure terminal
  11. Cisco2 (config) # lacp system-priority 4096
  12. Cisco2 (config) # interface range Ethernet 0/1-3
  13. Cisco2 (config-if-range) # lacp port-priority 4096
  14. Cisco2 (config-if-range) # channel-group 1 mode active
  15. Cisco2 (config-if-range) # end

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.