Skip navigation.

Illidan's Castle of Runes

Posts tagged with "internetwork engineering"

An IPv6 Tunnel Experiment on Dynagen

,



Sec.1 Dynagen Configuration


autostart = False
ghostios = true
 
[localhost]
    port = 7200
    udp = 10000
    workingdir = ../workingdir/
     
    [[router R1]]
        image = ../ios/unzip-c3640-js-mz.124-10.bin
        model = 3640
        console = 3001
        ram = 80
        confreg = 0x2102
        exec_area = 64
        mmap = true
        slot0 = NM-1FE-TX
        f0/0 = R2 f0/0
     
    [[router R2]]
        image = ../ios/unzip-c3640-js-mz.124-10.bin
        model = 3640
        console = 3002
        ram = 80
        confreg = 0x2102
        exec_area = 64
        mmap = true
        slot0 = NM-1FE-TX
        slot1 = NM-4T
        s1/0 = R3 s1/0
     
    [[router R3]]
        image = ../ios/unzip-c3640-js-mz.124-10.bin
        model = 3640
        console = 3003
        ram = 80
        confreg = 0x2102
        exec_area = 64
        mmap = true
        slot1 = NM-4T
        s1/1 = R4 s1/0
     
    [[router R4]]
        image = ../ios/unzip-c3640-js-mz.124-10.bin
        model = 3640
        console = 3004
        ram = 80
        confreg = 0x2102
        exec_area = 64
        mmap = true
        slot0 = NM-1FE-TX
        slot1 = NM-4T
    f0/0 = R5 f0/0
     
    [[router R5]]
        image = ../ios/unzip-c3640-js-mz.124-10.bin
        model = 3640
        console = 3005
        ram = 80
        confreg = 0x2102
        exec_area = 64
        mmap = true
        slot0 = NM-1FE-TX 



Sec.2 Router Configurations

Only commands that need typing in are presented.
hostname R1
ipv6 unicast-routing
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2000:1:1:1:1:1:1:1112/112
 ipv6 rip 6bone enable
ipv6 router rip 6bone

hostname R2
interface Tunnel0
 no ip address
 ipv6 address 3000::1/112
 ipv6 rip 6bone enable
 tunnel destination 192.34.1.4
 tunnel mode ipv6ip

interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2000:1:1:1:1:1:1:1111/112
 ipv6 rip 6bone enable

!
interface Serial1/0
 ip address 192.23.1.2 255.255.255.0
ipv6 router rip 6bone
router ospf 1
 log-adjacency-changes
 network 192.23.1.0 0.0.0.255 area 0
ipv6 router rip 6bone



Sec.3 Running

R1#sh ipv6 route
IPv6 Routing Table - 6 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
C 2000:1:1:1:1:1:1:0/112 [0/0]
via ::, FastEthernet0/0
L 2000:1:1:1:1:1:1:1112/128 [0/0]
via ::, FastEthernet0/0
R 3000::/112 [120/2]
via FE80::CE01:1AFF:FE72:0, FastEthernet0/0
R 4000:1:1:1:1:1:1:0/112 [120/3]
via FE80::CE01:1AFF:FE72:0, FastEthernet0/0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0


R1#ping 4000:1:1:1:1:1:1:1112

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4000:1:1:1:1:1:1:1112, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/168/328 ms

Setup Dynamips/Dynagen Router Emulation Environment on Ubuntu Linux

,

1. Download Dynamips and Dynagen
2.
mkdir dynamips
mv dynamips-0.2.5-x86.bin /opt/dynamips
mv dynagen-0.9.0.tar.gz /opt/dynamips
cd /opt/dynamips; tar zxvf dynagen-0.9.0.tar.gz ; ln -s dynagen-0.9.0 dynagen

In following text, if full path is not specified, /opt/dynamips is the start point.
3. Set up environment variables
Add the following lines into ~/.bash_profile
export PATH=$PATH:/opt/dynamips:/opt/dynamips/dynagen

