The Diameter of a tree is the length of the longest path between any two nodes. This path does not have to go through the root. For instance, in a tree shaped like a Y, the diameter might be from one tip of the Y to the other tip, passing through the fork.
The root could be anywhere, but the diameter stays the same. Computing the diameter is a classic tree DP problem. You need to think about paths that turn at each node. Each path has a turning point where it changes direction.