According to my book, Korean Grammar in Use, "구나" is the plain informal version of "군요." You use these endings to express a sudden realization.
Examples from the book:
"감기에 걸렸군요." = "I see you've caught a cold."
"정말 비가 오는군요." = "Wow, it's really raining."
"응, 그래서 늦었구나." = "OK, so (I see) that's why you're late."