IP Tunnelling code



next up previous
Next: About this document Up: Unix MSNL Code Previous: Port management

IP Tunnelling code

The unix kernel code optionally contains four logical interfaces called ms0 through ms3 which uses the MSNL code to implement an IP over MSNL tunnelling service. The tunnelling code uses MSNL connections controlled by the user space manager in a way which is very similar but not identical to user space MSNL sockets. The differences are to do with the interconversion of IP and MSNL addresses. The only difference between the four interfaces is that they use a different MTU value. IP routeing should be used to configure routeing for remote machines as required.

Binding

When the tunnelling code interface is given an address with ifconfig it will bind and listen on an MSNL socket for incoming connections. The address it supplies to the bind must be an AF_MSNL address, and it leaves the MSNL address field zero, and requests one of the four IP tunnelling ports (depending on which interface it is).gif Thus it will listen on the machine's default MSNL address. The IP address which is being used on that interface is communicated to the user space manager in the ms_ipa field in the address.

Connecting

Since the tunnelling code must leave the mapping of IP to MSNL addresses to the management code the tunnel passes an AF_INET style address to the connect. The manager must perform the translation and make the connection to the appropriate place. However the code must also communicate the MTU that it is going to use since the connection must be to the MSNL tunneling interface on the remote machine which uses the same MTU value. To help the manager perform the correct connection, the IP tunneling code places the port number of the appropriate IP MTU / MSNL service in the four octets sa_data[6] through sa_data[9] of the connection address.

Accepting

For the purposes of ensuring the end to end existence and validity of a tunnel, tunnels are used in a full-duplex manner. As a result the tunnelling code must always be informed of the address of the IP peer when a new connection to it is established. The user space manager must, therefore, present an AF_INET style address when issuing an MMDOWN_NEWCONN.



next up previous
Next: About this document Up: Unix MSNL Code Previous: Port management



Richard Black