45
Cisco Public 1 © 2013 Cisco and/or its affiliates. All rights reserved. Run your next CGN on a $20 OpenWRT Andrew Yourtchenko @ayourtch

Run your next CGN on a $20 OpenWRT

  • Upload
    adsila

  • View
    65

  • Download
    0

Embed Size (px)

DESCRIPTION

Run your next CGN on a $20 OpenWRT. Andrew Yourtchenko @ ayourtch. What is this talk about ?. There’re plenty of interesting technologies emerging Let’s pick MAP: a sustainable life-support for IPv4 Not all of them are on the shelves yet - PowerPoint PPT Presentation

Citation preview

Page 1: Run your next CGN  on a $20  OpenWRT

Cisco Public 1© 2013 Cisco and/or its affiliates. All rights reserved.

Run your next CGN on a $20 OpenWRTAndrew Yourtchenko

@ayourtch

Page 2: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 2

What is this talk about ?• There’re plenty of interesting technologies emerging

Let’s pick MAP: a sustainable life-support for IPv4

• Not all of them are on the shelves yetThere are some CPE vendors working on it, but I want one *now*

• Practical steps to make your own CPE for experimental purposes

Page 3: Run your next CGN  on a $20  OpenWRT

Cisco Public 3© 2013 Cisco and/or its affiliates. All rights reserved.

Post-IPv4 SP technologies

Page 4: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 4

WARNING: IPv6-only ahead !• Requires IPv6 in production

• “post-IPv4”: IPv4 as a service

Page 5: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 5

Dual Stack Lite (DS-Lite)

Subscribers Providers Internet

IPv6

IPv6

IPv6

IPv4

Private IPv4

Private IPv4

IPv6

Private IPv4

IPv6

IPv4 in IPv6 Tunnel

IPv4 in IPv6 Tunnel

IPv6

IPv6

IPv6-only AFTR

Page 6: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 6

Subscribers Providers Internet

IPv6

IPv6

IPv6

IPv4

Private IPv4

Private IPv4

IPv6

Private IPv4

IPv6

IPv4 in IPv6 Tunnel

IPv4 in IPv6 Tunnel

IPv6

IPv6

IPv6-only AFTR

“Lightweight 4 over 6” (also “Public 4over6”)

Page 7: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 7

10 000s hostroutes per BNG

100s IGP prefixes

10s BGP prefixes

1 000 000s of subscribers

:

DS-Lite/LW46/Public 4over6 –Per-subscriber tunnels

1 000 000s of DS-Lite or LW46 Tunnel endpoints

AFTR

Page 8: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 8

1 000 000s of subscribers

:10s of MAP Rules and no CGN

10 000s hostroutes per BNG

100s IGP prefixes

10s BGP prefixes

MAP Exploits Aggregation in IPv6 Routing

Page 9: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 9

Subscribers Providers Internet

IPv6

IPv6

IPv6

IPv4

Private IPv4

Private IPv4

IPv6

Private IPv4

IPv6

IPv4 i IPv6 Tunnel

IPv6

IPv6

IPv6-only

Mapping Address + Port (MAP)

Page 10: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 10

Stateless Address Sharing With MAP• A public IPv4 address: (32 – MAP IPv4 prefix len) = p bits

• PSID: Port Set ID: q bits

• p + q = DHCPv6-PD (user) pref.len. – MAP Rule IPv6 pref. len

Page 11: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 11

IPv6 Delegated Prefix (e.g., /56)

IPv4 Address Port

Interface IDSubnet-ID

64 (fixed) “EA Bits”

56-42 = 14

01010101 111000

/56

2001:0DB8:00 /42

Mapping Domain Prefix

Size = 42 bits (provisioned)

0 42

> 0 XXXX

12

6

0 6 16

10-6 = 4

130.67.1 /24

IPv4 Prefix

24 bits (provisioned)

0 24

+01010101 111000

IPv4 Suffix

32-24 = 8 14-8 = 6

Port Set ID32

