Contents

7  HDLC Configuration

7.1  HDLC Overview

7.2  Default Configuration

7.3  Configuring HDLC

7.3.1  Configuring HDLC Encapsulation for an Interface

7.3.2  Configuring the Interface IP Address

7.3.3  Configuring the Polling Interval

7.3.4  Checking the Configuration

7.4  Configuration Examples

7.4.1  Example for Configuring Basic HDLC Functions

7.4.2  Example for Configuring HDLC with a Borrowed IP Address

7  HDLC Configuration

The High-level Data Link Control (HDLC) is a bit-oriented link-layer protocol and features transparent transmission of any type of bit flow.

7.1  HDLC Overview

HDLC is a common protocol used at the data link layer of the Open System Interconnection (OSI) model. A data packet is encapsulated in an HDLC frame by adding a trailer and a header.

HDLC has the following features:

  • Supports only point-to-point (P2P) links but not point-to-multipoint (P2MP) links.
  • Not supporting IP address negotiation or authentication.
  • Uses keepalive packets to detect the link status. The polling interval is configurable to specify the interval for sending keepalive packets.
  • Can be encapsulated only on synchronous links. On a synchronous/asynchronous serial interface, HDLC can be used only when the synchronous/asynchronous serial interface works in synchronous mode.
NOTE:
The following interfaces support HDLC:
  • Synchronous/asynchronous serial interfaces that work in synchronous mode. The interface name is Serial.

  • Interfaces formed by CE1/PRI and CT1/PRI interfaces. The interface name is Serial and the interface logic is the same as that of synchronous serial interfaces.

  • Interfaces formed by E1-F and T1-F interfaces. The interface name is Serial and the interface logic is the same as that of synchronous serial interfaces.

  • Interfaces formed by E1/T1 interfaces that are channelized from CPOS interfaces. The interface name is Serial and the interface logic is the same as that of synchronous serial interfaces.

  • POS interfaces.

7.2  Default Configuration

This topic describes the default value of the common HDLC parameter.

Table 7-1  Default HDLC configuration

Parameter

Default Value

Polling interval

10 seconds

7.3  Configuring HDLC

This topic describes how to configure HDLC encapsulation for an interface, the interface IP address, and the polling interval.

Pre-configuration Tasks

Before configuring basic HDLC functions, complete the following tasks:

  • Powering on the device and ensuring a successful self-check

7.3.1  Configuring HDLC Encapsulation for an Interface

Procedure

  1. Run:
    system-view

    The system view is displayed.

  2. Run:
    interface interface-type interface-number

    The interface view is displayed.

  3. Run:
    link-protocol hdlc

    The link-layer protocol is set to HDLC.

7.3.2  Configuring the Interface IP Address

Context

Configure the interface IP address in either of the following methods:

  • Manually set an IP address.
  • Borrow an IP address from another interface.

To save IP address resources, you can borrow an IP address from another interface on the same device.

When a borrowed IP address is configured, you can configure a routing protocol to ensure that the local device can learn the route to the peer device. During the configuration, pay attention to the following points:

  • If a dynamic routing protocol is used, a device searches for a route according to the longest match principle. Ensure that the mask length of the learned route is longer than the mask length of the IP address that the local device will borrow.

  • If a static routing protocol is used and the IP address that the local device will borrow has a 32-bit mask, the mask length of the static route must be shorter than the mask length of the IP address.

  • If a static routing protocol is used and the IP address that the local device will borrow has a mask of less than 32 bits, the mask length of the static route must be longer than the mask length of the IP address.

NOTE:

If a borrowed IP address is configured for a interface that encapsulates HDLC, the local device must learn the network route to the peer device. Otherwise, packets sent by the local device cannot reach the peer device.

Procedure

  1. Run:
    system-view

    The system view is displayed.

  2. Run:
    interface interface-type interface-number

    The interface view is displayed.

  3. Configure or borrow an IP address.
    • Run:

      ip address ip-address { mask | mask-length }

      The IP address is configured for the interface.

    • Run:

      ip address unnumbered interface interface-type interface-number

      The IP address is borrowed for the interface.

7.3.3  Configuring the Polling Interval

Context

CAUTION:

Ensure that the polling interval is configured the same on both devices. Otherwise, the link-layer protocol cannot be Up.

HDLC uses keepalive packets to check the link status. You can set the polling interval to specify the interval for sending keepalive packets.

