Implement an Ipv6 Router Using KAME Under Freebsd
Total Page:16
File Type:pdf, Size:1020Kb
在 FreeBSD 下利用 KAME 實做一個 IPv6 路由器 Implement An IPv6 Router Using KAME under FreeBSD 梁家瑋 Liang Jia-Wei 高雄師範大學資訊教育所 [email protected] KAME 計劃是日本的一些公司團隊所共同 ABSTRACT 參與的一個計劃,而這個軟件主要是提供 BSD(包括 FreeBSD、NetBSD 等)作業系統一些 With IPv4(Internet Protocol version 4) , it has 額外的功能,包括了 IPv6、IPSec 以及一些網路 been found the address space provided can’t sustain the growing number hosts connected to the 流量控制應用管理的功能。在此篇論文我們最 Internet. IPv6(Internet Protocol version 6) has 主要的目的是利用 KAME 來實作一個 Router, been designed to resolve scalability issues of the 透過這台 Router,可以使 IPv4 網路與 IPv6 網路 Internet address space. There are a lot of 串聯起來,我們只需要一台 PC 來安裝 FreeBSD advantages in using IPv6. For example, it’s not 並且應用 KAME 來達成,這對於過渡時期還沒 necessary for NAT(Network Address Transmission) 有獨立 IPv6 機器的機構來說是很有幫助的。 server , and the number of IP address is enough. In this way , it’s more convenient to deliver IP 關鍵字: IPv6, FreeBSD,轉換機制,KAME。 addresses to mobile devices , such as notebook , PDA , cell phone , etc. Nowadays , enterprises , 1. Introduction schools , people use computer network in IPv4. It is important for the IPv4/IPv6 transition Nowadays,more and more electric mechanisms.There are various translation equipments need IP address to support internet strategies can be broadly divided into dual stack , access , such as notebooks , cell phones, PDAs. tunneling and translation , and they will be IPv6 will solve the problem of IP address shortage. mentioned later. IPv6 is a new version of IP which is designed to be an evolutionary step from IPv4. It is a natural KAME Project is a joint effort to create increment to IPv4. It can be installed as a normal single solid software set, especially targeted at software upgrade in internet devices and is IPv6/IPsec.In this study, we have a pc which interoperable with the current IPv4. Its deployment installs FreeBSD and KAME and use it for IPv6 strategy is designed to not have any flag days or routing. In this way, we can connect both IPv6 and other dependencies. IPv6 is designed to run well IPv4 networks by the tunneling mechanism . on high performance networks (e.g. Gigabit Ethernet, OC-12, ATM, etc.) and at the same time Keywords: IPv6 networks, Transition still be efficient for low bandwidth networks (e.g. Mechanisms, KAME project, Tunneling wireless). In addition, it provides a platform for Mechanism, FreeBSD. new internet functionality that will be required in the near future. 摘要 IPv4 and IPv6 protocols do not interoperate, 隨著網路愈來愈發達,以及現今科技產品 and hence IPv4 applications do not work in IPv6 environment and vice versa. However, the 都具備上網的功能,我們的網路位址愈來愈不 deployment of IPv6 within the present IPv4 敷使用了,因此我們需要 IPv6 這種新一代的網 Internet will be on an incremental basis and start 路協定,IPv6 與舊有的 IPv4 規格是完全不同 from small IPv6 networks that merge into the 的,且具有相當多的優點,像是不再需要位址 global IPv6 network gradually. 分享共用的機制(NAT),且 IPv6 具有自動裝配 (Autoconfigure) 的機制,還有網路位址安全 KAME Project aims to provide FREE (IPSec)的高度支媛。IPv6 的出現並不會導致 reference implementations of IPv6, IPsec (for both IPv4 的消失,往後的網路環境將是 IPv4 和 IPv6 IPv4 and IPv6) , and advanced internetworking 共存的,如果要 IPv4 與 IPv6 的網路都能夠互 such as advanced packet queuing, ATM, mobility, and whatever interesting on BSD variants. In this 連,必須要有一些轉換機制,此篇論文會提到 study, we implement a IPv6 router that is achieve 一些 IPv6 的特性及轉換的機制。 on FreeBSD with KAME, and we will show how it works. Anycast: An identifier for a set of interfaces (typically belonging to different nodes). A packet 2. IPv6 Overview sent to an anycast address is delivered to one of the interfaces identified by that address (the "nearest" one, according to the routing protocols' measure of distance). Figure2: IPv6 Unicast addresses Multicast : An identifier for a set of interfaces (typically belonging to different nodes). Figure1: IPv6 header format A packet sent to a multicast address is delivered to all interfaces identified by that address. There are some features of IPv6 which is different from IPv4 , such as new header format , 2.3 Efficient addressing and routing expanded addressing capabilities , efficient and infrastructure hierarchical addressing and routing infrastructure , autoconfiguration , built-in security , better IPv6 is designed to create an efficient, support for Qos , mobility , and extensibility. hierarchical, and summarizable routing infrastructure based on the common occurrence of 2.1 Header Format multiple levels of ISP(Internet Service Providers). The IPv6 headers is a new format which On the IPv6 differs from IPv4 header. IPv4 headers and IPv6 Internet, backbone routers have much smaller headers are not interoperable. IPv6 has a 128-bit routing tables, corresponding to the routing address , rather than 32-bit address of IPv4. The infrastructure of global ISPs. IPv6 header is twice as large as the IPv4 header. Figure1 shows the IPv6 header format. 2.4 Autoconfiguration 2.2 Expanded Addressing Capabilities In the past, network administrator have to configure the network for each computer. IPv6 IPv6 has 128-bit source and destination IP make it easier for configuring the network. There addresses. 128 bit can express over 3.4×1038 are two ways : One is done by external server like possible combinations of addresses. Each person DHCP , and the other is done by address can own more than 10 IP address. In that way , the autoconfiguration. The plug-and-play can be problem of lack of IP address can be solved. With achieved by autoconfiguration. Using this a much larger number of available addresses, mechanism nodes on a link automatically acquire address-conservation techniques, such as the link-local addresses and communicate with each deployment of NAT, are no longer necessary. other. In the presence of a router advertising Unlike IPv4’s dotted decimal notation, IPv6 network prefixes, they can then acquire site-local addresses are denoted by colon hexadecimal and globally unicast addresses to navigate the notation.There are three types of IPv6 addresses: global IPv6 Internet. Unicast: An identifier for a single interface. 2.5 Security A packet sent to a unicast address is delivered to the interface identified by that address.There are IPsec for IPv6 is still very important. There is three types of unicast addresses : Global Unicast no authentication capability for IPv6, and using Address , Link-Local Unicast Address , Site-Local IPsec for IPv6 is necessary. KAME project Unicast Address shown by Figure2. provides pretty good IPsec stack utility for BSD operating system. 2 2.6 Qos 2.9.1 Dual Stack IPv6 have a better support for Qos. The IPv6 One technique is “Dual Stack” mechanism. header contains the traffic class which defines how This approach requires hosts and routers to traffic is handled and identified. Traffic implement both IPv4 and IPv6 protocols. Figure4 identification using a Flow Label field in the IPv6 shows the arichitecture of dual stack header allows routers to identify and provide special handling for packets belonging to a flow, a series of packets between a source and destination. Because the traffic class and the flow label are identified individually for every packet, it is ensured that data transmission won’t delay. 2.7 Mobility As the increase of cell phones , PDA , notebooks, and some some advices with mobility, we need more IP addresses for these advices. There are more advantages in using IPv6, such as following: 1. Everyone can have his own IP address, and Figure 3: Three directions of IPv6 not only one. It’s more convenient for mobile nodes transferring data. As the name suggests, dual stack mode need two protocol stacks which operate in parallel and 2. Easier network management through address thus allow the device to operate via either protocol. autoconfiguration thereby simplifying the IPv4 and IPv6 protocol survive together. Both IPv4 assignment of care-of-address for mobile nodes. and IPv6 packet types are allowed passing in the dual-stacked network.IPv4 applications use the 3. Foreigne agents are not necessary any more. IPv4 stack, and IPv6 applications use the IPv6 stack, and they work together on a project but 4. Routing Algorithms are improved to reduce doing different things. Flow decisions are based on delay by avoiding triangulated routing.We will the IP header version field for receiving, and on the show a router which is implemented in the destination address type for sending. environment of FreeBSD + KAME later. DNS check address types, and the appropriate 2.8 Extensiblility stack is chosen in response to returned DNS record The IPv6 feature allows extending for new types. Some open source operating systems, such feature by adding extension headers after the IPv6 as Linux , FreeBSD , etc , already provide dual IP header. The size of IPv6 extension header is not protocol stacks.The dual stack mode is the most fixed, and it’s only constrained by the size of the widely deployed transition mechanism. However, IPv6 packet. the dual stack mechanism only enables IPv6-IPv6 and IPv4-IPv4 communications. IPv6 packets 2.9 IPv4 / IPv6 transition mechanism aren’t allowed passing to IPv4 stack, contrariwise. When we add the mechanism of IPv6 in our 2.9.2 Tunneling exsisting network, there is an important concept that IPv4 don’t disappear. We still need some Tunneling is a approach for an IPv6 Island to application services of IPv4. Because of this, we connect other IPv6 island accros IPv4 networks. must construct a dual stack network including IPv4 From the point of view of the two nodes,this and IPv6. "virtual link", called an IPv6 tunnel, appears as a point to point link on which IPv6 acts like a Generally speaking , there are two kinds of link-layer protocol. Tunneling, from the IPv6 services , including IPv6 Dual Stack Service, perspective of transitioning , enables incompatible and IPv6 Tunneling Service, and Native Service. networks to be bridged and is typically deployed We need to integrate with these three different in a point-to-point or sequential fashion.