In a medium saucepan, whisk together sugar, flour, and salt.
Gradually stir in 2 cups of milk until smooth; cook over medium heat, stirring constantly, until mixture thickens and bubbles appear.
Remove from heat. Whisk a small amount of hot mixture into egg yolks, then return yolk mixture to saucepan and cook 1 minute more.
Stir in remaining 1 cup milk and vanilla extract; let custard cool for 10 minutes.
In a 2-quart dish, layer vanilla wafers, banana slices, and custard. Repeat until ingredients are used, finishing with custard on top.
Cover and chill in refrigerator for at least 1 hour before serving.