If the network delay is too long or the congestion is severe, you can increase the polling interval to prevent network flapping. Pay attention to the following points:

  • If the polling interval is too long, the link check will be slow.
  • If the polling interval is too short, device load will increase and more network bandwidth will be occupied.

Procedure

  1. Run:
    system-view

    The system view is displayed.

  2. Run:
    interface pos interface-number

    The POS interface view is displayed.

  3. Run:
    timer hold seconds

    The polling interval is configured.

    By default, the polling interval is 10s.

7.3.4  Checking the Configuration

Procedure

  • Run the display interface [ interface-type [ interface-number ] ] command to check the status, link layer protocol, and configuration of the interface.
  • Run the display hdlc error { statistics | packet packet-number } [ interface interface-type interface-number ] command to check the statistics or details about error packets received by HDLC.
  • Run the display hdlc statistics [ interface interface-type interface-number ] command to check the packet statistics on the HDLC interface.

7.4  Configuration Examples

This example shows how to configure HDLC to connect devices on a typical network.

7.4.1  Example for Configuring Basic HDLC Functions

Networking Requirements

RouterA and RouterB are connected through Serial interfaces whose link-layer protocol is HDLC.

Figure 7-1  Networking diagram of basic HDLC functions

Configuration Roadmap

The configuration roadmap is as follows:

  1. Set the router link-layer protocol to HDLC.

  2. Set an IP address for each interface.

NOTE:

The IP addresses of RouterA and RouterB must be in the same network segment, otherwise, the link layer cannot be Up.

Procedure

  1. Configure RouterA.
    <Huawei> system-view
    [Huawei] sysname RouterA
    [RouterA] interface serial 1/0/0
    [RouterA-Serial1/0/0] link-protocol hdlc
    [RouterA-Serial1/0/0] ip address 100.1.1.1 24
    [RouterA-Serial1/0/0] quit
  2. Configure RouterB.
    <Huawei> system-view
    [Huawei] sysname RouterB
    [RouterB] interface serial 1/0/0
    [RouterB-Serial1/0/0] link-protocol hdlc
    [RouterB-Serial1/0/0] ip address 100.1.1.2 24
    [RouterB-Serial1/0/0] quit
  3. Verify the configuration.

    Run the display interface serial 1/0/0 command on RouterA to check the interface configuration. The command output shows that both the physical layer status and link layer status of the interface are Up. In addition, RouterA and RouterB can ping each other.

    [RouterA] display interface serial 1/0/0
    Serial1/0/0 current state : UP                                                  
    Line protocol current state : UP                                                
    Last line protocol up time : 2011-11-15 15:01:46                                
    Description:HUAWEI, AR Series, Serial1/0/0 Interface                            
    Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)             
    Internet Address is 100.1.1.1/24                                          
    Link layer protocol is nonstandard HDLC                                         
    Last physical up time   : 2011-11-15 15:01:46                                   
    Last physical down time : 2011-11-15 15:01:46                                   
    Current system time: 2011-11-15 15:02:56                                        
    Physical layer is synchronous, Baudrate is 64000 bps                            
    Interface is DCE, Cable type is V35, Clock mode is DCECLK                       
    Last 300 seconds input rate 4 bytes/sec 32 bits/sec 0 packets/sec               
    Last 300 seconds output rate 17 bytes/sec 136 bits/sec 0 packets/sec            
    Input: 89089 packets, 1341532 bytes                                             
      Broadcast:              0,  Multicast:              0                         
      Errors:                 0,  Runts:                  0                         
      Giants:                 0,  CRC:                    0                         
                                                                                    
      Alignments:             0,  Overruns:               0                         
      Dribbles:               0,  Aborts:                 0                         
      No Buffers:             0,  Frame Error:            0                         
                                                                                    
    Output: 173822 packets, 5639896 bytes                                           
      Total Error:            0,  Overruns:               0                         
      Collisions:             0,  Deferred:               0                         
                                                                                    
    DCD=UP DTR=UP DSR=UP RTS=UP CTS=UP                                              
                                                                                    
        Input bandwidth utilization  : 1.17%                                        
        Output bandwidth utilization : 0.16%      

Configuration Files

  • Configuration file of RouterA

    #
     sysname RouterA
    #
    interface Serial1/0/0
     link-protocol hdlc
     ip address 100.1.1.1 255.255.255.0
    #
    return
  • Configuration file of RouterB

    #
     sysname RouterB
    #
    interface Serial1/0/0
     link-protocol hdlc
     ip address 100.1.1.2 255.255.255.0
    #
    return

