Table of Contents
We will show in this section how to connect two hosts using HIP. We assume two machines called crash and oops that are in the same network. Crash is the one that starts a communication against oops.
Both machines are used through this whole document as examples even though you probably have your own naming and addressing conventions. It is possible to use IPv4 addresses as well as IPv6 addresses on-wire.
This section show to developers and maintainers how to test your HIPL installation. The section starts with a IPv6 test applications applications, continues with IPv4-IPv6 interoperability and concludes with IPv4 test applications.
You can test HIP with any networking application, but in this section we will demonstrate few development-oriented test applications.
You should run conntest-client-hip and conntest-server with root privileges if conntest-server port number is less than 1024.
In this section we will use ipv6 addresses, but you can use also ipv4 addresses. Furthermore, the use of hipfw is optional.
oops:
ifconfig eth0 inet6 add 3ffe::2/64
cd somewhere/hipl
hipd/hipd # (to start as a background daemon process, add -b flag)
test/conntest-server tcp 1111
Crash will act as the connection initiator, so we need to configure the hosts files of crash:
crash:
/etc/hosts:
3ffe::2 oops
/etc/hip/hosts:
HIT_OF_OOPS oops
ifconfig eth0 inet6 add 3ffe::1/64
cd somewhere/hipl
hipd/hipd
test/conntest-client-hip oops tcp 1111
;<Type some text in crash, press enter and ctrl+d and you should see some text appearing in the output of the hosts>
This will setup a HIP connection between the two hosts (it may take a while if you are using virtual machines). You should replace HIT_OF_XXX with the HIT of the host XXX. The hip daemon loads (and creates if necessary) the host identities from /etc/hip automatically. If you want to know the default HIT of the localhost, run "hipconf get hi default". You can list all HITs of the machine with "hipconf get hi all". By default, you'll see only one. If you want to use all four HITs of the host, you have to invoke "hipconf add hi default". The use of multiple local HITs is not currently recommended!
Mappings between HITs and IP addresses are usually set up automatically with the hosts files. Manual configuration is also possible but not necessary:
tools/hipconf add map PEER_HIT PEER_IP
You can also add the mapping to "/etc/hip/hipd_config" and restart hipd. It is also possible to use DNS or OpenDHT (Chapter 24, Bamboo-based Name Lookup for HIP) for the mappings.
Link local IPv6 addresses are not supported well, so do not use them. Use global IPv6 addresses instead for testing. The reason for this is that it is hard to know if the peer belongs to the same local network as we are or not.