Patent ID: 8812633

Claim:
A method for managing address spaces and setting up a communications tunnel between a first tunnel end-point of a first communications sub-network and a second tunnel end-point of a second communications sub-network distinct from said first sub-network, said method being performed by the first tunnel end-point and comprising the steps of: (a) detecting a request for setting up the communications tunnel between the first sub-network and the second sub-network distinct from said first sub-network, wherein at least one apparatus is connected to each of said first sub-network and said second sub-network and each apparatus connected to each of said first sub-network and said second sub-network is allocated an address included in an address space associated with each of said first sub-network and said second sub-network; (b) in response to the detecting of the request, detecting at least one pair of apparatuses to which a same address is allocated, each pair of apparatuses comprising a first apparatus of the first sub-network and a second apparatus of the second sub-network; (c) upon the detecting of the at least one pair of apparatuses, selecting at least one apparatus of each pair of apparatuses; (d) upon the selecting of the at least one apparatus, allocating a new address to each selected apparatus, wherein the allocating of the new address includes the steps of: obtaining a number of addresses that are included in at least one of the address spaces associated with said first and second sub-networks and that are not yet allocated to an apparatus of said first and second sub-networks; comparing said number of addresses with the number of selected apparatuses; and, if said number of addresses is smaller than the number of selected apparatuses, extending at least one of the address spaces associated with said first and second sub-networks in order to make said number of addresses greater than or equal to the number of selected apparatuses; and (e) after the allocating step, setting up the tunnel between the first and second sub-networks.