7.4.2  Example for Configuring HDLC with a Borrowed IP Address

Networking Requirements

RouterA and RouterB are connected through Serial interfaces whose link-layer protocol is HDLC.

Borrow the local loopback interface IP address for the Serial1/0/0 interface on RouterA. The loopback interface has a 32-bit mask.

Figure 7-2  Networking diagram of HDLC with a borrowed IP address

Configuration Roadmap

The configuration roadmap is as follows:

  1. Set the link-layer protocol of the router interface to HDLC.

  2. Set the loopback1 interface IP address on RouterA.

  3. Borrow the IP address of the Serial1/0/0 interface on RouterA.

  4. Configure a static route for RouterA to learn the route to the peer device.

  5. Set the IP address of the Serial1/0/0 interface on RouterB.

NOTE:

The IP addresses of the loopback interface and the Serial1/0/0 interface on RouterB must be in the same network segment, otherwise, the link layer cannot be Up.

Procedure

  1. Configure RouterA.
    <Huawei> system-view
    [Huawei] sysname RouterA
    [RouterA] interface loopback 1
    [RouterA-LoopBack1] ip address 100.1.1.1 32
    [RouterA-LoopBack1] quit
    [RouterA] interface serial 1/0/0
    [RouterA-Serial1/0/0] link-protocol hdlc
    [RouterA-Serial1/0/0] ip address unnumbered interface loopback 1
    [RouterA-Serial1/0/0] quit
  2. Configure RouterB.
    <Huawei> system-view
    [Huawei] sysname RouterB
    [RouterB] interface serial 1/0/0
    [RouterB-Serial1/0/0] link-protocol hdlc
    [RouterB-Serial1/0/0] ip address 100.1.1.2 24
    [RouterB-Serial1/0/0] quit
  3. Set a static route on RouterA.
    [RouterA] ip route-static 100.1.1.0 24 serial 1/0/0
  4. Verify the configuration.

    Run the display interface serial 1/0/0 command on RouterA to check the interface configuration. The command output shows that both the physical layer status and link layer status of the interface are Up. In addition, RouterA and RouterB can ping each other.

    [RouterA] display interface serial 1/0/0
    Serial1/0/0 current state : UP                                                  
    Line protocol current state : UP                                                
    Last line protocol up time : 2011-12-03 15:00:00                                
    Description:HUAWEI, AR Series, Serial1/0/0 Interface                            
    Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)             
    Internet Address is unnumbered, using address of LoopBack0(100.1.1.1/32)  
    Link layer protocol is nonstandard HDLC                                         
    Last physical up time   : 2011-12-03 15:00:00                                   
    Last physical down time : 2011-12-03 15:00:00                                   
    Current system time: 2011-12-03 15:29:02                                        
    Physical layer is synchronous, Virtualbaudrate is 64000 bps                     
    Interface is DTE, Cable type is V35, Clock mode is TC                           
    Last 300 seconds input rate 17 bytes/sec 136 bits/sec 0 packets/sec             
    Last 300 seconds output rate 3 bytes/sec 24 bits/sec 0 packets/sec              
    Input: 60724 packets, 1783780 bytes                                             
      broadcasts:            0,  multicasts:            0                           
      errors:                0,  runts:                 0,  giants:                0
      CRC:                   0,  align errors:          0,  overruns:              0
      dribbles:              0,  aborts:                0,  no buffers:            0
      frame errors:          0                                                      
    Output: 28481 packets, 393624 bytes                                             
      errors:                0,  underruns:             0,  collisions:            0
      deferred:              0                                                      
    DCD=UP DTR=UP DSR=UP RTS=UP CTS=UP                                              
                                                                                    
        Input bandwidth utilization  : 0.84%                                        
        Output bandwidth utilization : 0.65%   

Configuration Files

  • Configuration file of RouterA

    #
     sysname RouterA
    #
    interface Serial1/0/0
     link-protocol hdlc
     ip address unnumbered interface LoopBack1
    #
    interface LoopBack1
     ip address 100.1.1.1 255.255.255.255
    #
     ip route-static 100.1.1.0 255.255.255.0 Serial1/0/0
    #
    return
  • Configuration file of RouterB

    #
     sysname RouterB
    #
    interface Serial1/0/0
     link-protocol hdlc
     ip address 100.1.1.2 255.255.255.0
    #
    return