You need use setValueState() method of input control.
Validation code should be written by yourself. based on the parameters you pass to setValueState() method, framework will show or hide the red colored border.
Check the below link to see it live
https://openui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.InputChecked/preview
the code for above preview is here
https://openui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.InputChecked/code/V.view.xml