Optimal admission control in tandem and parallel queueing systems with applications to computer networks