add some cotrol logic in layer2.