26=64 port setsper IPv4 Address

Ports 0-1023 skipped, each CPE gets 216/26 - 24 = 1008 ports

For this Example…

+

One IPv4 /24 serves 2(6+8) ≈ 16,384 (vs.≈256) subscribers

Stateless Address Sharing: Example

Page 12: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 12

http://6lab.cisco.com/map

Page 13: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 13

IPv4

IPv6

Transport

Link

IPv4

Transport

Link

IPv4

Transport

Link

IPv6

Transport

Link

ORIPv4

Native IPv6 InfrastructureCE BR

MAP MAP

MAP-E MAP-T

Encapsulation or Translation – Boils down to 20 bytes

Page 14: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 14

Standardizing MAP in the IETF

• MAP-E will be a Standards Track RFChttp://tools.ietf.org/html/draft-ietf-softwire-map-07

• MAP-T, 4rd, etc. will be Experimental or Informational

http://tools.ietf.org/html/draft-ietf-softwire-map-t-01

• LW46/Pubilc4over6 can be viewed as “special cases” of MAP

• Goal: One unified standard for CPE vendors• Stretch Goal: One unified standard for BR/AFTR

vendors

Page 15: Run your next CGN  on a $20  OpenWRT

Cisco Public 15© 2013 Cisco and/or its affiliates. All rights reserved.

Running code

Page 16: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 16

MAP testing by NIC.br• “The working applications had no need of a special configuration

to work.”

• Most of the applications work OK

• FTP active mode does not work. (But, it’s 2013…)

• More info:http://tools.ietf.org/html/draft-cordeiro-experience-mapt-testing-00

Page 17: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 17

IPv6 MAP Testing at Multi-Vendor Interoperability Test Event 2013

European Advanced Networking Test Center

Page 18: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 18

Mapping of Address and Port (MAP)IPv6 TestsStateless counterpart to

DS-LiteDesigned to be used without

Carrier-Grade NATCisco ASR1000, ASR9000 and

Cernet (CPE) participated

Successfully tested:Mapping of Address and Port

with Encapsulation (MAP-E)Mapping of Address and Port

using Translation (MAP-T)

Page 19: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 19

MAP on ASR 9K• MAP does not route traffic through the ISM

Blade, yielding line rate performance. • Using A9K-24x10G line cards = 240 Gbps per slot!• 7 x 240 = 1.68 Tbps on a 9010 chassis.

• DS-Lite routes traffic through the ISM Blade• 14Gbps per slot

Page 20: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 20

CPE code: http://github.com/cernet/MAP

Page 21: Run your next CGN  on a $20  OpenWRT

Cisco Public 21© 2013 Cisco and/or its affiliates. All rights reserved.

DIY CPE: How To

Page 22: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 22

“E” or “T” ?

http://tools.ietf.org/html/draft-ietf-softwire-mapStandards TrackRunning code on ASR9k

http://tools.ietf.org/html/draft-ietf-softwire-map-tExperimental TrackRunning code on ASR9k, ASR1k

My deciding factor: the size of the box. Also, I like NATs. “T”.

Page 23: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 23

Your own CPE: OpenWRT• Great platform support

• Well documented

• Open Source

Page 24: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 24

My own CPE: the hardware (TP-Link)• X86 VM

The cheapest

• TL-WR703NThe smallest

• TL-MR3020Feels more polished

• TL-WR1043NDPoC platform of choice

• TL-WDR4300The luxury CPE.

Page 25: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 25

Getting your build environment• Ubuntu 12.04 Server install with all-defaults

• In a VM => easy to rollback

sudo apt-get updatesudo apt-get upgrade

sudo apt-get install build-essential subversion git-core libncurses5-dev sudo apt-get install zlib1g-dev gawk flex quilt libssl-dev unzipsudo apt-get install xsltproc libxml-parser-perl

Page 26: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 26

Check out the trunk: “bleeding edge”

git clone git://git.openwrt.org/openwrt.git

Page 27: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 27

Update and add all the packages

