Saturday, February 22, 2020

PPP Multilink Link Fragmentation and Interleaving

PPP Multilink lets us bundle multiple physical interfaces into a single logical interface. We can use this to load balance on layer 2 instead of layer 3. Take a look at the following picture so I can give you an example:
two serial lines and routers
Above we have two routers connected to each other with two serial links. If we want to use load balancing we could do this on layer 3, just configure a subnet on each serial link and activate both links in a routing protocol like EIGRP or OSPF.
When we use PPP multilink we can bundle the two serial links into one logical layer 3 interface and we’ll do load balancing on layer 2. PPP multilink will break the outgoing packets into smaller pieces, puts a sequence number on them and sends them out the serial interfaces. Another feature of PPP multilink is fragmentation. This could be useful when you are sending VoIP between the two routers.
Most voice codecs require a maximum delay of 10 ms between the different VoIP packets. Let’s say the serial link offers 128 Kbit of bandwidth…how long would it take to send a voice packet that is about 60 bytes?
60 bytes * 8 = 480 bits / 128.000 = 0.00375.
So it takes roughly 3.7 ms to send the voice packet which is far below the required 10 ms. We can run into issues however when we also send data packets over this link. Let’s say we have a 1500 bytes data packet that we want to send over this link:
1500 bytes * 8 = 12.000 / 128.000 = 0.093.
So it will take about 93 ms to send this packet over this 128 Kbit link. Imagine we are sending this data packet and a voice packet arrives at the router, it will have to wait for at least 93 ms before the data packet is out of the way…exceeding our 10 ms maximum delay.
Multilink PPP offers a solution by fragmenting the data packets and interleaving the voice packets between the data fragments. This way a large data packet will not delay a voice packet for too long.
Anyway now you have an idea what multilink PPP is about, let me show you how to configure it. I will use the following topology:
two routers serial
I am using two routers with only a single serial link between them. Even though it’s called multilink PPP you can still configure it on only one link. This is how we configure it:
R1(config)#interface virtual-template 1
R1(config-if)#bandwidth 128
R1(config-if)#ip address 192.168.12.1 255.255.255.0     
R1(config-if)#fair-queue 
R1(config-if)#ppp multilink fragment delay 10
R1(config-if)#ppp multilink interleave
R2(config)#interface virtual-template 1
R2(config-if)#bandwidth 128
R2(config-if)#ip address 192.168.12.2 255.255.255.0     
R2(config-if)#fair-queue 
R2(config-if)#ppp multilink fragment delay 10
R2(config-if)#ppp multilink interleave
We will use a virtual-template to configure the IP addresses and to configure PPP multilink. The ppp multilink fragment delay commands lets us configure the maximum delay. In my example I’ve set it to 10 ms. Don’t forget to use ppp multilink interleave or interleaving won’t work. I’m using WFQ to prioritize voice traffic before data traffic using the fair-queue command. Interleaving will occur between WFQ and the FIFO queue and has 2 queues, a normal and priority queue. non-fragmented traffic goes to the priority queue and fragmented traffic will use the normal queue. Now let’s link the virtual template to PPP multilink:
R1(config)#multilink virtual-template 1
R2(config)#multilink virtual-template 1
And last but not least, configure the interfaces to use PPP multilink:
R1(config)#interface serial 0/0
R1(config-if)#bandwidth 128
R1(config-if)#encapsulation ppp
R1(config-if)#ppp multilink 
R2(config)#interface serial 0/0
R2(config-if)#bandwidth 128
R2(config-if)#encapsulation ppp
R2(config-if)#ppp multilink 
Just make sure you enable PPP encapsulation and PPP multilink on the interfaces and you are done. Now let’s see if it’s working or not:
R1#show ppp multilink 

Virtual-Access2
  Bundle name: R2
  Remote Endpoint Discriminator: [1] R2
  Local Endpoint Discriminator: [1] R1
  Bundle up for 00:00:25, total bandwidth 128, load 1/255
  Receive buffer limit 12192 bytes, frag timeout 1000 ms
  Interleaving enabled
    0/0 fragments/bytes in reassembly list
    0 lost fragments, 0 reordered
    0/0 discarded fragments/bytes, 0 lost received
    0x2 received sequence, 0x2 sent sequence
  Member links: 1 (max not set, min not set)
    Se0/0, since 00:00:25, 160 weight, 152 frag size
No inactive multilink interfaces
R1#show interfaces virtual-access 2
Virtual-Access2 is up, line protocol is up 
  Hardware is Virtual Access interface
  Internet address is 192.168.12.1/24
  MTU 1500 bytes, BW 128 Kbit/sec, DLY 100000 usec, 
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Open, multilink Open
  Open: IPCP
  MLP Bundle vaccess, cloned from Virtual-Template1
  Vaccess status 0x40, loopback not set
  Keepalive set (10 sec)
  DTR is pulsed for 5 seconds on reset
  Last input 00:01:05, output never, output hang never
  Last clearing of "show interface" counters 00:01:05
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops) 
     Conversations  0/1/32 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 96 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     2 packets input, 28 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     2 packets output, 40 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
Above you can see that PPP multilink is enabled and that we are using interleaving.
hostname R1
!
ip cef
!
multilink virtual-template 1
!
interface Serial0/0
 bandwidth 128
 ip address 192.168.12.1 255.255.255.0
 encapsulation ppp
 no fair-queue
 ppp multilink
!
interface Virtual-Template1
 bandwidth 128
 ip address 192.168.12.1 255.255.255.0
 fair-queue
 ppp multilink interleave
 ppp multilink fragment delay 10
!
end
hostname R2
!
ip cef
!
multilink virtual-template 1
!
interface Serial0/0
 bandwidth 128
 ip address 192.168.12.2 255.255.255.0
 encapsulation ppp
 no fair-queue
 ppp multilink
!
interface Virtual-Template1
 bandwidth 128
 ip address 192.168.12.2 255.255.255.0
 fair-queue
 ppp multilink interleave
 ppp multilink fragment delay 10
!
end

If you have any questions or comments let me know!

No comments:

Post a Comment