Allocating a proper endpoint