SMS: Optimal resource allocation