4.(optional) Configure dynagen
Since my X setting is a bit messed I cannot use xterm because of "X locale not supported" and "Cannot open input method". As a result I have to find an alternative.
sudo apt-get install rxvt

Edit dynagen/dynagen.ini, jump to the following lines:
# Uncomment below for Linux
telnet = xterm -T %d -e telnet %h %p > /dev/null 2>&1 &

Modify the second line to:
 telnet =rxvt -T %d -e telnet %h %p > /dev/null 2>&1 &

5. Dowload an IOS image. Below is a possible site:
http://www.cublog.cn/u/17982/showart.php?id=221235
mkdir ios
mv unzip-c7200-is-mz.122-37.bin ios


6. Configure a dynagen topology.
mkdir labini; cd labini
touch ccnp_mini.net


Edit the text file ccnp_mini.net, add following contents (make usre to give image attribute a valid path):
autostart = False



[localhost]

    port = 7200

    udp = 10000

    

    [[router R1]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3001

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        slot2 = PA-A1

        f0/0 = SW1 1

        s1/1 = R2 s1/0

        s1/2 = FR1 1

        a2/0 = AT1 1

    

    [[router R2]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3002

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        f0/0 = SW1 2

        s1/1 = R3 s1/0

        s1/2 = FR1 2

    

    [[router R3]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3003

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        f0/0 = SW1 3

        s1/1 = R4 s1/0

        s1/2 = FR1 3

    

    [[router R4]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3004

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        f0/0 = SW1 4

        s1/1 = R5 s1/0

        s1/2 = FR1 4

    

    [[router R5]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3005

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        f0/0 = SW1 5

        s1/1 = R6 s1/0

        s1/2 = FR1 5

    

    [[router R6]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3006

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        f0/0 = SW1 6

        s1/1 = R7 s1/0

        s1/2 = FR1 6

    

    [[router R7]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3007

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        f0/0 = SW1 7

        s1/1 = R8 s1/0

        s1/2 = FR1 7

    

    [[router R8]]

        image = ../ios/unzip-c7200-is-mz.122-37.bin

        model = 7200

        console = 3008

        npe = npe-400

        ram = 60

        confreg = 0x2102

        exec_area = 64

        mmap = False

        slot0 = PA-C7200-IO-FE

        slot1 = PA-4T

        slot2 = PA-A1

        f0/0 = SW1 8

        s1/2 = FR1 8

        a2/0 = AT1 2

    

    [[ATMSW AT1]]

        1:1:100 = 2:2:200

    

    [[ethsw SW1]]

        1 = dot1q 1

        2 = dot1q 1

        3 = dot1q 1

        4 = dot1q 1

        5 = dot1q 1

        6 = dot1q 1

        7 = dot1q 1

        8 = dot1q 1

    

    [[FRSW FR1]]

        1:102 = 2:201

        1:103 = 3:301

        1:104 = 4:401

        1:105 = 5:501

        1:106 = 6:601

        1:107 = 7:701

        1:108 = 8:801

        2:203 = 3:302

        2:204 = 4:402

        2:205 = 5:502

        2:206 = 6:602

        2:207 = 7:702

        2:208 = 8:802

        3:304 = 4:403

        3:305 = 5:503

        3:306 = 6:603

        3:307 = 7:703

        3:308 = 8:803

        4:405 = 5:504

        4:406 = 6:604

        4:407 = 7:704

        4:408 = 8:804

        5:506 = 6:605

        5:507 = 7:705

        5:508 = 8:805

        6:607 = 7:706

        6:608 = 8:806

        7:708 = 8:807



Below is the topology depicted in the following figure:


7. Run an emulation.
In a gnome-terminal tab, execute
dynamips -H 7200

In another tab, execute
dynagen /opt/dynamips/labini/ccnp_mini.net

The output in the console may be like:
Reading configuration file...


Network successfully started

Dynagen management console for Dynamips

=>


8. Continue running
=> list
Name       Type       State      Server          Console
R1         7200       stopped    localhost:7200  3001
R2         7200       stopped    localhost:7200  3002
R3         7200       stopped    localhost:7200  3003
R4         7200       stopped    localhost:7200  3004
R5         7200       stopped    localhost:7200  3005
R6         7200       stopped    localhost:7200  3006
R7         7200       stopped    localhost:7200  3007
R8         7200       stopped    localhost:7200  3008
FR1        FRSW       n/a        localhost:7200  n/a
AT1        ATMSW      n/a        localhost:7200  n/a
SW1        ETHSW      n/a        localhost:7200  n/a


Start a router and connect to it
=> start R1
100-C7200 'R1' started
=> telnet R1
=>

Now you'll see a new rxvt window. That's the telnet session for router R1.

6to4 tunneling brief

,

6to4 (sometimes written 6 to 4) is a system that allows IPv6 packets to be transmitted over an IPv4 network (generally the IPv4 internet) without the need to configure explicit tunnels. Routing conventions are also in place that allow 6to4 hosts to communicate with hosts on the IPv6 internet. It is typically used when an end site or end user wants to connect to the IPv6 internet using their existing IPv4 connection.

Since IPv6 is not required to be configured or supported on any nearby networking devices relative to the host, 6to4 is especially relevant during the initial phases of deployment to full, native IPv6 connectivity. However, it is intended only as transition mechanism and is not meant to be used permanently.

6to4 may be used by an individual host, or by a local IPv6 network. When used by an individual host, that host must have IPv4 connectivity and a global IPv4 address, and the host is responsible for encapsulation of outgoing IPv6 packets and decapsulation of incoming 6to4 packets. Many host operating systems implement this encapsulation and decapsulation via a 6to4 pseudo-interface.

When 6to4 is used by a local network, the entire local network needs only a single IPv4 address. Within that network, hosts learn their IPv6 addresses and routing using ordinary router discovery protocols, just as on a native IPv6 network.

6to4 does not facilitate interoperation between IPv4-only hosts and IPv6-only hosts.

How 6to4 works

6to4 performs three functions:

1. Assigns a block of IPv6 address space to any host or network that has a global IPv4 address.
2. Encapsulates IPv6 packets inside IPv4 packets for transmission over an IPv4 network.
3. Routes traffic between 6to4 and "native" IPv6 networks.

Address Block Allocation

For any 32-bit global IPv4 address that is assigned to a host, a 48-bit 6to4 IPv6 prefix can be constructed for use by that host (and if applicable the network behind it) by prepending 2002 (hex) to the IPv4 address. Thus for the global IPv4 address 207.142.131.202, the corresponding 6to4 prefix would be 2002:CF8E:83CA::/48. (IPv4 addresses use decimal notation while IPv6 addresses use hexadecimal notation). This gives a total prefix length of 48 bits, the same as an end site is supposed to be allocated under normal IPv6 address alocation leaving room for a 16 bit subnet field and a 64 bit address within the subnet.

Any IPv6 address that begins with the 2002::/16 prefix is known of as a 6to4 address, as opposed to a native IPv6 address which does not use that prefix.

Encapsulation and Transmission

6to4 embeds an IPv6 packet in the payload portion of an IPv4 packet with protocol type 41. To send an IPv6 packet over an IPv4 network to a 6to4 destination address, an IPv4 header with protocol type 41 is prepended to the IPv6 packet. The IPv4 destination address for the prepended packet header is derived from the IPv6 destination address of the inner packet, by extracting the 32 bits immediately following the IPv6 destination address's 2002:: prefix. The IPv4 source address in the prepended packet header is the IPv4 address of the host or router which is sending the packet over IPv4. The resulting IPv4 packet is then routed to its IPv4 destination address just like any other IPv4 packet.

Routing Between 6to4 and Native IPv6

To allow hosts and networks using 6to4 addresses to exchange traffic with hosts using "native" IPv6 addresses, "relay routers" have been established. A relay router connects to an IPv4 network and an IPv6 network. 6to4 packets arriving on an IPv4 interface will have their IPv6 payloads routed to the IPv6 network, while packets arriving on the IPv6 interface with a destination address prefix of 2002::/16 will be encapsulated and forwarded over the IPv4 network.

To allow a 6to4 router to communicate with the native IPv6 Internet, it must have its IPv6 default gateway set to a 6to4 address which contains the IPv4 address of a 6to4 relay router. To avoid the need for users to set this up manually, the 6to4 relay anycast address of 192.88.99.1 (which when wrapped in 6to4 with the subnet and hosts fields zero becomes 2002:c058:6301::) has been allocated for the purpose of sending packets to a relay router. For routing reasons the whole of 192.88.99.0/24 has been allocated for routes pointed at 6to4 relay routers that use the anycast IP. Providers willing to provide 6to4 service to their clients or peers should advertise the anycast prefix like any other IP prefix, and route the prefix to their 6to4 relay.

Packets from the IPv6 Internet to 6to4 systems must be sent to a 6to4 relay router by normal IPv6 routing methods. The specification states that such relay routers must only advertise 2002::/16 and not subdivisions of it to prevent IPv4 routes polluting the routing tables of IPv6 routers. From here they can then be sent over the IPv4 Internet to the destination.


Running Example


This example resembles the scenario in RFC 3056 Section 5.5. In the RFC scenario, there are multiple IPv6 sites, connected to one IP backbone. While in this scenario, there is only one IPv6 site connected to the IP backbone. Site A and Site C are 6to4 sites while Site B is 6to4 relay and Site B pure IPv6.









After running lets see the IPv6 forwarding table in Site A dual-stack gateway (Router A):



The incoming and outing traffic flow on IPv6 layer of Workstation C in 6to4 Site C:



The PING report (ICMPv6) from Workstation A to Workstation C (Site A -> Site C):

Mobile Ad-hoc Network (MANET)

,

Overview
A mobile ad-hoc network (MANET) is a kind of wireless ad-hoc network, and is a self-configuring network of mobile routers (and associated hosts) connected by wireless links—the union of which form an arbitrary topology. The routers are free to move randomly and organise themselves arbitrarily; thus, the network's wireless topology may change rapidly and unpredictably. Such a network may operate in a standalone fashion, or may be connected to the larger Internet.

Mobile ad-hoc networks became a popular subject for research as laptops and 802.11/Wi-Fi wireless networking became widespread in the mid- to late 1990s. Many of the academic papers evaluate protocols and abilities assuming varying degrees of mobility within a bounded space, usually with all nodes within a few hops of each other, and usually with nodes sending data at a constant rate. Different protocols are then evaluated based on the packet drop rate, the overhead introduced by the routing protocol, and other measures.

The MIT Media Lab $100 laptop program hopes to develop a cheap laptop for mass distribution (>1 million at a time) to developing countries for education. The laptops will use ad-hoc wireless mesh networking to develop their own communications network out of the box.

Vehicular ad-hoc networks or VANETs are a form of MANETs used for communication among vehicles and between vehicles and roadside equipment.


Routing
Routing within a MANET is different from traditional routing in wired network.

There is no infrastrcure within a MANET and dedicated router. Each node has to do routing, behaving as a host and a router.

The topology may change at any time, so routing has to reach convergence in a short period of time. And because wireless medium has a limited bandwidth, and MANET nodes may run on battery, routing mechanism with high overhead will not be a good choice for MANET. There are mayor reasons that traditional routing protocols are not suitable for MANET.

Considering the factors mentioned above, on-demand routing protocols are competitive candidates. They only perform routing process while the application layer has data to send, if not, they will stay silent. Examples are DSR, AODV, TORA, etc.

But there are indeed proactive routing protocols. One example is OLSR, which maintains neighbor relation by sending periodical Hello messages and keeps a link-state route database constantly, no matter the user application layer wants to send data or not.

By first look, we may take on-demand routing as more reasonable for MANET. Interestingly, however, proactive OLSR is an Internet standard defined in RFC 3626, while the well known on-demand routing protocols haven't reached standard status. DSR and TORA are still draft, while AODV is an Internet experimental protocol.

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31