cd openwrt./scripts/feeds update -a./scripts/feeds install -a

Page 28: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 28

Configure your CPE a la carte!

make menuconfig

Page 29: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 29

Run “make”: Take a break!

make

Page 30: Run your next CGN  on a $20  OpenWRT

Cisco Public 30© 2013 Cisco and/or its affiliates. All rights reserved.

But, what about MAP ?

Page 31: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 31

Several packages exist• ASAMAP (kernel patches)

http://enog.jp/~masakazu/vyatta/map/

• CERNET MAP (kernel module)https://github.com/cernet/MAP

Page 32: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 32

CERNET MAP manual provisioning• ivictl -s -i br-lan -I wan0 -H -a 192.168.1.1/24 -A 1.1.1.1/32 -P

2001:6f8:147e:1000::/52 -R 16 -z 4 -o 14 -c 1234 -T

• ivictl -r -d -P 2610:d0:1208:cafe::/64 –T

(does it look complicated to you too ?)

Page 33: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 33

There’s got to be a better way!• IETF draft - draft-ietf-softwire-map-dhcp-03• A new “MAP” DHCPv6 option

Rule optionDMR optionMAP Port Parameters

• *static* value, the same across the entire MAP domain

• Let’s do some coding!

Page 34: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 34

Odhcp6c custom scripting• Starts /etc/odhcp6c.user on addressing changes

• Preset environment variablesAllocated prefixesDHCPv6 options requested

Page 35: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 35

First implementation in shell• ~1 day to write

• Works

• Problem: way too slow

• Need a rewrite!

Page 36: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 36

Let’s do it in C• https://github.com/ayourtch/mdpc

Page 37: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 37

DHCPv6 interaction

odhcp6c odhcp6c.user

mdpc

ivictl

Not in standard image

Page 38: Run your next CGN  on a $20  OpenWRT

Cisco Public 38© 2013 Cisco and/or its affiliates. All rights reserved.

Adding your stuff todefault image

Page 39: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 39

Packages and feeds• Package

An OpenWRT-specific abstractionDescribes

- building process- name and place in the “menuconfig” menu- dependencies to enable

Very flexible retrieval mechanism (git, tarball, http, etc.)

• FeedA collection of packagesSimple way to add functionalityOnly one-line edit needed for the source!

Page 40: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 40

Openwrt-map: experimental feed• https://github.com/ayourtch/openwrt-map

• Adds “CERNET MAP” package

• Adds “MDPC” package

• Tested on “Barrier Breaker” (trunk in October 2013)

Page 41: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 41

MAP-T example demo configuration

IPv6

IPv6

IPv4Private IPv4

IPv6

Private IPv4

IPv6IPv6

IPv6-only

nat64 map-t domain 1 default-mapping-rule 2610:D0:1208:CAFE::/64 basic-mapping-rule ipv6-prefix 2001:6F8:147E:1000::/52 ipv4-prefix 153.16.17.83/32 port-parameters share-ratio 16

2001:6F8:147E:1F00::/56DHCPv6 MAP option(*)

DHCPv6

Page 42: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 42

How to construct the DHCPv6 option ?

https://github.com/ayourtch/mdpc/blob/master/html/provision-03.html

Page 43: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 43

End result: DHCPv6-provisioned MAP CPE

DIY demo: http://tinyurl.com/map-cpe

(links to http://www.youtube.com/watch?v=UQUK5nnqilA)

Page 44: Run your next CGN  on a $20  OpenWRT

© 2013 Cisco and/or its affiliates. All rights reserved. Cisco Public 44

Summary

• NATs are good! MAPs are good!• There’s a MAP CPE ready for your experiments today

My home office connects through a MAP-T CPE and CSR1000V BRAsk your CPE supplier for the production-grade code

• This model is replicable for other technologies

• Allows to evaluate the new tech w/o waiting for the vendorsThe code they ship can contain lessons from early iterations

Page 45: Run your next CGN  on a $20  OpenWRT

Thank you.